xrdp-0.10.1/000755 001751 000000 00000000000 14652432105 012630 5ustar00metawheel000000 000000 xrdp-0.10.1/common/000755 001751 000000 00000000000 14652432104 014117 5ustar00metawheel000000 000000 xrdp-0.10.1/third_party/000755 001751 000000 00000000000 14652432104 015160 5ustar00metawheel000000 000000 xrdp-0.10.1/pkgconfig/000755 001751 000000 00000000000 14652432105 014577 5ustar00metawheel000000 000000 xrdp-0.10.1/Makefile.in000644 001751 000000 00000070435 14652432075 014714 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.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 = config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config_ac-h.in # 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)` DIST_SUBDIRS = third_party third_party/tomlc99 common vnc xup mc \ neutrinordp libipm libxrdp libpainter librfxcodec sesman xrdp \ fontutils keygen waitforx docs instfiles genkeymap xrdpapi \ pkgconfig xrdpvr ulalaca tests tools am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config_ac-h.in \ COPYING NEWS.md README.md compile config.guess config.sub \ install-sh ltmain.sh missing tap-driver.sh 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 -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = -9 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 -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = \ --without-systemdsystemunitdir \ --enable-strict-locations \ --enable-tests EXTRA_DIST = \ COPYING \ README.md \ NEWS.md \ astyle_config.as \ bootstrap \ coding_style.md \ m4 \ vrplayer @XRDP_NEUTRINORDP_FALSE@NEUTRINORDPDIR = @XRDP_NEUTRINORDP_TRUE@NEUTRINORDPDIR = neutrinordp @XRDP_XRDPVR_FALSE@XRDPVRDIR = @XRDP_XRDPVR_TRUE@XRDPVRDIR = xrdpvr @XRDP_PAINTER_FALSE@PAINTERDIR = @XRDP_PAINTER_TRUE@PAINTERDIR = libpainter @XRDP_RFXCODEC_FALSE@RFXCODECDIR = @XRDP_RFXCODEC_TRUE@RFXCODECDIR = librfxcodec @XRDP_ULALACA_FALSE@ULALACADIR = @XRDP_ULALACA_TRUE@ULALACADIR = ulalaca # This should not be dictionary order but build order SUBDIRS = \ third_party \ third_party/tomlc99 \ common \ vnc \ xup \ mc \ $(NEUTRINORDPDIR) \ libipm \ libxrdp \ $(PAINTERDIR) \ $(RFXCODECDIR) \ sesman \ xrdp \ fontutils \ keygen \ waitforx \ docs \ instfiles \ genkeymap \ xrdpapi \ pkgconfig \ $(XRDPVRDIR) \ $(ULALACADIR) \ tests \ tools all: config_ac.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile 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): config_ac.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config_ac-h.in $(top_builddir)/config.status $(AM_V_at)rm -f stamp-h1 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config_ac.h $(srcdir)/config_ac-h.in: $(am__configure_deps) $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) $(AM_V_at)rm -f stamp-h1 $(AM_V_at)touch $@ distclean-hdr: -rm -f config_ac.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -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 -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 -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-recursive all-am: Makefile config_ac.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-local distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool 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-generic distclean-hdr distclean-libtool \ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean-local: -rm -f xrdp_configure_options.h # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/neutrinordp/000755 001751 000000 00000000000 14652432104 015200 5ustar00metawheel000000 000000 xrdp-0.10.1/xrdpapi/000755 001751 000000 00000000000 14652432105 014277 5ustar00metawheel000000 000000 xrdp-0.10.1/waitforx/000755 001751 000000 00000000000 14652432105 014473 5ustar00metawheel000000 000000 xrdp-0.10.1/bootstrap000755 001751 000000 00000001236 14652432047 014602 0ustar00metawheel000000 000000 #!/bin/sh command -v autoconf if ! test $? -eq 0 then echo "error, install autoconf" exit 1 fi command -v automake if ! test $? -eq 0 then echo "error, install automake" exit 1 fi command -v libtool || command -v libtoolize if ! test $? -eq 0 then echo "error, install libtool" exit 1 fi command -v pkg-config if ! test $? -eq 0 then echo "error, install pkg-config" exit 1 fi if ! test -f libpainter/configure.ac then git submodule update --init libpainter fi if ! test -f librfxcodec/configure.ac then git submodule update --init librfxcodec fi if ! test -f ulalaca/Makefile.am then git submodule update --init ulalaca fi autoreconf -fvi xrdp-0.10.1/mc/000755 001751 000000 00000000000 14652432104 013226 5ustar00metawheel000000 000000 xrdp-0.10.1/libxrdp/000755 001751 000000 00000000000 14652432104 014273 5ustar00metawheel000000 000000 xrdp-0.10.1/README.md000644 001751 000000 00000013546 14652432047 014125 0ustar00metawheel000000 000000 [![Build Status](https://github.com/neutrinolabs/xrdp/actions/workflows/build.yml/badge.svg)](https://github.com/neutrinolabs/xrdp/actions) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neutrinolabs/xrdp-questions) ![Apache-License](https://img.shields.io/badge/License-Apache%202.0-blue.svg) [![Latest Version](https://img.shields.io/github/v/release/neutrinolabs/xrdp.svg?label=Latest%20Version)](https://github.com/neutrinolabs/xrdp/releases) # xrdp - an open source RDP server ## Overview **xrdp** provides a graphical login to remote machines using Microsoft Remote Desktop Protocol (RDP). xrdp accepts connections from a variety of RDP clients: * FreeRDP * rdesktop * KRDC * NeutrinoRDP * Windows MSTSC (Microsoft Terminal Services Client, aka `mstsc.exe`) * Microsoft Remote Desktop (found on Microsoft Store, which is distinct from MSTSC) Many of these work on some or all of Windows, Mac OS, iOS, and/or Android. RDP transport is encrypted using TLS by default. ![demo](https://github.com/neutrinolabs/xrdp/raw/gh-pages/xrdp_demo.gif) ## Features ### Remote Desktop Access * Connect to a Linux desktop using RDP from anywhere (requires [xorgxrdp](https://github.com/neutrinolabs/xorgxrdp) Xorg module) * Reconnect to an existing session * Session resizing (both on-connect and on-the-fly) * RDP/VNC proxy (connect to another RDP/VNC server via xrdp) ### Access to Remote Resources * Two-way clipboard transfer (text, bitmap, file) * Audio redirection ([requires to build additional modules](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection)) * Microphone redirection ([requires to build additional modules](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection)) * Drive redirection (mount local client drives on remote machine) ## Supported Platforms **xrdp** primarily targets GNU/Linux operating system. x86 (including x86-64) and ARM processors are most mature architecture to run xrdp on. See also [Platform Support Tier](https://github.com/neutrinolabs/xrdp/wiki/Platform-Support-Tier). Some components such as xorgxrdp and RemoteFX codec have special optimization for x86 using SIMD instructions. So running xrdp on x86 processors will get fully accelerated experience. ## Quick Start Most Linux distributions should distribute the latest release of xrdp in their repository. You would need xrdp and xorgxrdp packages for the best experience. It is recommended that xrdp depends on xorgxrdp, so it should be sufficient to install xrdp. If xorgxrdp is not provided, use Xvnc server. xrdp listens on 3389/tcp. Make sure your firewall accepts connection to 3389/tcp from where you want to access. ### Ubuntu / Debian ```bash apt install xrdp ``` ### RedHat / CentOS / Fedora On RedHat and CentOS, make sure to enable EPEL packages first. ```bash yum install epel-release ``` Install xrdp package. ```bash yum install xrdp ``` `yum` is being replaced with `dnf`, so you may need to use `dnf` instead of `yum` in the above commands. ## Compiling See also https://github.com/neutrinolabs/xrdp/wiki#building-from-sources ### Prerequisites To compile xrdp from the packaged sources, you need basic build tools - a compiler (**gcc** or **clang**) and the **make** program. Additionally, you would need **openssl-devel**, **pam-devel**, **libX11-devel**, **libXfixes-devel**, **libXrandr-devel**. More additional software would be needed depending on your configuration. To compile xrdp from a checked out git repository, you would additionally need **autoconf**, **automake**, **libtool** and **pkg-config**. ### Get the source and build it If compiling from the packaged source, unpack the tarball and change to the resulting directory. If compiling from a checked out repository, please make sure you've got the submodules cloned too (use `git clone --recursive https://github.com/neutrinolabs/xrdp`) Then run following commands to compile and install xrdp: ```bash ./bootstrap ./configure make sudo make install ``` If you want to use audio redirection, you need to build and install additional pulseaudio modules. The build instructions can be found at wiki. * [How to set up audio redirection](https://github.com/neutrinolabs/xrdp/wiki/How-to-set-up-audio-redirection) ## Directory Structure ``` xrdp ├── common ······ common code ├── docs ········ documentation ├── fontutils ··· font handling utilities ├── genkeymap ··· keymap generator ├── instfiles ··· installable data file ├── keygen ······ xrdp RSA key pair generator ├── libpainter ·· painter library ├── librfxcodec · RFX codec library ├── libxrdp ····· core RDP protocol implementation ├── m4 ·········· Autoconf macros ├── mc ·········· media center module ├── neutrinordp · RDP client module for proxying RDP connections using NeutrinoRDP ├── pkgconfig ··· pkg-config configuration ├── scripts ····· build scripts ├┬─ sesman ······ session manager for xrdp |├── chansrv ···· channel server for xrdp |├── libsesman ·· Code common to sesman and its related executables |└── tools ······ session management tools for sys admins ├── tests ······· tests for the code ├┬─ tools ······· tools |└┬─ devel ······ development tools | ├── gtcp_proxy GTK app that forwards TCP connections to a remote host | └── tcp_proxy · CLI app that forwards TCP connections to a remote host ├── vnc ········· VNC client module for xrdp ├── vrplayer ···· QT player redirecting video/audio to clients over xrdpvr channel ├── xrdp ········ main server code ├── xrdpapi ····· virtual channel API ├── xrdpvr ······ API for playing media over RDP └── xup ········· xorgxrdp client module ``` xrdp-0.10.1/sesman/000755 001751 000000 00000000000 14652432105 014116 5ustar00metawheel000000 000000 xrdp-0.10.1/config.guess000755 001751 000000 00000126014 14652432075 015162 0ustar00metawheel000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # 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 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 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -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 1992-2018 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 # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 set_cc_for_build() { : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { 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" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" 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 } # 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 ; 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 case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # 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 tuples: *-*-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=`(uname -p 2>/dev/null || \ "/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 ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-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) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) 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 # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; 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/[-_].*//' | cut -d. -f1,2` ;; 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}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$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 ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 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`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" case `isainfo -b` in 32) echo i386-pc-solaris2"$UNAME_REL" ;; 64) echo x86_64-pc-solaris2"$UNAME_REL" ;; esac 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) 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 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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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:4.4BSD:*) 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 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 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:*:*) 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 ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-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-$LIBC`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 "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) 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-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) 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 | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" 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-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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.*:*) 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 configure 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 ;; x86_64:Haiku:*:*) echo x86_64-unknown-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 ;; SX-ACE:SUPER-UX:*:*) echo sxace-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 set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-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. # shellcheck disable=SC2154 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 ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xrdp-0.10.1/docs/000755 001751 000000 00000000000 14652432105 013560 5ustar00metawheel000000 000000 xrdp-0.10.1/configure000755 001751 000000 00002666615 14652432074 014572 0ustar00metawheel000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for xrdp 0.10.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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="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 case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac 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 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) 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 case e in #( e) 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 ;; esac 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: xrdp-devel@googlegroups.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac 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_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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # 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 ' t clear :clear 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} 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='xrdp' PACKAGE_TARNAME='xrdp' PACKAGE_VERSION='0.10.1' PACKAGE_STRING='xrdp 0.10.1' PACKAGE_BUGREPORT='xrdp-devel@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= enable_option_checking=no ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgconfigdir pamconfdir moduledir CMOCKA_LIBS CMOCKA_CFLAGS CHECK_LIBS CHECK_CFLAGS X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS CPP XMKMF TurboJpegLibDir TurboJpegIncDir PIXMAN_LIBS PIXMAN_CFLAGS FDKAAC_LIBS FDKAAC_CFLAGS FUSE_LIBS FUSE_CFLAGS FREERDP_LIBS FREERDP_CFLAGS PAM_RULES AUTHMOD_LIB AUTHMOD_OBJ USE_FREETYPE2_FALSE USE_FREETYPE2_TRUE FREETYPE2_LIBS FREETYPE2_CFLAGS IMLIB2_LIBS IMLIB2_CFLAGS OPENSSL OPENSSL_LIBS OPENSSL_CFLAGS DLOPEN_LIBS XRDP_RDPSNDAUDIN_FALSE XRDP_RDPSNDAUDIN_TRUE XRDP_RFXCODEC_FALSE XRDP_RFXCODEC_TRUE XRDP_PAINTER_FALSE XRDP_PAINTER_TRUE XRDP_PIXMAN_FALSE XRDP_PIXMAN_TRUE XRDP_MP3LAME_FALSE XRDP_MP3LAME_TRUE XRDP_OPUS_FALSE XRDP_OPUS_TRUE XRDP_FDK_AAC_FALSE XRDP_FDK_AAC_TRUE XRDP_XRDPVR_FALSE XRDP_XRDPVR_TRUE XRDP_FUSE_FALSE XRDP_FUSE_TRUE XRDP_TJPEG_FALSE XRDP_TJPEG_TRUE XRDP_JPEG_FALSE XRDP_JPEG_TRUE XRDP_ULALACA_FALSE XRDP_ULALACA_TRUE XRDP_NEUTRINORDP_FALSE XRDP_NEUTRINORDP_TRUE DEVEL_DEBUG_FALSE DEVEL_DEBUG_TRUE SESMAN_PAMUSERPASS_FALSE SESMAN_PAMUSERPASS_TRUE SESMAN_KERBEROS_FALSE SESMAN_KERBEROS_TRUE SESMAN_BSD_FALSE SESMAN_BSD_TRUE SESMAN_NOPAM_FALSE SESMAN_NOPAM_TRUE HAVE_SYSTEMD_FALSE HAVE_SYSTEMD_TRUE systemdsystemunitdir socketdir MACOS_FALSE MACOS_TRUE NETBSD_FALSE NETBSD_TRUE OPENBSD_FALSE OPENBSD_TRUE FREEBSD_FALSE FREEBSD_TRUE LINUX_FALSE LINUX_TRUE subdirs PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CXXCPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__xargs_n am__rm_f_notfound 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_socketdir with_systemdsystemunitdir enable_tests enable_pam enable_vsock enable_ipv6 enable_ipv6only enable_kerberos enable_bsd enable_pamuserpass enable_pam_config enable_devel_all enable_devel_debug enable_devel_logging enable_devel_streamcheck enable_neutrinordp enable_ulalaca enable_jpeg enable_tjpeg enable_fuse enable_xrdpvr enable_fdkaac enable_opus enable_mp3lame enable_pixman enable_painter enable_rfxcodec enable_rdpsndaudin with_imlib2 with_freetype2 enable_xrdpdebug with_x enable_strict_locations with_pamconfdir with_pkgconfigdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR OPENSSL_CFLAGS OPENSSL_LIBS IMLIB2_CFLAGS IMLIB2_LIBS FREETYPE2_CFLAGS FREETYPE2_LIBS FREERDP_CFLAGS FREERDP_LIBS FUSE_CFLAGS FUSE_LIBS FDKAAC_CFLAGS FDKAAC_LIBS PIXMAN_CFLAGS PIXMAN_LIBS XMKMF CPP CHECK_CFLAGS CHECK_LIBS CMOCKA_CFLAGS CMOCKA_LIBS' ac_subdirs_all='libpainter librfxcodec' # 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 xrdp 0.10.1 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/xrdp] --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 X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xrdp 0.10.1:";; 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-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-tests Ensure dependencies for the tests are installed --enable-pam Build PAM support (default: yes) --enable-vsock Build AF_VSOCK support (default: no) --enable-ipv6 Build IPv6 support (default: no, experimental) --enable-ipv6only Build IPv6-only (default: no) --enable-kerberos Build kerberos support (prefer --enable-pam if available) (default: no) --enable-bsd Build BSD auth support (default: no) --enable-pamuserpass Build PAM userpass support (default: no) --enable-pam-config=CONF Select PAM config to install: arch, debian, redhat, suse, freebsd, macos, unix (default: autodetect) --enable-devel-all Enable all development options (default: no) --enable-devel-debug Build exes with no optimisation and debugging symbols (default: no) --enable-devel-logging Enable development logging (default: no) --enable-devel-streamcheck Add range-check/abort to stream primitives (default: no) --enable-neutrinordp Build neutrinordp module (default: no) --enable-ulalaca Build ulalaca module (experimental) (default: no) --enable-jpeg Build jpeg module (default: no) --enable-tjpeg Build turbo jpeg module (default: no) --enable-fuse Build fuse(clipboard file / drive redir) (default: no) --enable-xrdpvr Build xrdpvr module (default: no) --enable-fdkaac Build aac(audio codec) (default: no) --enable-opus Build opus(audio codec) (default: no) --enable-mp3lame Build lame mp3(audio codec) (default: no) --enable-pixman Use pixman library (default: no) --disable-painter Do not use included painter library (default: no) --disable-rfxcodec Do not use included librfxcodec library (default: no) --enable-rdpsndaudin Use rdpsnd audio in (default: no) --enable-xrdpdebug This option is no longer supported - use --enable-devel-all --enable-strict-locations Use standard Autoconf install directories unless overridden (default: use /etc and /var) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-socketdir=DIR Use directory for UNIX sockets for XRDP sessions (default: RUNSTATEDIR/xrdp) --with-systemdsystemunitdir=DIR Directory for systemd service files, no to disable --with-imlib2=ARG imlib2 library to use for non-BMP backgrounds (ARG=yes/no/) --with-freetype2=ARG freetype2 library to use for rendering fonts (ARG=yes/no/) --with-x use the X Window System --with-pamconfdir=DIR Use directory for pam.d config (default: /etc/pam.d) --with-pkgconfigdir pkg-config installation directory ['${libdir}/pkgconfig'] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory 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 CXX C++ compiler command CXXFLAGS C++ compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path OPENSSL_CFLAGS C compiler flags for OPENSSL, overriding pkg-config OPENSSL_LIBS linker flags for OPENSSL, overriding pkg-config IMLIB2_CFLAGS C compiler flags for IMLIB2, overriding pkg-config IMLIB2_LIBS linker flags for IMLIB2, overriding pkg-config FREETYPE2_CFLAGS C compiler flags for FREETYPE2, overriding pkg-config FREETYPE2_LIBS linker flags for FREETYPE2, overriding pkg-config FREERDP_CFLAGS C compiler flags for FREERDP, overriding pkg-config FREERDP_LIBS linker flags for FREERDP, overriding pkg-config FUSE_CFLAGS C compiler flags for FUSE, overriding pkg-config FUSE_LIBS linker flags for FUSE, overriding pkg-config FDKAAC_CFLAGS C compiler flags for FDKAAC, overriding pkg-config FDKAAC_LIBS linker flags for FDKAAC, overriding pkg-config PIXMAN_CFLAGS C compiler flags for PIXMAN, overriding pkg-config PIXMAN_LIBS linker flags for PIXMAN, overriding pkg-config XMKMF Path to xmkmf, Makefile generator for X Window System CPP C preprocessor CHECK_CFLAGS C compiler flags for CHECK, overriding pkg-config CHECK_LIBS linker flags for CHECK, overriding pkg-config CMOCKA_CFLAGS C compiler flags for CMOCKA, overriding pkg-config CMOCKA_LIBS linker flags for CMOCKA, overriding pkg-config Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. 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 xrdp configure 0.10.1 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # 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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext 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>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_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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_cpp conftest.$ac_ext") 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; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext 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>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_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 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; } && { ac_try='./conftest$ac_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 : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status ;; esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break else case e in #( e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break else case e in #( e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done else case e in #( e) ac_lo= ac_hi= ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid else case e in #( e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval (void) { return $2; } static unsigned long int ulongval (void) { return $2; } #include #include int main (void) { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) eval "$3=yes" ;; esac 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 ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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_cpp conftest.$ac_ext") 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; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp 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 xrdp $as_me 0.10.1, which was generated by GNU Autoconf 2.72. 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 C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " # 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; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="tap-driver.sh config.guess config.sub ltmain.sh compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # 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 case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac 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 printf "%s\n" "#define VERSION_YEAR 2024" >>confdefs.h ac_config_headers="$ac_config_headers config_ac.h:config_ac-h.in" am__api_version='1.17' # 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 case e in #( e) 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 ;; esac 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 sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&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 $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # 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 test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi 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 case e in #( e) 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 ;; esac 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; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi 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='xrdp' VERSION='0.10.1' 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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}gcc" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&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_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="gcc" 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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}cc" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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 if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" 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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="$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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}clang" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&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_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="clang" 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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { 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 $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # 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 -version; 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 case e in #( e) ac_file='' ;; esac 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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac 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 case e in #( e) { { 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; } ;; esac 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"); if (!f) return 1; 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.o conftest.obj 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 case e in #( e) 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 case e in #( e) 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; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac 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_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac 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=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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 { 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 case e in #( e) 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 case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ;; esac 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 case e in #( e) 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 case e in #( e) 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 case e in #( e) 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 ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 case e in #( e) { 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" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 case e in #( e) { 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" ;; esac fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 ;; esac 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 depcc="$CXX" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else case e in #( e) ac_cv_c_const=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then printf "%s\n" "#define const /**/" >>confdefs.h fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify 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' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } 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 yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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 ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 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 ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; 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_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # 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_FILECMD="${ac_tool_prefix}file" 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 ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&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_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; 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_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # 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_FILECMD="file" 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 ;; esac fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" 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 FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" 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 ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&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_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" 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 ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 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* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" 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 ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&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_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" 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 ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="$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 ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="$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 ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { 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_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_RANLIB="${ac_tool_prefix}ranlib" 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 ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&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_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { 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_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_RANLIB="ranlib" 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 ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # 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 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #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. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" 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 ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&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_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" 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 ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" 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 ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&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_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" 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 ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" 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 ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&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_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" 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 ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" 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 ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&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_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" 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 ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" 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 ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&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_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" 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 ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" 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 ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&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_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" 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 ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) 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" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } 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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; 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 else case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; 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 else case e in #( e) enable_static=yes ;; esac fi # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; 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 else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi with_aix_soname=$lt_cv_with_aix_soname ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.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 func_cc_basename $compiler cc_basename=$func_cc_basename_result # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$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);}' # 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 # 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 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* 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* ## 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_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-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_prog_compiler_pic='-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 lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; 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_prog_compiler_pic='-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_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; 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). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-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_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # 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'. exclude_expsyms='_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. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$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 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 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 ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$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. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='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 tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ld_shlibs=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 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** 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 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$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. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 hardcode_direct=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 hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$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. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$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. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=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. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$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" module_expsym_cmds="$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" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='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 "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $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='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='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' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='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 hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=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 yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT 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. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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`' 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 # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[23].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } 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 striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } 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 CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CXXCPP=$CXXCPP ;; esac fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { 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 $? "C++ preprocessor \"$CXXCPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 else _lt_caught_CXX_error=yes fi 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 archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$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 yes != "$_lt_caught_CXX_error"; 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. # 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 # save warnings/boilerplate of simple test code 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* 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* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } 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 yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_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 yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$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 whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= 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. archive_cmds_CXX='$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 -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; 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 hardcode_direct_CXX=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 hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$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. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`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 "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`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 "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$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. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # 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. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="$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" module_expsym_cmds_CXX="$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" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$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" archive_expsym_cmds_CXX="$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 ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=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 ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $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 ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$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. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='$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++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | 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. archive_cmds_CXX='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' archive_expsym_cmds_CXX='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; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$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."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='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 | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='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 | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='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 | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$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 hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # 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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='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 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=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='func_echo_all' # 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. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=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*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=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. archive_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='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 "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # 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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # 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 -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='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' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=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?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # 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. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$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. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='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 $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT 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. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$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 ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$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... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev 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 "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $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 "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken 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. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-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_prog_compiler_pic_CXX='-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 lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; 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_prog_compiler_pic_CXX=-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_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--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 ;; 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). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o_CXX=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_CXX+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[23].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS 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 yes != "$_lt_caught_CXX_error" 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_commands="$ac_config_commands libtool" # Only expand once: if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { 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_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_PKG_CONFIG="$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 ;; esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&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_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { 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_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_ac_pt_PKG_CONFIG="$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 ;; esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi if test "x$PKG_CONFIG" = "x"; then as_fn_error $? "please install pkg-config" "$LINENO" 5 fi subdirs="$subdirs libpainter librfxcodec" # Use silent rules by default if supported by Automake AM_DEFAULT_VERBOSITY=0 case $host_os in *linux*) linux=yes ;; *kfreebsd*) linux=yes # only used in instfiles/ so that’s ok for us for now ;; *freebsd*) freebsd=yes ;; *netbsd*) netbsd=yes ;; *openbsd*) openbsd=yes ;; *darwin*) macos=yes ;; esac if test "x$linux" = xyes; then LINUX_TRUE= LINUX_FALSE='#' else LINUX_TRUE='#' LINUX_FALSE= fi if test "x$freebsd" = xyes; then FREEBSD_TRUE= FREEBSD_FALSE='#' else FREEBSD_TRUE='#' FREEBSD_FALSE= fi if test "x$openbsd" = xyes; then OPENBSD_TRUE= OPENBSD_FALSE='#' else OPENBSD_TRUE='#' OPENBSD_FALSE= fi if test "x$netbsd" = xyes; then NETBSD_TRUE= NETBSD_FALSE='#' else NETBSD_TRUE='#' NETBSD_FALSE= fi if test "x$macos" = xyes; then MACOS_TRUE= MACOS_FALSE='#' else MACOS_TRUE='#' MACOS_FALSE= fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_int" = yes; then { { 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 compute sizeof (int) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_long" = yes; then { { 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 compute sizeof (long) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 printf %s "checking size of void *... " >&6; } if test ${ac_cv_sizeof_void_p+y} then : printf %s "(cached) " >&6 else case e in #( e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" then : else case e in #( e) if test "$ac_cv_type_void_p" = yes; then { { 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 compute sizeof (void *) See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 printf "%s\n" "$ac_cv_sizeof_void_p" >&6; } printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h # runstatedir not available for autoconf <= 2.69 if test "x$runstatedir" = "x" ; then runstatedir='${localstatedir}/run' fi # Check whether --with-socketdir was given. if test ${with_socketdir+y} then : withval=$with_socketdir; else case e in #( e) with_socketdir="$runstatedir/xrdp" ;; esac fi socketdir=$with_socketdir # Check whether --with-systemdsystemunitdir was given. if test ${with_systemdsystemunitdir+y} then : withval=$with_systemdsystemunitdir; else case e in #( e) if test "x$linux" = xyes; then with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) fi ;; esac fi if test "x$with_systemdsystemunitdir" != xno; then systemdsystemunitdir=$with_systemdsystemunitdir fi if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then HAVE_SYSTEMD_TRUE= HAVE_SYSTEMD_FALSE='#' else HAVE_SYSTEMD_TRUE='#' HAVE_SYSTEMD_FALSE= fi # Check whether --enable-tests was given. if test ${enable_tests+y} then : enableval=$enable_tests; ensure_tests_deps=yes fi # Check whether --enable-pam was given. if test ${enable_pam+y} then : enableval=$enable_pam; else case e in #( e) enable_pam=yes ;; esac fi if test x$enable_pam != xyes; then SESMAN_NOPAM_TRUE= SESMAN_NOPAM_FALSE='#' else SESMAN_NOPAM_TRUE='#' SESMAN_NOPAM_FALSE= fi # Check whether --enable-vsock was given. if test ${enable_vsock+y} then : enableval=$enable_vsock; else case e in #( e) enable_vsock=no ;; esac fi # Check whether --enable-ipv6 was given. if test ${enable_ipv6+y} then : enableval=$enable_ipv6; else case e in #( e) enable_ipv6=no ;; esac fi # Check whether --enable-ipv6only was given. if test ${enable_ipv6only+y} then : enableval=$enable_ipv6only; else case e in #( e) enable_ipv6only=no ;; esac fi # Check whether --enable-kerberos was given. if test ${enable_kerberos+y} then : enableval=$enable_kerberos; else case e in #( e) enable_kerberos=no ;; esac fi # Check whether --enable-bsd was given. if test ${enable_bsd+y} then : enableval=$enable_bsd; bsd=true else case e in #( e) bsd=false ;; esac fi if test x$bsd = xtrue; then SESMAN_BSD_TRUE= SESMAN_BSD_FALSE='#' else SESMAN_BSD_TRUE='#' SESMAN_BSD_FALSE= fi if test x$enable_kerberos = xyes; then SESMAN_KERBEROS_TRUE= SESMAN_KERBEROS_FALSE='#' else SESMAN_KERBEROS_TRUE='#' SESMAN_KERBEROS_FALSE= fi # Check whether --enable-pamuserpass was given. if test ${enable_pamuserpass+y} then : enableval=$enable_pamuserpass; else case e in #( e) enable_pamuserpass=no ;; esac fi if test x$enable_pamuserpass = xyes; then SESMAN_PAMUSERPASS_TRUE= SESMAN_PAMUSERPASS_FALSE='#' else SESMAN_PAMUSERPASS_TRUE='#' SESMAN_PAMUSERPASS_FALSE= fi # Check whether --enable-pam-config was given. if test ${enable_pam_config+y} then : enableval=$enable_pam_config; fi # Development options. devel_all is first as this provides a default for # the others # Check whether --enable-devel_all was given. if test ${enable_devel_all+y} then : enableval=$enable_devel_all; devel_all=$enableval else case e in #( e) devel_all=no ;; esac fi # Check whether --enable-devel_debug was given. if test ${enable_devel_debug+y} then : enableval=$enable_devel_debug; devel_debug=$enableval else case e in #( e) devel_debug=$devel_all ;; esac fi if test x$devel_debug = xyes ; then DEVEL_DEBUG_TRUE= DEVEL_DEBUG_FALSE='#' else DEVEL_DEBUG_TRUE='#' DEVEL_DEBUG_FALSE= fi # Check whether --enable-devel_logging was given. if test ${enable_devel_logging+y} then : enableval=$enable_devel_logging; devel_logging=$enableval else case e in #( e) devel_logging=$devel_all ;; esac fi # Check whether --enable-devel_streamcheck was given. if test ${enable_devel_streamcheck+y} then : enableval=$enable_devel_streamcheck; devel_streamcheck=$enableval else case e in #( e) devel_streamcheck=$devel_all ;; esac fi # Check whether --enable-neutrinordp was given. if test ${enable_neutrinordp+y} then : enableval=$enable_neutrinordp; else case e in #( e) enable_neutrinordp=no ;; esac fi if test x$enable_neutrinordp = xyes; then XRDP_NEUTRINORDP_TRUE= XRDP_NEUTRINORDP_FALSE='#' else XRDP_NEUTRINORDP_TRUE='#' XRDP_NEUTRINORDP_FALSE= fi # Check whether --enable-ulalaca was given. if test ${enable_ulalaca+y} then : enableval=$enable_ulalaca; else case e in #( e) enable_ulalaca=no ;; esac fi if test x$enable_ulalaca = xyes; then XRDP_ULALACA_TRUE= XRDP_ULALACA_FALSE='#' else XRDP_ULALACA_TRUE='#' XRDP_ULALACA_FALSE= fi # Check whether --enable-jpeg was given. if test ${enable_jpeg+y} then : enableval=$enable_jpeg; else case e in #( e) enable_jpeg=no ;; esac fi if test x$enable_jpeg = xyes; then XRDP_JPEG_TRUE= XRDP_JPEG_FALSE='#' else XRDP_JPEG_TRUE='#' XRDP_JPEG_FALSE= fi # Check whether --enable-tjpeg was given. if test ${enable_tjpeg+y} then : enableval=$enable_tjpeg; else case e in #( e) enable_tjpeg=no ;; esac fi if test x$enable_tjpeg = xyes; then XRDP_TJPEG_TRUE= XRDP_TJPEG_FALSE='#' else XRDP_TJPEG_TRUE='#' XRDP_TJPEG_FALSE= fi # Check whether --enable-fuse was given. if test ${enable_fuse+y} then : enableval=$enable_fuse; else case e in #( e) enable_fuse=no ;; esac fi if test x$enable_fuse = xyes; then XRDP_FUSE_TRUE= XRDP_FUSE_FALSE='#' else XRDP_FUSE_TRUE='#' XRDP_FUSE_FALSE= fi # Check whether --enable-xrdpvr was given. if test ${enable_xrdpvr+y} then : enableval=$enable_xrdpvr; else case e in #( e) enable_xrdpvr=no ;; esac fi if test x$enable_xrdpvr = xyes; then XRDP_XRDPVR_TRUE= XRDP_XRDPVR_FALSE='#' else XRDP_XRDPVR_TRUE='#' XRDP_XRDPVR_FALSE= fi # Check whether --enable-fdkaac was given. if test ${enable_fdkaac+y} then : enableval=$enable_fdkaac; else case e in #( e) enable_fdkaac=no ;; esac fi if test x$enable_fdkaac = xyes; then XRDP_FDK_AAC_TRUE= XRDP_FDK_AAC_FALSE='#' else XRDP_FDK_AAC_TRUE='#' XRDP_FDK_AAC_FALSE= fi # Check whether --enable-opus was given. if test ${enable_opus+y} then : enableval=$enable_opus; else case e in #( e) enable_opus=no ;; esac fi if test x$enable_opus = xyes; then XRDP_OPUS_TRUE= XRDP_OPUS_FALSE='#' else XRDP_OPUS_TRUE='#' XRDP_OPUS_FALSE= fi # Check whether --enable-mp3lame was given. if test ${enable_mp3lame+y} then : enableval=$enable_mp3lame; else case e in #( e) enable_mp3lame=no ;; esac fi if test x$enable_mp3lame = xyes; then XRDP_MP3LAME_TRUE= XRDP_MP3LAME_FALSE='#' else XRDP_MP3LAME_TRUE='#' XRDP_MP3LAME_FALSE= fi # Check whether --enable-pixman was given. if test ${enable_pixman+y} then : enableval=$enable_pixman; else case e in #( e) enable_pixman=no ;; esac fi if test x$enable_pixman = xyes; then XRDP_PIXMAN_TRUE= XRDP_PIXMAN_FALSE='#' else XRDP_PIXMAN_TRUE='#' XRDP_PIXMAN_FALSE= fi # Check whether --enable-painter was given. if test ${enable_painter+y} then : enableval=$enable_painter; else case e in #( e) enable_painter=yes ;; esac fi if test x$enable_painter = xyes; then XRDP_PAINTER_TRUE= XRDP_PAINTER_FALSE='#' else XRDP_PAINTER_TRUE='#' XRDP_PAINTER_FALSE= fi # Check whether --enable-rfxcodec was given. if test ${enable_rfxcodec+y} then : enableval=$enable_rfxcodec; else case e in #( e) enable_rfxcodec=yes ;; esac fi if test x$enable_rfxcodec = xyes; then XRDP_RFXCODEC_TRUE= XRDP_RFXCODEC_FALSE='#' else XRDP_RFXCODEC_TRUE='#' XRDP_RFXCODEC_FALSE= fi # Check whether --enable-rdpsndaudin was given. if test ${enable_rdpsndaudin+y} then : enableval=$enable_rdpsndaudin; else case e in #( e) enable_rdpsndaudin=no ;; esac fi if test x$enable_rdpsndaudin = xyes; then XRDP_RDPSNDAUDIN_TRUE= XRDP_RDPSNDAUDIN_FALSE='#' else XRDP_RDPSNDAUDIN_TRUE='#' XRDP_RDPSNDAUDIN_FALSE= fi # Check whether --with-imlib2 was given. if test ${with_imlib2+y} then : withval=$with_imlib2; fi # Check whether --with-freetype2 was given. if test ${with_freetype2+y} then : withval=$with_freetype2; fi # Obsolete options # Check whether --enable-xrdpdebug was given. if test ${enable_xrdpdebug+y} then : enableval=$enable_xrdpdebug; fi if test "x$enable_xrdpdebug" != x; then as_fn_error $? "--enable-xrdpdebug must be replaced with one or more --enable-devel-* options" "$LINENO" 5 fi # configure compiler options and CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __attribute__((format))" >&5 printf %s "checking for __attribute__((format))... " >&6; } if test ${ax_cv_have_func_attribute_format+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(const char *p, ...) __attribute__((format(printf, 1, 2))); int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if test -s conftest.err then : ax_cv_have_func_attribute_format=no else case e in #( e) ax_cv_have_func_attribute_format=yes ;; esac fi else case e in #( e) ax_cv_have_func_attribute_format=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_func_attribute_format" >&5 printf "%s\n" "$ax_cv_have_func_attribute_format" >&6; } if test yes = $ax_cv_have_func_attribute_format then : printf "%s\n" "#define HAVE_FUNC_ATTRIBUTE_FORMAT 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 printf %s "checking for socklen_t... " >&6; } if test ${ac_cv_ax_type_socklen_t+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { socklen_t len = (socklen_t) 42; return (!len); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_ax_type_socklen_t=yes else case e in #( e) ac_cv_ax_type_socklen_t=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ax_type_socklen_t" >&5 printf "%s\n" "$ac_cv_ax_type_socklen_t" >&6; } if test $ac_cv_ax_type_socklen_t != yes; then printf "%s\n" "#define socklen_t int" >>confdefs.h 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 printf %s "checking CFLAGS for maximum warnings... " >&6; } if test ${ac_cv_cflags_warn_all+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_cflags_warn_all="no, unknown" ac_save_CFLAGS="$CFLAGS" for ac_arg in "-warn all % -warn all" "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS="$ac_save_CFLAGS" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 printf "%s\n" "$ac_cv_cflags_warn_all" >&6; } case ".$ac_cv_cflags_warn_all" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$ac_cv_cflags_warn_all"; } >&5 (: CFLAGS already contains $ac_cv_cflags_warn_all) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $ac_cv_cflags_warn_all" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$ac_cv_cflags_warn_all { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi ;; esac 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 for flag in -Wwrite-strings; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done if test -z "$LINUX_TRUE"; then : for flag in -Werror; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done fi # bsd has warnings that have not been fixed yet if test -z "$DEVEL_DEBUG_TRUE"; then : for flag in -g -O0; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done else for flag in -O2; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done fi # Function setusercontext() is in BSD -lutil but N/A on Solaris or GNU systems { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setusercontext" >&5 printf %s "checking for library containing setusercontext... " >&6; } if test ${ac_cv_search_setusercontext+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char setusercontext (void); int main (void) { return setusercontext (); ; return 0; } _ACEOF for ac_lib in '' util do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_setusercontext=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_setusercontext+y} then : break fi done if test ${ac_cv_search_setusercontext+y} then : else case e in #( e) ac_cv_search_setusercontext=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setusercontext" >&5 printf "%s\n" "$ac_cv_search_setusercontext" >&6; } ac_res=$ac_cv_search_setusercontext if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Define HAVE_XXXXX macros for some system functions ac_fn_c_check_func "$LINENO" "setusercontext" "ac_cv_func_setusercontext" if test "x$ac_cv_func_setusercontext" = xyes then : printf "%s\n" "#define HAVE_SETUSERCONTEXT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist" if test "x$ac_cv_func_getgrouplist" = xyes then : printf "%s\n" "#define HAVE_GETGROUPLIST 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "clearenv" "ac_cv_func_clearenv" if test "x$ac_cv_func_clearenv" = xyes then : printf "%s\n" "#define HAVE_CLEARENV 1" >>confdefs.h fi # The type used by getgrouplist() is the same type used by getgroups() ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" if test "x$ac_cv_type_uid_t" = xyes then : else case e in #( e) printf "%s\n" "#define uid_t int" >>confdefs.h ;; esac fi ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" if test "x$ac_cv_type_gid_t" = xyes then : else case e in #( e) printf "%s\n" "#define gid_t int" >>confdefs.h ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5 printf %s "checking type of array argument to getgroups... " >&6; } if test ${ac_cv_type_getgroups+y} then : printf %s "(cached) " >&6 else case e in #( e) # If AC_TYPE_UID_T says there isn't any gid_t typedef, then we can skip # everything below. if test $ac_cv_type_gid_t = no then : ac_cv_type_getgroups=int else case e in #( e) # Test programs below rely on strict type checking of extern declarations: # 'extern int getgroups(int, int *); extern int getgroups(int, pid_t *);' # is valid in C89 if and only if pid_t is a typedef for int. Unlike # anything involving either an assignment or a function call, compilers # tend to make this kind of type mismatch a hard error, not just an # "incompatible pointer types" warning. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern int getgroups(int, gid_t *); int main (void) { return !(getgroups(0, 0) >= 0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_getgroups_gidarray=yes else case e in #( e) ac_getgroups_gidarray=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern int getgroups(int, int *); int main (void) { return !(getgroups(0, 0) >= 0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_getgroups_intarray=yes else case e in #( e) ac_getgroups_intarray=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext case int:$ac_getgroups_intarray,gid:$ac_getgroups_gidarray in #( int:yes,gid:no) : ac_cv_type_getgroups=int ;; #( int:no,gid:yes) : ac_cv_type_getgroups=gid_t ;; #( int:yes,gid:yes) : # Both programs compiled - this means *either* that getgroups # was declared with no prototype, in which case we should use int, # or that it was declared prototyped but gid_t is a typedef for int, # in which case we should use gid_t. Distinguish the two cases # by testing if the compiler catches a blatantly incorrect function # signature for getgroups. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern int getgroups(int, float); int main (void) { return !(getgroups(0, 0) >= 0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : # Compiler did not catch incorrect argument list; # getgroups is unprototyped. ac_cv_type_getgroups=int else case e in #( e) # Compiler caught incorrect argument list; # gid_t is a typedef for int. ac_cv_type_getgroups=gid_t ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; #( *) : # Both programs failed to compile - this probably means getgroups # wasn't declared at all. Use 'int', as this is probably a very # old system where the type _would have been_ int. ac_cv_type_getgroups=int ;; esac ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5 printf "%s\n" "$ac_cv_type_getgroups" >&6; } printf "%s\n" "#define GETGROUPS_T $ac_cv_type_getgroups" >>confdefs.h # Don't fail without working nasm if rfxcodec is not enabled if test "x$enable_rfxcodec" != xyes; then with_simd=no export with_simd fi # Check if -ldl is needed to use dlopen() DLOPEN_LIBS= ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : DLOPEN_LIBS=-ldl fi ;; esac fi # checking for openssl pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 printf %s "checking for OPENSSL... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 0.9.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$OPENSSL_LIBS"; then pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 0.9.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 0.9.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl >= 0.9.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 0.9.8" 2>&1` else OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 0.9.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$OPENSSL_PKG_ERRORS" >&5 as_fn_error $? "please install libssl-dev or openssl-devel" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install libssl-dev or openssl-devel" "$LINENO" 5 else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi # look for openssl binary OPENSSL_BIN=`$PKG_CONFIG --variable=exec_prefix openssl`/bin for ac_prog in openssl 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_path_OPENSSL+y} then : printf %s "(cached) " >&6 else case e in #( e) case $OPENSSL in [\\/]* | ?:[\\/]*) ac_cv_path_OPENSSL="$OPENSSL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$OPENSSL_BIN:$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_OPENSSL="$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 ;; esac ;; esac fi OPENSSL=$ac_cv_path_OPENSSL if test -n "$OPENSSL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OPENSSL" >&5 printf "%s\n" "$OPENSSL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$OPENSSL" && break done test -n "$OPENSSL" || OPENSSL=":" # checking for PAM variation # Linux-PAM is used in Linux systems # OpenPAM is used by FreeBSD, NetBSD, DragonFly BSD and OS X # OpenBSD uses BSD Authentication rather than both PAMs ac_fn_c_check_header_compile "$LINENO" "security/_pam_types.h" "ac_cv_header_security__pam_types_h" "$ac_includes_default" if test "x$ac_cv_header_security__pam_types_h" = xyes then : printf "%s\n" "#define HAVE__PAM_TYPES_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "security/pam_constants.h" "ac_cv_header_security_pam_constants_h" "$ac_includes_default" if test "x$ac_cv_header_security_pam_constants_h" = xyes then : printf "%s\n" "#define HAVE_PAM_CONSTANTS_H 1" >>confdefs.h fi # Find imlib2 case "$with_imlib2" in '' | no) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: imlib2 will not be supported" >&5 printf "%s\n" "$as_me: imlib2 will not be supported" >&6;} use_imlib2=no ;; yes) pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IMLIB2" >&5 printf %s "checking for IMLIB2... " >&6; } if test -n "$IMLIB2_CFLAGS"; then pkg_cv_IMLIB2_CFLAGS="$IMLIB2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"imlib2 >= 1.4.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "imlib2 >= 1.4.5") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_IMLIB2_CFLAGS=`$PKG_CONFIG --cflags "imlib2 >= 1.4.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$IMLIB2_LIBS"; then pkg_cv_IMLIB2_LIBS="$IMLIB2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"imlib2 >= 1.4.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "imlib2 >= 1.4.5") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_IMLIB2_LIBS=`$PKG_CONFIG --libs "imlib2 >= 1.4.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then IMLIB2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "imlib2 >= 1.4.5" 2>&1` else IMLIB2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "imlib2 >= 1.4.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$IMLIB2_PKG_ERRORS" >&5 as_fn_error $? "please install libimlib2-dev or imlib2-devel" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install libimlib2-dev or imlib2-devel" "$LINENO" 5 else IMLIB2_CFLAGS=$pkg_cv_IMLIB2_CFLAGS IMLIB2_LIBS=$pkg_cv_IMLIB2_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } use_imlib2=yes fi ;; /*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for imlib2 in $with_imlib2" >&5 printf %s "checking for imlib2 in $with_imlib2... " >&6; } if test -d $with_imlib2/lib; then IMLIB2_LIBS="-L$with_imlib2/lib -lImlib2" elif test -d $with_imlib2/lib64; then IMLIB2_LIBS="-L$with_imlib2/lib64 -lImlib2" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Can't find libImlib2 in $with_imlib2" "$LINENO" 5 fi if test -f $with_imlib2/include/Imlib2.h; then IMLIB2_CFLAGS="-I $with_imlib2/include" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Can't find $with_imlib2/include/Imlib2.h" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } use_imlib2=yes ;; *) as_fn_error $? "--with-imlib2 needs yes/no or absolute path" "$LINENO" 5 esac if test x$use_imlib2 = xyes; then printf "%s\n" "#define USE_IMLIB2 1" >>confdefs.h fi # Find freetype2 # # The modversion used by pkgcheck does not correspond to the # freetype2 release. See docs/VERSIONS.TXT in the freetype2 # source for a table of correspondences. If you change one # of the below defines, change both. case "$with_freetype2" in '' | no) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: freetype2 will not be supported" >&5 printf "%s\n" "$as_me: freetype2 will not be supported" >&6;} use_freetype2=no ;; yes) pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FREETYPE2" >&5 printf %s "checking for FREETYPE2... " >&6; } if test -n "$FREETYPE2_CFLAGS"; then pkg_cv_FREETYPE2_CFLAGS="$FREETYPE2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2 >= 20.0.14\""; } >&5 ($PKG_CONFIG --exists --print-errors "freetype2 >= 20.0.14") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags "freetype2 >= 20.0.14" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FREETYPE2_LIBS"; then pkg_cv_FREETYPE2_LIBS="$FREETYPE2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2 >= 20.0.14\""; } >&5 ($PKG_CONFIG --exists --print-errors "freetype2 >= 20.0.14") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREETYPE2_LIBS=`$PKG_CONFIG --libs "freetype2 >= 20.0.14" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "freetype2 >= 20.0.14" 2>&1` else FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "freetype2 >= 20.0.14" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FREETYPE2_PKG_ERRORS" >&5 as_fn_error $? "please install version 2_8_0 or later of libfreetype6-dev or freetype-devel" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install version 2_8_0 or later of libfreetype6-dev or freetype-devel" "$LINENO" 5 else FREETYPE2_CFLAGS=$pkg_cv_FREETYPE2_CFLAGS FREETYPE2_LIBS=$pkg_cv_FREETYPE2_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } use_freetype2=yes fi ;; /*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for freetype2 in $with_freetype2" >&5 printf %s "checking for freetype2 in $with_freetype2... " >&6; } if test -d $with_freetype2/lib; then FREETYPE2_LIBS="-L$with_freetype2/lib -llibfreetype" elif test -d $with_freetype2/lib64; then FREETYPE2_LIBS="-L$with_freetype2/lib64 -llibfreetype" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Can't find libfreetype in $with_freetype2" "$LINENO" 5 fi if test -f $with_freetype2/include/freetype2/ft2build.h; then FREETYPE2_CFLAGS="-I $with_freetype2/include/freetype2" else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "Can't find $with_freetype2/include/freetype2/ft2build.h" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } use_freetype2=yes ;; *) as_fn_error $? "--with-freetype2 needs yes/no or absolute path" "$LINENO" 5 esac if test "x$use_freetype2" = xyes; then USE_FREETYPE2_TRUE= USE_FREETYPE2_FALSE='#' else USE_FREETYPE2_TRUE='#' USE_FREETYPE2_FALSE= fi # Check only one auth mechanism is specified, and give it a name auth_cnt=0 auth_mech="Builtin" AUTHMOD_OBJ=verify_user.lo AUTHMOD_LIB=-lcrypt if test x$enable_pam = xyes then auth_cnt=`expr $auth_cnt + 1` auth_mech="PAM" AUTHMOD_OBJ=verify_user_pam.lo AUTHMOD_LIB=-lpam fi if test x$bsd = xtrue then auth_cnt=`expr $auth_cnt + 1` auth_mech="BSD" AUTHMOD_OBJ=verify_user_bsd.lo AUTHMOD_LIB= fi if test x$enable_kerberos = xyes then auth_cnt=`expr $auth_cnt + 1` auth_mech="Kerberos" AUTHMOD_OBJ=verify_user_kerberos.lo AUTHMOD_LIB=-lkrb5 fi if test x$enable_pamuserpass = xyes then auth_cnt=`expr $auth_cnt + 1` auth_mech="PAM userpass" AUTHMOD_OBJ=verify_user_pam_userpass.lo AUTHMOD_LIB="-lpam -lpam_userpass" fi if test $auth_cnt -gt 1 then as_fn_error $? "--enable-pam, --enable-bsd, --enable-pamuserpass and --enable-kerberos are mutually exclusive" "$LINENO" 5 fi # checking if pam should be autodetected. if test "x$enable_pam" = "xyes" then if test -z "$enable_bsd" then ac_fn_c_check_header_compile "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default" if test "x$ac_cv_header_security_pam_appl_h" = xyes then : else case e in #( e) as_fn_error $? "please install libpam0g-dev or pam-devel" "$LINENO" 5 ;; esac fi fi if test "x$enable_pam_config" = "x"; then PAM_RULES="auto" else pam_config_file="$srcdir/instfiles/pam.d/xrdp-sesman.$enable_pam_config" if test -f "$pam_config_file"; then PAM_RULES="$enable_pam_config" else as_fn_error $? "PAM file \"$pam_config_file\" is not available" "$LINENO" 5 fi fi fi # Add define for development options to config_ac.h printf "%s\n" "#define CONFIG_AC_H 1" >>confdefs.h if test x$devel_logging = xyes then printf "%s\n" "#define USE_DEVEL_LOGGING 1" >>confdefs.h fi if test x$devel_streamcheck = xyes then printf "%s\n" "#define USE_DEVEL_STREAMCHECK 1" >>confdefs.h fi if test "x$enable_vsock" = "xyes" then enable_vsock=yes if test "x$freebsd" = "xyes" then # Determine if we have AF_HYPERV defined (FreeBSD 13+) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else case e in #( e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; esac fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { 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 make $CC report undeclared builtins See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac ac_fn_check_decl "$LINENO" "AF_HYPERV" "ac_cv_have_decl_AF_HYPERV" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_AF_HYPERV" = xyes then : printf "%s\n" "#define XRDP_ENABLE_VSOCK 1" >>confdefs.h fi else for ac_header in linux/socket.h linux/vm_sockets.h do : as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include " if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 _ACEOF printf "%s\n" "#define XRDP_ENABLE_VSOCK 1" >>confdefs.h fi done fi fi if test "x$enable_ipv6only" = "xyes" then enable_ipv6=yes printf "%s\n" "#define XRDP_ENABLE_IPV6ONLY 1" >>confdefs.h fi if test "x$enable_ipv6" = "xyes" then printf "%s\n" "#define XRDP_ENABLE_IPV6 1" >>confdefs.h fi if test "x$enable_neutrinordp" = "xyes" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FREERDP" >&5 printf %s "checking for FREERDP... " >&6; } if test -n "$FREERDP_CFLAGS"; then pkg_cv_FREERDP_CFLAGS="$FREERDP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freerdp >= 1.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "freerdp >= 1.0.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREERDP_CFLAGS=`$PKG_CONFIG --cflags "freerdp >= 1.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FREERDP_LIBS"; then pkg_cv_FREERDP_LIBS="$FREERDP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freerdp >= 1.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "freerdp >= 1.0.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FREERDP_LIBS=`$PKG_CONFIG --libs "freerdp >= 1.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FREERDP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "freerdp >= 1.0.0" 2>&1` else FREERDP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "freerdp >= 1.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FREERDP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (freerdp >= 1.0.0) were not met: $FREERDP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables FREERDP_CFLAGS and FREERDP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { 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 $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables FREERDP_CFLAGS and FREERDP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See 'config.log' for more details" "$LINENO" 5; } else FREERDP_CFLAGS=$pkg_cv_FREERDP_CFLAGS FREERDP_LIBS=$pkg_cv_FREERDP_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi # checking for libjpeg if test "x$enable_jpeg" = "xyes" then ac_fn_c_check_header_compile "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes then : else case e in #( e) as_fn_error $? "please install libjpeg-dev or libjpeg-devel" "$LINENO" 5 ;; esac fi fi # checking for fuse if test "x$enable_fuse" = "xyes" then pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FUSE" >&5 printf %s "checking for FUSE... " >&6; } if test -n "$FUSE_CFLAGS"; then pkg_cv_FUSE_CFLAGS="$FUSE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "fuse >= 2.6") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FUSE_CFLAGS=`$PKG_CONFIG --cflags "fuse >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FUSE_LIBS"; then pkg_cv_FUSE_LIBS="$FUSE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "fuse >= 2.6") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FUSE_LIBS=`$PKG_CONFIG --libs "fuse >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FUSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fuse >= 2.6" 2>&1` else FUSE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fuse >= 2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FUSE_PKG_ERRORS" >&5 as_fn_error $? "please install libfuse-dev or fuse-devel" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install libfuse-dev or fuse-devel" "$LINENO" 5 else FUSE_CFLAGS=$pkg_cv_FUSE_CFLAGS FUSE_LIBS=$pkg_cv_FUSE_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi # checking for fdk aac if test "x$enable_fdkaac" = "xyes" then pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for FDKAAC" >&5 printf %s "checking for FDKAAC... " >&6; } if test -n "$FDKAAC_CFLAGS"; then pkg_cv_FDKAAC_CFLAGS="$FDKAAC_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fdk-aac >= 0.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "fdk-aac >= 0.1.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FDKAAC_CFLAGS=`$PKG_CONFIG --cflags "fdk-aac >= 0.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FDKAAC_LIBS"; then pkg_cv_FDKAAC_LIBS="$FDKAAC_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fdk-aac >= 0.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "fdk-aac >= 0.1.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FDKAAC_LIBS=`$PKG_CONFIG --libs "fdk-aac >= 0.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FDKAAC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fdk-aac >= 0.1.0" 2>&1` else FDKAAC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fdk-aac >= 0.1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FDKAAC_PKG_ERRORS" >&5 as_fn_error $? "please install libfdk-aac-dev or fdk-aac-devel" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install libfdk-aac-dev or fdk-aac-devel" "$LINENO" 5 else FDKAAC_CFLAGS=$pkg_cv_FDKAAC_CFLAGS FDKAAC_LIBS=$pkg_cv_FDKAAC_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi # checking for opus if test "x$enable_opus" = "xyes" then ac_fn_c_check_header_compile "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default" if test "x$ac_cv_header_opus_opus_h" = xyes then : else case e in #( e) as_fn_error $? "please install libopus-dev or opus-devel" "$LINENO" 5 ;; esac fi fi # checking for lame mp3 if test "x$enable_mp3lame" = "xyes" then ac_fn_c_check_header_compile "$LINENO" "lame/lame.h" "ac_cv_header_lame_lame_h" "$ac_includes_default" if test "x$ac_cv_header_lame_lame_h" = xyes then : else case e in #( e) as_fn_error $? "please install libmp3lame-dev or lamemp3-devel" "$LINENO" 5 ;; esac fi fi if test "x$enable_pixman" = "xyes" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PIXMAN" >&5 printf %s "checking for PIXMAN... " >&6; } if test -n "$PIXMAN_CFLAGS"; then pkg_cv_PIXMAN_CFLAGS="$PIXMAN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pixman-1 >= 0.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pixman-1 >= 0.1.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PIXMAN_CFLAGS=`$PKG_CONFIG --cflags "pixman-1 >= 0.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PIXMAN_LIBS"; then pkg_cv_PIXMAN_LIBS="$PIXMAN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pixman-1 >= 0.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pixman-1 >= 0.1.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PIXMAN_LIBS=`$PKG_CONFIG --libs "pixman-1 >= 0.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PIXMAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pixman-1 >= 0.1.0" 2>&1` else PIXMAN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pixman-1 >= 0.1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PIXMAN_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (pixman-1 >= 0.1.0) were not met: $PIXMAN_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PIXMAN_CFLAGS and PIXMAN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { 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 $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PIXMAN_CFLAGS and PIXMAN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See 'config.log' for more details" "$LINENO" 5; } else PIXMAN_CFLAGS=$pkg_cv_PIXMAN_CFLAGS PIXMAN_LIBS=$pkg_cv_PIXMAN_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi # checking for TurboJPEG if test "x$enable_tjpeg" = "xyes" then if test ! -z "$TURBOJPEG_PATH" then # env var TURBOJPEG_PATH has been defined, use that as_ac_Header=`printf "%s\n" "ac_cv_header_$TURBOJPEG_PATH/include/turbojpeg.h" | sed "$as_sed_sh"` ac_fn_c_check_header_compile "$LINENO" "$TURBOJPEG_PATH/include/turbojpeg.h" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes" then : else case e in #( e) as_fn_error $? "could not find TurboJPEG in dir specified by env variable TURBOJPEG_PATH ($TURBOJPEG_PATH)" "$LINENO" 5 ;; esac fi TurboJpegIncDir="-I$TURBOJPEG_PATH/include" TurboJpegLibDir="-L$TURBOJPEG_PATH/lib -Wl,-rpath -Wl,$TURBOJPEG_PATH/lib" elif test -e /opt/libjpeg-turbo/lib64 then # TurboJPEG has been installed to /opt on a 64 bit m/c TurboJpegIncDir="-I/opt/libjpeg-turbo/include" TurboJpegLibDir="-L/opt/libjpeg-turbo/lib64 -Wl,-rpath -Wl,/opt/libjpeg-turbo/lib64" elif test -e /opt/libjpeg-turbo/lib32 then # TurboJPEG has been installed to /opt on a 32 bit m/c TurboJpegIncDir="-I/opt/libjpeg-turbo/include" TurboJpegLibDir="-L/opt/libjpeg-turbo/lib32 -Wl,-rpath -Wl,/opt/libjpeg-turbo/lib32" else # check in default location ac_fn_c_check_header_compile "$LINENO" "/usr/include/turbojpeg.h" "ac_cv_header__usr_include_turbojpeg_h" "$ac_includes_default" if test "x$ac_cv_header__usr_include_turbojpeg_h" = xyes then : else case e in #( e) as_fn_error $? "please install TurboJPEG " "$LINENO" 5 ;; esac fi TurboJpegIncDir="" TurboJpegLibDir="" 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else case e in #( e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP ;; esac fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else case e in #( e) # Broken: fails on valid input. continue ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else case e in #( e) # Passes both tests. ac_preproc_ok=: break ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else case e in #( e) { { 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 $? "C preprocessor \"$CPP\" fails sanity check See 'config.log' for more details" "$LINENO" 5; } ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X" >&5 printf %s "checking for X... " >&6; } # Check whether --with-x was given. if test ${with_x+y} then : withval=$with_x; fi # $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if test ${ac_cv_have_x+y} then : printf %s "(cached) " >&6 else case e in #( e) # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no # Do we need to do anything special at all? ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : # We can compile and link X programs with no special options. ac_x_includes= ac_x_libraries= fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" # If that didn't work, only try xmkmf and file system searches # for native compilation. if test x"$ac_x_includes" = xno && test "$cross_compiling" = no then : rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /opt/X11/include /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # We can compile using X headers with no special include directory. ac_x_includes= else case e in #( e) for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done ;; esac fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else case e in #( e) LIBS=$ac_save_LIBS for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no fi # Record the results. case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) : # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no" ;; #( *) : # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" ;; esac ;; esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 printf "%s\n" "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 printf "%s\n" "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. printf "%s\n" "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 printf %s "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else case e in #( e) LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 printf "%s\n" "neither works" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (void); int main (void) { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 printf %s "checking for dnet_ntoa in -ldnet... " >&6; } if test ${ac_cv_lib_dnet_dnet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (void); int main (void) { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_dnet_ntoa=yes else case e in #( e) ac_cv_lib_dnet_dnet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (void); int main (void) { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else case e in #( e) ac_cv_lib_dnet_stub_dnet_ntoa=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes then : fi if test $ac_cv_func_gethostbyname = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char gethostbyname (void); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes else case e in #( e) ac_cv_lib_nsl_gethostbyname=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 printf %s "checking for gethostbyname in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_gethostbyname+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char gethostbyname (void); int main (void) { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_gethostbyname=yes else case e in #( e) ac_cv_lib_bsd_gethostbyname=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes then : fi if test $ac_cv_func_connect = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 printf %s "checking for connect in -lsocket... " >&6; } if test ${ac_cv_lib_socket_connect+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char connect (void); int main (void) { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_connect=yes else case e in #( e) ac_cv_lib_socket_connect=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes then : fi if test $ac_cv_func_remove = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 printf %s "checking for remove in -lposix... " >&6; } if test ${ac_cv_lib_posix_remove+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char remove (void); int main (void) { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix_remove=yes else case e in #( e) ac_cv_lib_posix_remove=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes then : fi if test $ac_cv_func_shmat = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 printf %s "checking for shmat in -lipc... " >&6; } if test ${ac_cv_lib_ipc_shmat+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shmat (void); int main (void) { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ipc_shmat=yes else case e in #( e) ac_cv_lib_ipc_shmat=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 printf %s "checking for IceConnectionNumber in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceConnectionNumber+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (void); int main (void) { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceConnectionNumber=yes else case e in #( e) ac_cv_lib_ICE_IceConnectionNumber=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "x$no_x" == "xyes"; then as_fn_error $? "please install libx11-dev or libX11-devel" "$LINENO" 5 fi save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $X_CFLAGS" # checking for Xfixes ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xfixes.h" "ac_cv_header_X11_extensions_Xfixes_h" "#include " if test "x$ac_cv_header_X11_extensions_Xfixes_h" = xyes then : else case e in #( e) as_fn_error $? "please install libxfixes-dev or libXfixes-devel" "$LINENO" 5 ;; esac fi # checking for Xrandr ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "#include " if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes then : else case e in #( e) as_fn_error $? "please install libxrandr-dev or libXrandr-devel" "$LINENO" 5 ;; esac fi CFLAGS="$save_CFLAGS" # perform unit tests if libcheck and libmocka found perform_unit_tests=yes; # Assume packages will be found if test "x$ensure_tests_deps" == "xyes"; then pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CHECK" >&5 printf %s "checking for CHECK... " >&6; } if test -n "$CHECK_CFLAGS"; then pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.10.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CHECK_LIBS"; then pkg_cv_CHECK_LIBS="$CHECK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.10.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.10.0" 2>&1` else CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CHECK_PKG_ERRORS" >&5 as_fn_error $? "please install check, the unit test framework" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install check, the unit test framework" "$LINENO" 5 else CHECK_CFLAGS=$pkg_cv_CHECK_CFLAGS CHECK_LIBS=$pkg_cv_CHECK_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi # Check if cmocka is available - needed for unit testing pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CMOCKA" >&5 printf %s "checking for CMOCKA... " >&6; } if test -n "$CMOCKA_CFLAGS"; then pkg_cv_CMOCKA_CFLAGS="$CMOCKA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cmocka\""; } >&5 ($PKG_CONFIG --exists --print-errors "cmocka") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CMOCKA_CFLAGS=`$PKG_CONFIG --cflags "cmocka" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CMOCKA_LIBS"; then pkg_cv_CMOCKA_LIBS="$CMOCKA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cmocka\""; } >&5 ($PKG_CONFIG --exists --print-errors "cmocka") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CMOCKA_LIBS=`$PKG_CONFIG --libs "cmocka" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CMOCKA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cmocka" 2>&1` else CMOCKA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cmocka" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CMOCKA_PKG_ERRORS" >&5 as_fn_error $? "please install cmocka, the mocking framework" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "please install cmocka, the mocking framework" "$LINENO" 5 else CMOCKA_CFLAGS=$pkg_cv_CMOCKA_CFLAGS CMOCKA_LIBS=$pkg_cv_CMOCKA_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi else pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CHECK" >&5 printf %s "checking for CHECK... " >&6; } if test -n "$CHECK_CFLAGS"; then pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.10.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CHECK_CFLAGS=`$PKG_CONFIG --cflags "check >= 0.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CHECK_LIBS"; then pkg_cv_CHECK_LIBS="$CHECK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.10.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CHECK_LIBS=`$PKG_CONFIG --libs "check >= 0.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "check >= 0.10.0" 2>&1` else CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "check >= 0.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CHECK_PKG_ERRORS" >&5 perform_unit_tests=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } perform_unit_tests=no else CHECK_CFLAGS=$pkg_cv_CHECK_CFLAGS CHECK_LIBS=$pkg_cv_CHECK_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CMOCKA" >&5 printf %s "checking for CMOCKA... " >&6; } if test -n "$CMOCKA_CFLAGS"; then pkg_cv_CMOCKA_CFLAGS="$CMOCKA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cmocka\""; } >&5 ($PKG_CONFIG --exists --print-errors "cmocka") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CMOCKA_CFLAGS=`$PKG_CONFIG --cflags "cmocka" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CMOCKA_LIBS"; then pkg_cv_CMOCKA_LIBS="$CMOCKA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cmocka\""; } >&5 ($PKG_CONFIG --exists --print-errors "cmocka") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CMOCKA_LIBS=`$PKG_CONFIG --libs "cmocka" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CMOCKA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cmocka" 2>&1` else CMOCKA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cmocka" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CMOCKA_PKG_ERRORS" >&5 perform_unit_tests=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } perform_unit_tests=no else CMOCKA_CFLAGS=$pkg_cv_CMOCKA_CFLAGS CMOCKA_LIBS=$pkg_cv_CMOCKA_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi if test "x$perform_unit_tests" == "xyes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libcheck found, unit tests will be performed" >&5 printf "%s\n" "$as_me: libcheck found, unit tests will be performed" >&6;} else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: libcheck not found, unit tests will be skipped" >&5 printf "%s\n" "$as_me: libcheck not found, unit tests will be skipped" >&6;} fi # -- end perform unit tests moduledir='${libdir}/xrdp' # Check whether --enable-strict-locations was given. if test ${enable_strict_locations+y} then : enableval=$enable_strict_locations; else case e in #( e) enable_strict_locations=no ;; esac fi if test "x$enable_strict_locations" != "xyes"; then sysconfdir="/etc"; localstatedir="/var"; fi # Check whether --with-pamconfdir was given. if test ${with_pamconfdir+y} then : withval=$with_pamconfdir; else case e in #( e) with_pamconfdir="$sysconfdir/pam.d" ;; esac fi pamconfdir=$with_pamconfdir # Check whether --with-pkgconfigdir was given. if test ${with_pkgconfigdir+y} then : withval=$with_pkgconfigdir; else case e in #( e) with_pkgconfigdir='${libdir}/pkgconfig' ;; esac fi pkgconfigdir=$with_pkgconfigdir ac_fn_c_check_header_compile "$LINENO" "sys/prctl.h" "ac_cv_header_sys_prctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_prctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PRCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "uchar.h" "ac_cv_header_uchar_h" "$ac_includes_default" if test "x$ac_cv_header_uchar_h" = xyes then : printf "%s\n" "#define HAVE_UCHAR_H 1" >>confdefs.h fi ac_config_files="$ac_config_files common/Makefile docs/Makefile docs/man/Makefile fontutils/Makefile genkeymap/Makefile instfiles/default/Makefile instfiles/init.d/Makefile instfiles/Makefile instfiles/pam.d/Makefile instfiles/pulse/Makefile instfiles/rc.d/Makefile keygen/Makefile waitforx/Makefile libipm/Makefile libxrdp/Makefile Makefile mc/Makefile neutrinordp/Makefile ulalaca/Makefile pkgconfig/Makefile pkgconfig/xrdp.pc pkgconfig/xrdp-uninstalled.pc sesman/libsesman/Makefile sesman/chansrv/Makefile sesman/Makefile sesman/sesexec/Makefile sesman/tools/Makefile tests/Makefile tests/common/Makefile tests/libipm/Makefile tests/libxrdp/Makefile tests/memtest/Makefile tests/xrdp/Makefile tools/Makefile tools/devel/Makefile tools/devel/tcp_proxy/Makefile vnc/Makefile xrdpapi/Makefile xrdp/Makefile xrdpvr/Makefile xup/Makefile third_party/Makefile third_party/tomlc99/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; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then as_fn_error $? "conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FREEBSD_TRUE}" && test -z "${FREEBSD_FALSE}"; then as_fn_error $? "conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OPENBSD_TRUE}" && test -z "${OPENBSD_FALSE}"; then as_fn_error $? "conditional \"OPENBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${NETBSD_TRUE}" && test -z "${NETBSD_FALSE}"; then as_fn_error $? "conditional \"NETBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MACOS_TRUE}" && test -z "${MACOS_FALSE}"; then as_fn_error $? "conditional \"MACOS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SESMAN_NOPAM_TRUE}" && test -z "${SESMAN_NOPAM_FALSE}"; then as_fn_error $? "conditional \"SESMAN_NOPAM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SESMAN_BSD_TRUE}" && test -z "${SESMAN_BSD_FALSE}"; then as_fn_error $? "conditional \"SESMAN_BSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SESMAN_KERBEROS_TRUE}" && test -z "${SESMAN_KERBEROS_FALSE}"; then as_fn_error $? "conditional \"SESMAN_KERBEROS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SESMAN_PAMUSERPASS_TRUE}" && test -z "${SESMAN_PAMUSERPASS_FALSE}"; then as_fn_error $? "conditional \"SESMAN_PAMUSERPASS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEVEL_DEBUG_TRUE}" && test -z "${DEVEL_DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEVEL_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_NEUTRINORDP_TRUE}" && test -z "${XRDP_NEUTRINORDP_FALSE}"; then as_fn_error $? "conditional \"XRDP_NEUTRINORDP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_ULALACA_TRUE}" && test -z "${XRDP_ULALACA_FALSE}"; then as_fn_error $? "conditional \"XRDP_ULALACA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_JPEG_TRUE}" && test -z "${XRDP_JPEG_FALSE}"; then as_fn_error $? "conditional \"XRDP_JPEG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_TJPEG_TRUE}" && test -z "${XRDP_TJPEG_FALSE}"; then as_fn_error $? "conditional \"XRDP_TJPEG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_FUSE_TRUE}" && test -z "${XRDP_FUSE_FALSE}"; then as_fn_error $? "conditional \"XRDP_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_XRDPVR_TRUE}" && test -z "${XRDP_XRDPVR_FALSE}"; then as_fn_error $? "conditional \"XRDP_XRDPVR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_FDK_AAC_TRUE}" && test -z "${XRDP_FDK_AAC_FALSE}"; then as_fn_error $? "conditional \"XRDP_FDK_AAC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_OPUS_TRUE}" && test -z "${XRDP_OPUS_FALSE}"; then as_fn_error $? "conditional \"XRDP_OPUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_MP3LAME_TRUE}" && test -z "${XRDP_MP3LAME_FALSE}"; then as_fn_error $? "conditional \"XRDP_MP3LAME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_PIXMAN_TRUE}" && test -z "${XRDP_PIXMAN_FALSE}"; then as_fn_error $? "conditional \"XRDP_PIXMAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_PAINTER_TRUE}" && test -z "${XRDP_PAINTER_FALSE}"; then as_fn_error $? "conditional \"XRDP_PAINTER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_RFXCODEC_TRUE}" && test -z "${XRDP_RFXCODEC_FALSE}"; then as_fn_error $? "conditional \"XRDP_RFXCODEC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${XRDP_RDPSNDAUDIN_TRUE}" && test -z "${XRDP_RDPSNDAUDIN_FALSE}"; then as_fn_error $? "conditional \"XRDP_RDPSNDAUDIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_FREETYPE2_TRUE}" && test -z "${USE_FREETYPE2_FALSE}"; then as_fn_error $? "conditional \"USE_FREETYPE2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 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 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 case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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 xrdp $as_me 0.10.1, which was generated by GNU Autoconf 2.72. 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" config_commands="$ac_config_commands" _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 Configuration commands: $config_commands 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="\\ xrdp config.status 0.10.1 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # 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' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _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 "config_ac.h") CONFIG_HEADERS="$CONFIG_HEADERS config_ac.h:config_ac-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/man/Makefile") CONFIG_FILES="$CONFIG_FILES docs/man/Makefile" ;; "fontutils/Makefile") CONFIG_FILES="$CONFIG_FILES fontutils/Makefile" ;; "genkeymap/Makefile") CONFIG_FILES="$CONFIG_FILES genkeymap/Makefile" ;; "instfiles/default/Makefile") CONFIG_FILES="$CONFIG_FILES instfiles/default/Makefile" ;; "instfiles/init.d/Makefile") CONFIG_FILES="$CONFIG_FILES instfiles/init.d/Makefile" ;; "instfiles/Makefile") CONFIG_FILES="$CONFIG_FILES instfiles/Makefile" ;; "instfiles/pam.d/Makefile") CONFIG_FILES="$CONFIG_FILES instfiles/pam.d/Makefile" ;; "instfiles/pulse/Makefile") CONFIG_FILES="$CONFIG_FILES instfiles/pulse/Makefile" ;; "instfiles/rc.d/Makefile") CONFIG_FILES="$CONFIG_FILES instfiles/rc.d/Makefile" ;; "keygen/Makefile") CONFIG_FILES="$CONFIG_FILES keygen/Makefile" ;; "waitforx/Makefile") CONFIG_FILES="$CONFIG_FILES waitforx/Makefile" ;; "libipm/Makefile") CONFIG_FILES="$CONFIG_FILES libipm/Makefile" ;; "libxrdp/Makefile") CONFIG_FILES="$CONFIG_FILES libxrdp/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "mc/Makefile") CONFIG_FILES="$CONFIG_FILES mc/Makefile" ;; "neutrinordp/Makefile") CONFIG_FILES="$CONFIG_FILES neutrinordp/Makefile" ;; "ulalaca/Makefile") CONFIG_FILES="$CONFIG_FILES ulalaca/Makefile" ;; "pkgconfig/Makefile") CONFIG_FILES="$CONFIG_FILES pkgconfig/Makefile" ;; "pkgconfig/xrdp.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/xrdp.pc" ;; "pkgconfig/xrdp-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/xrdp-uninstalled.pc" ;; "sesman/libsesman/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/libsesman/Makefile" ;; "sesman/chansrv/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/chansrv/Makefile" ;; "sesman/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/Makefile" ;; "sesman/sesexec/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/sesexec/Makefile" ;; "sesman/tools/Makefile") CONFIG_FILES="$CONFIG_FILES sesman/tools/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/common/Makefile") CONFIG_FILES="$CONFIG_FILES tests/common/Makefile" ;; "tests/libipm/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libipm/Makefile" ;; "tests/libxrdp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libxrdp/Makefile" ;; "tests/memtest/Makefile") CONFIG_FILES="$CONFIG_FILES tests/memtest/Makefile" ;; "tests/xrdp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/xrdp/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/devel/Makefile") CONFIG_FILES="$CONFIG_FILES tools/devel/Makefile" ;; "tools/devel/tcp_proxy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/devel/tcp_proxy/Makefile" ;; "vnc/Makefile") CONFIG_FILES="$CONFIG_FILES vnc/Makefile" ;; "xrdpapi/Makefile") CONFIG_FILES="$CONFIG_FILES xrdpapi/Makefile" ;; "xrdp/Makefile") CONFIG_FILES="$CONFIG_FILES xrdp/Makefile" ;; "xrdpvr/Makefile") CONFIG_FILES="$CONFIG_FILES xrdpvr/Makefile" ;; "xup/Makefile") CONFIG_FILES="$CONFIG_FILES xup/Makefile" ;; "third_party/Makefile") CONFIG_FILES="$CONFIG_FILES third_party/Makefile" ;; "third_party/tomlc99/Makefile") CONFIG_FILES="$CONFIG_FILES third_party/tomlc99/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 test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` 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 :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`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 ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { 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 $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # 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 library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # 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. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # 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 '$q' "$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" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # 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. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; 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 # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 printf "%s\n" "$ac_msg" >&6 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 cd "$ac_dir" # 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 ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 printf "%s\n" "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done 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 echo "" echo "xrdp will be compiled with:" echo "" echo " mp3lame $enable_mp3lame" echo " opus $enable_opus" echo " fdkaac $enable_fdkaac" echo " jpeg $enable_jpeg" echo " turbo jpeg $enable_tjpeg" echo " rfxcodec $enable_rfxcodec" echo " painter $enable_painter" echo " pixman $enable_pixman" echo " fuse $enable_fuse" echo " ipv6 $enable_ipv6" echo " ipv6only $enable_ipv6only" echo " vsock $enable_vsock" echo " auth mechanism $auth_mech" echo " rdpsndaudin $enable_rdpsndaudin" echo echo " with imlib2 $use_imlib2" echo " with freetype2 $use_freetype2" echo echo " development logging $devel_logging" echo " development streamcheck $devel_streamcheck" echo "" echo " strict_locations $enable_strict_locations" echo " prefix $prefix" echo " exec_prefix $exec_prefix" echo " libdir $libdir" echo " bindir $bindir" echo " sysconfdir $sysconfdir" echo " pamconfdir $pamconfdir" echo " localstatedir $localstatedir" echo " runstatedir $runstatedir" echo " socketdir $socketdir" echo "" echo " unit tests performable $perform_unit_tests" echo "" echo " CFLAGS = $CFLAGS" echo " LDFLAGS = $LDFLAGS" # xrdp_configure_options.h will be written to the build directory, not the source directory echo '#define XRDP_CONFIGURE_OPTIONS \' > ./xrdp_configure_options.h ./config.status --config | xargs -n 1 | sed -e 's/^/" /' -e 's/$/\\n" \\/' >> ./xrdp_configure_options.h echo '""' >> ./xrdp_configure_options.h xrdp-0.10.1/depcomp000755 001751 000000 00000056217 14652432076 014227 0ustar00metawheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "depcomp (GNU Automake) $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interference from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. ## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: xrdp-0.10.1/missing000755 001751 000000 00000017060 14652432075 014241 0ustar00metawheel000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. scriptversion=2024-06-07.14; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells # Copyright (C) 1996-2024 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 autogen autoheader autom4te automake autoreconf bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Report bugs to . GNU Automake home page: . General help using GNU software: ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing (GNU Automake) $scriptversion" 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|autoreconf) 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'" autoheader_deps="'acconfig.h'" automake_deps="'Makefile.am'" aclocal_deps="'acinclude.m4'" case $normalized_program in aclocal*) echo "You should only need it if you modified $aclocal_deps or" echo "$configure_deps." ;; autoconf*) echo "You should only need it if you modified $configure_deps." ;; autogen*) echo "You should only need it if you modified a '.def' or '.tpl' file." echo "You may want to install the GNU AutoGen package:" echo "<$gnu_software_URL/autogen/>" ;; autoheader*) echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." ;; automake*) echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." ;; autoreconf*) echo "You should only need it if you modified $aclocal_deps or" echo "$automake_deps or $autoheader_deps or $automake_deps or" echo "$configure_deps." ;; 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/>" ;; 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/>" ;; 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>" ;; 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/>" ;; perl*) echo "You should only need it to run GNU Autoconf, GNU Automake, " echo " assorted other tools, or if you modified a Perl source file." echo "You may want to install the Perl 5 language interpreter:" echo "<$perl_URL>" ;; *) 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 program_details "$normalized_program" } 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: xrdp-0.10.1/m4/000755 001751 000000 00000000000 14652432071 013152 5ustar00metawheel000000 000000 xrdp-0.10.1/tests/000755 001751 000000 00000000000 14652432105 013772 5ustar00metawheel000000 000000 xrdp-0.10.1/COPYING000644 001751 000000 00000024224 14652432047 013674 0ustar00metawheel000000 000000 Apache License, Version 2.0 Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. xrdp-0.10.1/config_ac-h.in000644 001751 000000 00000007202 14652432074 015323 0ustar00metawheel000000 000000 /* config_ac-h.in. Generated from configure.ac by autoheader. */ /* Allow sources to check config_ac.h is included */ #undef CONFIG_AC_H /* Define to the type of elements in the array argument to 'getgroups'. Usually this is either 'int' or 'gid_t'. */ #undef GETGROUPS_T /* Define to 1 if you have the 'clearenv' function. */ #undef HAVE_CLEARENV /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if the system has the `format' function attribute */ #undef HAVE_FUNC_ATTRIBUTE_FORMAT /* Define to 1 if you have the 'getgrouplist' function. */ #undef HAVE_GETGROUPLIST /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VM_SOCKETS_H /* Using OpenPAM */ #undef HAVE_PAM_CONSTANTS_H /* Define to 1 if you have the 'setusercontext' function. */ #undef HAVE_SETUSERCONTEXT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PRCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Using Linux-PAM */ #undef HAVE__PAM_TYPES_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 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 /* The size of 'int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of 'long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of 'void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Enable development logging */ #undef USE_DEVEL_LOGGING /* Enable development stream checking */ #undef USE_DEVEL_STREAMCHECK /* Compile with imlib2 support */ #undef USE_IMLIB2 /* Version number of package */ #undef VERSION /* Copyright year */ #undef VERSION_YEAR /* Enable IPv6 */ #undef XRDP_ENABLE_IPV6 /* Enable IPv6 only */ #undef XRDP_ENABLE_IPV6ONLY /* Enable AF_VSOCK */ #undef XRDP_ENABLE_VSOCK /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to empty if 'const' does not conform to ANSI C. */ #undef const /* Define as 'int' if doesn't define. */ #undef gid_t /* Substitute for socklen_t */ #undef socklen_t /* Define as 'int' if doesn't define. */ #undef uid_t xrdp-0.10.1/keygen/000755 001751 000000 00000000000 14652432105 014112 5ustar00metawheel000000 000000 xrdp-0.10.1/libpainter/000755 001751 000000 00000000000 14652432104 014760 5ustar00metawheel000000 000000 xrdp-0.10.1/fontutils/000755 001751 000000 00000000000 14652432105 014657 5ustar00metawheel000000 000000 xrdp-0.10.1/Makefile.am000644 001751 000000 00000002026 14652432047 014671 0ustar00metawheel000000 000000 ACLOCAL_AMFLAGS = -I m4 AM_DISTCHECK_CONFIGURE_FLAGS = \ --without-systemdsystemunitdir \ --enable-strict-locations \ --enable-tests EXTRA_DIST = \ COPYING \ README.md \ NEWS.md \ astyle_config.as \ bootstrap \ coding_style.md \ m4 \ vrplayer if XRDP_NEUTRINORDP NEUTRINORDPDIR = neutrinordp else NEUTRINORDPDIR = endif if XRDP_XRDPVR XRDPVRDIR = xrdpvr else XRDPVRDIR = endif if XRDP_PAINTER PAINTERDIR = libpainter else PAINTERDIR = endif if XRDP_RFXCODEC RFXCODECDIR = librfxcodec else RFXCODECDIR = endif if XRDP_ULALACA ULALACADIR = ulalaca else ULALACADIR = endif # This should not be dictionary order but build order SUBDIRS = \ third_party \ third_party/tomlc99 \ common \ vnc \ xup \ mc \ $(NEUTRINORDPDIR) \ libipm \ libxrdp \ $(PAINTERDIR) \ $(RFXCODECDIR) \ sesman \ xrdp \ fontutils \ keygen \ waitforx \ docs \ instfiles \ genkeymap \ xrdpapi \ pkgconfig \ $(XRDPVRDIR) \ $(ULALACADIR) \ tests \ tools distclean-local: -rm -f xrdp_configure_options.h xrdp-0.10.1/coding_style.md000644 001751 000000 00000006151 14652432047 015645 0ustar00metawheel000000 000000 XRdp Coding Style ================= The coding style used by XRdp is described below. The XRdp project uses astyle (artistic style) to format the code. Astyle requires a configuration file that describes how you want your code formatted. This file is present in the XRdp root directory and is named `astyle_config.as`. Here is how we run the astyle command: astyle --options=/path/to/file/astyle_config.as "*.c" This coding style is a work in progress and is still evolving. Language Standard ----------------- Try to make all code compile with both C and C++ compiler. C++ is more strict, which makes the code safer. Indentation ----------- * 4 spaces per indent * No tabs for any indents ☞ if (fd < 0) { return -1; } Line wrapping ------------- * Keep lines not longer than 80 chars * Align wrapped argument to the first argument ☞ log_message("connection aborted: error %d", ret); Variable names -------------- * Use lowercase with underscores as needed * Don't use camelCase * Preprocessor constants should be uppercase ☞ #define BUF_SIZE 1024 int fd; int bytes_in_stream; Variable declaration -------------------- * Each variable is declared on a separate line ☞ int i; int j; Whitespace ---------- * Use blank lines to group statements * Use at most one empty line between statements * For pointers and references, use a single space before * or & but not after * Use one space after a cast * No space before square brackets ☞ char *cptr; int *iptr; cptr = (char *) malloc(1024); write(fd, &buf[12], 16); Function declarations --------------------- * Use newline before function name ☞ static int value_ok(int val) { return (val >= 0); } Braces ------ * Opening brace is always on a separate line * Align braces with the line preceding the opening brace ☞ struct stream { int flags; char *data; }; void process_data(struct stream *s) { if (stream == NULL) { return; } } `if` statements --------------- * Always use braces * Put both braces on separate lines ☞ if (val <= 0xff) { out_uint8(s, val); } else if (val <= 0xffff) { out_uint16_le(s, val); } else { out_uint32_le(s, val); } `for` statements ---------------- * Always use braces * Put both braces on separate lines ☞ for (i = 0; i < 10; i++) { printf("i = %d\n", i); } `while` and `do while` statements --------------------------------- * Always use braces * `while` after the closing brace is on the same line ☞ while (cptr) { cptr—; } do { cptr--; } while (cptr); `switch` statements ------------------- * Indent `case` once * Indent statements under `case` one more time * Put both braces on separate lines ☞ switch (cmd) { case READ: read(fd, buf, 1024); break; default: printf("bad cmd\n"); } Comments -------- Use /* */ for comments Don't use // xrdp-0.10.1/genkeymap/000755 001751 000000 00000000000 14652432105 014610 5ustar00metawheel000000 000000 xrdp-0.10.1/test-driver000755 001751 000000 00000012137 14652432075 015040 0ustar00metawheel000000 000000 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2024-06-19.01; # UTC # Copyright (C) 2011-2024 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <. GNU Automake home page: . General help using GNU software: . END } test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. expect_failure=no color_tests=no collect_skipped_logs=yes enable_hard_errors=yes while test $# -gt 0; do case $1 in --help) print_usage; exit $?;; --version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;; --test-name) test_name=$2; shift;; --log-file) log_file=$2; shift;; --trs-file) trs_file=$2; shift;; --color-tests) color_tests=$2; shift;; --collect-skipped-logs) collect_skipped_logs=$2; shift;; --expect-failure) expect_failure=$2; shift;; --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; *) break;; esac shift done missing_opts= test x"$test_name" = x && missing_opts="$missing_opts --test-name" test x"$log_file" = x && missing_opts="$missing_opts --log-file" test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" if test x"$missing_opts" != x; then usage_error "the following mandatory options are missing:$missing_opts" fi if test $# -eq 0; then usage_error "missing argument" fi if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. grn='' # Green. lgn='' # Light green. blu='' # Blue. mgn='' # Magenta. std='' # No color. else red= grn= lgn= blu= mgn= std= fi do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' trap "st=129; $do_exit" 1 trap "st=130; $do_exit" 2 trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 # Test script is run here. We create the file first, then append to it, # to ameliorate tests themselves also writing to the log file. Our tests # don't, but others can (automake bug#35762). : >"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=$collect_skipped_logs;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: xrdp-0.10.1/config.sub000755 001751 000000 00000105526 14652432075 014632 0ustar00metawheel000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-05-24' # 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 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 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # 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 or ALIAS Canonicalize a configuration name. Options: -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 1992-2018 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 # Split fields of configuration type IFS="-" read -r field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers 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 | microblaze* \ | sim | cisco | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; 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 ;; cegcc) basic_machine=arm-unknown os=cegcc ;; cray) basic_machine=j90-cray os=unicos ;; craynv) basic_machine=craynv-cray os=unicosmp ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; 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 ;; hp300bsd) basic_machine=m68k-hp os=bsd ;; hp300hpux) basic_machine=m68k-hp os=hpux ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; vsta) basic_machine=i386-unknown os=vsta ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-pc os=msys ;; mvs) basic_machine=i370-ibm os=mvs ;; nacl) basic_machine=le32-unknown os=nacl ;; 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 ;; necv70) basic_machine=v70-nec os=sysv ;; 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 ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; pw32) basic_machine=i586-unknown os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=rdos ;; rdos32) basic_machine=i386-pc os=rdos ;; rom68k) basic_machine=m68k-rom68k os=coff ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sps7) basic_machine=m68k-bull os=sysv2 ;; stratus) basic_machine=i860-stratus os=sysv4 ;; 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 ;; 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 ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; 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 ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; 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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper | csky \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | 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 \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=${os:-none} ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; m9s12z | m68hcs12z | hcs12z | s12z) basic_machine=s12z-unknown os=${os:-none} ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=${os:-none} ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | 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-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | powerpcspe-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | 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-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | 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. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; abacus) basic_machine=abacus-unknown ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; amiga | amiga-*) basic_machine=m68k-unknown ;; asmjs) basic_machine=asmjs-unknown ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; bluegene*) basic_machine=powerpc-ibm os=cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=${os:-unicos} ;; 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 ;; cr16 | cr16-*) basic_machine=cr16-unknown os=${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=${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 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=${os:-bosx} ;; dpx2*) basic_machine=m68k-bull os=sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; encore | umax | mmax) basic_machine=ns32k-encore ;; elxsi) basic_machine=elxsi-elxsi os=${os:-bsd} ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=hiuxwe2 ;; hp300-*) basic_machine=m68k-hp ;; 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 ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; 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 ;; j90 | j90-cray) basic_machine=j90-cray os=${os:-unicos} ;; iris | iris4d) basic_machine=mips-sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; microblaze*) basic_machine=microblaze-xilinx ;; 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 ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; news-3600 | risc-news) basic_machine=mips-sony os=newsos ;; next | m*-next) basic_machine=m68k-next case $os in nextstep* ) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=hiuxwe2 ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) 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) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; 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 ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=${os:-elf} ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=vxworks ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; tile*) basic_machine=$basic_machine-unknown os=linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; w65*) basic_machine=w65-wdc os=none ;; w89k-*) basic_machine=hppa1.1-winbond os=proelf ;; x64) basic_machine=x86_64-pc ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; none) basic_machine=none-none os=${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 ;; 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 ;; 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. auroraux) os=auroraux ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; 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 ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; none) ;; *-eabi) ;; *) 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 ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; hexagon-*) os=elf ;; tic54x-*) os=coff ;; tic55x-*) os=coff ;; tic6x-*) 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 ;; 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 ;; pru-*) os=elf ;; *-be) os=beos ;; *-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 ;; *-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 ;; *-wrs) os=vxworks ;; *) 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 ;; clix*) vendor=intergraph ;; 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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xrdp-0.10.1/astyle_config.as000644 001751 000000 00000002774 14652432047 016022 0ustar00metawheel000000 000000 # detached brackets --style=allman # 4 spaces, no tabs --indent=spaces=4 # for C++ files only --indent-classes # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block. # The entire case block is indented. --indent-switches # Add extra indentation to namespace blocks. This option has no effect on Java files. --indent-namespaces # Converts tabs into spaces in the non-indentation part of the line. --convert-tabs # requires --convert-tabs to work properly --indent-preproc-define --indent-col1-comments --min-conditional-indent=2 --max-continuation-indent=40 # Insert space padding around operators. --pad-oper # Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...). --pad-header # Add brackets to unbracketed one line conditional statements (e.g. 'if', 'for', 'while'...). --add-braces --align-pointer=name # Do not retain a backup of the original file. The original file is purged after it is formatted. --suffix=none # For each directory in the command line, process all subdirectories recursively. --recursive # Exclude git submodule directories and generated files. --exclude=libpainter --exclude=librfxcodec --exclude=xrdp_configure_options.h # ignore errors from generated files that do not exist --ignore-exclude-errors # Preserve the original file's date and time modified. --preserve-date # Formatted files display mode. Display only the files that have been formatted. # Do not display files that are unchanged. --formatted --lineend=linux xrdp-0.10.1/compile000755 001751 000000 00000016705 14652432075 014225 0ustar00metawheel000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook '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: xrdp-0.10.1/xrdpvr/000755 001751 000000 00000000000 14652432105 014155 5ustar00metawheel000000 000000 xrdp-0.10.1/ltmain.sh000644 001751 000000 00001212353 14652432071 014461 0ustar00metawheel000000 000000 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.7 package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # 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. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. 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. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution 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_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --no-warnings equivalent to '-Wnone' --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 more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$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. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. 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) version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/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 } # 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 } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # 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 ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 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 $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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 yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # 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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs 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 () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$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 () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # 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_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # 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 yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # 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. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # 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_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # 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_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; 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 func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && 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 yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && 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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_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 build PIC objects only -prefer-non-pic try to build 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 -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler 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-dir 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 -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 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 '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # 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 $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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 func_append 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 -* | *.la | *.lo ) ;; *) # 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_append_quoted args "$file" done if $opt_dry_run; then # 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 else 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 fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 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" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" 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 "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_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_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_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 -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi 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=: if $isdir; 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. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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 "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -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 "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "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_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) 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" && func_append 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 yes = "$build_old_libs"; 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=: 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 "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_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 "$file$stripped_ext" | $SED "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_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_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 install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; 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 "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $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 case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac 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 func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append 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" "${nlist}I"' # 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "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 "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # 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. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd 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 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac 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_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi 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 () { $debug_cmd 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` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result 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 "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $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 | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # 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 where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $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. 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 file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_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 \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; 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" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${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\ " } # 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 #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #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 /* path handling portability macros */ #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 */ #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 (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ 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_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); 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_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 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; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); 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]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); 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 = (size_t) (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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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) { lt_debugprintf (__FILE__, __LINE__, "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 { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "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 (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t 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) { size_t orig_value_len = strlen (orig_value); size_t 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; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (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 #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (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 case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd 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 # what 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 that 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 bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false 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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && 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_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_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 bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append 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 "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append 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 none = "$pic_object" && test none = "$non_pic_object"; 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 none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 ;; os2dllname) os2dllname=$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 rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append 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 ;; -bindir) prev=bindir 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-export-symbols = "X$arg"; 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" if test -z "$func_stripname_result"; 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 func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # 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 "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm 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|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append 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 ;; -os2dllname) prev=os2dllname 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_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append 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_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_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_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append 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 none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" 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_arg pretty "$arg" arg=$func_quote_arg_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 yes = "$export_dynamic" && 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 \"\$$shlibpath_var\" \| \$SED \'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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # 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_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; 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 "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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=false 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; 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=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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 "$inherited_linker_flags" | $SED '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 "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; 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. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi 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 dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && 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 func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append 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 dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; 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_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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:"*) ;; *) func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append 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 yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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* | *os2*) 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 cannot # 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 no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; 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 "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result 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 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append 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 link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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 "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 func_append 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 no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|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 ;; 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" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; 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) # correct to gnu/linux during the next big refactor 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 0 -ne "$loop"; 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. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 "*) ;; *) func_append 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 "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # 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 yes = "$build_libtool_need_lc"; then func_append 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` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi 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 "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append 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. func_append 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 yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append 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 \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append 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. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; 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 ;; esac ;; 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 " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED '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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append 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 relink = "$opt_mode" || 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 func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$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 func_append 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 func_dll_def_p "$export_symbols" || { # 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 ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || 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 cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs 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 : != "$skipped_export"; 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && 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 func_append 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 "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && 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 func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && 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 func_basename "$output" output_la=$func_basename_result # 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" 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 -z "$objlist" || 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 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$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~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { 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 } 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_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; 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 ${skipped_export-false} && { 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 "$include_expsyms" | $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 func_append 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 } 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 yes = "$module" && 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 func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs 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 test yes = "$build_libtool_libs" || { 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 } if test -n "$pic_flag" || test default != "$pic_mode"; 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" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && 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 " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED '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=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # 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 } 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 func_append 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 func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; 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 "$link_command" | $SED '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 $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # 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" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED '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 $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # 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_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result 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 case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; 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 func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append 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 func_append 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" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result 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 elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" 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 -z "$oldobjs"; 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 yes = "$build_old_libs" && 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_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; 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 func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append 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" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append 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" func_append newdlprefiles " ${lt_sysroot:+=}$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 func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; 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 $rmforce; 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 func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; 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 func_append 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 func_append 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 func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # 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 } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_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 # where 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: xrdp-0.10.1/instfiles/000755 001751 000000 00000000000 14652432105 014630 5ustar00metawheel000000 000000 xrdp-0.10.1/NEWS.md000644 001751 000000 00000046351 14652432047 013744 0ustar00metawheel000000 000000 # Release notes for xrdp v0.10.1 (2024/07/31) ## General announcements A clipboard bugfix included in this release is sponsored by Krämer Pferdesport GmbH & Co KG. We very much appreciate the sponsorship. Please consider sponsoring or making a donation to the project if you like xrdp. We accept financial contributions via [Open Collective](https://opencollective.com/xrdp-project). Direct donations to each developer via GitHub Sponsors are also welcomed. ## Security fixes * Unauthenticated RDP security scan finding / partial auth bypass (no CVE). Thanks to @txtdawg for reporting this. ## New features * GFX-RFX lossy compression levels are now selectable depending on connection type on the client (#3183, backport of #2973) ## Bug fixes * A regression in the code for creating the chansrv FUSE directory has been fixed (#3088, backport of #3082) * Fix a systemd dependency ("network-online.target") (#3088, backport of #3086) * A problem in session list processing which could result in incorrect display assignments has been fixed (#3088, backport of #3103) * A problem in GFX resizing which could lead to a SEGV in xrdp has been fixed (#3088, backport of #3107) * A problem with the US Dvorak keyboard layout has been resolved (#3088, backport of #3112) * A regression bug when pasting image to LibreOffice has been fixed [Sponsored by Krämer Pferdesport GmbH & Co KG] (#3102 #3120) * Fix a regression when the server tries to negotiate GFX when max_bpp is not high enough (#3118 #3122) * Fix a GFX multi-monitor screen placing issue on minimise/maximize (#3075 #3127) * Fix an issue some files are not included properly in release tarball (#3149 #3150) * Using 'I' in the session selection policy now works correctly (#3167 #3171) * A potential name buffer overflow in the redirector has been fixed [no security implications] (#3175) * Screens wider than 4096 pixels should now be supported (#3083) * An unnecessary licensing exchange during connection setup has been removed. This was causing problems for FIPS-compliant clients (#3132 backport of #3143) ## Internal changes * FreeBSD CI bumped to 13.3 (#3088, backport of #3104) ## Changes for users * None since v0.10.0. * If moving from v0.9.x, read the v0.10.0 release note. ## Changes for packagers or developers * None since v0.10.0. * If moving from v0.9.x, read the v0.10.0 release note. ----------------------- # Release notes for xrdp v0.10.0 (2024/05/10) This section notes changes since the [v0.10 branch](#branch-v010) was created. ## General announcements The biggest news of this release is that [Graphic Pipeline Extension](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegfx/da5c75f9-cd99-450c-98c4-014a496942b0) also called GFX in short has been supported. xrdp v0.10 with GFX achieves more frame rates and less bandwidth compared to v0.9. There is a significant performance improvement especially if the client is Windows 11's mstsc.exe or Microsoft Remote Desktop for Mac. GFX H.264/AVC 444 mode and hardware-accelerated encoding are not supported in this version yet. GFX implementation in xrdp is sponsored by an enterprise sponsor. @CyberTrust is also one of the sponsors. We very much appreciate the sponsorship. It helped us to accelerate xrdp development and land GFX earlier! Please consider sponsoring or making a donation to the project if you like xrdp. We accept financial contributions via [Open Collective](https://opencollective.com/xrdp-project). Direct donations to each developer via GitHub Sponsors are also welcomed. ## Highlights This section describes the most user-visible new or changed features in xrdp since v0.9.19. See [Branch v0.10](#branch-v010) for all changes relative to v0.9.19. * Added GFX support with multi-monitor support (including monitor hot plug/unplug) (#2256 #2338 #2595 #2879 #2891 #2911 #2929 #2933) * Touchpad inertial scrolling (#2364, #2424). Thanks to new contributor @seflerZ * New look of login screen (#2366) * Scaled login screen on higher DPI monitors (#2341, #2427, #2435) * This feature works automatically when monitor DPI information is sent by the client (i.e. a full-screen session) * Native platform tools are now provided to manipulate .fv1 format font files. * The format of the date and time in the log file has been changed to ISO 8601 with milliseconds (#2386 #2541) * xrdp-sesman now supports a `--reload` switch to allow for the configuration to be changed when sessions are active (#2416) ## Security fixes None ## New features * If the client announces support for the Image RemoteFX codec it is logged (back-port of #2946) ## Bug fixes * Fix some monitor hotplug issues (#2951) * GFX: Fix disconnect on resize of busy windows (#2962 #2957) * Fall back to IPv4 if IPv6 capable but don't have an IPv6 address set (#2967 #2957) * Remove tcutils channel from xrdp.ini (#2970 #2957) * Don't generate a corefile when generating SIGSEGV during unit testing (#2987) * If the drdynvc static channel isn't available, disable GFX gracefully (#3003) * A buffer misconfiguration which affects performance on high bandwidth, high latency links has been addressed (cherry-pick of #2910) * A permissions fix for the socketdir update in #2731 has been issued (cherry-pick of #3011) ## Internal changes * Adjust log level not too verbose (#2954 #2972 #2957) * Migrate GitHub actions to Node 20 (#2955 #2957) * Bump copyright year and make easier to bump (#2956 #2957) * Remove duplicate DEBUG output (#2976 #2977) * Add script to make release tarball (#2983) * Syscall filter for xrdp updated (cherry-pick of #3017) * GFX memory usage for large screens is greatly improved (cherry-pick of #3013) * librfxcodec SSE2 performance improvements (#3032) ## Known issues * On-the-fly resolution change with the Microsoft Store version of Remote Desktop client sometimes crashes on connect (#1869) * xrdp's login dialog is not relocated at the center of the new resolution after on-the-fly resolution change happens (#1867) ## Changes for users * If moving from v0.9.x, read the '[User changes](#user-changes)' for the v0.10 branch below. ## Changes for packagers or developers * If moving from v0.9.x, read the '[User changes](#user-changes)' and '[Significant changes for packagers or developers section](#significant-changes-for-packagers-or-developers)' sections for the v0.10 branch below. ----------------------- # Branch v0.10 This branch was forked from development on 2024-02-08 in preparation for testing and release of v0.10.1. The changes in this section are relative to version v0.9.19 of xrdp. ## User changes * The [x11rdp](/neutrinolabs/x11rdp) X server is no longer supported. Users will need to move to xorgxrdp (#2489) * Running xrdp and xrdp-sesman on separate hosts is no longer supported. * There are some changes to `xrdp.ini` and `sesman.ini` which break backwards compatibility. In particular:- * `sesman.ini/Globals/ListenAddress` is not longer used. A warning message is generated if this is found in the configuration, but the configuration will continue to work. * `sesman.ini/Globals/ListenPort` is now a path to a socket, or an unqualified socket in a default directory. If the old default value `3350` is found, a warning is generated and a default value is used instead. The configuration will continue to work. * The `ip` and `pamsessionmng` parameters are no longer required in sections in `xrdp.ini` to locate the sesman port. Unnecessary usages of this parameter now generate warnings. The configuration will continue to work. * The 'C' field for the session allocation policy has been replaced with `Policy=Separate`. This field is has a very specific specialist purpose, and will not be used by the vast majority of users. The renaming makes it much clearer what is happening (#2251 #2239). Any uses of the 'C' field will generate warnings, **and the configuration will require updating** * The format of the date and time in the log file has been changed to ISO 8601 with milliseconds (#2386 #2541) Users are urged to heed any generated configuration warnings and update their configurations. Later major versions of xrdp may remove these warnings, or introduce other behaviours for the affected parameters. ## Security fixes This branch provides following important security fixes reported by [Team BT5 (BoB 11th)](https://github.com/Team-BT5). We appreciate their great help with making and reviewing patches for them. * [CVE-2022-23468](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23468) * [CVE-2022-23477](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23477) * [CVE-2022-23478](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23478) * [CVE-2022-23479](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23479) * [CVE-2022-23480](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23480) * [CVE-2022-23481](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23481) * [CVE-2022-23483](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23483) * [CVE-2022-23482](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23482) * [CVE-2022-23484](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23484) * [CVE-2022-23493](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23493) The following issue was reported by [@gafusss](https://github.com/gafusss) * [CVE-2023-40184](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40184) Other security fixes:- * [CVE-2023-42822: Unchecked access to font glyph info](https://www.cve.org/CVERecord?id=CVE-2023-42822) ## New features * Added GFX support with multi-monitor support (including monitor hot plug/unplug) (#2256 #2338 #2595 #2879 #2891 #2911 #2929 #2933) * Add Ulalaca that enables remote access to macOS's native screen (developed by [team unstablers](https://unstabler.pl/)) * Ulalaca is still heavy in development, not suitable for production use yet * `sessionbroker` and `sessionprojector` are also required, see also [README](https://github.com/unstabler/ulalaca) * Scaled login screen on higher DPI monitors (#2341, #2427, #2435) * This feature works automatically when monitor DPI information is sent by the client (i.e. a full-screen session) * Native platform tools are now provided to manipulate .fv1 format font files. * Touchpad inertial scrolling (#2364, #2424). Thanks to new contributor @seflerZ * New look of login screen (#2366) * Record codec GUID to identify unknown codc (#2401) * OpenSuSE Tumbleweed move to /usr/lib/pam.d is now supported in the installation scripts (#2413) * xrdp-sesman now supports a `--reload` switch to allow for the configuration to be changed when sessions are active (#2416) * VNC backend session now supports extra mouse buttons 6, 7 and 8 (#2426) * `LogFile=` redirects log to stdout, which is useful for debugging (#2407) * xrdp-sesrun and xrdp-sesadmin can now authenticate automatically as the logged-in user without a password (#2472) * Empty passwords are no longer automatically passed though to sesman for authentication (#2487) * BSD setusercontext() is now supported (#2225, #2473) * The FUSE mount path can now be qualified with the display name or display string (#2528) * Debian: use startup command from /usr/share/xsession if DISPLAY_SESSION is set (#2522) * The directory where PAM configuration files is installed can now be set with `--with-pamconfdir` (#2552 #2557) * Some classes of 'blue screen' failures have been addressed:- * X server failures are now reported as a separate error from window manager (#2592) * sesman failures are reported immediately (#2640) * Allow longer UserWindowManager strings (#2651) * Some changes have been made to made it easier to implement AppArmor support in the future (#2265):- * `g_file_open()` has been replaced with `g_file_open_ro()` and `g_file_open_rw()` calls * the starting of the X server with no-new-privileges can now be disabled by the administrator * On systemd-based systems, system call filtering is used to restrict the system calls that the xrdp process can make (#2697 #2719) * GNOME and KDE keyrings should now be supported out-of-the-box on Debian and Arch (#2776) * Implement vsock support for FreeBSD #2798 * Side buttons on some mice are now supported by NeutrinoRDP (#2864). Thanks to new contributor @naruhito for this patch. * Support for the Elbrus E2K architecture (#2872). Thanks to new contributor @r-a-sattarov for this patch. * Just log Image RemoteFX codec (#2946) ## Bug fixes * A missing directive to link libxrdpapi with libcommon has been added (#2185) * Some sesman config warning messages could be lost. This has now been fixed (#2198) * Moving sesman to a Unix domain socket fixes a number of issues related to firewalls and Ipv4/v6 connectivity issues (#1596 #1805 #1855) * Secondary groups are now added correctly on Linux from /etc/security/group.conf (#1978). * The `--disable-static` switch for `configure` now works (#1467 #2257) * Windows RDS compatibility has been improved, so some old clients (e.g. Wyse Sx0) can now be used again with xrdp in non-TLS mode (#2166) * PAM_RHOST is now set for the PAM stack (#2251, #392) * A minor spacing issue in a sesman log message has been fixed (#2282) * MSTSC crashes when resolution is changed by maximizing on a different monitor (#2291 #2300) * Fix swapped `require_credentials`/`enable_token_login` config options in xrdp.ini manpage (#2391) * Passwords are no longer left on the heap in sesman (#1599 #2438) * Set permissions on pcsc socket dir to owner only (#2454 #2459) * The Kerberos authentication module has been reworked and tested (#2453) * Minor documentation fixes (#2481 #2581) * The correct message is now generated when the session limit is reached (#642) * sesman now returns better information to xrdp when session creation fails (#909, #1921) * MaxLoginRetry limit for sesman now works (#1739) * On systems where the same user can have multiple names, the correct session is now reconnected (#1823) * On FreeBSD, the correct peer is now logged for xorgxrdp connections (#146) * In some situations, xrdp sessions can be bootstrapped on system startup (#1303) * Don't try to listen on the scard socket if it isn't there (#2504) * Fix some noise of MP3/AAC audio redirection and add some parameters to tweak sounds (#2519 #2608) * Memory management fixes to list module (#2536 #2575) * Session is not now started until X server is fully active (#2492) * Fix potential NULL dereferences in chansrv (#2573) * An erroneous free in the smartcard handling code has been removed (#2607) * An unnecessary 'check.h' include was removed which prevented compilation on Arch systems (#2649) * No user session created with xrdp and pam_systemd_home account module (#1684) * Homedir gets not correctly created at first login (#350) * pam_setcred never returns xrdp-sesman is hung (#1323) * chansrv should no longer hang occasionally in developer builds on session exit (#2145) * Environment variables set by PAM modules are no longer restricted to around 250 characters (#2711) * Checking group membership should now work better on systems using directory services (#2806 #2815) * Pasting more than 32K characters of text to the clipboard now succeeds (#1839 #2810) * An incompatibility with FreeRDP 2.11.2 in the drive redirector has been fixed (#2834 #2838) * Unicode bugs have been fixed (#942 #2603) ## Internal changes * SCP (Sesman Control Protocol) has been refactored from separate V0 and V1 protocols to a simplified V2 protocol running on top of a new library 'libipm' (#2163). * libipm provides a way to pass file descriptors between processes (#2494) * SCP connections are now only supported on top of Unix Domain Sockets (#2207 #2235 #2247) * Monitor processing logic, which was in two places, has now been unified (#1895 #2301) * Simplifications to transport connect logic (#2204) * The fields in `struct trans` and `struct xrdp_client_info` used for storing client addressing information have been simplified (#2251) * A couple of string utility functions have been added to parse character strings like the one used for the session allocation policy (#2251) * cppcheck version used for CI bumped to 2.13.0 (#2520 #2737 #2785 #2886). Note that #2785 greatly increases cppcheck scan times. * cppcheck install script no longer installs z3 for cppcheck >= 2.8 (#2782) * The physical desktop size information sent from the client is now recorded in more situations (#2310) * Simple maintenance improvements (#2354) * An opaque type is now used for the auth_info handle used by the sesman auth module (#2362) * CI updates to cope with github upgrades (#2394) * GUIDs created for new sessions are now compliant with RFC4122 random UUIDs (#2420) * Some 'magic numbers' have been replaced with constants (#2421) * FreeBSD CI now runs a 'make check' (#2490) * FreeBSD CI now runs on FreeBSD 13.2 (#2621 #2896) * Some logging improvements on audio redirection (#2537) * Extra executables : waitforx (#2492 #2591 #2586) xrdp-sesexec (#2644) * The poll() system call now replaces select() for monitoring file descriptors (#2497 #2568) * sigaction() now replaces signal() for increased portability (#2813) * Other portability changes (#2909) * Some extra convenience functions were added for handling lists of strings (#2576) * `g_malloc`, `g_free`, `g_memset`, `g_memcpy`, and `g_memmove` are now macros. These should not be used in new code (#2609) * config_ac.h is now used consistently (#2667) * as mentioned above, `g_file_open()` has been replaced with `g_file_open_ro()` and `g_file_open_rw()` calls * The separate fifo packages in the common directory and chansrv have now been merged (#2686) * Unicode conversions are now provided by explicit functions rather than relying on C library `mbstowcs()`/`wcstombs()` functions (#2794) * Some test timeouts have been increased for slow CI machines (#2901) * `g_obj_wait()` can now take a zero timeout (#2904) * POSIX shared memory is now used to communicate with `xorgxrdp` rather than System-V shared memory (#2709 #2786 #2889) ## Significant changes for packagers or developers * The libscp.so shared library is replaced with libipm.so * A new shared library libsesman.so contains shared code for sesman and related executables (#2601) * The default setting for `--with-socketdir` is now `/var/run/xrdp` rather than `/tmp/.xrdp`. The new setting works for installations where `/tmp` is polyinstantiated ( see #1482 for more details) * The permissions of the socketdir have changed from 1777 to 755 (owned by root). Within this directory are the sesman socket and user-specific directories. The user-specific directories store the session sockets used by each user (#2731). It is recommended not to use the same `--with-socketdir` setting for v0.9.x and v0.10.x packages as the differing permissions can cause problems on package downgrades. See #3066 for an example of where this can be a problem. * Passing `--disable-static` to `configure` prevents unused static libraries being installed by `make install`. * The `simple.c` example xrdpapi program has been updated to work with logging changes, and is now built as part of the CI (#2276) * If the `xrdp-mkfv1` utility is to be built, the switch `--with-freetype2` must be passed to `./configure`. * Minimum supported autoconf version is now 2.69 (#2408) * Add xrdp-sesman.system to distributed files (#2466 #2467) * A developer-only utility to exercise the auth module selected at configure time has been provided (#2453) * Extra executables have been added to this release in pkglibexecdir * The default systemd unit files have been changed to no longer fork (#2672)xrdp-0.10.1/tap-driver.sh000755 001751 000000 00000046273 14652432075 015266 0ustar00metawheel000000 000000 #! /bin/sh # Copyright (C) 2011-2024 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, 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. # This file is maintained in Automake, please report # bugs to or send patches to # . scriptversion=2024-06-19.01; # UTC # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u me=tap-driver.sh fatal () { echo "$me: fatal: $*" >&2 exit 1 } usage_error () { echo "$me: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <. GNU Automake home page: . General help using GNU software: . END } # TODO: better error handling in option parsing (in particular, ensure # TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the result and output of the test script. trs_file= # Where to save the metadata of the test run. expect_failure=0 color_tests=0 merge=0 ignore_exit=0 comments=0 diag_string='#' while test $# -gt 0; do case $1 in --help) print_usage; exit $?;; --version) echo "$me (GNU Automake) $scriptversion"; exit $?;; --test-name) test_name=$2; shift;; --log-file) log_file=$2; shift;; --trs-file) trs_file=$2; shift;; --color-tests) color_tests=$2; shift;; --expect-failure) expect_failure=$2; shift;; --enable-hard-errors) shift;; # No-op. --merge) merge=1;; --no-merge) merge=0;; --ignore-exit) ignore_exit=1;; --comments) comments=1;; --no-comments) comments=0;; --diagnostic-string) diag_string=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; esac shift done test $# -gt 0 || usage_error "missing test command" case $expect_failure in yes) expect_failure=1;; *) expect_failure=0;; esac if test $color_tests = yes; then init_colors=' color_map["red"]="" # Red. color_map["grn"]="" # Green. color_map["lgn"]="" # Light green. color_map["blu"]="" # Blue. color_map["mgn"]="" # Magenta. color_map["std"]="" # No color. color_for_result["ERROR"] = "mgn" color_for_result["PASS"] = "grn" color_for_result["XPASS"] = "red" color_for_result["FAIL"] = "red" color_for_result["XFAIL"] = "lgn" color_for_result["SKIP"] = "blu"' else init_colors='' fi # :; is there to work around a bug in bash 3.2 (and earlier) which # does not always set '$?' properly on redirection failure. # See the Autoconf manual for more details. :;{ ( # Ignore common signals (in this subshell only!), to avoid potential # problems with Korn shells. Some Korn shells are known to propagate # to themselves signals that have killed a child process they were # waiting for; this is done at least for SIGINT (and usually only for # it, in truth). Without the `trap' below, such a behavior could # cause a premature exit in the current subshell, e.g., in case the # test command it runs gets terminated by a SIGINT. Thus, the awk # script we are piping into would never seen the exit status it # expects on its last input line (which is displayed below by the # last `echo $?' statement), and would thus die reporting an internal # error. # For more information, see the Autoconf manual and the threads: # # trap : 1 3 2 13 15 if test $merge -gt 0; then exec 2>&1 else exec 2>&3 fi "$@" echo $? ) | LC_ALL=C ${AM_TAP_AWK-awk} \ -v me="$me" \ -v test_script_name="$test_name" \ -v log_file="$log_file" \ -v trs_file="$trs_file" \ -v expect_failure="$expect_failure" \ -v merge="$merge" \ -v ignore_exit="$ignore_exit" \ -v comments="$comments" \ -v diag_string="$diag_string" \ ' # TODO: the usages of "cat >&3" below could be optimized when using # GNU awk, and/on on systems that supports /dev/fd/. # Implementation note: in what follows, `result_obj` will be an # associative array that (partly) simulates a TAP result object # from the `TAP::Parser` perl module. ## ----------- ## ## FUNCTIONS ## ## ----------- ## function fatal(msg) { print me ": " msg | "cat >&2" exit 1 } function abort(where) { fatal("internal error " where) } # Convert a boolean to a "yes"/"no" string. function yn(bool) { return bool ? "yes" : "no"; } function add_test_result(result) { if (!test_results_index) test_results_index = 0 test_results_list[test_results_index] = result test_results_index += 1 test_results_seen[result] = 1; } # Whether the test script should be re-run by "make recheck". function must_recheck() { for (k in test_results_seen) if (k != "XFAIL" && k != "PASS" && k != "SKIP") return 1 return 0 } # Whether the content of the log file associated to this test should # be copied into the "global" test-suite.log. function copy_in_global_log() { for (k in test_results_seen) if (k != "PASS") return 1 return 0 } function get_global_test_result() { if ("ERROR" in test_results_seen) return "ERROR" if ("FAIL" in test_results_seen || "XPASS" in test_results_seen) return "FAIL" all_skipped = 1 for (k in test_results_seen) if (k != "SKIP") all_skipped = 0 if (all_skipped) return "SKIP" return "PASS"; } function stringify_result_obj(result_obj) { if (result_obj["is_unplanned"] || result_obj["number"] != testno) return "ERROR" if (plan_seen == LATE_PLAN) return "ERROR" if (result_obj["directive"] == "TODO") return result_obj["is_ok"] ? "XPASS" : "XFAIL" if (result_obj["directive"] == "SKIP") return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL; if (length(result_obj["directive"])) abort("in function stringify_result_obj()") return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL } function decorate_result(result) { color_name = color_for_result[result] if (color_name) return color_map[color_name] "" result "" color_map["std"] # If we are not using colorized output, or if we do not know how # to colorize the given result, we should return it unchanged. return result } function report(result, details) { if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/) { msg = ": " test_script_name add_test_result(result) } else if (result == "#") { msg = " " test_script_name ":" } else { abort("in function report()") } if (length(details)) msg = msg " " details # Output on console might be colorized. print decorate_result(result) msg # Log the result in the log file too, to help debugging (this is # especially true when said result is a TAP error or "Bail out!"). print result msg | "cat >&3"; } function testsuite_error(error_message) { report("ERROR", "- " error_message) } function handle_tap_result() { details = result_obj["number"]; if (length(result_obj["description"])) details = details " " result_obj["description"] if (plan_seen == LATE_PLAN) { details = details " # AFTER LATE PLAN"; } else if (result_obj["is_unplanned"]) { details = details " # UNPLANNED"; } else if (result_obj["number"] != testno) { details = sprintf("%s # OUT-OF-ORDER (expecting %d)", details, testno); } else if (result_obj["directive"]) { details = details " # " result_obj["directive"]; if (length(result_obj["explanation"])) details = details " " result_obj["explanation"] } report(stringify_result_obj(result_obj), details) } # `skip_reason` should be empty whenever planned > 0. function handle_tap_plan(planned, skip_reason) { planned += 0 # Avoid getting confused if, say, `planned` is "00" if (length(skip_reason) && planned > 0) abort("in function handle_tap_plan()") if (plan_seen) { # Error, only one plan per stream is acceptable. testsuite_error("multiple test plans") return; } planned_tests = planned # The TAP plan can come before or after *all* the TAP results; we speak # respectively of an "early" or a "late" plan. If we see the plan line # after at least one TAP result has been seen, assume we have a late # plan; in this case, any further test result seen after the plan will # be flagged as an error. plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN) # If testno > 0, we have an error ("too many tests run") that will be # automatically dealt with later, so do not worry about it here. If # $plan_seen is true, we have an error due to a repeated plan, and that # has already been dealt with above. Otherwise, we have a valid "plan # with SKIP" specification, and should report it as a particular kind # of SKIP result. if (planned == 0 && testno == 0) { if (length(skip_reason)) skip_reason = "- " skip_reason; report("SKIP", skip_reason); } } function extract_tap_comment(line) { if (index(line, diag_string) == 1) { # Strip leading `diag_string` from `line`. line = substr(line, length(diag_string) + 1) # And strip any leading and trailing whitespace left. sub("^[ \t]*", "", line) sub("[ \t]*$", "", line) # Return what is left (if any). return line; } return ""; } # When this function is called, we know that line is a TAP result line, # so that it matches the (perl) RE "^(not )?ok\b". function setup_result_obj(line) { # Get the result, and remove it from the line. result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0) sub("^(not )?ok[ \t]*", "", line) # If the result has an explicit number, get it and strip it; otherwise, # automatically assign the next test number to it. if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/) { match(line, "^[0-9]+") # The final `+ 0` is to normalize numbers with leading zeros. result_obj["number"] = substr(line, 1, RLENGTH) + 0 line = substr(line, RLENGTH + 1) } else { result_obj["number"] = testno } if (plan_seen == LATE_PLAN) # No further test results are acceptable after a "late" TAP plan # has been seen. result_obj["is_unplanned"] = 1 else if (plan_seen && testno > planned_tests) result_obj["is_unplanned"] = 1 else result_obj["is_unplanned"] = 0 # Strip trailing and leading whitespace. sub("^[ \t]*", "", line) sub("[ \t]*$", "", line) # This will have to be corrected if we have a "TODO"/"SKIP" directive. result_obj["description"] = line result_obj["directive"] = "" result_obj["explanation"] = "" if (index(line, "#") == 0) return # No possible directive, nothing more to do. # Directives are case-insensitive. rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*" # See whether we have the directive, and if yes, where. pos = match(line, rx "$") if (!pos) pos = match(line, rx "[^a-zA-Z0-9_]") # If there was no TAP directive, we have nothing more to do. if (!pos) return # Let`s now see if the TAP directive has been escaped. For example: # escaped: ok \# SKIP # not escaped: ok \\# SKIP # escaped: ok \\\\\# SKIP # not escaped: ok \ # SKIP if (substr(line, pos, 1) == "#") { bslash_count = 0 for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--) bslash_count += 1 if (bslash_count % 2) return # Directive was escaped. } # Strip the directive and its explanation (if any) from the test # description. result_obj["description"] = substr(line, 1, pos - 1) # Now remove the test description from the line, that has been dealt # with already. line = substr(line, pos) # Strip the directive, and save its value (normalized to upper case). sub("^[ \t]*#[ \t]*", "", line) result_obj["directive"] = toupper(substr(line, 1, 4)) line = substr(line, 5) # Now get the explanation for the directive (if any), with leading # and trailing whitespace removed. sub("^[ \t]*", "", line) sub("[ \t]*$", "", line) result_obj["explanation"] = line } function get_test_exit_message(status) { if (status == 0) return "" if (status !~ /^[1-9][0-9]*$/) abort("getting exit status") if (status < 127) exit_details = "" else if (status == 127) exit_details = " (command not found?)" else if (status >= 128 && status <= 255) exit_details = sprintf(" (terminated by signal %d?)", status - 128) else if (status > 256 && status <= 384) # We used to report an "abnormal termination" here, but some Korn # shells, when a child process die due to signal number n, can leave # in $? an exit status of 256+n instead of the more standard 128+n. # Apparently, both behaviors are allowed by POSIX (2008), so be # prepared to handle them both. See also Austin Group report ID # 0000051 exit_details = sprintf(" (terminated by signal %d?)", status - 256) else # Never seen in practice. exit_details = " (abnormal termination)" return sprintf("exited with status %d%s", status, exit_details) } function write_test_results() { print ":global-test-result: " get_global_test_result() > trs_file print ":recheck: " yn(must_recheck()) > trs_file print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file for (i = 0; i < test_results_index; i += 1) print ":test-result: " test_results_list[i] > trs_file close(trs_file); } BEGIN { ## ------- ## ## SETUP ## ## ------- ## '"$init_colors"' # Properly initialized once the TAP plan is seen. planned_tests = 0 COOKED_PASS = expect_failure ? "XPASS": "PASS"; COOKED_FAIL = expect_failure ? "XFAIL": "FAIL"; # Enumeration-like constants to remember which kind of plan (if any) # has been seen. It is important that NO_PLAN evaluates "false" as # a boolean. NO_PLAN = 0 EARLY_PLAN = 1 LATE_PLAN = 2 testno = 0 # Number of test results seen so far. bailed_out = 0 # Whether a "Bail out!" directive has been seen. # Whether the TAP plan has been seen or not, and if yes, which kind # it is ("early" is seen before any test result, "late" otherwise). plan_seen = NO_PLAN ## --------- ## ## PARSING ## ## --------- ## is_first_read = 1 while (1) { # Involutions required so that we are able to read the exit status # from the last input line. st = getline if (st < 0) # I/O error. fatal("I/O error while reading from input stream") else if (st == 0) # End-of-input { if (is_first_read) abort("in input loop: only one input line") break } if (is_first_read) { is_first_read = 0 nextline = $0 continue } else { curline = nextline nextline = $0 $0 = curline } # Copy any input line verbatim into the log file. print | "cat >&3" # Parsing of TAP input should stop after a "Bail out!" directive. if (bailed_out) continue # TAP test result. if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/) { testno += 1 setup_result_obj($0) handle_tap_result() } # TAP plan (normal or "SKIP" without explanation). else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/) { # The next two lines will put the number of planned tests in $0. sub("^1\\.\\.", "") sub("[^0-9]*$", "") handle_tap_plan($0, "") continue } # TAP "SKIP" plan, with an explanation. else if ($0 ~ /^1\.\.0+[ \t]*#/) { # The next lines will put the skip explanation in $0, stripping # any leading and trailing whitespace. This is a little more # tricky in truth, since we want to also strip a potential leading # "SKIP" string from the message. sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "") sub("[ \t]*$", ""); handle_tap_plan(0, $0) } # "Bail out!" magic. # Older versions of prove and TAP::Harness (e.g., 3.17) did not # recognize a "Bail out!" directive when preceded by leading # whitespace, but more modern versions (e.g., 3.23) do. So we # emulate the latter, "more modern" behavior. else if ($0 ~ /^[ \t]*Bail out!/) { bailed_out = 1 # Get the bailout message (if any), with leading and trailing # whitespace stripped. The message remains stored in `$0`. sub("^[ \t]*Bail out![ \t]*", ""); sub("[ \t]*$", ""); # Format the error message for the bailout_message = "Bail out!" if (length($0)) bailout_message = bailout_message " " $0 testsuite_error(bailout_message) } # Maybe we have to look for diagnostic comments too. else if (comments != 0) { comment = extract_tap_comment($0); if (length(comment)) report("#", comment); } } ## -------- ## ## FINISH ## ## -------- ## # A "Bail out!" directive should cause us to ignore any following TAP # error, as well as a non-zero exit status from the TAP producer. if (!bailed_out) { if (!plan_seen) { testsuite_error("missing test plan") } else if (planned_tests != testno) { bad_amount = testno > planned_tests ? "many" : "few" testsuite_error(sprintf("too %s tests run (expected %d, got %d)", bad_amount, planned_tests, testno)) } if (!ignore_exit) { # Fetch exit status from the last line. exit_message = get_test_exit_message(nextline) if (exit_message) testsuite_error(exit_message) } } write_test_results() exit 0 } # End of "BEGIN" block. ' # TODO: document that we consume the file descriptor 3 :-( } 3>"$log_file" test $? -eq 0 || fatal "I/O or internal error" # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: xrdp-0.10.1/vrplayer/000755 001751 000000 00000000000 14652432047 014501 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/000755 001751 000000 00000000000 14652432105 015114 5ustar00metawheel000000 000000 xrdp-0.10.1/libipm/000755 001751 000000 00000000000 14652432104 014103 5ustar00metawheel000000 000000 xrdp-0.10.1/install-sh000755 001751 000000 00000036115 14652432075 014650 0ustar00metawheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2024-06-19.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. Report bugs to . GNU Automake home page: . General help using GNU software: ." 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 (GNU Automake) $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-writable /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 incompatibility 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: xrdp-0.10.1/ulalaca/000755 001751 000000 00000000000 14652432105 014232 5ustar00metawheel000000 000000 xrdp-0.10.1/aclocal.m4000644 001751 000000 00000141717 14652432074 014510 0ustar00metawheel000000 000000 # generated automatically by aclocal 1.17 -*- Autoconf -*- # Copyright (C) 1996-2024 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.72],, [m4_warning([this file was generated for autoconf 2.72. 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-2024 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.17' 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.17], [], [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.17])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-2024 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_COND_IF -*- Autoconf -*- # Copyright (C) 2008-2024 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_COND_IF # _AM_COND_ELSE # _AM_COND_ENDIF # -------------- # These macros are only used for tracing. m4_define([_AM_COND_IF]) m4_define([_AM_COND_ELSE]) m4_define([_AM_COND_ENDIF]) # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE]) # --------------------------------------- # If the shell condition COND is true, execute IF-TRUE, otherwise execute # IF-FALSE. Allow automake to learn about conditional instantiating macros # (the AC_CONFIG_FOOS). AC_DEFUN([AM_COND_IF], [m4_ifndef([_AM_COND_VALUE_$1], [m4_fatal([$0: no such condition "$1"])])dnl _AM_COND_IF([$1])dnl if test -z "$$1_TRUE"; then : m4_n([$2])[]dnl m4_ifval([$3], [_AM_COND_ELSE([$1])dnl else $3 ])dnl _AM_COND_ENDIF([$1])dnl fi[]dnl ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2024 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])]) # Copyright (C) 1999-2024 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2024 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2024 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 AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) 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-2024 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-2024 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2024 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_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2024 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-2024 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])]) # Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2022-2024 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_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2024 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2024 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_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[]*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) 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-2024 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 # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 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 ]) 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]) 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 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) # Copyright (C) 2001-2024 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-2024 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-2024 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 x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif 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 x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif 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 # Copyright (C) 2022-2024 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_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) m4_include([m4/ax_append_compile_flags.m4]) m4_include([m4/ax_append_flag.m4]) m4_include([m4/ax_cflags_warn_all.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_gcc_func_attribute.m4]) m4_include([m4/ax_require_defined.m4]) m4_include([m4/ax_type_socklen_t.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/pkg.m4]) xrdp-0.10.1/configure.ac000644 001751 000000 00000054016 14652432047 015131 0ustar00metawheel000000 000000 # Process this file with autoconf to produce a configure script AC_PREREQ([2.69]) AC_INIT([xrdp], [0.10.1], [xrdp-devel@googlegroups.com]) AC_DEFINE([VERSION_YEAR], 2024, [Copyright year]) AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in) AM_INIT_AUTOMAKE([1.7.2 foreign]) AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC AC_PROG_CXX AC_C_CONST LT_INIT PKG_PROG_PKG_CONFIG if test "x$PKG_CONFIG" = "x"; then AC_MSG_ERROR([please install pkg-config]) fi AC_CONFIG_SUBDIRS([libpainter librfxcodec]) # Use silent rules by default if supported by Automake m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) case $host_os in *linux*) linux=yes ;; *kfreebsd*) linux=yes # only used in instfiles/ so that’s ok for us for now ;; *freebsd*) freebsd=yes ;; *netbsd*) netbsd=yes ;; *openbsd*) openbsd=yes ;; *darwin*) macos=yes ;; esac AM_CONDITIONAL(LINUX, [test "x$linux" = xyes]) AM_CONDITIONAL(FREEBSD, [test "x$freebsd" = xyes]) AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes]) AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes]) AM_CONDITIONAL(MACOS, [test "x$macos" = xyes]) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([void *]) # runstatedir not available for autoconf <= 2.69 if test "x$runstatedir" = "x" ; then runstatedir='${localstatedir}/run' fi AC_ARG_WITH([socketdir], [AS_HELP_STRING([--with-socketdir=DIR], [Use directory for UNIX sockets for XRDP sessions (default: RUNSTATEDIR/xrdp)])], [], [with_socketdir="$runstatedir/xrdp"]) AC_SUBST([socketdir], [$with_socketdir]) AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files, no to disable]), [], [ if test "x$linux" = xyes; then with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) fi ]) if test "x$with_systemdsystemunitdir" != xno; then AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [Ensure dependencies for the tests are installed]), [ensure_tests_deps=yes], []) AC_ARG_ENABLE(pam, AS_HELP_STRING([--enable-pam], [Build PAM support (default: yes)]), [], [enable_pam=yes]) AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_pam != xyes]) AC_ARG_ENABLE(vsock, AS_HELP_STRING([--enable-vsock], [Build AF_VSOCK support (default: no)]), [], [enable_vsock=no]) AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--enable-ipv6], [Build IPv6 support (default: no, experimental)]), [], [enable_ipv6=no]) AC_ARG_ENABLE(ipv6only, AS_HELP_STRING([--enable-ipv6only], [Build IPv6-only (default: no)]), [], [enable_ipv6only=no]) AC_ARG_ENABLE(kerberos, AS_HELP_STRING([--enable-kerberos], [Build kerberos support (prefer --enable-pam if available) (default: no)]), [], [enable_kerberos=no]) AC_ARG_ENABLE(bsd, AS_HELP_STRING([--enable-bsd], [Build BSD auth support (default: no)]), [bsd=true], [bsd=false]) AM_CONDITIONAL(SESMAN_BSD, [test x$bsd = xtrue]) AM_CONDITIONAL(SESMAN_KERBEROS, [test x$enable_kerberos = xyes]) AC_ARG_ENABLE(pamuserpass, AS_HELP_STRING([--enable-pamuserpass], [Build PAM userpass support (default: no)]), [], [enable_pamuserpass=no]) AM_CONDITIONAL(SESMAN_PAMUSERPASS, [test x$enable_pamuserpass = xyes]) AC_ARG_ENABLE(pam-config, AS_HELP_STRING([--enable-pam-config=CONF], [Select PAM config to install: arch, debian, redhat, suse, freebsd, macos, unix (default: autodetect)])) # Development options. devel_all is first as this provides a default for # the others AC_ARG_ENABLE(devel_all, AS_HELP_STRING([--enable-devel-all], [Enable all development options (default: no)]), [devel_all=$enableval], [devel_all=no]) AC_ARG_ENABLE(devel_debug, AS_HELP_STRING([--enable-devel-debug], [Build exes with no optimisation and debugging symbols (default: no)]), [devel_debug=$enableval], [devel_debug=$devel_all]) AM_CONDITIONAL(DEVEL_DEBUG, [test x$devel_debug = xyes ]) AC_ARG_ENABLE(devel_logging, AS_HELP_STRING([--enable-devel-logging], [Enable development logging (default: no)]), [devel_logging=$enableval], [devel_logging=$devel_all]) AC_ARG_ENABLE(devel_streamcheck, AS_HELP_STRING([--enable-devel-streamcheck], [Add range-check/abort to stream primitives (default: no)]), [devel_streamcheck=$enableval], [devel_streamcheck=$devel_all]) AC_ARG_ENABLE(neutrinordp, AS_HELP_STRING([--enable-neutrinordp], [Build neutrinordp module (default: no)]), [], [enable_neutrinordp=no]) AM_CONDITIONAL(XRDP_NEUTRINORDP, [test x$enable_neutrinordp = xyes]) AC_ARG_ENABLE(ulalaca, AS_HELP_STRING([--enable-ulalaca], [Build ulalaca module (experimental) (default: no)]), [], [enable_ulalaca=no]) AM_CONDITIONAL(XRDP_ULALACA, [test x$enable_ulalaca = xyes]) AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--enable-jpeg], [Build jpeg module (default: no)]), [], [enable_jpeg=no]) AM_CONDITIONAL(XRDP_JPEG, [test x$enable_jpeg = xyes]) AC_ARG_ENABLE(tjpeg, AS_HELP_STRING([--enable-tjpeg], [Build turbo jpeg module (default: no)]), [], [enable_tjpeg=no]) AM_CONDITIONAL(XRDP_TJPEG, [test x$enable_tjpeg = xyes]) AC_ARG_ENABLE(fuse, AS_HELP_STRING([--enable-fuse], [Build fuse(clipboard file / drive redir) (default: no)]), [], [enable_fuse=no]) AM_CONDITIONAL(XRDP_FUSE, [test x$enable_fuse = xyes]) AC_ARG_ENABLE(xrdpvr, AS_HELP_STRING([--enable-xrdpvr], [Build xrdpvr module (default: no)]), [], [enable_xrdpvr=no]) AM_CONDITIONAL(XRDP_XRDPVR, [test x$enable_xrdpvr = xyes]) AC_ARG_ENABLE(fdkaac, AS_HELP_STRING([--enable-fdkaac], [Build aac(audio codec) (default: no)]), [], [enable_fdkaac=no]) AM_CONDITIONAL(XRDP_FDK_AAC, [test x$enable_fdkaac = xyes]) AC_ARG_ENABLE(opus, AS_HELP_STRING([--enable-opus], [Build opus(audio codec) (default: no)]), [], [enable_opus=no]) AM_CONDITIONAL(XRDP_OPUS, [test x$enable_opus = xyes]) AC_ARG_ENABLE(mp3lame, AS_HELP_STRING([--enable-mp3lame], [Build lame mp3(audio codec) (default: no)]), [], [enable_mp3lame=no]) AM_CONDITIONAL(XRDP_MP3LAME, [test x$enable_mp3lame = xyes]) AC_ARG_ENABLE(pixman, AS_HELP_STRING([--enable-pixman], [Use pixman library (default: no)]), [], [enable_pixman=no]) AM_CONDITIONAL(XRDP_PIXMAN, [test x$enable_pixman = xyes]) AC_ARG_ENABLE(painter, AS_HELP_STRING([--disable-painter], [Do not use included painter library (default: no)]), [], [enable_painter=yes]) AM_CONDITIONAL(XRDP_PAINTER, [test x$enable_painter = xyes]) AC_ARG_ENABLE(rfxcodec, AS_HELP_STRING([--disable-rfxcodec], [Do not use included librfxcodec library (default: no)]), [], [enable_rfxcodec=yes]) AM_CONDITIONAL(XRDP_RFXCODEC, [test x$enable_rfxcodec = xyes]) AC_ARG_ENABLE(rdpsndaudin, AS_HELP_STRING([--enable-rdpsndaudin], [Use rdpsnd audio in (default: no)]), [], [enable_rdpsndaudin=no]) AM_CONDITIONAL(XRDP_RDPSNDAUDIN, [test x$enable_rdpsndaudin = xyes]) AC_ARG_WITH(imlib2, AS_HELP_STRING([--with-imlib2=ARG], [imlib2 library to use for non-BMP backgrounds (ARG=yes/no/)]),,) AC_ARG_WITH(freetype2, AS_HELP_STRING([--with-freetype2=ARG], [freetype2 library to use for rendering fonts (ARG=yes/no/)]),,) # Obsolete options AC_ARG_ENABLE(xrdpdebug, AS_HELP_STRING([--enable-xrdpdebug], [This option is no longer supported - use --enable-devel-all])) if test "x$enable_xrdpdebug" != x; then AC_MSG_ERROR([--enable-xrdpdebug must be replaced with one or more --enable-devel-* options]) fi # configure compiler options and CFLAGS AX_GCC_FUNC_ATTRIBUTE([format]) AX_TYPE_SOCKLEN_T AX_CFLAGS_WARN_ALL AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AM_COND_IF([LINUX], [AX_APPEND_COMPILE_FLAGS([-Werror])]) # bsd has warnings that have not been fixed yet AM_COND_IF([DEVEL_DEBUG], [AX_APPEND_COMPILE_FLAGS([-g -O0])], [AX_APPEND_COMPILE_FLAGS([-O2])]) # Function setusercontext() is in BSD -lutil but N/A on Solaris or GNU systems AC_SEARCH_LIBS([setusercontext], [util]) # Define HAVE_XXXXX macros for some system functions AC_CHECK_FUNCS([setusercontext getgrouplist clearenv]) # The type used by getgrouplist() is the same type used by getgroups() AC_TYPE_GETGROUPS # Don't fail without working nasm if rfxcodec is not enabled if test "x$enable_rfxcodec" != xyes; then with_simd=no export with_simd fi # Check if -ldl is needed to use dlopen() DLOPEN_LIBS= AC_CHECK_FUNC(dlopen, [], [AC_CHECK_LIB(dl, dlopen, [DLOPEN_LIBS=-ldl])]) AC_SUBST(DLOPEN_LIBS) # checking for openssl PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8], [], [AC_MSG_ERROR([please install libssl-dev or openssl-devel])]) # look for openssl binary OPENSSL_BIN=`$PKG_CONFIG --variable=exec_prefix openssl`/bin AC_PATH_PROGS([OPENSSL], [openssl], [:], [$OPENSSL_BIN:$PATH]) # checking for PAM variation # Linux-PAM is used in Linux systems # OpenPAM is used by FreeBSD, NetBSD, DragonFly BSD and OS X # OpenBSD uses BSD Authentication rather than both PAMs AC_CHECK_HEADER([security/_pam_types.h], [AC_DEFINE([HAVE__PAM_TYPES_H], 1, [Using Linux-PAM], [])]) AC_CHECK_HEADER([security/pam_constants.h], [AC_DEFINE([HAVE_PAM_CONSTANTS_H], 1, [Using OpenPAM], [])]) # Find imlib2 case "$with_imlib2" in '' | no) AC_MSG_NOTICE([imlib2 will not be supported]) use_imlib2=no ;; yes) PKG_CHECK_MODULES([IMLIB2], [imlib2 >= 1.4.5], [use_imlib2=yes], [AC_MSG_ERROR([please install libimlib2-dev or imlib2-devel])]) ;; /*) AC_MSG_CHECKING([for imlib2 in $with_imlib2]) if test -d $with_imlib2/lib; then IMLIB2_LIBS="-L$with_imlib2/lib -lImlib2" elif test -d $with_imlib2/lib64; then IMLIB2_LIBS="-L$with_imlib2/lib64 -lImlib2" else AC_MSG_RESULT([no]) AC_MSG_ERROR([Can't find libImlib2 in $with_imlib2]) fi if test -f $with_imlib2/include/Imlib2.h; then IMLIB2_CFLAGS="-I $with_imlib2/include" else AC_MSG_RESULT([no]) AC_MSG_ERROR([Can't find $with_imlib2/include/Imlib2.h]) fi AC_MSG_RESULT([yes]) AC_SUBST([IMLIB2_LIBS]) AC_SUBST([IMLIB2_CFLAGS]) use_imlib2=yes ;; *) AC_MSG_ERROR([--with-imlib2 needs yes/no or absolute path]) esac if test x$use_imlib2 = xyes; then AC_DEFINE([USE_IMLIB2],1, [Compile with imlib2 support]) fi # Find freetype2 # # The modversion used by pkgcheck does not correspond to the # freetype2 release. See docs/VERSIONS.TXT in the freetype2 # source for a table of correspondences. If you change one # of the below defines, change both. m4_define([FT2_REQUIRED_VERSION], [2_8_0]) m4_define([FT2_REQUIRED_MODVERSION], [20.0.14]) case "$with_freetype2" in '' | no) AC_MSG_NOTICE([freetype2 will not be supported]) use_freetype2=no ;; yes) PKG_CHECK_MODULES([FREETYPE2], [freetype2 >= FT2_REQUIRED_MODVERSION], [use_freetype2=yes], [AC_MSG_ERROR([please install version FT2_REQUIRED_VERSION or later of libfreetype6-dev or freetype-devel])]) ;; /*) AC_MSG_CHECKING([for freetype2 in $with_freetype2]) if test -d $with_freetype2/lib; then FREETYPE2_LIBS="-L$with_freetype2/lib -llibfreetype" elif test -d $with_freetype2/lib64; then FREETYPE2_LIBS="-L$with_freetype2/lib64 -llibfreetype" else AC_MSG_RESULT([no]) AC_MSG_ERROR([Can't find libfreetype in $with_freetype2]) fi if test -f $with_freetype2/include/freetype2/ft2build.h; then FREETYPE2_CFLAGS="-I $with_freetype2/include/freetype2" else AC_MSG_RESULT([no]) AC_MSG_ERROR([Can't find $with_freetype2/include/freetype2/ft2build.h]) fi AC_MSG_RESULT([yes]) AC_SUBST([FREETYPE2_LIBS]) AC_SUBST([FREETYPE2_CFLAGS]) use_freetype2=yes ;; *) AC_MSG_ERROR([--with-freetype2 needs yes/no or absolute path]) esac AM_CONDITIONAL([USE_FREETYPE2], [test "x$use_freetype2" = xyes]) # Check only one auth mechanism is specified, and give it a name auth_cnt=0 auth_mech="Builtin" AUTHMOD_OBJ=verify_user.lo AUTHMOD_LIB=-lcrypt if test x$enable_pam = xyes then auth_cnt=`expr $auth_cnt + 1` auth_mech="PAM" AUTHMOD_OBJ=verify_user_pam.lo AUTHMOD_LIB=-lpam fi if test x$bsd = xtrue then auth_cnt=`expr $auth_cnt + 1` auth_mech="BSD" AUTHMOD_OBJ=verify_user_bsd.lo AUTHMOD_LIB= fi if test x$enable_kerberos = xyes then auth_cnt=`expr $auth_cnt + 1` auth_mech="Kerberos" AUTHMOD_OBJ=verify_user_kerberos.lo AUTHMOD_LIB=-lkrb5 fi if test x$enable_pamuserpass = xyes then auth_cnt=`expr $auth_cnt + 1` auth_mech="PAM userpass" AUTHMOD_OBJ=verify_user_pam_userpass.lo AUTHMOD_LIB="-lpam -lpam_userpass" fi if test $auth_cnt -gt 1 then AC_MSG_ERROR([--enable-pam, --enable-bsd, --enable-pamuserpass and --enable-kerberos are mutually exclusive]) fi AC_SUBST([AUTHMOD_OBJ]) AC_SUBST([AUTHMOD_LIB]) # checking if pam should be autodetected. if test "x$enable_pam" = "xyes" then if test -z "$enable_bsd" then AC_CHECK_HEADER([security/pam_appl.h], [], [AC_MSG_ERROR([please install libpam0g-dev or pam-devel])]) fi if test "x$enable_pam_config" = "x"; then PAM_RULES="auto" else pam_config_file="$srcdir/instfiles/pam.d/xrdp-sesman.$enable_pam_config" if test -f "$pam_config_file"; then PAM_RULES="$enable_pam_config" else AC_MSG_ERROR([PAM file "$pam_config_file" is not available]) fi fi fi AC_SUBST(PAM_RULES) # Add define for development options to config_ac.h AC_DEFINE([CONFIG_AC_H],1, [Allow sources to check config_ac.h is included]) if test x$devel_logging = xyes then AC_DEFINE([USE_DEVEL_LOGGING],1,[Enable development logging]) fi if test x$devel_streamcheck = xyes then AC_DEFINE([USE_DEVEL_STREAMCHECK],1,[Enable development stream checking]) fi if test "x$enable_vsock" = "xyes" then enable_vsock=yes if test "x$freebsd" = "xyes" then # Determine if we have AF_HYPERV defined (FreeBSD 13+) AC_CHECK_DECL([AF_HYPERV], [AC_DEFINE([XRDP_ENABLE_VSOCK], 1, [Enable AF_HYPERV])], [], [#include ]) else AC_CHECK_HEADERS([linux/socket.h linux/vm_sockets.h], [AC_DEFINE([XRDP_ENABLE_VSOCK], 1, [Enable AF_VSOCK])], [], [#include ]) fi fi if test "x$enable_ipv6only" = "xyes" then enable_ipv6=yes AC_DEFINE([XRDP_ENABLE_IPV6ONLY],1,[Enable IPv6 only]) fi if test "x$enable_ipv6" = "xyes" then AC_DEFINE([XRDP_ENABLE_IPV6],1,[Enable IPv6]) fi AS_IF( [test "x$enable_neutrinordp" = "xyes"] , [PKG_CHECK_MODULES(FREERDP, freerdp >= 1.0.0)] ) # checking for libjpeg if test "x$enable_jpeg" = "xyes" then AC_CHECK_HEADER([jpeglib.h], [], [AC_MSG_ERROR([please install libjpeg-dev or libjpeg-devel])]) fi # checking for fuse if test "x$enable_fuse" = "xyes" then PKG_CHECK_MODULES([FUSE], [fuse >= 2.6], [], [AC_MSG_ERROR([please install libfuse-dev or fuse-devel])]) fi # checking for fdk aac if test "x$enable_fdkaac" = "xyes" then PKG_CHECK_MODULES([FDKAAC], [fdk-aac >= 0.1.0], [], [AC_MSG_ERROR([please install libfdk-aac-dev or fdk-aac-devel])]) fi # checking for opus if test "x$enable_opus" = "xyes" then AC_CHECK_HEADER([opus/opus.h], [], [AC_MSG_ERROR([please install libopus-dev or opus-devel])]) fi # checking for lame mp3 if test "x$enable_mp3lame" = "xyes" then AC_CHECK_HEADER([lame/lame.h], [], [AC_MSG_ERROR([please install libmp3lame-dev or lamemp3-devel])]) fi AS_IF( [test "x$enable_pixman" = "xyes"] , [PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.1.0)] ) # checking for TurboJPEG if test "x$enable_tjpeg" = "xyes" then if test ! -z "$TURBOJPEG_PATH" then # env var TURBOJPEG_PATH has been defined, use that AC_CHECK_HEADER([$TURBOJPEG_PATH/include/turbojpeg.h], [], [AC_MSG_ERROR([could not find TurboJPEG in dir specified by env variable TURBOJPEG_PATH ($TURBOJPEG_PATH)])]) AC_SUBST(TurboJpegIncDir, ["-I$TURBOJPEG_PATH/include"]) AC_SUBST(TurboJpegLibDir, ["-L$TURBOJPEG_PATH/lib -Wl,-rpath -Wl,$TURBOJPEG_PATH/lib"]) elif test -e /opt/libjpeg-turbo/lib64 then # TurboJPEG has been installed to /opt on a 64 bit m/c AC_SUBST(TurboJpegIncDir, ["-I/opt/libjpeg-turbo/include"]) AC_SUBST(TurboJpegLibDir, ["-L/opt/libjpeg-turbo/lib64 -Wl,-rpath -Wl,/opt/libjpeg-turbo/lib64"]) elif test -e /opt/libjpeg-turbo/lib32 then # TurboJPEG has been installed to /opt on a 32 bit m/c AC_SUBST(TurboJpegIncDir, ["-I/opt/libjpeg-turbo/include"]) AC_SUBST(TurboJpegLibDir, ["-L/opt/libjpeg-turbo/lib32 -Wl,-rpath -Wl,/opt/libjpeg-turbo/lib32"]) else # check in default location AC_CHECK_HEADER([/usr/include/turbojpeg.h], [], [AC_MSG_ERROR([please install TurboJPEG ])]) AC_SUBST(TurboJpegIncDir, [""]) AC_SUBST(TurboJpegLibDir, [""]) fi fi AC_PATH_XTRA if test "x$no_x" == "xyes"; then AC_MSG_ERROR([please install libx11-dev or libX11-devel]) fi save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $X_CFLAGS" # checking for Xfixes AC_CHECK_HEADER([X11/extensions/Xfixes.h], [], [AC_MSG_ERROR([please install libxfixes-dev or libXfixes-devel])], [#include ]) # checking for Xrandr AC_CHECK_HEADER([X11/extensions/Xrandr.h], [], [AC_MSG_ERROR([please install libxrandr-dev or libXrandr-devel])], [#include ]) CFLAGS="$save_CFLAGS" # perform unit tests if libcheck and libmocka found perform_unit_tests=yes; # Assume packages will be found if test "x$ensure_tests_deps" == "xyes"; then PKG_CHECK_MODULES([CHECK], [check >= 0.10.0], [], [AC_MSG_ERROR([please install check, the unit test framework])]) # Check if cmocka is available - needed for unit testing PKG_CHECK_MODULES([CMOCKA], [cmocka], [], [AC_MSG_ERROR([please install cmocka, the mocking framework])]) else PKG_CHECK_MODULES([CHECK], [check >= 0.10.0], [], [perform_unit_tests=no]) PKG_CHECK_MODULES([CMOCKA], [cmocka], [], [perform_unit_tests=no]) fi if test "x$perform_unit_tests" == "xyes"; then AC_MSG_NOTICE([libcheck found, unit tests will be performed]) else AC_MSG_NOTICE([libcheck not found, unit tests will be skipped]) fi # -- end perform unit tests AC_SUBST([moduledir], '${libdir}/xrdp') AC_ARG_ENABLE([strict-locations], [AS_HELP_STRING([--enable-strict-locations], [Use standard Autoconf install directories unless overridden (default: use /etc and /var)])], [], [enable_strict_locations=no]) if test "x$enable_strict_locations" != "xyes"; then sysconfdir="/etc"; localstatedir="/var"; fi AC_ARG_WITH([pamconfdir], [AS_HELP_STRING([--with-pamconfdir=DIR], [Use directory for pam.d config (default: /etc/pam.d)])], [], [with_pamconfdir="$sysconfdir/pam.d"]) AC_SUBST([pamconfdir], [$with_pamconfdir]) PKG_INSTALLDIR AC_CHECK_HEADERS([sys/prctl.h uchar.h]) AC_CONFIG_FILES([ common/Makefile docs/Makefile docs/man/Makefile fontutils/Makefile genkeymap/Makefile instfiles/default/Makefile instfiles/init.d/Makefile instfiles/Makefile instfiles/pam.d/Makefile instfiles/pulse/Makefile instfiles/rc.d/Makefile keygen/Makefile waitforx/Makefile libipm/Makefile libxrdp/Makefile Makefile mc/Makefile neutrinordp/Makefile ulalaca/Makefile pkgconfig/Makefile pkgconfig/xrdp.pc pkgconfig/xrdp-uninstalled.pc sesman/libsesman/Makefile sesman/chansrv/Makefile sesman/Makefile sesman/sesexec/Makefile sesman/tools/Makefile tests/Makefile tests/common/Makefile tests/libipm/Makefile tests/libxrdp/Makefile tests/memtest/Makefile tests/xrdp/Makefile tools/Makefile tools/devel/Makefile tools/devel/tcp_proxy/Makefile vnc/Makefile xrdpapi/Makefile xrdp/Makefile xrdpvr/Makefile xup/Makefile third_party/Makefile third_party/tomlc99/Makefile ]) AC_REQUIRE_AUX_FILE([tap-driver.sh]) AC_OUTPUT echo "" echo "xrdp will be compiled with:" echo "" echo " mp3lame $enable_mp3lame" echo " opus $enable_opus" echo " fdkaac $enable_fdkaac" echo " jpeg $enable_jpeg" echo " turbo jpeg $enable_tjpeg" echo " rfxcodec $enable_rfxcodec" echo " painter $enable_painter" echo " pixman $enable_pixman" echo " fuse $enable_fuse" echo " ipv6 $enable_ipv6" echo " ipv6only $enable_ipv6only" echo " vsock $enable_vsock" echo " auth mechanism $auth_mech" echo " rdpsndaudin $enable_rdpsndaudin" echo echo " with imlib2 $use_imlib2" echo " with freetype2 $use_freetype2" echo echo " development logging $devel_logging" echo " development streamcheck $devel_streamcheck" echo "" echo " strict_locations $enable_strict_locations" echo " prefix $prefix" echo " exec_prefix $exec_prefix" echo " libdir $libdir" echo " bindir $bindir" echo " sysconfdir $sysconfdir" echo " pamconfdir $pamconfdir" echo " localstatedir $localstatedir" echo " runstatedir $runstatedir" echo " socketdir $socketdir" echo "" echo " unit tests performable $perform_unit_tests" echo "" echo " CFLAGS = $CFLAGS" echo " LDFLAGS = $LDFLAGS" # xrdp_configure_options.h will be written to the build directory, not the source directory echo '#define XRDP_CONFIGURE_OPTIONS \' > ./xrdp_configure_options.h ./config.status --config | xargs -n 1 | sed -e 's/^/" /' -e 's/$/\\n" \\/' >> ./xrdp_configure_options.h echo '""' >> ./xrdp_configure_options.h xrdp-0.10.1/xrdp/000755 001751 000000 00000000000 14652432105 013605 5ustar00metawheel000000 000000 xrdp-0.10.1/tools/000755 001751 000000 00000000000 14652432105 013770 5ustar00metawheel000000 000000 xrdp-0.10.1/vnc/000755 001751 000000 00000000000 14652432104 013415 5ustar00metawheel000000 000000 xrdp-0.10.1/xup/000755 001751 000000 00000000000 14652432104 013443 5ustar00metawheel000000 000000 xrdp-0.10.1/xup/Makefile.am000644 001751 000000 00000000624 14652432047 015507 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libxup.la libxup_la_SOURCES = \ xup.c \ xup.h libxup_la_LIBADD = \ $(top_builddir)/common/libcommon.la if !MACOS libxup_la_LDFLAGS = -avoid-version -module endif xrdp-0.10.1/xup/Makefile.in000644 001751 000000 00000053631 14652432076 015530 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = xup ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libxup_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libxup_la_OBJECTS = xup.lo libxup_la_OBJECTS = $(am_libxup_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libxup_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libxup_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/xup.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libxup_la_SOURCES) DIST_SOURCES = $(libxup_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libxup.la libxup_la_SOURCES = \ xup.c \ xup.h libxup_la_LIBADD = \ $(top_builddir)/common/libcommon.la @MACOS_FALSE@libxup_la_LDFLAGS = -avoid-version -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign xup/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign xup/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libxup.la: $(libxup_la_OBJECTS) $(libxup_la_DEPENDENCIES) $(EXTRA_libxup_la_DEPENDENCIES) $(AM_V_CCLD)$(libxup_la_LINK) -rpath $(moduledir) $(libxup_la_OBJECTS) $(libxup_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xup.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/xup.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/xup.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/xup/xup.h000644 001751 000000 00000023276 14652432047 014450 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libxup main header file */ #ifndef XUP_H #define XUP_H /* include other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #include "log.h" #include "xrdp_client_info.h" #include "xrdp_constants.h" #include "xrdp_rail.h" #define CURRENT_MOD_VER 4 struct source_info; struct mod { int size; /* size of this struct */ int version; /* internal version */ /* client functions */ int (*mod_start)(struct mod *v, int w, int h, int bpp); int (*mod_connect)(struct mod *v); int (*mod_event)(struct mod *v, int msg, tbus param1, tbus param2, tbus param3, tbus param4); int (*mod_signal)(struct mod *v); int (*mod_end)(struct mod *v); int (*mod_set_param)(struct mod *v, const char *name, const char *value); int (*mod_session_change)(struct mod *v, int, int); int (*mod_get_wait_objs)(struct mod *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int (*mod_check_wait_objs)(struct mod *v); int (*mod_frame_ack)(struct mod *v, int flags, int frame_id); int (*mod_suppress_output)(struct mod *v, int suppress, int left, int top, int right, int bottom); int (*mod_server_monitor_resize)(struct mod *v, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress); int (*mod_server_monitor_full_invalidate)(struct mod *v, int width, int height); int (*mod_server_version_message)(struct mod *v); tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod functions above */ /* server functions */ int (*server_begin_update)(struct mod *v); int (*server_end_update)(struct mod *v); int (*server_fill_rect)(struct mod *v, int x, int y, int cx, int cy); int (*server_screen_blt)(struct mod *v, int x, int y, int cx, int cy, int srcx, int srcy); int (*server_paint_rect)(struct mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy); int (*server_set_cursor)(struct mod *v, int x, int y, char *data, char *mask); int (*server_palette)(struct mod *v, int *palette); int (*server_msg)(struct mod *v, const char *msg, int code); int (*server_is_term)(void); int (*server_set_clip)(struct mod *v, int x, int y, int cx, int cy); int (*server_reset_clip)(struct mod *v); int (*server_set_fgcolor)(struct mod *v, int fgcolor); int (*server_set_bgcolor)(struct mod *v, int bgcolor); int (*server_set_opcode)(struct mod *v, int opcode); int (*server_set_mixmode)(struct mod *v, int mixmode); int (*server_set_brush)(struct mod *v, int x_origin, int y_origin, int style, char *pattern); int (*server_set_pen)(struct mod *v, int style, int width); int (*server_draw_line)(struct mod *v, int x1, int y1, int x2, int y2); int (*server_add_char)(struct mod *v, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_draw_text)(struct mod *v, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int (*client_monitor_resize)(struct mod *v, int width, int height, int num_monitors, const struct monitor_info *monitors); int (*server_monitor_resize_done)(struct mod *v); int (*server_get_channel_count)(struct mod *v); int (*server_query_channel)(struct mod *v, int index, char *channel_name, int *channel_flags); int (*server_get_channel_id)(struct mod *v, const char *name); int (*server_send_to_channel)(struct mod *v, int channel_id, char *data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct mod *v); int (*server_chansrv_in_use)(struct mod *v); /* off screen bitmaps */ int (*server_create_os_surface)(struct mod *v, int rdpindex, int width, int height); int (*server_switch_os_surface)(struct mod *v, int rdpindex); int (*server_delete_os_surface)(struct mod *v, int rdpindex); int (*server_paint_rect_os)(struct mod *v, int x, int y, int cx, int cy, int rdpindex, int srcx, int srcy); int (*server_set_hints)(struct mod *v, int hints, int mask); /* rail */ int (*server_window_new_update)(struct mod *v, int window_id, struct rail_window_state_order *window_state, int flags); int (*server_window_delete)(struct mod *v, int window_id); int (*server_window_icon)(struct mod *v, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags); int (*server_window_cached_icon)(struct mod *v, int window_id, int cache_entry, int cache_id, int flags); int (*server_notify_new_update)(struct mod *v, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags); int (*server_notify_delete)(struct mod *v, int window_id, int notify_id); int (*server_monitored_desktop)(struct mod *v, struct rail_monitored_desktop_order *mdo, int flags); int (*server_set_cursor_ex)(struct mod *v, int x, int y, char *data, char *mask, int bpp); int (*server_add_char_alpha)(struct mod *v, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_create_os_surface_bpp)(struct mod *v, int rdpindex, int width, int height, int bpp); int (*server_paint_rect_bpp)(struct mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy, int bpp); int (*server_composite)(struct mod *v, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat); int (*server_paint_rects)(struct mod *v, int num_drects, short *drects, int num_crects, short *crects, char *data, int width, int height, int flags, int frame_id); int (*server_session_info)(struct mod *v, const char *data, int data_bytes); int (*server_set_pointer_large)(struct mod *v, int x, int y, char *data, char *mask, int bpp, int width, int height); int (*server_paint_rects_ex)(struct mod *v, int num_drects, short *drects, int num_crects, short *crects, char *data, int left, int top, int width, int height, int flags, int frame_id, void *shmem_ptr, int shmem_bytes); int (*server_egfx_cmd)(struct mod *v, char *cmd, int cmd_bytes, char *data, int data_bytes); tintptr server_dumby[100 - 50]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; struct source_info *si; /* mod data */ int width; int height; int bpp; int sck_closed; char username[INFO_CLIENT_MAX_CB_LEN]; char password[INFO_CLIENT_MAX_CB_LEN]; char ip[256]; char port[256]; int shift_state; struct xrdp_client_info client_info; int screen_shmem_id; int screen_shmem_id_mapped; /* boolean */ char *screen_shmem_pixels; struct trans *trans; }; #endif // XUP_H xrdp-0.10.1/xup/xup.c000644 001751 000000 00000150712 14652432047 014437 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libxup main file */ #if defined(HAVE_CONFIG_H) #include #endif #include "xup.h" #include "log.h" #include "trans.h" #include "string_calls.h" static int send_server_monitor_update(struct mod *v, struct stream *s, int width, int height, int num_monitors, const struct monitor_info *monitors); static int send_server_monitor_full_invalidate( struct mod *mod, struct stream *s, int width, int height); static int send_server_version_message(struct mod *v, struct stream *s); static int lib_mod_process_message(struct mod *mod, struct stream *s); /******************************************************************************/ static int lib_send_copy(struct mod *mod, struct stream *s) { return trans_write_copy_s(mod->trans, s); } /******************************************************************************/ /* return error */ int lib_mod_start(struct mod *mod, int w, int h, int bpp) { LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_start"); mod->width = w; mod->height = h; mod->bpp = bpp; LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_start"); return 0; } /******************************************************************************/ static int lib_mod_log_peer(struct mod *mod) { int my_pid; int pid; int uid; int gid; my_pid = g_getpid(); if (g_sck_get_peer_cred(mod->trans->sck, &pid, &uid, &gid) == 0) { LOG(LOG_LEVEL_INFO, "lib_mod_log_peer: xrdp_pid=%d connected " "to Xorg_pid=%d Xorg_uid=%d Xorg_gid=%d " "client=%s", my_pid, pid, uid, gid, mod->client_info.client_description); } else { LOG(LOG_LEVEL_ERROR, "lib_mod_log_peer: g_sck_get_peer_cred " "failed"); } return 0; } /******************************************************************************/ static int lib_data_in(struct trans *trans) { struct mod *self; struct stream *s; int len; LOG_DEVEL(LOG_LEVEL_TRACE, "lib_data_in:"); if (trans == 0) { return 1; } self = (struct mod *)(trans->callback_data); s = trans_get_in_s(trans); if (s == 0) { return 1; } switch (trans->extra_flags) { case 1: s->p = s->data; in_uint8s(s, 4); /* processed later in lib_mod_process_message */ in_uint32_le(s, len); if (len < 0 || len > 128 * 1024) { LOG(LOG_LEVEL_ERROR, "lib_data_in: bad size"); return 1; } if (len > 0) { trans->header_size = len + 8; trans->extra_flags = 2; break; } /* fall through */ case 2: s->p = s->data; if (lib_mod_process_message(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "lib_data_in: lib_mod_process_message failed"); return 1; } init_stream(s, 0); trans->header_size = 8; trans->extra_flags = 1; break; } return 0; } /******************************************************************************/ /* return error */ int lib_mod_connect(struct mod *mod) { int error; int socket_mode; struct stream *s; char con_port[256]; mod->server_msg(mod, "started connecting", 0); /* only support 8, 15, 16, 24, and 32 bpp connections from rdp client */ if (mod->bpp != 8 && mod->bpp != 15 && mod->bpp != 16 && mod->bpp != 24 && mod->bpp != 32) { mod->server_msg(mod, "error - only supporting 8, 15, 16, 24, and 32" " bpp rdp connections", 0); return 1; } make_stream(s); g_sprintf(con_port, "%s", mod->port); error = 0; mod->sck_closed = 0; if (con_port[0] == '/') { socket_mode = TRANS_MODE_UNIX; LOG(LOG_LEVEL_INFO, "lib_mod_connect: connecting via UNIX socket"); } else { socket_mode = TRANS_MODE_TCP; LOG(LOG_LEVEL_INFO, "lib_mod_connect: connecting via TCP socket"); if (g_strcmp(mod->ip, "") == 0) { mod->server_msg(mod, "error - no ip set", 0); free_stream(s); return 1; } } mod->trans = trans_create(socket_mode, 8 * 8192, 8192); if (mod->trans == 0) { free_stream(s); return 1; } mod->trans->si = mod->si; mod->trans->my_source = XRDP_SOURCE_MOD; mod->trans->is_term = mod->server_is_term; /* Give the X server a bit of time to start */ if (trans_connect(mod->trans, mod->ip, con_port, 30 * 1000) == 0) { LOG_DEVEL(LOG_LEVEL_INFO, "lib_mod_connect: connected to Xserver " "(Xorg) sck %lld", (long long) (mod->trans->sck)); } else { mod->server_msg(mod, "connection problem, giving up", 0); error = 1; } if (error == 0 && socket_mode == TRANS_MODE_UNIX) { lib_mod_log_peer(mod); } if (error == 0) { error = send_server_version_message(mod, s); } if (error == 0) { error = send_server_monitor_full_invalidate( mod, s, mod->width, mod->height); } free_stream(s); if (error != 0) { trans_delete(mod->trans); mod->trans = 0; mod->server_msg(mod, "some problem", 0); return 1; } else { mod->server_msg(mod, "connected ok", 0); mod->trans->trans_data_in = lib_data_in; mod->trans->header_size = 8; mod->trans->callback_data = mod; mod->trans->no_stream_init_on_data_in = 1; mod->trans->extra_flags = 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_connect"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_event(struct mod *mod, int msg, tbus param1, tbus param2, tbus param3, tbus param4) { struct stream *s; int len; int key; int rv; LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_event"); make_stream(s); if ((msg >= 15) && (msg <= 16)) /* key events */ { key = param2; if (key > 0) { if (key == 65027) /* altgr */ { if (mod->shift_state) { LOG_DEVEL(LOG_LEVEL_TRACE, "special"); /* fix for mstsc sending left control down with altgr */ /* control down / up msg param1 param2 param3 param4 15 0 65507 29 0 16 0 65507 29 49152 */ init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 103); out_uint32_le(s, 16); /* key up */ out_uint32_le(s, 0); out_uint32_le(s, 65507); /* left control */ out_uint32_le(s, 29); /* RDP scan code */ out_uint32_le(s, 0xc000); /* flags */ s_mark_end(s); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); lib_send_copy(mod, s); } } if (key == 65507) /* left control */ { mod->shift_state = msg == 15; } } } init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 103); out_uint32_le(s, msg); out_uint32_le(s, param1); out_uint32_le(s, param2); out_uint32_le(s, param3); out_uint32_le(s, param4); s_mark_end(s); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); rv = lib_send_copy(mod, s); free_stream(s); LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_event"); return rv; } /******************************************************************************/ /* return error */ static int process_server_fill_rect(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); rv = mod->server_fill_rect(mod, x, y, cx, cy); return rv; } /******************************************************************************/ /* return error */ static int process_server_screen_blt(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; int srcx; int srcy; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_sint16_le(s, srcx); in_sint16_le(s, srcy); rv = mod->server_screen_blt(mod, x, y, cx, cy, srcx, srcy); return rv; } /******************************************************************************/ /* return error */ static int process_server_paint_rect(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; int width; int height; int srcx; int srcy; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint32_le(s, len_bmpdata); in_uint8p(s, bmpdata, len_bmpdata); in_uint16_le(s, width); in_uint16_le(s, height); in_sint16_le(s, srcx); in_sint16_le(s, srcy); rv = mod->server_paint_rect(mod, x, y, cx, cy, bmpdata, width, height, srcx, srcy); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_clip(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); rv = mod->server_set_clip(mod, x, y, cx, cy); return rv; } /******************************************************************************/ /* return error */ static int process_server_reset_clip(struct mod *mod, struct stream *s) { int rv; rv = mod->server_reset_clip(mod); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_fgcolor(struct mod *mod, struct stream *s) { int rv; int fgcolor; in_uint32_le(s, fgcolor); rv = mod->server_set_fgcolor(mod, fgcolor); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_bgcolor(struct mod *mod, struct stream *s) { int rv; int bgcolor; in_uint32_le(s, bgcolor); rv = mod->server_set_bgcolor(mod, bgcolor); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_opcode(struct mod *mod, struct stream *s) { int rv; int opcode; in_uint16_le(s, opcode); rv = mod->server_set_opcode(mod, opcode); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_pen(struct mod *mod, struct stream *s) { int rv; int style; int width; in_uint16_le(s, style); in_uint16_le(s, width); rv = mod->server_set_pen(mod, style, width); return rv; } /******************************************************************************/ /* return error */ static int process_server_draw_line(struct mod *mod, struct stream *s) { int rv; int x1; int y1; int x2; int y2; in_sint16_le(s, x1); in_sint16_le(s, y1); in_sint16_le(s, x2); in_sint16_le(s, y2); rv = mod->server_draw_line(mod, x1, y1, x2, y2); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_cursor(struct mod *mod, struct stream *s) { int rv; int x; int y; char cur_data[32 * (32 * 3)]; char cur_mask[32 * (32 / 8)]; in_sint16_le(s, x); in_sint16_le(s, y); in_uint8a(s, cur_data, 32 * (32 * 3)); in_uint8a(s, cur_mask, 32 * (32 / 8)); rv = mod->server_set_cursor(mod, x, y, cur_data, cur_mask); return rv; } /******************************************************************************/ /* return error */ static int process_server_create_os_surface(struct mod *mod, struct stream *s) { int rv; int rdpid; int width; int height; in_uint32_le(s, rdpid); in_uint16_le(s, width); in_uint16_le(s, height); rv = mod->server_create_os_surface(mod, rdpid, width, height); return rv; } /******************************************************************************/ /* return error */ static int process_server_switch_os_surface(struct mod *mod, struct stream *s) { int rv; int rdpid; in_uint32_le(s, rdpid); rv = mod->server_switch_os_surface(mod, rdpid); return rv; } /******************************************************************************/ /* return error */ static int process_server_delete_os_surface(struct mod *mod, struct stream *s) { int rv; int rdpid; in_uint32_le(s, rdpid); rv = mod->server_delete_os_surface(mod, rdpid); return rv; } /******************************************************************************/ /* return error */ static int process_server_paint_rect_os(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; int rdpid; int srcx; int srcy; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint32_le(s, rdpid); in_sint16_le(s, srcx); in_sint16_le(s, srcy); rv = mod->server_paint_rect_os(mod, x, y, cx, cy, rdpid, srcx, srcy); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_hints(struct mod *mod, struct stream *s) { int rv; int hints; int mask; in_uint32_le(s, hints); in_uint32_le(s, mask); rv = mod->server_set_hints(mod, hints, mask); return rv; } /******************************************************************************/ /* return error */ static int process_server_window_new_update(struct mod *mod, struct stream *s) { int flags; int window_id; int title_bytes; int index; int bytes; int rv; struct rail_window_state_order rwso; g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); in_uint32_le(s, rwso.owner_window_id); in_uint32_le(s, rwso.style); in_uint32_le(s, rwso.extended_style); in_uint32_le(s, rwso.show_state); in_uint16_le(s, title_bytes); if (title_bytes > 0) { rwso.title_info = g_new(char, title_bytes + 1); in_uint8a(s, rwso.title_info, title_bytes); rwso.title_info[title_bytes] = 0; } in_uint32_le(s, rwso.client_offset_x); in_uint32_le(s, rwso.client_offset_y); in_uint32_le(s, rwso.client_area_width); in_uint32_le(s, rwso.client_area_height); in_uint32_le(s, rwso.rp_content); in_uint32_le(s, rwso.root_parent_handle); in_uint32_le(s, rwso.window_offset_x); in_uint32_le(s, rwso.window_offset_y); in_uint32_le(s, rwso.window_client_delta_x); in_uint32_le(s, rwso.window_client_delta_y); in_uint32_le(s, rwso.window_width); in_uint32_le(s, rwso.window_height); in_uint16_le(s, rwso.num_window_rects); if (rwso.num_window_rects > 0) { bytes = sizeof(struct rail_window_rect) * rwso.num_window_rects; rwso.window_rects = (struct rail_window_rect *)g_malloc(bytes, 0); for (index = 0; index < rwso.num_window_rects; index++) { in_uint16_le(s, rwso.window_rects[index].left); in_uint16_le(s, rwso.window_rects[index].top); in_uint16_le(s, rwso.window_rects[index].right); in_uint16_le(s, rwso.window_rects[index].bottom); } } in_uint32_le(s, rwso.visible_offset_x); in_uint32_le(s, rwso.visible_offset_y); in_uint16_le(s, rwso.num_visibility_rects); if (rwso.num_visibility_rects > 0) { bytes = sizeof(struct rail_window_rect) * rwso.num_visibility_rects; rwso.visibility_rects = (struct rail_window_rect *)g_malloc(bytes, 0); for (index = 0; index < rwso.num_visibility_rects; index++) { in_uint16_le(s, rwso.visibility_rects[index].left); in_uint16_le(s, rwso.visibility_rects[index].top); in_uint16_le(s, rwso.visibility_rects[index].right); in_uint16_le(s, rwso.visibility_rects[index].bottom); } } in_uint32_le(s, flags); mod->server_window_new_update(mod, window_id, &rwso, flags); rv = 0; g_free(rwso.title_info); g_free(rwso.window_rects); g_free(rwso.visibility_rects); return rv; } /******************************************************************************/ /* return error */ static int process_server_window_delete(struct mod *mod, struct stream *s) { int window_id; int rv; in_uint32_le(s, window_id); mod->server_window_delete(mod, window_id); rv = 0; return rv; } /******************************************************************************/ /* return error */ static int process_server_window_show(struct mod *mod, struct stream *s) { int window_id; int rv; int flags; struct rail_window_state_order rwso; g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); in_uint32_le(s, flags); in_uint32_le(s, rwso.show_state); mod->server_window_new_update(mod, window_id, &rwso, flags); rv = 0; return rv; } /******************************************************************************/ /* return error */ static int process_server_add_char(struct mod *mod, struct stream *s) { int rv; int font; int character; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; in_uint16_le(s, font); in_uint16_le(s, character); in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint16_le(s, len_bmpdata); in_uint8p(s, bmpdata, len_bmpdata); rv = mod->server_add_char(mod, font, character, x, y, cx, cy, bmpdata); return rv; } /******************************************************************************/ /* return error */ static int process_server_add_char_alpha(struct mod *mod, struct stream *s) { int rv; int font; int character; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; in_uint16_le(s, font); in_uint16_le(s, character); in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint16_le(s, len_bmpdata); in_uint8p(s, bmpdata, len_bmpdata); rv = mod->server_add_char_alpha(mod, font, character, x, y, cx, cy, bmpdata); return rv; } /******************************************************************************/ /* return error */ static int process_server_draw_text(struct mod *mod, struct stream *s) { int rv; int font; int flags; int mixmode; int clip_left; int clip_top; int clip_right; int clip_bottom; int box_left; int box_top; int box_right; int box_bottom; int x; int y; int len_bmpdata; char *bmpdata; in_uint16_le(s, font); in_uint16_le(s, flags); in_uint16_le(s, mixmode); in_sint16_le(s, clip_left); in_sint16_le(s, clip_top); in_sint16_le(s, clip_right); in_sint16_le(s, clip_bottom); in_sint16_le(s, box_left); in_sint16_le(s, box_top); in_sint16_le(s, box_right); in_sint16_le(s, box_bottom); in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, len_bmpdata); in_uint8p(s, bmpdata, len_bmpdata); rv = mod->server_draw_text(mod, font, flags, mixmode, clip_left, clip_top, clip_right, clip_bottom, box_left, box_top, box_right, box_bottom, x, y, bmpdata, len_bmpdata); return rv; } /******************************************************************************/ /* return error */ static int process_server_create_os_surface_bpp(struct mod *mod, struct stream *s) { int rv; int rdpid; int width; int height; int bpp; in_uint32_le(s, rdpid); in_uint16_le(s, width); in_uint16_le(s, height); in_uint8(s, bpp); rv = mod->server_create_os_surface_bpp(mod, rdpid, width, height, bpp); return rv; } /******************************************************************************/ /* return error */ static int process_server_paint_rect_bpp(struct mod *mod, struct stream *s) { int rv; int x; int y; int cx; int cy; int len_bmpdata; char *bmpdata; int width; int height; int srcx; int srcy; int bpp; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint32_le(s, len_bmpdata); in_uint8p(s, bmpdata, len_bmpdata); in_uint16_le(s, width); in_uint16_le(s, height); in_sint16_le(s, srcx); in_sint16_le(s, srcy); in_uint8(s, bpp); rv = mod->server_paint_rect_bpp(mod, x, y, cx, cy, bmpdata, width, height, srcx, srcy, bpp); return rv; } /******************************************************************************/ /* return error */ static int process_server_composite(struct mod *mod, struct stream *s) { int rv; int srcidx; int srcformat; int srcwidth; int srcrepeat; int transform[10]; int mskflags; int mskidx; int mskformat; int mskwidth; int mskrepeat; int op; int srcx; int srcy; int mskx; int msky; int dstx; int dsty; int width; int height; int dstformat; in_uint16_le(s, srcidx); in_uint32_le(s, srcformat); in_uint16_le(s, srcwidth); in_uint8(s, srcrepeat); g_memcpy(transform, s->p, 40); in_uint8s(s, 40); in_uint8(s, mskflags); in_uint16_le(s, mskidx); in_uint32_le(s, mskformat); in_uint16_le(s, mskwidth); in_uint8(s, mskrepeat); in_uint8(s, op); in_sint16_le(s, srcx); in_sint16_le(s, srcy); in_sint16_le(s, mskx); in_sint16_le(s, msky); in_sint16_le(s, dstx); in_sint16_le(s, dsty); in_uint16_le(s, width); in_uint16_le(s, height); in_uint32_le(s, dstformat); rv = mod->server_composite(mod, srcidx, srcformat, srcwidth, srcrepeat, transform, mskflags, mskidx, mskformat, mskwidth, mskrepeat, op, srcx, srcy, mskx, msky, dstx, dsty, width, height, dstformat); return rv; } /******************************************************************************/ /* return error */ static int process_server_set_pointer_ex(struct mod *mod, struct stream *s) { int rv; int x; int y; int bpp; int Bpp; char cur_data[32 * (32 * 4)]; char cur_mask[32 * (32 / 8)]; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, bpp); Bpp = (bpp == 0) ? 3 : (bpp + 7) / 8; in_uint8a(s, cur_data, 32 * (32 * Bpp)); in_uint8a(s, cur_mask, 32 * (32 / 8)); rv = mod->server_set_cursor_ex(mod, x, y, cur_data, cur_mask, bpp); return rv; } /******************************************************************************/ /* return error */ static int send_paint_rect_ack(struct mod *mod, int flags, int x, int y, int cx, int cy, int frame_id) { int len; struct stream *s; make_stream(s); init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 105); out_uint32_le(s, flags); out_uint32_le(s, frame_id); out_uint32_le(s, x); out_uint32_le(s, y); out_uint32_le(s, cx); out_uint32_le(s, cy); s_mark_end(s); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); lib_send_copy(mod, s); free_stream(s); return 0; } /******************************************************************************/ /* return error */ static int process_server_paint_rect_shmem(struct mod *amod, struct stream *s) { int rv; int x; int y; int cx; int cy; int flags; int frame_id; int shmem_id; int shmem_offset; int width; int height; int srcx; int srcy; char *bmpdata; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, cx); in_uint16_le(s, cy); in_uint32_le(s, flags); in_uint32_le(s, frame_id); in_uint32_le(s, shmem_id); in_uint32_le(s, shmem_offset); in_uint16_le(s, width); in_uint16_le(s, height); in_sint16_le(s, srcx); in_sint16_le(s, srcy); bmpdata = 0; rv = 0; if (amod->screen_shmem_id_mapped == 0) { amod->screen_shmem_id = shmem_id; amod->screen_shmem_pixels = (char *) g_shmat(amod->screen_shmem_id); if (amod->screen_shmem_pixels == (void *) -1) { /* failed */ amod->screen_shmem_id = 0; amod->screen_shmem_pixels = 0; amod->screen_shmem_id_mapped = 0; } else { amod->screen_shmem_id_mapped = 1; } } else if (amod->screen_shmem_id != shmem_id) { amod->screen_shmem_id = shmem_id; g_shmdt(amod->screen_shmem_pixels); amod->screen_shmem_pixels = (char *) g_shmat(amod->screen_shmem_id); if (amod->screen_shmem_pixels == (void *) -1) { /* failed */ amod->screen_shmem_id = 0; amod->screen_shmem_pixels = 0; amod->screen_shmem_id_mapped = 0; } } if (amod->screen_shmem_pixels != 0) { bmpdata = amod->screen_shmem_pixels + shmem_offset; } if (bmpdata != 0) { rv = amod->server_paint_rect(amod, x, y, cx, cy, bmpdata, width, height, srcx, srcy); } send_paint_rect_ack(amod, flags, x, y, cx, cy, frame_id); return rv; } /******************************************************************************/ /* return error */ static int send_paint_rect_ex_ack(struct mod *mod, int flags, int frame_id) { int len; struct stream *s; make_stream(s); init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 106); out_uint32_le(s, flags); out_uint32_le(s, frame_id); s_mark_end(s); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); lib_send_copy(mod, s); free_stream(s); return 0; } /******************************************************************************/ /* return error */ static int send_suppress_output(struct mod *mod, int suppress, int left, int top, int right, int bottom) { int len; struct stream *s; make_stream(s); init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 108); out_uint32_le(s, suppress); out_uint32_le(s, left); out_uint32_le(s, top); out_uint32_le(s, right); out_uint32_le(s, bottom); s_mark_end(s); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); lib_send_copy(mod, s); free_stream(s); return 0; } /******************************************************************************/ /* return error */ static int process_server_paint_rect_shmem_ex(struct mod *amod, struct stream *s) { LOG(LOG_LEVEL_TRACE, "process_server_paint_rect_shmem_ex:"); int num_drects; int num_crects; int flags; int frame_id; int shmem_id; int shmem_offset; int width; int height; int index; int rv; tsi16 *ldrects; tsi16 *ldrects1; tsi16 *lcrects; tsi16 *lcrects1; char *bmpdata; /* dirty pixels */ in_uint16_le(s, num_drects); ldrects = (tsi16 *) g_malloc(2 * 4 * num_drects, 0); ldrects1 = ldrects; for (index = 0; index < num_drects; index++) { in_sint16_le(s, ldrects1[0]); in_sint16_le(s, ldrects1[1]); in_sint16_le(s, ldrects1[2]); in_sint16_le(s, ldrects1[3]); ldrects1 += 4; } /* copied pixels */ in_uint16_le(s, num_crects); lcrects = (tsi16 *) g_malloc(2 * 4 * num_crects, 0); lcrects1 = lcrects; for (index = 0; index < num_crects; index++) { in_sint16_le(s, lcrects1[0]); in_sint16_le(s, lcrects1[1]); in_sint16_le(s, lcrects1[2]); in_sint16_le(s, lcrects1[3]); lcrects1 += 4; } in_uint32_le(s, flags); in_uint32_le(s, frame_id); in_uint32_le(s, shmem_id); in_uint32_le(s, shmem_offset); in_uint16_le(s, width); in_uint16_le(s, height); bmpdata = 0; if (amod->screen_shmem_id_mapped == 0) { amod->screen_shmem_id = shmem_id; amod->screen_shmem_pixels = (char *) g_shmat(amod->screen_shmem_id); if (amod->screen_shmem_pixels == (void *) -1) { /* failed */ amod->screen_shmem_id = 0; amod->screen_shmem_pixels = 0; amod->screen_shmem_id_mapped = 0; } else { amod->screen_shmem_id_mapped = 1; } } else if (amod->screen_shmem_id != shmem_id) { amod->screen_shmem_id = shmem_id; g_shmdt(amod->screen_shmem_pixels); amod->screen_shmem_pixels = (char *) g_shmat(amod->screen_shmem_id); if (amod->screen_shmem_pixels == (void *) -1) { /* failed */ amod->screen_shmem_id = 0; amod->screen_shmem_pixels = 0; amod->screen_shmem_id_mapped = 0; } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "process_server_paint_rect_shmem_ex:" " flags=%d frame_id=%d, shmem_id=%d, shmem_offset=%d," " width=%d, height=%d", flags, frame_id, shmem_id, shmem_offset, width, height); } if (amod->screen_shmem_pixels != 0) { bmpdata = amod->screen_shmem_pixels + shmem_offset; } if (bmpdata != 0) { rv = amod->server_paint_rects(amod, num_drects, ldrects, num_crects, lcrects, bmpdata, width, height, flags, frame_id); } else { rv = 1; } g_free(lcrects); g_free(ldrects); return rv; } /******************************************************************************/ /* return error */ int process_server_egfx_shmfd(struct mod *amod, struct stream *s) { char *data; char *cmd; int rv; int cmd_bytes; int shmem_bytes; int fd; int recv_bytes; unsigned int num_fds; void *shmem_ptr; char msg[4]; rv = 0; in_uint32_le(s, cmd_bytes); in_uint8p(s, cmd, cmd_bytes); in_uint32_le(s, shmem_bytes); if (shmem_bytes == 0) { return amod->server_egfx_cmd(amod, cmd, cmd_bytes, NULL, 0); } fd = -1; num_fds = -1; if (g_tcp_can_recv(amod->trans->sck, 5000) == 0) { return 1; } recv_bytes = g_sck_recv_fd_set(amod->trans->sck, msg, 4, &fd, 1, &num_fds); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_server_egfx_shmfd: " "g_sck_recv_fd_set rv %d fd %d", recv_bytes, fd); if (recv_bytes == 4) { if (num_fds == 1) { if (g_file_map(fd, 1, 0, shmem_bytes, &shmem_ptr) == 0) { /* we give up ownership of shmem_ptr will get cleaned up in server_egfx_cmd or xrdp_mm_process_enc_done(gfx) */ data = (char *) shmem_ptr; rv = amod->server_egfx_cmd(amod, cmd, cmd_bytes, data, shmem_bytes); } g_file_close(fd); } } return rv; } /******************************************************************************/ /* return error */ static int process_server_set_pointer_shmfd(struct mod *amod, struct stream *s) { int rv; int x; int y; int bpp; int Bpp; int width; int height; int fd; int recv_bytes; int shmembytes; unsigned int num_fds; void *shmemptr; char *cur_data; char *cur_mask; char msg[4]; rv = 0; in_sint16_le(s, x); in_sint16_le(s, y); in_uint16_le(s, bpp); in_uint16_le(s, width); in_uint16_le(s, height); fd = -1; num_fds = -1; if (g_tcp_can_recv(amod->trans->sck, 5000) == 0) { return 1; } recv_bytes = g_sck_recv_fd_set(amod->trans->sck, msg, 4, &fd, 1, &num_fds); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_server_set_pointer_shmfd: " "g_sck_recv_fd_set rv %d fd %d", recv_bytes, fd); if (recv_bytes == 4) { if (num_fds == 1) { Bpp = (bpp == 0) ? 3 : (bpp + 7) / 8; shmembytes = width * height * Bpp + width * height / 8; if (g_file_map(fd, 1, 0, shmembytes, &shmemptr) == 0) { cur_data = (char *)shmemptr; cur_mask = cur_data + width * height * Bpp; rv = amod->server_set_pointer_large(amod, x, y, cur_data, cur_mask, bpp, width, height); g_munmap(shmemptr, shmembytes); } g_file_close(fd); } } return rv; } /******************************************************************************/ /* return error */ static int process_server_paint_rect_shmfd(struct mod *amod, struct stream *s) { int num_drects; int num_crects; int flags; int frame_id; int shmem_bytes; int shmem_offset; int left; int top; int width; int height; int index; int rv; int16_t *ldrects; int16_t *ldrects1; int16_t *lcrects; int16_t *lcrects1; char *bmpdata; int fd; int recv_bytes; unsigned int num_fds; void *shmem_ptr; char msg[4]; /* dirty pixels */ in_uint16_le(s, num_drects); ldrects = g_new(int16_t, 2 * 4 * num_drects); ldrects1 = ldrects; for (index = 0; index < num_drects; index++) { in_sint16_le(s, ldrects1[0]); in_sint16_le(s, ldrects1[1]); in_sint16_le(s, ldrects1[2]); in_sint16_le(s, ldrects1[3]); ldrects1 += 4; } /* copied pixels */ in_uint16_le(s, num_crects); lcrects = g_new(int16_t, 2 * 4 * num_crects); lcrects1 = lcrects; for (index = 0; index < num_crects; index++) { in_sint16_le(s, lcrects1[0]); in_sint16_le(s, lcrects1[1]); in_sint16_le(s, lcrects1[2]); in_sint16_le(s, lcrects1[3]); lcrects1 += 4; } in_uint32_le(s, flags); in_uint32_le(s, frame_id); in_uint32_le(s, shmem_bytes); in_uint32_le(s, shmem_offset); in_uint16_le(s, left); in_uint16_le(s, top); in_uint16_le(s, width); in_uint16_le(s, height); if (g_tcp_can_recv(amod->trans->sck, 5000) == 0) { g_free(ldrects); g_free(lcrects); return 1; } rv = 1; recv_bytes = g_sck_recv_fd_set(amod->trans->sck, msg, 4, &fd, 1, &num_fds); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_server_paint_rect_shmfd: " "g_sck_recv_fd_set rv %d fd %d", recv_bytes, fd); if (recv_bytes == 4) { if (num_fds == 1) { if (g_file_map(fd, 1, 0, shmem_bytes, &shmem_ptr) == 0) { bmpdata = (char *)shmem_ptr; bmpdata += shmem_offset; /* we give up ownership of shmem_ptr will get cleaned up in server_paint_rects_ex or xrdp_mm_process_enc_done(rfx, gfx) */ rv = amod->server_paint_rects_ex(amod, num_drects, ldrects, num_crects, lcrects, bmpdata, left, top, width, height, flags, frame_id, shmem_ptr, shmem_bytes); } g_file_close(fd); } } g_free(ldrects); g_free(lcrects); return rv; } /******************************************************************************/ /* return error */ static int send_server_version_message(struct mod *mod, struct stream *s) { /* send version message */ init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 103); out_uint32_le(s, 301); out_uint32_le(s, 0); out_uint32_le(s, 0); out_uint32_le(s, 0); out_uint32_le(s, 1); s_mark_end(s); int len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); int rv = lib_send_copy(mod, s); return rv; } /******************************************************************************/ /* return error */ static int send_server_monitor_update(struct mod *mod, struct stream *s, int width, int height, int num_monitors, const struct monitor_info *monitors) { /* send monitor update message */ init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 103); out_uint32_le(s, 302); out_uint32_le(s, width); out_uint32_le(s, height); out_uint32_le(s, num_monitors); out_uint32_le(s, 0); out_uint8a(s, monitors, sizeof(monitors[0]) * num_monitors); s_mark_end(s); int len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); int rv = lib_send_copy(mod, s); LOG_DEVEL(LOG_LEVEL_DEBUG, "send_server_monitor_update:" " sent monitor updsate message with following properties to" " xorgxrdp backend width=%d, height=%d, num=%d, return value=%d", width, height, num_monitors, rv); return rv; } static int send_server_monitor_full_invalidate( struct mod *mod, struct stream *s, int width, int height) { /* send invalidate message */ init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 103); out_uint32_le(s, 200); /* x and y */ int i = 0; out_uint32_le(s, i); /* width and height */ i = ((width & 0xffff) << 16) | height; out_uint32_le(s, i); out_uint32_le(s, 0); out_uint32_le(s, 0); s_mark_end(s); int len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); int rv = lib_send_copy(mod, s); LOG_DEVEL(LOG_LEVEL_DEBUG, "send_server_monitor_full_invalidate:" " sent invalidate message with following" " properties to xorgxrdp backend" " width=%d, height=%d, return value=%d", width, height, rv); return rv; } /******************************************************************************/ /* return error */ static int lib_send_server_version_message(struct mod *mod) { /* send server version message */ struct stream *s; make_stream(s); int rv = send_server_version_message(mod, s); free_stream(s); return rv; } /******************************************************************************/ /* return error */ static int lib_send_server_monitor_resize(struct mod *mod, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress) { struct stream *s; make_stream(s); int rv = send_server_monitor_update(mod, s, width, height, num_monitors, monitors); *in_progress = (rv == 0); free_stream(s); return rv; } /******************************************************************************/ /* return error */ static int lib_send_server_monitor_full_invalidate(struct mod *mod, int width, int height) { /* send invalidate message */ struct stream *s; make_stream(s); int rv = send_server_monitor_full_invalidate(mod, s, width, height); free_stream(s); return rv; } /******************************************************************************/ /* return error */ static int lib_mod_process_orders(struct mod *mod, int type, struct stream *s) { int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "lib_mod_process_orders: type %d", type); rv = 0; switch (type) { case 1: /* server_begin_update */ rv = mod->server_begin_update(mod); break; case 2: /* server_end_update */ rv = mod->server_end_update(mod); break; case 3: /* server_fill_rect */ rv = process_server_fill_rect(mod, s); break; case 4: /* server_screen_blt */ rv = process_server_screen_blt(mod, s); break; case 5: /* server_paint_rect */ rv = process_server_paint_rect(mod, s); break; case 10: /* server_set_clip */ rv = process_server_set_clip(mod, s); break; case 11: /* server_reset_clip */ rv = process_server_reset_clip(mod, s); break; case 12: /* server_set_fgcolor */ rv = process_server_set_fgcolor(mod, s); break; case 13: /* server_set_bgcolor */ rv = process_server_set_bgcolor(mod, s); break; case 14: /* server_set_opcode */ rv = process_server_set_opcode(mod, s); break; case 17: /* server_set_pen */ rv = process_server_set_pen(mod, s); break; case 18: /* server_draw_line */ rv = process_server_draw_line(mod, s); break; case 19: /* server_set_cursor */ rv = process_server_set_cursor(mod, s); break; case 20: /* server_create_os_surface */ rv = process_server_create_os_surface(mod, s); break; case 21: /* server_switch_os_surface */ rv = process_server_switch_os_surface(mod, s); break; case 22: /* server_delete_os_surface */ rv = process_server_delete_os_surface(mod, s); break; case 23: /* server_paint_rect_os */ rv = process_server_paint_rect_os(mod, s); break; case 24: /* server_set_hints */ rv = process_server_set_hints(mod, s); break; case 25: /* server_window_new_update */ rv = process_server_window_new_update(mod, s); break; case 26: /* server_window_delete */ rv = process_server_window_delete(mod, s); break; case 27: /* server_window_new_update - show */ rv = process_server_window_show(mod, s); break; case 28: /* server_add_char */ rv = process_server_add_char(mod, s); break; case 29: /* server_add_char_alpha */ rv = process_server_add_char_alpha(mod, s); break; case 30: /* server_draw_text */ rv = process_server_draw_text(mod, s); break; case 31: /* server_create_os_surface_bpp */ rv = process_server_create_os_surface_bpp(mod, s); break; case 32: /* server_paint_rect_bpp */ rv = process_server_paint_rect_bpp(mod, s); break; case 33: /* server_composite */ rv = process_server_composite(mod, s); break; case 51: /* server_set_pointer_ex */ rv = process_server_set_pointer_ex(mod, s); break; case 60: /* server_paint_rect_shmem */ rv = process_server_paint_rect_shmem(mod, s); break; case 61: /* server_paint_rect_shmem_ex */ rv = process_server_paint_rect_shmem_ex(mod, s); break; case 62: rv = process_server_egfx_shmfd(mod, s); break; case 63: /* server_set_pointer_shmfd */ rv = process_server_set_pointer_shmfd(mod, s); break; case 64: /* server_paint_rect_shmfd */ rv = process_server_paint_rect_shmfd(mod, s); break; default: LOG_DEVEL(LOG_LEVEL_WARNING, "lib_mod_process_orders: unknown order type %d", type); rv = 0; break; } return rv; } /******************************************************************************/ /* return error */ static int lib_send_client_info(struct mod *mod) { struct stream *s; int len; LOG_DEVEL(LOG_LEVEL_TRACE, "lib_send_client_info:"); make_stream(s); init_stream(s, 8192); s_push_layer(s, iso_hdr, 4); out_uint16_le(s, 104); g_memcpy(s->p, &(mod->client_info), sizeof(mod->client_info)); s->p += sizeof(mod->client_info); s_mark_end(s); len = (int)(s->end - s->data); s_pop_layer(s, iso_hdr); out_uint32_le(s, len); lib_send_copy(mod, s); free_stream(s); return 0; } /******************************************************************************/ /* return error */ static int lib_mod_process_message(struct mod *mod, struct stream *s) { int num_orders; int index; int rv; int len; int type; char *phold; int width; int height; LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_process_message:"); in_uint16_le(s, type); in_uint16_le(s, num_orders); in_uint32_le(s, len); LOG_DEVEL(LOG_LEVEL_DEBUG, "lib_mod_process_message: type %d", type); rv = 0; if (type == 1) /* original order list */ { for (index = 0; index < num_orders; ++index) { in_uint16_le(s, type); rv = lib_mod_process_orders(mod, type, s); if (rv != 0) { break; } } } else if (type == 2) /* caps */ { LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_process_message: type 2 len %d", len); for (index = 0; index < num_orders; index++) { phold = s->p; in_uint16_le(s, type); in_uint16_le(s, len); switch (type) { default: LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_process_message: unknown" " cap type %d len %d", type, len); break; } s->p = phold + len; } lib_send_client_info(mod); } else if (type == 3) /* order list with len after type */ { LOG_DEVEL(LOG_LEVEL_INFO, "lib_mod_process_message: type 3 len %d", len); for (index = 0; index < num_orders; index++) { phold = s->p; in_uint16_le(s, type); in_uint16_le(s, len); rv = lib_mod_process_orders(mod, type, s); if (rv != 0) { break; } s->p = phold + len; } } else if (type == 100) // metadata commands. { LOG_DEVEL(LOG_LEVEL_INFO, "lib_mod_process_message: type 100 len %d", len); for (index = 0; index < num_orders; ++index) { phold = s->p; in_uint16_le(s, type); in_uint16_le(s, len); switch (type) { case 3: // memory allocation complete in_uint16_le(s, width); in_uint16_le(s, height); LOG(LOG_LEVEL_INFO, "Received memory_allocation_complete" " command. width: %d, height: %d", width, height); rv = mod->server_monitor_resize_done(mod); break; } s->p = phold + len; } } else { LOG_DEVEL(LOG_LEVEL_TRACE, "unknown type %d", type); } return rv; } /******************************************************************************/ /* return error */ int lib_mod_signal(struct mod *mod) { // no-op return 0; } /******************************************************************************/ /* return error */ int lib_mod_end(struct mod *mod) { if (mod->screen_shmem_pixels != 0) { g_shmdt(mod->screen_shmem_pixels); mod->screen_shmem_pixels = 0; } return 0; } /******************************************************************************/ /* return error */ int lib_mod_set_param(struct mod *mod, const char *name, const char *value) { if (g_strcasecmp(name, "username") == 0) { g_strncpy(mod->username, value, INFO_CLIENT_MAX_CB_LEN - 1); } else if (g_strcasecmp(name, "password") == 0) { g_strncpy(mod->password, value, INFO_CLIENT_MAX_CB_LEN - 1); } else if (g_strcasecmp(name, "ip") == 0) { g_strncpy(mod->ip, value, 255); } else if (g_strcasecmp(name, "port") == 0) { g_strncpy(mod->port, value, 255); } else if (g_strcasecmp(name, "client_info") == 0) { g_memcpy(&(mod->client_info), value, sizeof(mod->client_info)); } return 0; } /******************************************************************************/ /* return error */ int lib_mod_get_wait_objs(struct mod *mod, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout) { if (mod != 0) { if (mod->trans != 0) { trans_get_wait_objs_rw(mod->trans, read_objs, rcount, write_objs, wcount, timeout); } } return 0; } /******************************************************************************/ /* return error */ int lib_mod_check_wait_objs(struct mod *mod) { int rv; rv = 0; if (mod != 0) { if (mod->trans != 0) { rv = trans_check_wait_objs(mod->trans); if (rv != 0) { LOG(LOG_LEVEL_ERROR, "Xorg server closed connection"); } } } return rv; } /******************************************************************************/ /* return error */ int lib_mod_frame_ack(struct mod *amod, int flags, int frame_id) { LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_frame_ack: flags 0x%8.8x frame_id %d", flags, frame_id); send_paint_rect_ex_ack(amod, flags, frame_id); return 0; } /******************************************************************************/ /* return error */ int lib_mod_suppress_output(struct mod *amod, int suppress, int left, int top, int right, int bottom) { LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_suppress_output: suppress 0x%8.8x left %d top %d " "right %d bottom %d", suppress, left, top, right, bottom); send_suppress_output(amod, suppress, left, top, right, bottom); return 0; } /******************************************************************************/ tintptr EXPORT_CC mod_init(void) { struct mod *mod; mod = (struct mod *)g_malloc(sizeof(struct mod), 1); mod->size = sizeof(struct mod); mod->version = CURRENT_MOD_VER; mod->handle = (tintptr) mod; mod->mod_connect = lib_mod_connect; mod->mod_start = lib_mod_start; mod->mod_event = lib_mod_event; mod->mod_signal = lib_mod_signal; mod->mod_end = lib_mod_end; mod->mod_set_param = lib_mod_set_param; mod->mod_get_wait_objs = lib_mod_get_wait_objs; mod->mod_check_wait_objs = lib_mod_check_wait_objs; mod->mod_frame_ack = lib_mod_frame_ack; mod->mod_suppress_output = lib_mod_suppress_output; mod->mod_server_monitor_resize = lib_send_server_monitor_resize; mod->mod_server_monitor_full_invalidate = lib_send_server_monitor_full_invalidate; mod->mod_server_version_message = lib_send_server_version_message; return (tintptr) mod; } /******************************************************************************/ int EXPORT_CC mod_exit(tintptr handle) { struct mod *mod = (struct mod *) handle; if (mod == 0) { return 0; } trans_delete(mod->trans); g_free(mod); return 0; } xrdp-0.10.1/vnc/vnc_clip.h000644 001751 000000 00000003170 14652432047 015372 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libvnc - functions used by the VNC clipboard feature */ #ifndef VNC_CLIP_H #define VNC_CLIP_H struct vnc; struct stream; /** * Init the clip module private data structures */ void vnc_clip_init(struct vnc *v); /** * Deallocate the clip module private data structures */ void vnc_clip_exit(struct vnc *v); /** * Process incoming data from the RDP clip channel * @param v VNC Object * @param s Stream object containing data * * @return Non-zero if error occurs */ int vnc_clip_process_channel_data(struct vnc *v, char *data, int size, int total_size, int flags); /** * Process incoming RFB protocol clipboard data * @param v VNC Object * * @return Non-zero if error occurs */ int vnc_clip_process_rfb_data(struct vnc *v); /** * Open the RDP clipboard channel * * The clip channel ID is written to the VNC object * * * @param v VNC Object * @return Non-zero if error occurs */ int vnc_clip_open_clip_channel(struct vnc *v); #endif /* VNC_CLIP_H */ xrdp-0.10.1/vnc/rfb.h000644 001751 000000 00000003525 14652432047 014352 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libvnc - defines related to the RFB protocol */ #ifndef RFB_H #define RFB_H #include "arch.h" /* Client-to-server messages */ enum c2s { RFB_C2S_SET_PIXEL_FORMAT = 0, RFB_C2S_SET_ENCODINGS = 2, RFB_C2S_FRAMEBUFFER_UPDATE_REQUEST = 3, RFB_C2S_KEY_EVENT = 4, RFB_C2S_POINTER_EVENT = 5, RFB_C2S_CLIENT_CUT_TEXT = 6, }; /* Server to client messages */ enum s2c { RFB_S2C_FRAMEBUFFER_UPDATE = 0, RFB_S2C_SET_COLOUR_MAP_ENTRIES = 1, RFB_S2C_BELL = 2, RFB_S2C_SERVER_CUT_TEXT = 3 }; /* Encodings and pseudo-encodings * * The RFC uses a signed type for these. We use an unsigned type as the * binary representation for the negative values is standardised in C * (which it wouldn't be for an enum value) */ typedef uint32_t encoding_type; #define RFB_ENC_RAW (encoding_type)0 #define RFB_ENC_COPY_RECT (encoding_type)1 #define RFB_ENC_CURSOR (encoding_type)-239 #define RFB_ENC_DESKTOP_SIZE (encoding_type)-223 #define RFB_ENC_EXTENDED_DESKTOP_SIZE (encoding_type)-308 /** * Returns an error string for an ExtendedDesktopSize status code */ const char * rfb_get_eds_status_msg(unsigned int response_code); #endif /* RFB_H */ xrdp-0.10.1/vnc/vnc.h000644 001751 000000 00000015637 14652432047 014376 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libvnc */ #ifndef VNC_H #define VNC_H /* include other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #include "guid.h" #include "ms-rdpbcgr.h" #define CURRENT_MOD_VER 4 /* Screen used for ExtendedDesktopSize / Set DesktopSize */ struct vnc_screen { int id; int x; int y; int width; int height; int flags; }; struct vnc_screen_layout { int total_width; int total_height; unsigned int count; /* For comparison, screens are sorted in x, y, width, height) order */ struct vnc_screen s[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; }; /** * Keep track of resize status at start of connection */ enum vnc_resize_status { VRS_WAITING_FOR_FIRST_UPDATE, VRS_WAITING_FOR_RESIZE_CONFIRM, VRS_DONE }; enum vnc_resize_support_status { VRSS_NOT_SUPPORTED, VRSS_SUPPORTED, VRSS_UNKNOWN }; struct source_info; /* Defined in vnc_clip.c */ struct vnc_clipboard_data; /* Defined in xrdp_client_info.h */ struct monitor_info; struct vnc { int size; /* size of this struct */ int version; /* internal version */ /* client functions */ int (*mod_start)(struct vnc *v, int w, int h, int bpp); int (*mod_connect)(struct vnc *v); int (*mod_event)(struct vnc *v, int msg, long param1, long param2, long param3, long param4); int (*mod_signal)(struct vnc *v); int (*mod_end)(struct vnc *v); int (*mod_set_param)(struct vnc *v, const char *name, const char *value); int (*mod_session_change)(struct vnc *v, int, int); int (*mod_get_wait_objs)(struct vnc *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int (*mod_check_wait_objs)(struct vnc *v); int (*mod_frame_ack)(struct vnc *v, int flags, int frame_id); int (*mod_suppress_output)(struct vnc *v, int suppress, int left, int top, int right, int bottom); int (*mod_server_monitor_resize)(struct vnc *v, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress); int (*mod_server_monitor_full_invalidate)(struct vnc *v, int width, int height); int (*mod_server_version_message)(struct vnc *v); tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod functions above */ /* server functions */ int (*server_begin_update)(struct vnc *v); int (*server_end_update)(struct vnc *v); int (*server_fill_rect)(struct vnc *v, int x, int y, int cx, int cy); int (*server_screen_blt)(struct vnc *v, int x, int y, int cx, int cy, int srcx, int srcy); int (*server_paint_rect)(struct vnc *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy); int (*server_set_cursor)(struct vnc *v, int x, int y, char *data, char *mask); int (*server_palette)(struct vnc *v, int *palette); int (*server_msg)(struct vnc *v, const char *msg, int code); int (*server_is_term)(void); int (*server_set_clip)(struct vnc *v, int x, int y, int cx, int cy); int (*server_reset_clip)(struct vnc *v); int (*server_set_fgcolor)(struct vnc *v, int fgcolor); int (*server_set_bgcolor)(struct vnc *v, int bgcolor); int (*server_set_opcode)(struct vnc *v, int opcode); int (*server_set_mixmode)(struct vnc *v, int mixmode); int (*server_set_brush)(struct vnc *v, int x_origin, int y_origin, int style, char *pattern); int (*server_set_pen)(struct vnc *v, int style, int width); int (*server_draw_line)(struct vnc *v, int x1, int y1, int x2, int y2); int (*server_add_char)(struct vnc *v, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_draw_text)(struct vnc *v, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int (*client_monitor_resize)(struct vnc *v, int width, int height, int num_monitors, const struct monitor_info *monitors); int (*server_monitor_resize_done)(struct vnc *v); int (*server_get_channel_count)(struct vnc *v); int (*server_query_channel)(struct vnc *v, int index, char *channel_name, int *channel_flags); int (*server_get_channel_id)(struct vnc *v, const char *name); int (*server_send_to_channel)(struct vnc *v, int channel_id, char *data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct vnc *v); int (*server_chansrv_in_use)(struct vnc *v); tintptr server_dumby[100 - 28]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; struct source_info *si; /* mod data */ int server_bpp; char mod_name[256]; int mod_mouse_state; int palette[256]; int vnc_desktop; char username[256]; char password[256]; char ip[256]; char port[256]; int sck_closed; int shift_state; /* 0 up, 1 down */ int keylayout; int clip_chanid; struct vnc_clipboard_data *vc; int delay_ms; struct trans *trans; struct guid guid; int suppress_output; unsigned int enabled_encodings_mask; /* Resizeable support */ int multimon_configured; struct vnc_screen_layout client_layout; struct vnc_screen_layout server_layout; enum vnc_resize_status resize_status; enum vnc_resize_support_status resize_supported; }; /* * Functions */ int lib_send_copy(struct vnc *v, struct stream *s); int skip_trans_bytes(struct trans *trans, unsigned int bytes); #endif /* VNC_H */ xrdp-0.10.1/vnc/Makefile.am000644 001751 000000 00000000706 14652432047 015462 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libvnc.la libvnc_la_SOURCES = \ vnc.c \ vnc_clip.c \ rfb.c \ vnc.h \ vnc_clip.h \ rfb.h libvnc_la_LIBADD = \ $(top_builddir)/common/libcommon.la if !MACOS libvnc_la_LDFLAGS = -avoid-version -module endif xrdp-0.10.1/vnc/vnc_clip.c000644 001751 000000 00000102060 14652432047 015363 0ustar00metawheel000000 000000 /* startup_complete is only ever set if we're using the VNC clip facility *//** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libvnc * * The message definitions used in this source file can be found mostly * in RFC6143 - "The Remote Framebuffer Protocol". * * The clipboard messages from the RDP client side are mostly * described in [MS-RDPECLIP] */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "vnc.h" #include "vnc_clip.h" #include "string_calls.h" #include "ssl_calls.h" #include "rfb.h" #include "log.h" #include "trans.h" #include "ms-rdpbcgr.h" #include "ms-rdpeclip.h" #include "xrdp_constants.h" /** * The formats we advertise as supported to the RDP client */ static const int g_supported_formats[] = { CF_UNICODETEXT, CF_LOCALE, CF_TEXT, /* Don't advertise CF_OEMTEXT - anything other than ASCII will be broken */ /* CF_OEMTEXT, */ 0 }; /** * Data private to the VNC clipboard * * Note that this doesn't include the clip channel ID, as vnc.c needs * this to redirect virtual channel PDUs to this module */ struct vnc_clipboard_data { struct stream *rfb_clip_s; int requested_clip_format; /* Last requested text format */ int active_data_requests; /* Number of outstanding FORMAT_DATA_REQUESTs */ struct stream *dechunker_s; /* Dechunker for the RDP clip channel */ int capability_version; /* Clipboard virt channel extension version */ int capability_flags; /* Channel capability flags */ bool_t startup_complete; /* is the startup sequence done (1.3.2.1) */ }; /** * Summarise a stream contents in a way which allows two streams to * be easily compared */ struct stream_characteristics { char digest[16]; int length; }; #ifdef USE_DEVEL_LOGGING /***************************************************************************//** * Convert a CF_ constant to text * * @param CF_xxx constant * @param buff Scratchpad for storing a temporary string in * @param bufflen Length of the above * * @return string representation */ static const char * cf2text(int cf, char *buff, int bufflen) { const char *result; switch (cf) { case CF_UNICODETEXT: result = "CF_UNICODETEXT"; break; case CF_LOCALE: result = "CF_LOCALE"; break; case CF_TEXT: result = "CF_TEXT"; break; case CF_OEMTEXT: result = "CF_OEMTEXT"; break; default: g_snprintf(buff, bufflen, "CF_<0x%08x>", cf); result = buff; }; return result; } #endif /* USE_DEVEL_LOGGING */ /***************************************************************************//** * Adds a CLIPRDR_HEADER ([MS-RDPECLIP] 2.2.1) to the data stream * * The location of the length is stored in the unused 'channel_hdr' field * of the data stream. When send_stream_to_clip_channel() is called, * we can use update the data length. * * @param s Output stream * @param msg_type Message Type * @param msg_flags Message flags */ static void out_cliprdr_header(struct stream *s, int msg_type, int msg_flags) { out_uint16_le(s, msg_type); out_uint16_le(s, msg_flags); /* Save the datalen location so we can update it later */ s_push_layer(s, channel_hdr, 4); } /***************************************************************************//** * Sends the contents of a stream buffer to the clipboard channel * * Stream contents are chunked appropriately if they are too big to * fit in a single PDU * * The stream object cliprdr datalen header field is updated by this call. * * @param v VNC object * @param s stream buffer * * @pre stream buffer must have been initialised with a call to * out_cliprdr_header() * @pre Stream is terminated with s_mark_end() */ static int send_stream_to_clip_channel(struct vnc *v, struct stream *s) { int rv = 0; int datalen = 0; /* cliprdr PDU datalen field */ int pos = 0; int pdu_len = 0; /* Length of channel PDU */ int total_data_len = (int)(s->end - s->data); int flags; int msg_type; int msg_flags; /* Use the pointer saved by out_cliprdr_header() to * write the cliprdr PDU length */ s_pop_layer(s, channel_hdr); datalen = (int)(s->end - s->p) - 4; out_uint32_le(s, datalen); /* Read the other fields of the cliprdr header for logging */ s->p = s->data; in_uint16_le(s, msg_type); in_uint16_le(s, msg_flags); LOG(LOG_LEVEL_DEBUG, "Sending cliprdr PDU type:%s flags:%d datalen:%d", CB_PDUTYPE_TO_STR(msg_type), msg_flags, datalen); for ( ; rv == 0 && pos < total_data_len ; pos += pdu_len) { pdu_len = MIN(CHANNEL_CHUNK_LENGTH, (total_data_len - pos)); /* Determine chunking flags for this PDU (MS-RDPBCGR 3.1.5.2.1) */ if (pos == 0) { if ((pos + pdu_len) == total_data_len) { /* Only one chunk */ flags = (XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_LAST); } else { /* First chunk of several */ flags = (XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_SHOW_PROTOCOL); } } else if ((pos + pdu_len) == total_data_len) { /* Last chunk of several */ flags = (XR_CHANNEL_FLAG_LAST | XR_CHANNEL_FLAG_SHOW_PROTOCOL); } else { /* Intermediate chunk of several */ flags = XR_CHANNEL_FLAG_SHOW_PROTOCOL; } rv = v->server_send_to_channel(v, v->clip_chanid, s->data + pos, pdu_len, total_data_len, flags); } return rv; } /***************************************************************************//** * Counts the occurrences of a character in a stream * @param s stream * @param c character * @return occurrence count */ static int char_count_in(const struct stream *s, char c) { int rv = 0; const char *p = s->data; const char *end = s->end; while ((p = g_strnchr(p, c, end - p)) != NULL) { ++rv; ++p; /* Skip counted character */ } return rv; } /***************************************************************************//** * Searches a Format List PDU for a preferred text format * * On entry, the stream contains a formatListData object * * @param v VNC module * @param msg_flags clipHeader msgFlags field * @params s formatListData object. * @return Preferred text format, or 0 if not found */ static int find_preferred_text_format(struct vnc *v, int msg_flags, struct stream *s) { int seen_cf_unicodetext = 0; int seen_cf_text = 0; int format_id; #ifdef USE_DEVEL_LOGGING char scratch[64]; #endif while (s_check_rem(s, 4)) { in_uint32_le(s, format_id); if ((v->vc->capability_flags & CB_USE_LONG_FORMAT_NAMES) == 0) { /* Short format name */ int skip = MIN(s_rem(s), 32); in_uint8s(s, skip); } else { /* Skip a wsz string */ int wc = 1; while (s_check_rem(s, 2) && wc != 0) { in_uint16_le(s, wc); } } LOG_DEVEL(LOG_LEVEL_INFO, "VNC: Format id %s available" " from RDP client", cf2text(format_id, scratch, sizeof(scratch))); switch (format_id) { case CF_UNICODETEXT: seen_cf_unicodetext = 1; break; case CF_TEXT: seen_cf_text = 1; break; } } /* Prefer Unicode (UTF-16), as it's most easily converted to * the ISO-8859-1 supported by the VNC clipboard */ return (seen_cf_unicodetext != 0 ? CF_UNICODETEXT : seen_cf_text != 0 ? CF_TEXT : /* Default */ 0); } /******************************************************************************/ static int handle_cb_format_list(struct vnc *v, int msg_flags, struct stream *s) { struct stream *out_s; int format; int rv = 0; #ifdef USE_DEVEL_LOGGING char scratch[64]; #endif /* This is the last stage of the startup sequence in MS-RDPECLIP 1.3.2.1, * although it does occur at other times */ v->vc->startup_complete = 1; make_stream(out_s); /* Reply to the caller */ init_stream(out_s, 64); out_cliprdr_header(out_s, CB_FORMAT_LIST_RESPONSE, CB_RESPONSE_OK); s_mark_end(out_s); send_stream_to_clip_channel(v, out_s); /* Send a CB_DATA_REQUEST message to the cliprdr channel, * if a suitable text format is available */ if ((format = find_preferred_text_format(v, msg_flags, s)) != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "Asking RDP client for clip data format=%s", cf2text(format, scratch, sizeof(scratch))); v->vc->requested_clip_format = format; ++v->vc->active_data_requests; init_stream(out_s, 64); out_cliprdr_header(out_s, CB_FORMAT_DATA_REQUEST, 0); out_uint32_le(out_s, format); s_mark_end(out_s); send_stream_to_clip_channel(v, out_s); } free_stream(out_s); return rv; } /***************************************************************************//** * Computes the characteristics of a stream. * * This can be used to tell if a stream has changed or two streams are * the same * * @param s Stream * @param[out] chars Resulting characteristics of stream */ static void compute_stream_characteristics(const struct stream *s, struct stream_characteristics *chars) { void *info = ssl_md5_info_create(); ssl_md5_clear(info); if (s->data != NULL && s->end != NULL) { chars->length = (int)(s->end - s->data); ssl_md5_transform(info, s->data, chars->length); } else { chars->length = 0; } ssl_md5_complete(info, chars->digest); ssl_md5_info_delete(info); } /***************************************************************************//** * Compare two stream characteristics structs for equality * * @param a characteristics of first stream * @param b characteristics of second stream * @result != 0 if characteristics are equal */ static int stream_characteristics_equal(const struct stream_characteristics *a, const struct stream_characteristics *b) { return (a->length == b->length && g_memcmp(a->digest, b->digest, sizeof(a->digest)) == 0); } /******************************************************************************/ static int handle_cb_format_data_request(struct vnc *v, struct stream *s) { int format = 0; struct stream *out_s; int i; struct vnc_clipboard_data *vc = v->vc; int rv = 0; int msg_flags = CB_RESPONSE_OK; int lf_count; int alloclen = 64; #ifdef USE_DEVEL_LOGGING char scratch[64]; #endif if (s_check_rem(s, 4)) { in_uint32_le(s, format); } LOG_DEVEL(LOG_LEVEL_INFO, "RDP client requested data format=%s", cf2text(format, scratch, sizeof(scratch))); make_stream(out_s); /* For all formats, we need to convert to Windows carriage control, * so we need to know how many '\n' characters become '\r\n' */ lf_count = char_count_in(vc->rfb_clip_s, '\n'); /* If we're writing a big string, we need to increase the alloclen * for the return PDU. We can also vet the requested format here */ switch (format) { case CF_TEXT: /* We need to allocate enough characters to hold the string * with '\n' becoming '\r\n' and also for a terminator. */ alloclen += vc->rfb_clip_s->size + lf_count + 1; break; case CF_UNICODETEXT: /* As CF_TEXT, but twice as much, as each ANSI character maps to * two octets */ alloclen += (vc->rfb_clip_s->size + lf_count + 1) * 2; break; case CF_LOCALE: break; default: /* No idea what this is */ msg_flags = CB_RESPONSE_FAIL; } /* Allocate the stream and check for failure as the string could be * essentially unlimited in length */ init_stream(out_s, alloclen); if (out_s->data == NULL) { LOG(LOG_LEVEL_ERROR, "Memory exhausted allocating %d bytes for clip data response", alloclen); rv = 1; } else { /* Write the packet header.... */ out_cliprdr_header(out_s, CB_FORMAT_DATA_RESPONSE, msg_flags); /* ...and any data */ switch (format) { case CF_LOCALE: /* * This is undocumented. * * Reverse engineering by firing this request off to * a Microsoft client suggests this is a code from * [MS-LCID]. 0x409 maps to en-us which uses codepage * 1252. This is a close enough match to ISO8859-1 as used * by RFB */ out_uint32_le(out_s, 0x409); break; case CF_TEXT: for (i = 0; i < vc->rfb_clip_s->size; ++i) { char c = vc->rfb_clip_s->data[i]; if (c == '\n') { out_uint8(out_s, '\r'); } out_uint8(out_s, c); } out_uint8s(out_s, 1); break; case CF_UNICODETEXT: /* The VNC clipboard format (ISO 8859-1) maps directly to UTF-16LE by moving over the bottom 8 bits, and setting the top 8 bits to zero */ for (i = 0; i < vc->rfb_clip_s->size; ++i) { char c = vc->rfb_clip_s->data[i]; if (c == '\n') { out_uint8(out_s, '\r'); out_uint8(out_s, 0); } out_uint8(out_s, c); out_uint8(out_s, 0); } out_uint8s(out_s, 2); break; } s_mark_end(out_s); send_stream_to_clip_channel(v, out_s); free_stream(out_s); } return rv; } /******************************************************************************/ static int handle_cb_format_data_response(struct vnc *v, struct stream *s) { int rv = 0; struct vnc_clipboard_data *vc = v->vc; /* The [MS-RDPECLIP] specification lets a new CB_FORMAT_LIST PDU turn * up before we've received a response to a CB_FORMAT_DATA_REQUEST. * As a result, there might be more than one CB_FORMAT_DATA_RESPONSE * PDUs in-flight. We handle this by ignoring all but the last PDU * we're expecting */ if (vc->active_data_requests > 0 && --vc->active_data_requests == 0) { struct stream *out_s; int length; char c; char lastc; int wc; unsigned int out_of_range = 0; /* We've got a copy of the current VNC paste buffer in * vc->rfb_clip_s. Since we're about to change the VNC paste * buffer anyway, we'll use this to construct the ISO8859-1 * text, and then send it to the VNC server * * We size the buffer as follows:- * TEXT Use the same size buffer. * UTF-16 - Use half the size * * In all cases this is big enough, or a little over when removal * of `\r` characters is taken into account */ if (vc->requested_clip_format == CF_UNICODETEXT) { length = s_rem(s) / 2; } else { length = s_rem(s); } init_stream(vc->rfb_clip_s, length); if (vc->rfb_clip_s->data == NULL) { LOG(LOG_LEVEL_ERROR, "Memory exhausted allocating %d bytes for clip buffer", length); rv = 1; } else { switch (vc->requested_clip_format) { case CF_TEXT: lastc = '\0'; while (s_check_rem(s, 1)) { in_uint8(s, c); if (c == '\n' && lastc == '\r') { /* Overwrite the `\r' */ --vc->rfb_clip_s->p; } out_uint8(vc->rfb_clip_s, c); lastc = c; } break; case CF_UNICODETEXT: lastc = '\0'; while (s_check_rem(s, 2)) { in_uint16_le(s, wc); if (wc / 0x100 == 0) { /* Valid ISO8859-1 character in bottom 8 bits */ c = wc % 0x100; if (c == '\n' && lastc == '\r') { /* Overwrite the `\r' */ --vc->rfb_clip_s->p; } out_uint8(vc->rfb_clip_s, c); lastc = c; } else { /* Character can't be represented in ISO8859-1 */ ++out_of_range; if (wc & 0xdc00 && wc <= 0xdfff) { /* Character is start of a surrogate pair */ if (s_check_rem(s, 2)) { in_uint16_le(s, wc); } } } } if (out_of_range > 0) { LOG(LOG_LEVEL_WARNING, "VNC: %u out-of-range Unicode characters" " could not be moved to the VNC clipboard", out_of_range); } break; } /* Remove a terminator at the end, as RFB doesn't need it */ if (vc->rfb_clip_s->p != vc->rfb_clip_s->data && *(vc->rfb_clip_s->p - 1) == '\0') { --vc->rfb_clip_s->p; } s_mark_end(vc->rfb_clip_s); /* Update the VNC server */ make_stream(out_s); length = (unsigned int)(vc->rfb_clip_s->end - vc->rfb_clip_s->data); init_stream(out_s, 1 + 3 + 4 + length); out_uint8(out_s, RFB_C2S_CLIENT_CUT_TEXT); out_uint8s(out_s, 3); /* padding */ out_uint32_be(out_s, length); out_uint8p(out_s, vc->rfb_clip_s->data, length); s_mark_end(out_s); lib_send_copy(v, out_s); free_stream(out_s); } } return rv; } /******************************************************************************/ static int handle_cb_caps(struct vnc *v, struct stream *s) { int rv = 0; int i; int capset_count; int capset_type; int capset_length; int version; int flags; if (!s_check_rem_and_log(s, 4, "Reading clip capabilities")) { rv = 1; } else { in_uint16_le(s, capset_count); in_uint8s(s, 2); /* pad */ for (i = 0; i < capset_count && rv == 0; ++i) { if (!s_check_rem_and_log(s, 4, "Reading capability set")) { rv = 1; break; } in_uint16_le(s, capset_type); /* Length includes these two fields */ in_uint16_le(s, capset_length); capset_length -= 4; /* Account for last two fields */ switch (capset_type) { case CB_CAPSTYPE_GENERAL: if (!s_check_rem_and_log(s, 8, "Reading general cap set")) { rv = 1; } else { in_uint32_le(s, version); /* version */ in_uint32_le(s, flags); /* generalFlags */ capset_length -= 8; /* Update our own capability fields */ if (version > 0 && version < v->vc->capability_version) { v->vc->capability_version = version; } v->vc->capability_flags &= flags; LOG(LOG_LEVEL_DEBUG, "Agreed MS-RDPECLIP capability" "version=%d flags=%08x with RDP client", v->vc->capability_version, v->vc->capability_flags); } break; default: LOG(LOG_LEVEL_WARNING, "clipboard_process_clip_caps: " "unknown capabilitySetType %d", capset_type); break; } /* Check for padding at the end of the set */ if (capset_length > 0) { if (!s_check_rem_and_log(s, capset_length, "cap set padding")) { rv = 1; } else { in_uint8s(s, capset_length); } } } } return rv; } /***************************************************************************//** * Send a format list PDU to the RDP client * * Described in [MS-RDPECLIP] 2.2.3.1 * * @param v VNC structure */ static void send_format_list(struct vnc *v) { struct vnc_clipboard_data *vc = v->vc; int use_long_names = vc->capability_flags & CB_USE_LONG_FORMAT_NAMES; struct stream *out_s; unsigned int i = 0; int format; make_stream(out_s); init_stream(out_s, 8192); out_cliprdr_header(out_s, CB_FORMAT_LIST, use_long_names); while ((format = g_supported_formats[i++]) != 0) { if (use_long_names) { /* Long format name [MS-RDPECLIP] 2.2.3.1.2.1 */ out_uint32_le(out_s, format); out_uint8s(out_s, 2); /* wsz terminator */ } else { /* Short format name [MS-RDPECLIP] 2.2.3.1.1.1 */ out_uint32_le(out_s, format); out_uint8s(out_s, 32); } } s_mark_end(out_s); send_stream_to_clip_channel(v, out_s); free_stream(out_s); } /******************************************************************************/ void vnc_clip_init(struct vnc *v) { v->vc = (struct vnc_clipboard_data *)g_malloc(sizeof(*v->vc), 1); make_stream(v->vc->rfb_clip_s); } /******************************************************************************/ void vnc_clip_exit(struct vnc *v) { if (v != NULL && v->vc != NULL) { free_stream(v->vc->rfb_clip_s); free_stream(v->vc->dechunker_s); g_free(v->vc); } } /******************************************************************************/ int vnc_clip_process_eclip_pdu(struct vnc *v, struct stream *s) { int type; int msg_flags; int datalen; int rv = 0; /* Ignore PDUs with no complete header */ if (s_check_rem_and_log(s, 8, "MS-RDPECLIP PDU Header")) { in_uint16_le(s, type); in_uint16_le(s, msg_flags); in_uint32_le(s, datalen); LOG(LOG_LEVEL_DEBUG, "got clip data type %s msg_flags %d length %d", CB_PDUTYPE_TO_STR(type), msg_flags, datalen); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "clipboard data", s->p, s->end - s->p); /* Check the PDU is contained in the stream */ if (!s_check_rem_and_log(s, datalen, "MS-RDPECLIP PDU")) { datalen = s_rem(s); } else { /* Truncate the PDU to the data length so we can use the * normal functions to parse the PDU */ s->end = s->p + datalen; } switch (type) { case CB_FORMAT_LIST: rv = handle_cb_format_list(v, msg_flags, s); break; case CB_FORMAT_LIST_RESPONSE: /* We don't need to do anything with this */ break; case CB_FORMAT_DATA_REQUEST: rv = handle_cb_format_data_request(v, s); break; case CB_FORMAT_DATA_RESPONSE: if (msg_flags == CB_RESPONSE_OK) { rv = handle_cb_format_data_response(v, s); } break; case CB_CLIP_CAPS: rv = handle_cb_caps(v, s); break; } } return rv; } /******************************************************************************/ /** * Process a [MS-RDPBCGR] 2.2.6.1 Virtual Channel PDU and re-assemble the * data chunks as needed - see 3.1.5.2.2.1 */ int vnc_clip_process_channel_data(struct vnc *v, char *data, int size, int total_size, int flags) { int rv = 1; struct vnc_clipboard_data *vc = v->vc; bool_t first = ((flags & XR_CHANNEL_FLAG_FIRST) != 0); bool_t last = ((flags & XR_CHANNEL_FLAG_LAST) != 0); if (size > total_size) { /* This should never happen */ LOG(LOG_LEVEL_ERROR, "Ignoring bad PDU chunk data on clip channel"); } else if (first && vc->dechunker_s != NULL) { /* * If this packet is marked as 'first', we should not be * dechunking data already */ LOG(LOG_LEVEL_ERROR, "Packet chunking start state error"); free_stream(vc->dechunker_s); vc->dechunker_s = NULL; } else if (!first && vc->dechunker_s == NULL) { /* * This is not the first packet, but the dechunker is not active */ LOG(LOG_LEVEL_ERROR, "Packet chunking end state error"); } else if (first && last) { /* this is a complete packet * Construct a temp stream for the complete packet, and pass it * to the application */ struct stream packet_s = {0}; packet_s.data = data; packet_s.size = size; packet_s.end = packet_s.data + size; packet_s.p = packet_s.data; rv = vnc_clip_process_eclip_pdu(v, &packet_s); } else if (first) { /* Start de-chunking the data */ make_stream(vc->dechunker_s); init_stream(vc->dechunker_s, (int)total_size); /* MS-RDPBCGR 3.1.5.2.2.1 states:- * * A reassembly buffer MUST be created by the virtual channel * endpoint using the size specified by totalLength when * the first chunk is received. * * The 'total_size' can be several GB in size, so we really need * to check for an allocation failure here */ if (vc->dechunker_s->data == NULL) { LOG(LOG_LEVEL_ERROR, "Memory exhausted dechunking a %u byte virtual channel PDU", total_size); } else { out_uint8a(vc->dechunker_s, data, size); rv = 0; } } else if (s_check_rem_out_and_log(vc->dechunker_s, size, "VNC dechunker:")) { out_uint8a(vc->dechunker_s, data, size); /* At the end? */ if (last) { s_mark_end(vc->dechunker_s); vc->dechunker_s->p = vc->dechunker_s->data; /* Call the app and reset the dechunker */ rv = vnc_clip_process_eclip_pdu(v, vc->dechunker_s); free_stream(vc->dechunker_s); vc->dechunker_s = NULL; } else { rv = 0; } } return rv; } /******************************************************************************/ /* clip data from the vnc server */ int vnc_clip_process_rfb_data(struct vnc *v) { struct vnc_clipboard_data *vc = v->vc; struct stream *s; int size; int rv; make_stream(s); init_stream(s, 8192); rv = trans_force_read_s(v->trans, s, 7); if (rv == 0) { in_uint8s(s, 3); in_uint32_be(s, size); if (v->clip_chanid < 0 || v->server_chansrv_in_use(v)) { /* Skip this message */ LOG(LOG_LEVEL_DEBUG, "Skipping %d clip bytes from RFB", size); rv = skip_trans_bytes(v->trans, size); } else { struct stream_characteristics old_chars; struct stream_characteristics new_chars; /* Compute the characteristics of the existing data */ compute_stream_characteristics(vc->rfb_clip_s, &old_chars); /* Lose any existing RFB clip data */ free_stream(vc->rfb_clip_s); vc->rfb_clip_s = 0; make_stream(vc->rfb_clip_s); if (size < 0) { /* This shouldn't happen - see Extended Clipboard * Pseudo-Encoding */ LOG(LOG_LEVEL_ERROR, "Unexpected size %d for RFB data", size); rv = 1; } else if (size == 0) { LOG(LOG_LEVEL_DEBUG, "RFB clip data cleared by VNC server"); } else { init_stream(vc->rfb_clip_s, size); if (vc->rfb_clip_s->data == NULL) { LOG(LOG_LEVEL_ERROR, "Memory exhausted allocating %d bytes" " for RFB clip data", size); rv = 1; } else { LOG(LOG_LEVEL_DEBUG, "Reading %d clip bytes from RFB", size); rv = trans_force_read_s(v->trans, vc->rfb_clip_s, size); } } /* Consider telling the RDP client about the update only if we've * completed the startup handshake */ if (rv == 0 && vc->startup_complete) { /* Has the data actually changed ? */ compute_stream_characteristics(vc->rfb_clip_s, &new_chars); if (stream_characteristics_equal(&old_chars, &new_chars)) { LOG_DEVEL(LOG_LEVEL_INFO, "RFB Clip data is unchanged"); } else { LOG_DEVEL(LOG_LEVEL_INFO, "RFB Clip data is updated"); send_format_list(v); } } } } free_stream(s); return rv; } /******************************************************************************/ int vnc_clip_open_clip_channel(struct vnc *v) { v->clip_chanid = v->server_get_channel_id(v, CLIPRDR_SVC_CHANNEL_NAME); if (v->server_chansrv_in_use(v)) { /* * The clipboard is provided by chansrv, if at all - it may of * course be disabled there. */ LOG(LOG_LEVEL_INFO, "VNC: Clipboard (if available) is provided " "by chansrv facility"); } else if (v->clip_chanid < 0) { LOG(LOG_LEVEL_INFO, "VNC: Clipboard is unavailable"); } else { struct stream *s; LOG(LOG_LEVEL_INFO, "VNC: Clipboard supports ISO-8859-1 text only"); make_stream(s); init_stream(s, 8192); v->vc->capability_version = CB_CAPS_VERSION_2; v->vc->capability_flags = CB_USE_LONG_FORMAT_NAMES; /** * Send two PDUs to initialise the channel. The client should * respond with a CB_CLIP_CAPS PDU of its own. See [MS-RDPECLIP] * 1.3.2.1 */ out_cliprdr_header(s, CB_CLIP_CAPS, 0); out_uint16_le(s, 1); /* #cCapabilitiesSets */ out_uint16_le(s, 0); /* pad1 */ /* CLIPRDR_GENERAL_CAPABILITY */ out_uint16_le(s, CB_CAPSTYPE_GENERAL); /* capabilitySetType */ out_uint16_le(s, 12); /* lengthCapability */ out_uint32_le(s, v->vc->capability_version); out_uint32_le(s, v->vc->capability_flags); s_mark_end(s); send_stream_to_clip_channel(v, s); /* Send the monitor ready PDU */ init_stream(s, 0); out_cliprdr_header(s, CB_MONITOR_READY, 0); s_mark_end(s); send_stream_to_clip_channel(v, s); free_stream(s); /* Need to complete the startup handshake before we send formats */ v->vc->startup_complete = 1; } return 0; } xrdp-0.10.1/vnc/vnc.c000644 001751 000000 00000175665 14652432047 014401 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libvnc * * The message definitions used in this source file can be found mostly * in RFC6143 - "The Remote Framebuffer Protocol". * * The ExtendedDesktopSize encoding is reserved in RFC6143, but not * documented there. It is documented by the RFB protocol community * wiki currently held at https://github.com/rfbproto/rfbroto. This is * referred to below as the "RFB community wiki" */ #if defined(HAVE_CONFIG_H) #include #endif #include "vnc.h" #include "vnc_clip.h" #include "rfb.h" #include "log.h" #include "trans.h" #include "ssl_calls.h" #include "string_calls.h" #include "xrdp_client_info.h" /* elements in above list */ #define EDS_STATUS_MSG_COUNT \ (sizeof(eds_status_msg) / sizeof(eds_status_msg[0])) /* Used by enabled_encodings_mask */ enum { MSK_EXTENDED_DESKTOP_SIZE = (1 << 0) }; /******************************************************************************/ int lib_send_copy(struct vnc *v, struct stream *s) { return trans_write_copy_s(v->trans, s); } /******************************************************************************/ /* taken from vncauth.c */ /* performing the des3 crypt on the password so it can not be seen on the wire 'bytes' in, contains 16 bytes server random out, random and 'passwd' conbined */ static void rfbEncryptBytes(char *bytes, const char *passwd) { char key[24]; void *des; int len; /* key is simply password padded with nulls */ g_memset(key, 0, sizeof(key)); len = MIN(g_strlen(passwd), 8); g_mirror_memcpy(key, passwd, len); des = ssl_des3_encrypt_info_create(key, 0); ssl_des3_encrypt(des, 8, bytes, bytes); ssl_des3_info_delete(des); des = ssl_des3_encrypt_info_create(key, 0); ssl_des3_encrypt(des, 8, bytes + 8, bytes + 8); ssl_des3_info_delete(des); } /******************************************************************************/ /* sha1 hash 'passwd', create a string from the hash and call rfbEncryptBytes */ static void rfbHashEncryptBytes(char *bytes, const char *passwd) { char passwd_hash[20]; char passwd_hash_text[40]; void *sha1; int passwd_bytes; /* create password hash from password */ passwd_bytes = g_strlen(passwd); sha1 = ssl_sha1_info_create(); ssl_sha1_clear(sha1); ssl_sha1_transform(sha1, "xrdp_vnc", 8); ssl_sha1_transform(sha1, passwd, passwd_bytes); ssl_sha1_transform(sha1, passwd, passwd_bytes); ssl_sha1_complete(sha1, passwd_hash); ssl_sha1_info_delete(sha1); g_snprintf(passwd_hash_text, 39, "%2.2x%2.2x%2.2x%2.2x", (tui8)passwd_hash[0], (tui8)passwd_hash[1], (tui8)passwd_hash[2], (tui8)passwd_hash[3]); passwd_hash_text[39] = 0; rfbEncryptBytes(bytes, passwd_hash_text); } /**************************************************************************//** * Logs a debug message containing a screen layout * * @param lvl Level to log at * @param source Where the layout came from * @param layout Layout to log */ static void log_screen_layout(const enum logLevels lvl, const char *source, const struct vnc_screen_layout *layout) { unsigned int i; char text[256]; size_t pos; int res; pos = 0; res = g_snprintf(text, sizeof(text) - pos, "Layout from %s (geom=%dx%d #screens=%u) :", source, layout->total_width, layout->total_height, layout->count); i = 0; while (res > 0 && (size_t)res < sizeof(text) - pos && i < layout->count) { pos += res; res = g_snprintf(&text[pos], sizeof(text) - pos, " %d:(%dx%d+%d+%d)", layout->s[i].id, layout->s[i].width, layout->s[i].height, layout->s[i].x, layout->s[i].y); ++i; } LOG(lvl, "%s", text); } /**************************************************************************//** * Compares two vnc_screen structures * * @param a First structure * @param b Second structure * * @return Suitable for sorting structures on (x, y, width, height) */ static int cmp_vnc_screen(const struct vnc_screen *a, const struct vnc_screen *b) { int result = 0; if (a->x != b->x) { result = a->x - b->x; } else if (a->y != b->y) { result = a->y - b->y; } else if (a->width != b->width) { result = a->width - b->width; } else if (a->height != b->height) { result = a->height - b->height; } return result; } /**************************************************************************//** * Compares two vnc_screen_layout structures for equality * @param a First layout * @param b First layout * @return != 0 if structures are equal */ static int vnc_screen_layouts_equal(const struct vnc_screen_layout *a, const struct vnc_screen_layout *b) { unsigned int i; int result = (a->total_width == b->total_width && a->total_height == b->total_height && a->count == b->count); if (result) { for (i = 0 ; result && i < a->count ; ++i) { result = (cmp_vnc_screen(&a->s[i], &b->s[i]) == 0); } } return result; } /**************************************************************************//** * Reads an extended desktop size rectangle from the VNC server * * @param v VNC object * @param [out] layout Desired layout for server * @return != 0 for error * * @pre The next octet read from v->trans is the number of screens * * @post Returned structure is in increasing ID order * @post layout->total_width is untouched * @post layout->total_height is untouched */ static int read_extended_desktop_size_rect(struct vnc *v, struct vnc_screen_layout *layout) { struct stream *s; int error; unsigned int count; layout->count = 0; make_stream(s); init_stream(s, 8192); /* Read in the current screen config */ error = trans_force_read_s(v->trans, s, 4); if (error == 0) { /* Get the number of screens */ in_uint8(s, count); if (count <= 0 || count > CLIENT_MONITOR_DATA_MAXIMUM_MONITORS) { LOG(LOG_LEVEL_ERROR, "Bad monitor count %d in ExtendedDesktopSize rectangle", count); error = 1; } else { in_uint8s(s, 3); error = trans_force_read_s(v->trans, s, 16 * count); if (error == 0) { unsigned int i; for (i = 0 ; i < count ; ++i) { in_uint32_be(s, layout->s[i].id); in_uint16_be(s, layout->s[i].x); in_uint16_be(s, layout->s[i].y); in_uint16_be(s, layout->s[i].width); in_uint16_be(s, layout->s[i].height); in_uint32_be(s, layout->s[i].flags); } /* sort monitors in increasing (x,y) order */ qsort(layout->s, count, sizeof(layout->s[0]), (int (*)(const void *, const void *))cmp_vnc_screen); layout->count = count; } } } free_stream(s); return error; } /**************************************************************************//** * Sends a SetDesktopSize message * * @param v VNC object * @param layout Desired layout for server * @return != 0 for error * * The SetDesktopSize message is documented in the RFB community wiki * "SetDesktopSize" section. */ static int send_set_desktop_size(struct vnc *v, const struct vnc_screen_layout *layout) { unsigned int i; struct stream *s; int error; make_stream(s); init_stream(s, 8192); out_uint8(s, 251); out_uint8(s, 0); out_uint16_be(s, layout->total_width); out_uint16_be(s, layout->total_height); out_uint8(s, layout->count); out_uint8(s, 0); for (i = 0 ; i < layout->count ; ++i) { out_uint32_be(s, layout->s[i].id); out_uint16_be(s, layout->s[i].x); out_uint16_be(s, layout->s[i].y); out_uint16_be(s, layout->s[i].width); out_uint16_be(s, layout->s[i].height); out_uint32_be(s, layout->s[i].flags); } s_mark_end(s); LOG(LOG_LEVEL_DEBUG, "VNC Sending SetDesktopSize"); error = lib_send_copy(v, s); free_stream(s); return error; } /**************************************************************************//** * Initialises a vnc_screen_layout as a single screen * @param[in] width Screen Width * @param[in] height Screen Height * @param[out] layout Layout to initialise */ static void init_single_screen_layout(int width, int height, struct vnc_screen_layout *layout) { layout->total_width = width; layout->total_height = height; layout->count = 1; layout->s[0].id = 0; layout->s[0].x = 0; layout->s[0].y = 0; layout->s[0].width = width; layout->s[0].height = height; layout->s[0].flags = 0; } /**************************************************************************//** * Resize the client to match the server_layout * * @param v VNC object * @param update_in_progress True if there's a painter update in progress * @return != 0 for error * * The new client layout is recorded in v->client_layout. */ static int resize_client_to_server(struct vnc *v, int update_in_progress) { int error = 0; unsigned int i; const struct vnc_screen_layout *sl = &v->server_layout; struct monitor_info client_mons[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS] = {0}; if (sl->count <= 0 || sl->count > CLIENT_MONITOR_DATA_MAXIMUM_MONITORS) { LOG(LOG_LEVEL_ERROR, "%s: Programming error. Bad monitors %d", __func__, sl->count); return 1; } // Convert the server monitors into client monitors for (i = 0; i < sl->count; ++i) { client_mons[i].left = sl->s[i].x; client_mons[i].top = sl->s[i].y; client_mons[i].right = sl->s[i].x + sl->s[i].width - 1; client_mons[i].bottom = sl->s[i].y + sl->s[i].height - 1; } if (update_in_progress && v->server_end_update(v) != 0) { error = 1; } else { error = v->client_monitor_resize(v, sl->total_width, sl->total_height, sl->count, client_mons); if (error == 0) { v->client_layout = *sl; } if (update_in_progress && v->server_begin_update(v) != 0) { error = 1; } } return error; } /**************************************************************************//** * Resize the server to the client layout * * @param v VNC object * @return != 0 for error * * The new client layout is recorded in v->client_layout. */ static int resize_server_to_client_layout(struct vnc *v) { int error = 0; if (v->resize_supported != VRSS_SUPPORTED) { LOG(LOG_LEVEL_ERROR, "%s: Asked to resize server, but not possible", __func__); error = 1; } else if (vnc_screen_layouts_equal(&v->server_layout, &v->client_layout)) { LOG(LOG_LEVEL_DEBUG, "Server layout is the same " "as the client layout"); v->resize_status = VRS_DONE; } else { /* * If we've only got one screen, and the other side has * only got one screen, we will preserve their screen ID * and any flags. This may prevent us sending an unwanted * SetDesktopSize message if the screen dimensions are * a match. We can't do this with more than one screen, * as we have no way to map different IDs */ if (v->server_layout.count == 1 && v->client_layout.count == 1) { LOG(LOG_LEVEL_DEBUG, "VNC " "setting screen id to %d from server", v->server_layout.s[0].id); v->client_layout.s[0].id = v->server_layout.s[0].id; v->client_layout.s[0].flags = v->server_layout.s[0].flags; } LOG(LOG_LEVEL_DEBUG, "Changing server layout"); error = send_set_desktop_size(v, &v->client_layout); v->resize_status = VRS_WAITING_FOR_RESIZE_CONFIRM; } return error; } /*****************************************************************************/ int lib_mod_event(struct vnc *v, int msg, long param1, long param2, long param3, long param4) { struct stream *s; int key; int error; int x; int y; int cx; int cy; int size; int total_size; int chanid; int flags; char *data; error = 0; make_stream(s); if (msg == WM_CHANNEL_DATA) { chanid = LOWORD(param1); flags = HIWORD(param1); size = (int)param2; data = (char *)param3; total_size = (int)param4; if ((size >= 0) && (size <= (32 * 1024)) && (data != 0)) { if (chanid == v->clip_chanid) { error = vnc_clip_process_channel_data(v, data, size, total_size, flags); } else { LOG(LOG_LEVEL_DEBUG, "lib_process_channel_data: unknown chanid: " "%d :(v->clip_chanid) %d", chanid, v->clip_chanid); } } else { error = 1; } } else if ((msg >= 15) && (msg <= 16)) /* key events */ { key = param2; if (key > 0) { if (key == 65027) /* altgr */ { if (v->shift_state) { /* fix for mstsc sending left control down with altgr */ init_stream(s, 8192); out_uint8(s, RFB_C2S_KEY_EVENT); out_uint8(s, 0); /* down flag */ out_uint8s(s, 2); out_uint32_be(s, 65507); /* left control */ s_mark_end(s); lib_send_copy(v, s); } } init_stream(s, 8192); out_uint8(s, RFB_C2S_KEY_EVENT); out_uint8(s, msg == 15); /* down flag */ out_uint8s(s, 2); out_uint32_be(s, key); s_mark_end(s); error = lib_send_copy(v, s); if (key == 65507) /* left control */ { v->shift_state = msg == 15; } } } /* mouse events * * VNC supports up to 8 mouse buttons because mouse buttons are * represented by 7 bits bitmask */ else if (msg >= WM_MOUSEMOVE && msg <= WM_BUTTON8DOWN) /* 100 to 116 */ { switch (msg) { case WM_MOUSEMOVE: break; case WM_LBUTTONUP: v->mod_mouse_state &= ~1; break; case WM_LBUTTONDOWN: v->mod_mouse_state |= 1; break; case WM_RBUTTONUP: v->mod_mouse_state &= ~4; break; case WM_RBUTTONDOWN: v->mod_mouse_state |= 4; break; case WM_BUTTON3UP: v->mod_mouse_state &= ~2; break; case WM_BUTTON3DOWN: v->mod_mouse_state |= 2; break; case WM_BUTTON4UP: v->mod_mouse_state &= ~8; break; case WM_BUTTON4DOWN: v->mod_mouse_state |= 8; break; case WM_BUTTON5UP: v->mod_mouse_state &= ~16; break; case WM_BUTTON5DOWN: v->mod_mouse_state |= 16; break; case WM_BUTTON6UP: v->mod_mouse_state &= ~32; break; case WM_BUTTON6DOWN: v->mod_mouse_state |= 32; break; case WM_BUTTON7UP: v->mod_mouse_state &= ~64; break; case WM_BUTTON7DOWN: v->mod_mouse_state |= 64; break; case WM_BUTTON8UP: v->mod_mouse_state &= ~128; break; case WM_BUTTON8DOWN: v->mod_mouse_state |= 128; break; } init_stream(s, 8192); out_uint8(s, RFB_C2S_POINTER_EVENT); out_uint8(s, v->mod_mouse_state); out_uint16_be(s, param1); out_uint16_be(s, param2); s_mark_end(s); error = lib_send_copy(v, s); } else if (msg == 200) /* invalidate */ { if (v->suppress_output == 0) { init_stream(s, 8192); out_uint8(s, RFB_C2S_FRAMEBUFFER_UPDATE_REQUEST); out_uint8(s, 0); /* incremental == 0 : Full contents */ x = (param1 >> 16) & 0xffff; out_uint16_be(s, x); y = param1 & 0xffff; out_uint16_be(s, y); cx = (param2 >> 16) & 0xffff; out_uint16_be(s, cx); cy = param2 & 0xffff; out_uint16_be(s, cy); s_mark_end(s); error = lib_send_copy(v, s); } } free_stream(s); return error; } //****************************************************************************** int get_pixel_safe(char *data, int x, int y, int width, int height, int bpp) { int start = 0; int shift = 0; if (x < 0) { return 0; } if (y < 0) { return 0; } if (x >= width) { return 0; } if (y >= height) { return 0; } if (bpp == 1) { width = (width + 7) / 8; start = (y * width) + x / 8; shift = x % 8; return (data[start] & (0x80 >> shift)) != 0; } else if (bpp == 4) { width = (width + 1) / 2; start = y * width + x / 2; shift = x % 2; if (shift == 0) { return (data[start] & 0xf0) >> 4; } else { return data[start] & 0x0f; } } else if (bpp == 8) { return *(((unsigned char *)data) + (y * width + x)); } else if (bpp == 15 || bpp == 16) { return *(((unsigned short *)data) + (y * width + x)); } else if (bpp == 24 || bpp == 32) { return *(((unsigned int *)data) + (y * width + x)); } else { LOG(LOG_LEVEL_ERROR, "error in get_pixel_safe bpp %d", bpp); } return 0; } /******************************************************************************/ void set_pixel_safe(char *data, int x, int y, int width, int height, int bpp, int pixel) { int start = 0; int shift = 0; if (x < 0) { return; } if (y < 0) { return; } if (x >= width) { return; } if (y >= height) { return; } if (bpp == 1) { width = (width + 7) / 8; start = (y * width) + x / 8; shift = x % 8; if (pixel & 1) { data[start] = data[start] | (0x80 >> shift); } else { data[start] = data[start] & ~(0x80 >> shift); } } else if (bpp == 15 || bpp == 16) { *(((unsigned short *)data) + (y * width + x)) = pixel; } else if (bpp == 24) { *(data + (3 * (y * width + x)) + 0) = pixel >> 0; *(data + (3 * (y * width + x)) + 1) = pixel >> 8; *(data + (3 * (y * width + x)) + 2) = pixel >> 16; } else { LOG(LOG_LEVEL_ERROR, "error in set_pixel_safe bpp %d", bpp); } } /******************************************************************************/ int split_color(int pixel, int *r, int *g, int *b, int bpp, int *palette) { if (bpp == 8) { if (pixel >= 0 && pixel < 256 && palette != 0) { *r = (palette[pixel] >> 16) & 0xff; *g = (palette[pixel] >> 8) & 0xff; *b = (palette[pixel] >> 0) & 0xff; } } else if (bpp == 15) { *r = ((pixel >> 7) & 0xf8) | ((pixel >> 12) & 0x7); *g = ((pixel >> 2) & 0xf8) | ((pixel >> 8) & 0x7); *b = ((pixel << 3) & 0xf8) | ((pixel >> 2) & 0x7); } else if (bpp == 16) { *r = ((pixel >> 8) & 0xf8) | ((pixel >> 13) & 0x7); *g = ((pixel >> 3) & 0xfc) | ((pixel >> 9) & 0x3); *b = ((pixel << 3) & 0xf8) | ((pixel >> 2) & 0x7); } else if (bpp == 24 || bpp == 32) { *r = (pixel >> 16) & 0xff; *g = (pixel >> 8) & 0xff; *b = pixel & 0xff; } else { LOG(LOG_LEVEL_ERROR, "error in split_color bpp %d", bpp); } return 0; } /******************************************************************************/ int make_color(int r, int g, int b, int bpp) { if (bpp == 24) { return (r << 16) | (g << 8) | b; } else { LOG(LOG_LEVEL_ERROR, "error in make_color bpp %d", bpp); } return 0; } /** * Converts a bits-per-pixel value to bytes-per-pixel */ static int get_bytes_per_pixel(int bpp) { int result = (bpp + 7) / 8; if (result == 3) { result = 4; } return result; } /**************************************************************************//** * Skips the specified number of bytes from the transport * * @param transport Transport to read * @param bytes Bytes to skip * @return != 0 for error */ int skip_trans_bytes(struct trans *trans, unsigned int bytes) { struct stream *s; int error = 0; make_stream(s); while (error == 0 && bytes > 0) { int chunk_size = MIN(32768, bytes); init_stream(s, chunk_size); error = trans_force_read_s(trans, s, chunk_size); bytes -= chunk_size; } free_stream(s); return error; } /**************************************************************************//** * Reads an encoding from the input stream and discards it * * @param v VNC object * @param x Encoding X value * @param y Encoding Y value * @param cx Encoding CX value * @param cy Encoding CY value * @param encoding Code for encoding * @return != 0 for error * * @pre On entry the input stream is positioned after the encoding header */ static int skip_encoding(struct vnc *v, int x, int y, int cx, int cy, encoding_type encoding) { char text[256]; int error = 0; switch (encoding) { case RFB_ENC_RAW: { int need_size = cx * cy * get_bytes_per_pixel(v->server_bpp); LOG(LOG_LEVEL_DEBUG, "Skipping RFB_ENC_RAW encoding"); error = skip_trans_bytes(v->trans, need_size); } break; case RFB_ENC_COPY_RECT: { LOG(LOG_LEVEL_DEBUG, "Skipping RFB_ENC_COPY_RECT encoding"); error = skip_trans_bytes(v->trans, 4); } break; case RFB_ENC_CURSOR: { int j = cx * cy * get_bytes_per_pixel(v->server_bpp); int k = ((cx + 7) / 8) * cy; LOG(LOG_LEVEL_DEBUG, "Skipping RFB_ENC_CURSOR encoding"); error = skip_trans_bytes(v->trans, j + k); } break; case RFB_ENC_DESKTOP_SIZE: LOG(LOG_LEVEL_DEBUG, "Skipping RFB_ENC_DESKTOP_SIZE encoding"); break; case RFB_ENC_EXTENDED_DESKTOP_SIZE: { struct vnc_screen_layout layout = {0}; LOG(LOG_LEVEL_DEBUG, "Skipping RFB_ENC_EXTENDED_DESKTOP_SIZE encoding " "x=%d, y=%d geom=%dx%d", x, y, cx, cy); error = read_extended_desktop_size_rect(v, &layout); } break; default: g_sprintf(text, "VNC error in skip_encoding " "encoding = %8.8x", encoding); v->server_msg(v, text, 1); } return error; } /**************************************************************************//** * Parses an entire framebuffer update message from the wire, and returns the * first matching ExtendedDesktopSize encoding if found. * * Caller can check for a match by examining match_layout.count after the call * * @param v VNC object * @param match Function to call to check for a match * @param [out] match_x Matching x parameter for an encoding (if needed) * @param [out] match_y Matching y parameter for an encoding (if needed) * @param [out] match_layout Returned layout for the encoding * @return != 0 for error */ static int find_matching_extended_rect(struct vnc *v, int (*match)(int x, int y, int cx, int cy), int *match_x, int *match_y, struct vnc_screen_layout *match_layout) { int error; struct stream *s; unsigned int num_rects; unsigned int i; int x; int y; int cx; int cy; encoding_type encoding; int found = 0; make_stream(s); init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 3); if (error == 0) { in_uint8s(s, 1); in_uint16_be(s, num_rects); for (i = 0; i < num_rects; ++i) { if (error != 0) { break; } init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 12); if (error == 0) { in_uint16_be(s, x); in_uint16_be(s, y); in_uint16_be(s, cx); in_uint16_be(s, cy); in_uint32_be(s, encoding); if (encoding == RFB_ENC_EXTENDED_DESKTOP_SIZE && !found && match(x, y, cx, cy)) { LOG(LOG_LEVEL_DEBUG, "VNC matched ExtendedDesktopSize rectangle " "x=%d, y=%d geom=%dx%d", x, y, cx, cy); found = 1; error = read_extended_desktop_size_rect(v, match_layout); if (match_x) { *match_x = x; } if (match_y) { *match_y = y; } match_layout->total_width = cx; match_layout->total_height = cy; } else { error = skip_encoding(v, x, y, cx, cy, encoding); } } } } free_stream(s); return error; } /**************************************************************************//** * Sends a FramebufferUpdateRequest for the resize status state machine * * The state machine is used at the start of the connection to negotiate * a common geometry between the client and the server. * * The RFB community wiki contains the following paragraph not present * in RFC6143:- * * Note that an empty area can still solicit a FramebufferUpdate * even though that update will only contain pseudo-encodings * * This doesn't seem to be as widely supported as we would like at * present. We will always request at least a single pixel update to * avoid confusing the server. * * @param v VNC object * @return != 0 for error */ static int send_update_request_for_resize_status(struct vnc *v) { int error = 0; struct stream *s; make_stream(s); init_stream(s, 8192); switch (v->resize_status) { case VRS_WAITING_FOR_FIRST_UPDATE: case VRS_WAITING_FOR_RESIZE_CONFIRM: /* * Ask for an immediate, minimal update. */ out_uint8(s, RFB_C2S_FRAMEBUFFER_UPDATE_REQUEST); out_uint8(s, 0); /* incremental == 0 : Full update */ out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, 1); out_uint16_be(s, 1); s_mark_end(s); error = lib_send_copy(v, s); break; default: /* * Ask for a full update from the server */ if (v->suppress_output == 0) { out_uint8(s, RFB_C2S_FRAMEBUFFER_UPDATE_REQUEST); out_uint8(s, 0); /* incremental == 0 : Full update */ out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, v->server_layout.total_width); out_uint16_be(s, v->server_layout.total_height); s_mark_end(s); error = lib_send_copy(v, s); } break; } free_stream(s); return error; } /**************************************************************************//** * Tests if extended desktop size rect is an initial geometry specification * * This should be x == 0, but the specification says to treat undefined * values as 0 also */ static int rect_is_initial_geometry(int x, int y, int cx, int cy) { return (x != 1 && x != 2); } /**************************************************************************//** * Tests if extended desktop size rect is a reply to a request from us */ static int rect_is_reply_to_us(int x, int y, int cx, int cy) { return (x == 1); } /**************************************************************************//** * Handles the first framebuffer update from the server * * This is used to determine if the server supports resizes from * us. See The RFB community wiki for details. * * If the server does support resizing, we send our client geometry over. * * @param v VNC object * @return != 0 for error */ static int lib_framebuffer_first_update(struct vnc *v) { int error; struct vnc_screen_layout layout = {0}; error = find_matching_extended_rect(v, rect_is_initial_geometry, NULL, NULL, &layout); if (error == 0) { if (layout.count > 0) { LOG(LOG_LEVEL_DEBUG, "VNC server supports resizing"); v->resize_supported = VRSS_SUPPORTED; v->server_layout = layout; /* Force the client geometry over to the server */ log_screen_layout(LOG_LEVEL_INFO, "ClientLayout", &v->client_layout); log_screen_layout(LOG_LEVEL_INFO, "OldServerLayout", &layout); /* * If we've only got one screen, and the other side has * only got one screen, we will preserve their screen ID * and any flags. This may prevent us sending an unwanted * SetDesktopSize message if the screen dimensions are * a match. We can't do this with more than one screen, * as we have no way to map different IDs */ if (layout.count == 1 && v->client_layout.count == 1) { LOG(LOG_LEVEL_DEBUG, "VNC " "setting screen id to %d from server", layout.s[0].id); v->client_layout.s[0].id = layout.s[0].id; v->client_layout.s[0].flags = layout.s[0].flags; } resize_server_to_client_layout(v); } else { LOG(LOG_LEVEL_DEBUG, "VNC server does not support resizing"); v->resize_supported = VRSS_NOT_SUPPORTED; /* Force client to same size as server */ LOG(LOG_LEVEL_DEBUG, "Resizing client to server %dx%d", v->server_layout.total_width, v->server_layout.total_height); error = resize_client_to_server(v, 0); v->resize_status = VRS_DONE; } } if (error == 0) { error = send_update_request_for_resize_status(v); } return error; } /**************************************************************************//** * Looks for a resize confirm in a framebuffer update request * * If the server supports resizes from us, this is used to find the * reply to our resize request. See The RFB community wiki for details. * * @param v VNC object * @return != 0 for error */ static int lib_framebuffer_waiting_for_resize_confirm(struct vnc *v) { int error; struct vnc_screen_layout layout = {0}; int response_code = 0; error = find_matching_extended_rect(v, rect_is_reply_to_us, NULL, &response_code, &layout); if (error == 0) { if (layout.count > 0) { if (response_code == 0) { LOG(LOG_LEVEL_DEBUG, "VNC server successfully resized"); log_screen_layout(LOG_LEVEL_INFO, "NewLayout", &layout); v->server_layout = layout; // If this resize was requested by the client mid-session // (dynamic resize), we need to tell xrdp_mm that // it's OK to continue with the resize state machine. error = v->server_monitor_resize_done(v); } else { LOG(LOG_LEVEL_WARNING, "VNC server resize failed - error code %d [%s]", response_code, rfb_get_eds_status_msg(response_code)); /* Force client to same size as server */ LOG(LOG_LEVEL_WARNING, "Resizing client to server"); error = resize_client_to_server(v, 0); } v->resize_status = VRS_DONE; } } if (error == 0) { error = send_update_request_for_resize_status(v); } return error; } /******************************************************************************/ int lib_framebuffer_update(struct vnc *v) { char *d1; char *d2; char cursor_data[32 * (32 * 3)]; char cursor_mask[32 * (32 / 8)]; char text[256]; int num_recs; int i; int j; int k; int x; int y; int cx; int cy; int srcx; int srcy; unsigned int encoding; int pixel; int r; int g; int b; int error; int need_size; struct stream *s; struct stream *pixel_s; struct vnc_screen_layout layout = { 0 }; num_recs = 0; make_stream(pixel_s); make_stream(s); init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 3); if (error == 0) { in_uint8s(s, 1); in_uint16_be(s, num_recs); error = v->server_begin_update(v); } for (i = 0; i < num_recs; i++) { if (error != 0) { break; } init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 12); if (error == 0) { in_uint16_be(s, x); in_uint16_be(s, y); in_uint16_be(s, cx); in_uint16_be(s, cy); in_uint32_be(s, encoding); if (encoding == RFB_ENC_RAW) { need_size = cx * cy * get_bytes_per_pixel(v->server_bpp); init_stream(pixel_s, need_size); error = trans_force_read_s(v->trans, pixel_s, need_size); if (error == 0) { error = v->server_paint_rect(v, x, y, cx, cy, pixel_s->data, cx, cy, 0, 0); } } else if (encoding == RFB_ENC_COPY_RECT) { init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 4); if (error == 0) { in_uint16_be(s, srcx); in_uint16_be(s, srcy); error = v->server_screen_blt(v, x, y, cx, cy, srcx, srcy); } } else if (encoding == RFB_ENC_CURSOR) { g_memset(cursor_data, 0, 32 * (32 * 3)); g_memset(cursor_mask, 0, 32 * (32 / 8)); j = cx * cy * get_bytes_per_pixel(v->server_bpp); k = ((cx + 7) / 8) * cy; init_stream(s, j + k); error = trans_force_read_s(v->trans, s, j + k); if (error == 0) { in_uint8p(s, d1, j); in_uint8p(s, d2, k); for (j = 0; j < 32; j++) { for (k = 0; k < 32; k++) { pixel = get_pixel_safe(d2, k, 31 - j, cx, cy, 1); set_pixel_safe(cursor_mask, k, j, 32, 32, 1, !pixel); if (pixel) { pixel = get_pixel_safe(d1, k, 31 - j, cx, cy, v->server_bpp); split_color(pixel, &r, &g, &b, v->server_bpp, v->palette); pixel = make_color(r, g, b, 24); set_pixel_safe(cursor_data, k, j, 32, 32, 24, pixel); } } } /* keep these in 32x32, vnc cursor can be a lot bigger */ if (x > 31) { x = 31; } if (y > 31) { y = 31; } error = v->server_set_cursor(v, x, y, cursor_data, cursor_mask); } } else if (encoding == RFB_ENC_DESKTOP_SIZE) { /* Server end has resized */ init_single_screen_layout(cx, cy, &v->server_layout); error = resize_client_to_server(v, 1); } else if (encoding == RFB_ENC_EXTENDED_DESKTOP_SIZE) { layout.total_width = cx; layout.total_height = cy; error = read_extended_desktop_size_rect(v, &layout); /* If this is a reply to a request from us, x == 1 */ if (error == 0 && x != 1) { if (!vnc_screen_layouts_equal(&v->server_layout, &layout)) { v->server_layout = layout; log_screen_layout(LOG_LEVEL_INFO, "NewServerLayout", &v->server_layout); error = resize_client_to_server(v, 1); } } } else { g_sprintf(text, "VNC error in lib_framebuffer_update encoding = %8.8x", encoding); v->server_msg(v, text, 1); } } } if (error == 0) { error = v->server_end_update(v); } if (error == 0) { if (v->suppress_output == 0) { init_stream(s, 8192); out_uint8(s, RFB_C2S_FRAMEBUFFER_UPDATE_REQUEST); out_uint8(s, 1); /* incremental == 1 : Changes only */ out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, v->server_layout.total_width); out_uint16_be(s, v->server_layout.total_height); s_mark_end(s); error = lib_send_copy(v, s); } } free_stream(s); free_stream(pixel_s); return error; } /******************************************************************************/ int lib_palette_update(struct vnc *v) { struct stream *s; int first_color; int num_colors; int i; int r; int g; int b; int error; make_stream(s); init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 5); if (error == 0) { in_uint8s(s, 1); in_uint16_be(s, first_color); in_uint16_be(s, num_colors); init_stream(s, 8192); error = trans_force_read_s(v->trans, s, num_colors * 6); } if (error == 0) { for (i = 0; i < num_colors; i++) { in_uint16_be(s, r); in_uint16_be(s, g); in_uint16_be(s, b); r = r >> 8; g = g >> 8; b = b >> 8; v->palette[first_color + i] = (r << 16) | (g << 8) | b; } error = v->server_begin_update(v); } if (error == 0) { error = v->server_palette(v, v->palette); } if (error == 0) { error = v->server_end_update(v); } free_stream(s); return error; } /******************************************************************************/ int lib_bell_trigger(struct vnc *v) { int error; error = v->server_bell_trigger(v); return error; } /******************************************************************************/ int lib_mod_signal(struct vnc *v) { return 0; } /******************************************************************************/ static int lib_mod_process_message(struct vnc *v, struct stream *s) { char type; int error; char text[256]; in_uint8(s, type); error = 0; if (error == 0) { if (type == RFB_S2C_FRAMEBUFFER_UPDATE) { switch (v->resize_status) { case VRS_WAITING_FOR_FIRST_UPDATE: error = lib_framebuffer_first_update(v); break; case VRS_WAITING_FOR_RESIZE_CONFIRM: error = lib_framebuffer_waiting_for_resize_confirm(v); break; default: error = lib_framebuffer_update(v); } } else if (type == RFB_S2C_SET_COLOUR_MAP_ENTRIES) { error = lib_palette_update(v); } else if (type == RFB_S2C_BELL) { error = lib_bell_trigger(v); } else if (type == RFB_S2C_SERVER_CUT_TEXT) /* clipboard */ { LOG(LOG_LEVEL_DEBUG, "VNC got clip data"); error = vnc_clip_process_rfb_data(v); } else { g_sprintf(text, "VNC unknown in lib_mod_process_message %d", type); v->server_msg(v, text, 1); } } return error; } /******************************************************************************/ int lib_mod_start(struct vnc *v, int w, int h, int bpp) { v->server_begin_update(v); v->server_set_fgcolor(v, 0); v->server_fill_rect(v, 0, 0, w, h); v->server_end_update(v); v->server_bpp = bpp; return 0; } /******************************************************************************/ static int lib_data_in(struct trans *trans) { struct vnc *self; struct stream *s; LOG_DEVEL(LOG_LEVEL_TRACE, "lib_data_in:"); if (trans == 0) { return 1; } self = (struct vnc *)(trans->callback_data); s = trans_get_in_s(trans); if (s == 0) { return 1; } if (lib_mod_process_message(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "lib_data_in: lib_mod_process_message failed"); return 1; } init_stream(s, 0); return 0; } /******************************************************************************/ /* return error */ int lib_mod_connect(struct vnc *v) { char cursor_data[32 * (32 * 3)]; char cursor_mask[32 * (32 / 8)]; char con_port[256]; char text[256]; struct stream *s; struct stream *pixel_format; int error; int i; int check_sec_result; v->server_msg(v, "VNC started connecting", 0); check_sec_result = 1; /* check if bpp is supported for rdp connection */ switch (v->server_bpp) { case 8: case 15: case 16: case 24: case 32: break; default: v->server_msg(v, "VNC error - only supporting 8, 15, 16, 24 and 32 " "bpp rdp connections", 0); return 1; } if (g_strcmp(v->ip, "") == 0) { v->server_msg(v, "VNC error - no ip set", 0); return 1; } make_stream(s); g_sprintf(con_port, "%s", v->port); make_stream(pixel_format); v->trans = trans_create(TRANS_MODE_TCP, 8 * 8192, 8192); if (v->trans == 0) { v->server_msg(v, "VNC error: trans_create() failed", 0); free_stream(s); free_stream(pixel_format); return 1; } v->sck_closed = 0; if (v->delay_ms > 0) { g_sprintf(text, "Waiting %d ms for VNC to start...", v->delay_ms); v->server_msg(v, text, 0); g_sleep(v->delay_ms); } g_sprintf(text, "VNC connecting to %s %s", v->ip, con_port); v->server_msg(v, text, 0); v->trans->si = v->si; v->trans->my_source = XRDP_SOURCE_MOD; error = trans_connect(v->trans, v->ip, con_port, 3000); if (error == 0) { v->server_msg(v, "VNC tcp connected", 0); /* protocol version */ init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 12); if (error == 0) { s->p = s->data; out_uint8a(s, "RFB 003.003\n", 12); s_mark_end(s); error = trans_force_write_s(v->trans, s); } /* sec type */ if (error == 0) { init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 4); } if (error == 0) { in_uint32_be(s, i); g_sprintf(text, "VNC security level is %d (1 = none, 2 = standard)", i); v->server_msg(v, text, 0); if (i == 1) /* none */ { check_sec_result = 0; } else if (i == 2) /* dec the password and the server random */ { init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 16); if (error == 0) { init_stream(s, 8192); if (guid_is_set(&v->guid)) { char guid_str[GUID_STR_SIZE]; guid_to_str(&v->guid, guid_str); rfbHashEncryptBytes(s->data, guid_str); } else { rfbEncryptBytes(s->data, v->password); } s->p += 16; s_mark_end(s); error = trans_force_write_s(v->trans, s); check_sec_result = 1; // not needed } } else if (i == 0) { LOG(LOG_LEVEL_ERROR, "VNC Server will disconnect"); error = 1; } else { LOG(LOG_LEVEL_ERROR, "VNC unsupported security level %d", i); error = 1; } } } if (error != 0) { LOG(LOG_LEVEL_ERROR, "VNC error %d after security negotiation", error); } if (error == 0 && check_sec_result) { /* sec result */ init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 4); if (error == 0) { in_uint32_be(s, i); if (i != 0) { v->server_msg(v, "VNC password failed", 0); error = 2; } else { v->server_msg(v, "VNC password ok", 0); } } } if (error == 0) { v->server_msg(v, "VNC sending share flag", 0); init_stream(s, 8192); s->data[0] = 1; s->p++; s_mark_end(s); error = trans_force_write_s(v->trans, s); /* share flag */ } else { LOG(LOG_LEVEL_ERROR, "VNC error before sending share flag"); } if (error == 0) { v->server_msg(v, "VNC receiving server init", 0); init_stream(s, 8192); error = trans_force_read_s(v->trans, s, 4); /* server init */ } else { LOG(LOG_LEVEL_ERROR, "VNC error before receiving server init"); } if (error == 0) { int width; int height; in_uint16_be(s, width); in_uint16_be(s, height); init_single_screen_layout(width, height, &v->server_layout); init_stream(pixel_format, 8192); v->server_msg(v, "VNC receiving pixel format", 0); error = trans_force_read_s(v->trans, pixel_format, 16); } else { LOG(LOG_LEVEL_ERROR, "VNC error before receiving pixel format"); } if (error == 0) { init_stream(s, 8192); v->server_msg(v, "VNC receiving name length", 0); error = trans_force_read_s(v->trans, s, 4); /* name len */ } else { LOG(LOG_LEVEL_ERROR, "VNC error before receiving name length"); } if (error == 0) { in_uint32_be(s, i); if (i > 255 || i < 0) { error = 3; } else { init_stream(s, 8192); v->server_msg(v, "VNC receiving name", 0); error = trans_force_read_s(v->trans, s, i); /* name len */ g_memcpy(v->mod_name, s->data, i); v->mod_name[i] = 0; } } else { LOG(LOG_LEVEL_ERROR, "VNC error before receiving name"); } /* should be connected */ if (error == 0) { init_stream(s, 8192); out_uint8(s, RFB_C2S_SET_PIXEL_FORMAT); out_uint8(s, 0); out_uint8(s, 0); out_uint8(s, 0); init_stream(pixel_format, 8192); if (v->server_bpp == 8) { out_uint8(pixel_format, 8); /* bits per pixel */ out_uint8(pixel_format, 8); /* depth */ #if defined(B_ENDIAN) out_uint8(pixel_format, 1); /* big endian */ #else out_uint8(pixel_format, 0); /* big endian */ #endif out_uint8(pixel_format, 0); /* true color flag */ out_uint16_be(pixel_format, 0); /* red max */ out_uint16_be(pixel_format, 0); /* green max */ out_uint16_be(pixel_format, 0); /* blue max */ out_uint8(pixel_format, 0); /* red shift */ out_uint8(pixel_format, 0); /* green shift */ out_uint8(pixel_format, 0); /* blue shift */ out_uint8s(pixel_format, 3); /* pad */ } else if (v->server_bpp == 15) { out_uint8(pixel_format, 16); /* bits per pixel */ out_uint8(pixel_format, 15); /* depth */ #if defined(B_ENDIAN) out_uint8(pixel_format, 1); /* big endian */ #else out_uint8(pixel_format, 0); /* big endian */ #endif out_uint8(pixel_format, 1); /* true color flag */ out_uint16_be(pixel_format, 31); /* red max */ out_uint16_be(pixel_format, 31); /* green max */ out_uint16_be(pixel_format, 31); /* blue max */ out_uint8(pixel_format, 10); /* red shift */ out_uint8(pixel_format, 5); /* green shift */ out_uint8(pixel_format, 0); /* blue shift */ out_uint8s(pixel_format, 3); /* pad */ } else if (v->server_bpp == 16) { out_uint8(pixel_format, 16); /* bits per pixel */ out_uint8(pixel_format, 16); /* depth */ #if defined(B_ENDIAN) out_uint8(pixel_format, 1); /* big endian */ #else out_uint8(pixel_format, 0); /* big endian */ #endif out_uint8(pixel_format, 1); /* true color flag */ out_uint16_be(pixel_format, 31); /* red max */ out_uint16_be(pixel_format, 63); /* green max */ out_uint16_be(pixel_format, 31); /* blue max */ out_uint8(pixel_format, 11); /* red shift */ out_uint8(pixel_format, 5); /* green shift */ out_uint8(pixel_format, 0); /* blue shift */ out_uint8s(pixel_format, 3); /* pad */ } else if (v->server_bpp == 24 || v->server_bpp == 32) { out_uint8(pixel_format, 32); /* bits per pixel */ out_uint8(pixel_format, 24); /* depth */ #if defined(B_ENDIAN) out_uint8(pixel_format, 1); /* big endian */ #else out_uint8(pixel_format, 0); /* big endian */ #endif out_uint8(pixel_format, 1); /* true color flag */ out_uint16_be(pixel_format, 255); /* red max */ out_uint16_be(pixel_format, 255); /* green max */ out_uint16_be(pixel_format, 255); /* blue max */ out_uint8(pixel_format, 16); /* red shift */ out_uint8(pixel_format, 8); /* green shift */ out_uint8(pixel_format, 0); /* blue shift */ out_uint8s(pixel_format, 3); /* pad */ } out_uint8a(s, pixel_format->data, 16); v->server_msg(v, "VNC sending pixel format", 0); s_mark_end(s); error = trans_force_write_s(v->trans, s); } if (error == 0) { encoding_type e[10]; unsigned int n = 0; unsigned int i; /* These encodings are always supported */ e[n++] = RFB_ENC_RAW; e[n++] = RFB_ENC_COPY_RECT; e[n++] = RFB_ENC_CURSOR; e[n++] = RFB_ENC_DESKTOP_SIZE; if (v->enabled_encodings_mask & MSK_EXTENDED_DESKTOP_SIZE) { e[n++] = RFB_ENC_EXTENDED_DESKTOP_SIZE; } else { LOG(LOG_LEVEL_INFO, "VNC User disabled EXTENDED_DESKTOP_SIZE"); } init_stream(s, 8192); out_uint8(s, RFB_C2S_SET_ENCODINGS); out_uint8(s, 0); out_uint16_be(s, n); /* Number of encodings following */ for (i = 0 ; i < n; ++i) { out_uint32_be(s, e[i]); } s_mark_end(s); error = trans_force_write_s(v->trans, s); } if (error == 0) { v->resize_supported = VRSS_UNKNOWN; v->resize_status = VRS_WAITING_FOR_FIRST_UPDATE; error = send_update_request_for_resize_status(v); } if (error == 0) { /* set almost null cursor, this is the little dot cursor */ g_memset(cursor_data, 0, 32 * (32 * 3)); g_memset(cursor_data + (32 * (32 * 3) - 1 * 32 * 3), 0xff, 9); g_memset(cursor_data + (32 * (32 * 3) - 2 * 32 * 3), 0xff, 9); g_memset(cursor_data + (32 * (32 * 3) - 3 * 32 * 3), 0xff, 9); g_memset(cursor_mask, 0xff, 32 * (32 / 8)); v->server_msg(v, "VNC sending cursor", 0); error = v->server_set_cursor(v, 3, 3, cursor_data, cursor_mask); } free_stream(s); free_stream(pixel_format); if (error == 0) { v->server_msg(v, "VNC connection complete, connected ok", 0); vnc_clip_open_clip_channel(v); } else { v->server_msg(v, "VNC error - problem connecting", 0); } if (error != 0) { trans_delete(v->trans); v->trans = 0; v->server_msg(v, "some problem", 0); return 1; } else { v->server_msg(v, "connected ok", 0); v->trans->trans_data_in = lib_data_in; v->trans->header_size = 1; v->trans->callback_data = v; } return error; } /******************************************************************************/ int lib_mod_end(struct vnc *v) { if (v->vnc_desktop != 0) { } return 0; } /**************************************************************************//** * Initialises the client layout from the Windows monitor definition. * * @param v VNC module * @param [in] width session width * @param [in] height session height * @param [in] num_monitors (can be 0, meaning one monitor) * @param [in] monitors Monitor definitions for num_monitors > 0 * @param [in] multimon_configured Whether multimon is configured */ static void init_client_layout(struct vnc *v, int width, int height, int num_monitors, const struct monitor_info *monitors) { struct vnc_screen_layout *layout = &v->client_layout; if (!v->multimon_configured || num_monitors < 1) { init_single_screen_layout(width, height, layout); } else { layout->total_width = width; layout->total_height = height; layout->count = num_monitors; unsigned int i; for (i = 0 ; i < layout->count; ++i) { layout->s[i].id = i; layout->s[i].x = monitors[i].left; layout->s[i].y = monitors[i].top; layout->s[i].width = monitors[i].right - monitors[i].left + 1; layout->s[i].height = monitors[i].bottom - monitors[i].top + 1; layout->s[i].flags = 0; } } } /******************************************************************************/ int lib_mod_set_param(struct vnc *v, const char *name, const char *value) { if (g_strcasecmp(name, "username") == 0) { g_strncpy(v->username, value, 255); } else if (g_strcasecmp(name, "password") == 0) { g_strncpy(v->password, value, 255); } else if (g_strcasecmp(name, "ip") == 0) { g_strncpy(v->ip, value, 255); } else if (g_strcasecmp(name, "port") == 0) { g_strncpy(v->port, value, 255); } else if (g_strcasecmp(name, "keylayout") == 0) { v->keylayout = g_atoi(value); } else if (g_strcasecmp(name, "delay_ms") == 0) { v->delay_ms = g_atoi(value); } else if (g_strcasecmp(name, "guid") == 0) { v->guid = *(struct guid *)value; } else if (g_strcasecmp(name, "disabled_encodings_mask") == 0) { v->enabled_encodings_mask = ~g_atoi(value); } else if (g_strcasecmp(name, "client_info") == 0) { const struct xrdp_client_info *client_info = (const struct xrdp_client_info *) value; v->multimon_configured = client_info->multimon; /* Save monitor information from the client * Use minfo_wm, as this is normalised for a top-left of (0,0) * as required by RFC6143 */ init_client_layout(v, client_info->display_sizes.session_width, client_info->display_sizes.session_height, client_info->display_sizes.monitorCount, client_info->display_sizes.minfo_wm); log_screen_layout(LOG_LEVEL_DEBUG, "client_info", &v->client_layout); } return 0; } /******************************************************************************/ /* return error */ int lib_mod_get_wait_objs(struct vnc *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout) { LOG_DEVEL(LOG_LEVEL_TRACE, "lib_mod_get_wait_objs:"); if (v != 0) { if (v->trans != 0) { trans_get_wait_objs_rw(v->trans, read_objs, rcount, write_objs, wcount, timeout); } } return 0; } /******************************************************************************/ /* return error */ int lib_mod_check_wait_objs(struct vnc *v) { int rv; rv = 0; if (v != 0) { if (v->trans != 0) { rv = trans_check_wait_objs(v->trans); if (rv != 0) { LOG(LOG_LEVEL_ERROR, "VNC server closed connection"); } } } return rv; } /******************************************************************************/ /* return error */ int lib_mod_frame_ack(struct vnc *v, int flags, int frame_id) { return 0; } /******************************************************************************/ /* return error */ int lib_mod_suppress_output(struct vnc *v, int suppress, int left, int top, int right, int bottom) { int error; struct stream *s; error = 0; v->suppress_output = suppress; if (suppress == 0) { make_stream(s); init_stream(s, 8192); out_uint8(s, RFB_C2S_FRAMEBUFFER_UPDATE_REQUEST); out_uint8(s, 0); /* incremental == 0 : Full contents */ out_uint16_be(s, 0); out_uint16_be(s, 0); out_uint16_be(s, v->server_layout.total_width); out_uint16_be(s, v->server_layout.total_height); s_mark_end(s); error = lib_send_copy(v, s); free_stream(s); } return error; } /******************************************************************************/ /* return error */ int lib_mod_server_version_message(struct vnc *v) { return 0; } /******************************************************************************/ /* return error */ int lib_mod_server_monitor_resize(struct vnc *v, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress) { int error; *in_progress = 0; init_client_layout(v, width, height, num_monitors, monitors); if ((error = resize_server_to_client_layout(v)) == 0) { // If we're waiting for a confirmation, send an update request. // According to the spec this should not be needed, but // it works around a buggy VNC server not sending an // ExtendedDesktopSize rectangle if the desktop change is // small (eg. same dimensions, but 2 monitors -> 1 monitor) if (v->resize_status == VRS_WAITING_FOR_RESIZE_CONFIRM && (error = send_update_request_for_resize_status(v)) == 0) { *in_progress = 1; } } return error; } /******************************************************************************/ /* return error */ int lib_mod_server_monitor_full_invalidate(struct vnc *v, int param1, int param2) { return 0; } /******************************************************************************/ tintptr EXPORT_CC mod_init(void) { struct vnc *v; v = (struct vnc *)g_malloc(sizeof(struct vnc), 1); /* set client functions */ v->size = sizeof(struct vnc); v->version = CURRENT_MOD_VER; v->handle = (tintptr) v; v->mod_connect = lib_mod_connect; v->mod_start = lib_mod_start; v->mod_event = lib_mod_event; v->mod_signal = lib_mod_signal; v->mod_end = lib_mod_end; v->mod_set_param = lib_mod_set_param; v->mod_get_wait_objs = lib_mod_get_wait_objs; v->mod_check_wait_objs = lib_mod_check_wait_objs; v->mod_frame_ack = lib_mod_frame_ack; v->mod_suppress_output = lib_mod_suppress_output; v->mod_server_monitor_resize = lib_mod_server_monitor_resize; v->mod_server_monitor_full_invalidate = lib_mod_server_monitor_full_invalidate; v->mod_server_version_message = lib_mod_server_version_message; /* Member variables */ v->enabled_encodings_mask = -1; vnc_clip_init(v); return (tintptr) v; } /******************************************************************************/ int EXPORT_CC mod_exit(tintptr handle) { struct vnc *v = (struct vnc *) handle; LOG(LOG_LEVEL_TRACE, "VNC mod_exit"); if (v == 0) { return 0; } trans_delete(v->trans); vnc_clip_exit(v); g_free(v); return 0; } xrdp-0.10.1/vnc/Makefile.in000644 001751 000000 00000054477 14652432075 015512 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = vnc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libvnc_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libvnc_la_OBJECTS = vnc.lo vnc_clip.lo rfb.lo libvnc_la_OBJECTS = $(am_libvnc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libvnc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libvnc_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rfb.Plo ./$(DEPDIR)/vnc.Plo \ ./$(DEPDIR)/vnc_clip.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libvnc_la_SOURCES) DIST_SOURCES = $(libvnc_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libvnc.la libvnc_la_SOURCES = \ vnc.c \ vnc_clip.c \ rfb.c \ vnc.h \ vnc_clip.h \ rfb.h libvnc_la_LIBADD = \ $(top_builddir)/common/libcommon.la @MACOS_FALSE@libvnc_la_LDFLAGS = -avoid-version -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign vnc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign vnc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libvnc.la: $(libvnc_la_OBJECTS) $(libvnc_la_DEPENDENCIES) $(EXTRA_libvnc_la_DEPENDENCIES) $(AM_V_CCLD)$(libvnc_la_LINK) -rpath $(moduledir) $(libvnc_la_OBJECTS) $(libvnc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfb.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vnc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vnc_clip.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/rfb.Plo -rm -f ./$(DEPDIR)/vnc.Plo -rm -f ./$(DEPDIR)/vnc_clip.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/rfb.Plo -rm -f ./$(DEPDIR)/vnc.Plo -rm -f ./$(DEPDIR)/vnc_clip.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/vnc/rfb.c000644 001751 000000 00000002764 14652432047 014351 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libvnc - RFB specific functions */ #if defined(HAVE_CONFIG_H) #include #endif #include "rfb.h" /* Messages for ExtendedDesktopSize status code */ static const char *eds_status_msg[] = { /* 0 */ "No error", /* 1 */ "Resize is administratively prohibited", /* 2 */ "Out of resources", /* 3 */ "Invalid screen layout", /* others */ "Unknown code" }; /* elements in above list */ #define EDS_STATUS_MSG_COUNT \ (sizeof(eds_status_msg) / sizeof(eds_status_msg[0])) /**************************************************************************//** * Returns an error string for an ExtendedDesktopSize status code */ const char * rfb_get_eds_status_msg(unsigned int response_code) { if (response_code >= EDS_STATUS_MSG_COUNT) { response_code = EDS_STATUS_MSG_COUNT - 1; } return eds_status_msg[response_code]; } xrdp-0.10.1/tools/Makefile.in000644 001751 000000 00000047350 14652432075 016054 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = \ devel all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tools/Makefile.am000644 001751 000000 00000000025 14652432047 016026 0ustar00metawheel000000 000000 SUBDIRS = \ devel xrdp-0.10.1/tools/devel/000755 001751 000000 00000000000 14652432105 015067 5ustar00metawheel000000 000000 xrdp-0.10.1/tools/devel/gtcp_proxy/000755 001751 000000 00000000000 14652432047 017272 5ustar00metawheel000000 000000 xrdp-0.10.1/tools/devel/tcp_proxy/000755 001751 000000 00000000000 14652432105 017116 5ustar00metawheel000000 000000 xrdp-0.10.1/tools/devel/Makefile.in000644 001751 000000 00000047433 14652432075 017155 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = tools/devel ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ gtcp_proxy SUBDIRS = \ tcp_proxy all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/devel/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/devel/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tools/devel/Makefile.am000644 001751 000000 00000000066 14652432047 017132 0ustar00metawheel000000 000000 EXTRA_DIST = \ gtcp_proxy SUBDIRS = \ tcp_proxy xrdp-0.10.1/tools/devel/tcp_proxy/main.c000644 001751 000000 00000021137 14652432047 020217 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "log.h" #include "os_calls.h" #include "string_calls.h" int g_loc_io_count = 0; // bytes read from local port int g_rem_io_count = 0; // bytes read from remote port static int g_terminated = 0; static char g_buf[1024 * 32]; typedef unsigned short tui16; /*****************************************************************************/ static int g_tcp_socket_ok(int sck) { int opt; socklen_t opt_len = sizeof(opt); if (getsockopt(sck, SOL_SOCKET, SO_ERROR, (char *)(&opt), &opt_len) == 0) { if (opt == 0) { return 1; } } return 0; } /*****************************************************************************/ static int main_loop(char *local_port, char *remote_ip, char *remote_port, int hexdump) { int lis_sck; int acc_sck; int con_sck; int sel; int count; int sent; int error; int i; int acc_to_con; int con_to_acc; acc_to_con = 0; con_to_acc = 0; acc_sck = 0; /* create the listening socket and setup options */ lis_sck = g_tcp_socket(); g_tcp_set_non_blocking(lis_sck); error = g_tcp_bind(lis_sck, local_port); if (error != 0) { LOG(LOG_LEVEL_WARNING, "bind failed"); } /* listen for an incoming connection */ if (error == 0) { error = g_tcp_listen(lis_sck); if (error == 0) { LOG(LOG_LEVEL_INFO, "listening for connection"); } } /* accept an incoming connection */ if (error == 0) { while ((!g_terminated) && (error == 0)) { acc_sck = g_sck_accept(lis_sck); if ((acc_sck == -1) && g_tcp_last_error_would_block(lis_sck)) { g_sleep(100); } else if (acc_sck == -1) { error = 1; } else { break; } } if (error == 0) { error = g_terminated; } /* stop listening */ g_tcp_close(lis_sck); lis_sck = 0; if (error == 0) { LOG(LOG_LEVEL_INFO, "got connection"); } } /* connect outgoing socket */ con_sck = 0; if (error == 0) { con_sck = g_tcp_socket(); g_tcp_set_non_blocking(con_sck); error = g_tcp_connect(con_sck, remote_ip, remote_port); if ((error == -1) && g_tcp_last_error_would_block(con_sck)) { error = 0; i = 0; while (!(g_tcp_can_send(con_sck, 100) && g_tcp_socket_ok(con_sck)) && (!g_terminated) && (i < 100)) { g_sleep(100); i++; } if (i > 99) { LOG(LOG_LEVEL_ERROR, "timeout connecting"); error = 1; } if (g_terminated) { error = 1; } } if ((error != 0) && (!g_terminated)) { LOG(LOG_LEVEL_ERROR, "error connecting to remote\r\n"); } } while ((!g_terminated) && (error == 0)) { sel = g_tcp_select(con_sck, acc_sck); if (sel == 0) { g_sleep(10); continue; } if (sel & 1) { // can read from con_sck w/o blocking count = g_tcp_recv(con_sck, g_buf, 1024 * 16, 0); error = count < 1; if (error == 0) { g_loc_io_count += count; con_to_acc += count; if (hexdump) { LOG_HEXDUMP(LOG_LEVEL_INFO, "from remove, the socket from connect", g_buf, count); } LOG(LOG_LEVEL_DEBUG, "local_io_count: %d\tremote_io_count: %d", g_loc_io_count, g_rem_io_count); sent = 0; while ((sent < count) && (error == 0) && (!g_terminated)) { i = g_tcp_send(acc_sck, g_buf + sent, count - sent, 0); if ((i == -1) && g_tcp_last_error_would_block(acc_sck)) { if (g_tcp_can_send(acc_sck, 1000)) { g_tcp_socket_ok(acc_sck); } } else if (i < 1) { error = 1; } else { sent += i; } } } } if (sel & 2) { // can read from acc_sck w/o blocking count = g_tcp_recv(acc_sck, g_buf, 1024 * 16, 0); error = count < 1; if (error == 0) { g_rem_io_count += count; acc_to_con += count; if (hexdump) { LOG_HEXDUMP(LOG_LEVEL_INFO, "from accepted, the socket from accept", g_buf, count); } LOG(LOG_LEVEL_DEBUG, "local_io_count: %d\tremote_io_count: %d", g_loc_io_count, g_rem_io_count); sent = 0; while ((sent < count) && (error == 0) && (!g_terminated)) { i = g_tcp_send(con_sck, g_buf + sent, count - sent, 0); if ((i == -1) && g_tcp_last_error_would_block(con_sck)) { if (g_tcp_can_send(con_sck, 1000)) { g_tcp_socket_ok(con_sck); } } else if (i < 1) { error = 1; } else { sent += i; } } } } } g_tcp_close(lis_sck); g_tcp_close(con_sck); g_tcp_close(acc_sck); LOG(LOG_LEVEL_INFO, "acc_to_con %d", acc_to_con); LOG(LOG_LEVEL_INFO, "con_to_acc %d", con_to_acc); return 0; } /*****************************************************************************/ static int usage(void) { g_writeln("tcp_proxy [dump]"); return 0; } /*****************************************************************************/ void proxy_shutdown(int sig) { LOG(LOG_LEVEL_INFO, "shutting down"); g_terminated = 1; } void clear_counters(int sig) { LOG(LOG_LEVEL_DEBUG, "cleared counters at: local_io_count: %d remote_io_count: %d", g_loc_io_count, g_rem_io_count); g_loc_io_count = 0; g_rem_io_count = 0; } /*****************************************************************************/ int main(int argc, char **argv) { int dump; struct log_config *config; if (argc < 4) { usage(); return 0; } g_init("tcp_proxy"); g_signal_user_interrupt(proxy_shutdown); /* SIGINT */ g_signal_usr1(clear_counters); /* SIGUSR1 */ g_signal_terminate(proxy_shutdown); /* SIGTERM */ config = log_config_init_for_console(LOG_LEVEL_INFO, NULL); log_start_from_param(config); log_config_free(config); if (argc < 5) { while (!g_terminated) { g_loc_io_count = 0; g_rem_io_count = 0; main_loop(argv[1], argv[2], argv[3], 0); } } else { dump = g_strcasecmp(argv[4], "dump") == 0; while (!g_terminated) { main_loop(argv[1], argv[2], argv[3], dump); } } log_end(); g_deinit(); return 0; } xrdp-0.10.1/tools/devel/tcp_proxy/Makefile.am000644 001751 000000 00000000271 14652432047 021157 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -I$(top_srcdir)/common noinst_PROGRAMS = \ tcp_proxy tcp_proxy_SOURCES = \ main.c tcp_proxy_LDADD = \ $(top_builddir)/common/libcommon.la \ $(DLOPEN_LIBS) xrdp-0.10.1/tools/devel/tcp_proxy/Makefile.in000644 001751 000000 00000046060 14652432075 021177 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = tcp_proxy$(EXEEXT) subdir = tools/devel/tcp_proxy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_tcp_proxy_OBJECTS = main.$(OBJEXT) tcp_proxy_OBJECTS = $(am_tcp_proxy_OBJECTS) am__DEPENDENCIES_1 = tcp_proxy_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/main.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(tcp_proxy_SOURCES) DIST_SOURCES = $(tcp_proxy_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir)/common tcp_proxy_SOURCES = \ main.c tcp_proxy_LDADD = \ $(top_builddir)/common/libcommon.la \ $(DLOPEN_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/devel/tcp_proxy/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/devel/tcp_proxy/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) tcp_proxy$(EXEEXT): $(tcp_proxy_OBJECTS) $(tcp_proxy_DEPENDENCIES) $(EXTRA_tcp_proxy_DEPENDENCIES) @rm -f tcp_proxy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tcp_proxy_OBJECTS) $(tcp_proxy_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/main.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/main.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tools/devel/gtcp_proxy/gtcp.c000644 001751 000000 00000020671 14652432047 020401 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "gtcp.h" /** * Return a newly created socket or -1 on error *****************************************************************************/ int tcp_socket_create(void) { int rv; int option_value; socklen_t option_len; /* in win32 a socket is an unsigned int, in linux, it's an int */ if ((rv = (int) socket(PF_INET, SOCK_STREAM, 0)) < 0) { return -1; } option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, option_len); } } option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *) &option_value, &option_len) == 0) { if (option_value < (1024 * 32)) { option_value = 1024 * 32; option_len = sizeof(option_value); setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *) &option_value, option_len); } } return rv; } /** * Place specified socket in non blocking mode *****************************************************************************/ void tcp_set_non_blocking(int skt) { unsigned long i; #if defined(_WIN32) i = 1; ioctlsocket(skt, FIONBIO, &i); #else i = fcntl(skt, F_GETFL); i = i | O_NONBLOCK; fcntl(skt, F_SETFL, i); #endif } /** * Assign name to socket * * @param skt the socket to bind * @param port the port to bind to * * @return 0 on success, -1 on error *****************************************************************************/ int tcp_bind(int skt, char *port) { struct sockaddr_in s; memset(&s, 0, sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = htons((uint16_t) atoi(port)); s.sin_addr.s_addr = INADDR_ANY; return bind(skt, (struct sockaddr *) &s, sizeof(struct sockaddr_in)); } /** * Listen for incoming connections * * @param skt the socket to listen on * * @return 0 on success, -1 on error *****************************************************************************/ int tcp_listen(int skt) { return listen(skt, 2); } /** * Accept incoming connection * * @param skt socket to accept incoming connection on * * @return 0 on success, -1 on error *****************************************************************************/ int tcp_accept(int skt) { struct sockaddr_in s; socklen_t i; i = sizeof(struct sockaddr_in); memset(&s, 0, i); return accept(skt, (struct sockaddr *)&s, &i); } /** * Check if the socket would block * * @return TRUE if would block, else FALSE *****************************************************************************/ int tcp_last_error_would_block() { #if defined(_WIN32) return WSAGetLastError() == WSAEWOULDBLOCK; #else return (errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == EINPROGRESS); #endif } /** * Close specified socket *****************************************************************************/ void tcp_close(int skt) { if (skt <= 0) { return; } #if defined(_WIN32) closesocket(skt); #else close(skt); #endif } /** * Create a new socket * * @return new socket or -1 on error *****************************************************************************/ int tcp_socket(void) { int rv; int option_value; socklen_t option_len; /* in win32 a socket is an unsigned int, in linux, it's an int */ if ((rv = (int) socket(PF_INET, SOCK_STREAM, 0)) < 0) { return -1; } option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, option_len); } } option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *) &option_value, &option_len) == 0) { if (option_value < (1024 * 32)) { option_value = 1024 * 32; option_len = sizeof(option_value); setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *) &option_value, option_len); } } return rv; } /** * Connect to a server * * @param skt opaque socket obj * @param address connect to this server * @param port using this port * * @return 0 on success, -1 on error *****************************************************************************/ int tcp_connect(int skt, const char *hostname, const char *port) { struct sockaddr_in s; struct hostent *h; memset(&s, 0, sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = htons((uint16_t) atoi(port)); s.sin_addr.s_addr = inet_addr(hostname); if (s.sin_addr.s_addr == INADDR_NONE) { h = gethostbyname(hostname); if (h != 0) { if (h->h_name != 0) { if (h->h_addr_list != 0) { if ((*(h->h_addr_list)) != 0) { s.sin_addr.s_addr = *((int *)(*(h->h_addr_list))); } } } } } return connect(skt, (struct sockaddr *) &s, sizeof(struct sockaddr_in)); } /** * Return 1 if we can write to the socket, 0 otherwise *****************************************************************************/ int tcp_can_send(int skt, int millis) { int rv = 0; if (skt > 0) { struct pollfd pollfd; pollfd.fd = skt; pollfd.events = POLLOUT; pollfd.revents = 0; if (poll(&pollfd, 1, millis) > 0) { if ((pollfd.revents & POLLOUT) != 0) { rv = 1; } } } return rv; } /** * Return 1 if socket is OK, 0 otherwise *****************************************************************************/ int tcp_socket_ok(int skt) { int opt; socklen_t opt_len = sizeof(opt); if (getsockopt(skt, SOL_SOCKET, SO_ERROR, (char *) (&opt), &opt_len) == 0) { if (opt == 0) { return 1; } } return 0; } /** * Check if specified sockets can be operated on without blocking * * @return 1 if they can be operated on or 0 if blocking would occur *****************************************************************************/ int tcp_select(int sck1, int sck2) { struct pollfd pollfd[2] = {0}; int rvmask[2] = {0}; /* Output masks corresponding to fds in pollfd */ unsigned int i = 0; int rv = 0; if (sck1 > 0) { pollfd[i].fd = sck1; pollfd[i].events = POLLIN; rvmask[i] = 1; ++i; } if (sck2 > 0) { pollfd[i].fd = sck2; pollfd[i].events = POLLIN; rvmask[i] = 2; ++i; } if (poll(pollfd, i, 0) > 0) { if ((pollfd[0].revents & (POLLIN | POLLHUP)) != 0) { rv |= rvmask[0]; } if ((pollfd[1].revents & (POLLIN | POLLHUP)) != 0) { rv |= rvmask[1]; } } return rv; } int tcp_recv(int skt, void *ptr, int len, int flags) { #if defined(_WIN32) return recv(skt, (char *) ptr, len, flags); #else return recv(skt, ptr, len, flags); #endif } int tcp_send(int skt, const void *ptr, int len, int flags) { #if defined(_WIN32) return send(skt, (const char *)ptr, len, flags); #else return send(skt, ptr, len, flags); #endif } xrdp-0.10.1/tools/devel/gtcp_proxy/README.txt000644 001751 000000 00000000147 14652432047 020772 0ustar00metawheel000000 000000 gtcp-proxy is a 'man in the middle' program to monitor data flowing between two network connections. xrdp-0.10.1/tools/devel/gtcp_proxy/hexdump.c000644 001751 000000 00000007326 14652432047 021120 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include /** * An optimized hexdump function * * @param address address to display in address column * @param buf data to hexdump * @param len number of bytes to dump *****************************************************************************/ void hexdump(int address, char *buf, int len) { uint32_t addr; char outbuf[80]; int blocks; int residual; int i; int j; int buf_index; int index2; /* data column */ int index3; /* ascii column */ unsigned char c; char cvt[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; if ((buf == NULL) || (len <= 0)) { return; } addr = (address < 0) ? 0 : address; blocks = len / 16; residual = len - blocks * 16; buf_index = 0; for (i = 0; i < blocks; i++) { index2 = 10; index3 = 60; outbuf[9] = ' '; outbuf[8] = ' '; outbuf[7] = cvt[(addr >> 0) & 0x0000000f]; outbuf[6] = cvt[(addr >> 4) & 0x0000000f]; outbuf[5] = cvt[(addr >> 8) & 0x0000000f]; outbuf[4] = cvt[(addr >> 12) & 0x0000000f]; outbuf[3] = cvt[(addr >> 16) & 0x0000000f]; outbuf[2] = cvt[(addr >> 20) & 0x0000000f]; outbuf[1] = cvt[(addr >> 24) & 0x0000000f]; outbuf[0] = cvt[(addr >> 28) & 0x0000000f]; addr += 16; /* insert spaces */ outbuf[8] = ' '; outbuf[9] = ' '; outbuf[58] = ' '; outbuf[59] = ' '; for (j = 0; j < 16; j++) { c = buf[buf_index++]; outbuf[index2++] = cvt[(c >> 4) & 0x0f]; outbuf[index2++] = cvt[(c >> 0) & 0x0f]; outbuf[index2++] = ' '; if ((c >= 0x20) && (c <= 0x7e)) { outbuf[index3++] = c; } else { outbuf[index3++] = '.'; } } outbuf[index3] = 0; puts(outbuf); } if (!residual) { return; } outbuf[7] = cvt[(addr >> 0) & 0x0000000f]; outbuf[6] = cvt[(addr >> 4) & 0x0000000f]; outbuf[5] = cvt[(addr >> 8) & 0x0000000f]; outbuf[4] = cvt[(addr >> 12) & 0x0000000f]; outbuf[3] = cvt[(addr >> 16) & 0x0000000f]; outbuf[2] = cvt[(addr >> 20) & 0x0000000f]; outbuf[1] = cvt[(addr >> 24) & 0x0000000f]; outbuf[0] = cvt[(addr >> 28) & 0x0000000f]; addr += 16; index2 = 10; index3 = 60; memset(&outbuf[8], ' ', 68); for (j = 0; j < residual; j++) { c = buf[buf_index++]; outbuf[index2++] = cvt[(c >> 4) & 0x0f]; outbuf[index2++] = cvt[(c >> 0) & 0x0f]; outbuf[index2++] = ' '; if ((c >= 0x20) && (c <= 0x7e)) { outbuf[index3++] = c; } else { outbuf[index3++] = '.'; } } outbuf[index3] = 0; puts(outbuf); } xrdp-0.10.1/tools/devel/gtcp_proxy/gtcp.h000644 001751 000000 00000002621 14652432047 020401 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _GTCP_H #define _GTCP_H #include #include #include #include #include #include #include #include #include #include int tcp_socket_create(void); void tcp_set_non_blocking(int skt); int tcp_bind(int skt, char *port); int tcp_listen(int skt); int tcp_accept(int skt); int tcp_last_error_would_block(); void tcp_close(int skt); int tcp_socket(void); int tcp_connect(int skt, const char *hostname, const char *port); int tcp_can_send(int skt, int millis); int tcp_socket_ok(int skt); int tcp_select(int sck1, int sck2); int tcp_recv(int skt, void *ptr, int len, int flags); int tcp_send(int skt, const void *ptr, int len, int flags); #endif xrdp-0.10.1/tools/devel/gtcp_proxy/gtcp-proxy.c000644 001751 000000 00000046622 14652432047 021564 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "gtcp.h" #define WINDOW_TITLE "Tcp Proxy Version 1.0" #define CONTEXT_ID 1 #define MSG_INFO GTK_MESSAGE_INFO #define MSG_WARN GTK_MESSAGE_WARNING #define MSG_ERROR GTK_MESSAGE_ERROR #define MAIN_THREAD_YES 0 #define MAIN_THREAD_NO 1 /* globals */ pthread_t g_tid; int g_keep_running = 1; int g_loc_io_count = 0; /* bytes read from local port */ int g_rem_io_count = 0; /* bytes read from remote port */ GtkWidget *g_btn_start; GtkWidget *g_tbx_loc_port; GtkWidget *g_tbx_rem_ip; GtkWidget *g_tbx_rem_port; GtkWidget *g_tbx_loc_stats; GtkWidget *g_tbx_rem_stats; GtkWidget *g_statusbar; GtkWidget *g_txtvu_loc_port; GtkWidget *g_txtvu_rem_port; /* forward declarations */ static void *tcp_proxy(void *arg); static void show_msg(int not_main_thread, int style, const gchar *title, const gchar *msg); static void show_status(int not_main_thread, char *msg); static void clear_status(int not_main_thread); static void enable_btn_start(int main_thread); static void disable_btn_start(int main_thread); /* getters */ static char *get_local_port(); static char *get_remote_ip(); static char *get_remote_port(); /* setters */ static void show_loc_port_stats(int main_thread, int count); static void show_rem_port_stats(int main_thread, int count); /* handlers */ static gboolean on_delete_event(GtkWidget *widget, GdkEvent *ev, gpointer data); static void on_destroy(GtkWidget *widget, gpointer data); static void on_start_clicked(GtkWidget *widget, gpointer data); static void on_clear_clicked(GtkWidget *widget, gpointer data); static void on_quit_clicked(GtkWidget *widget, gpointer data); int main(int argc, char **argv) { /* init threads */ g_thread_init(NULL); gdk_threads_init(); /* setup GTK */ gtk_init(&argc, &argv); /* create labels and right justify them */ GtkWidget *lbl_loc_port = gtk_label_new("Local port"); GtkWidget *lbl_rem_ip = gtk_label_new("Remote IP"); GtkWidget *lbl_rem_port = gtk_label_new("Remote port"); GtkWidget *lbl_loc_stats = gtk_label_new("Local port recv stats"); GtkWidget *lbl_rem_stats = gtk_label_new("Remote port recv stats"); gtk_misc_set_alignment(GTK_MISC(lbl_loc_port), 1.0, 0.5); gtk_misc_set_alignment(GTK_MISC(lbl_rem_ip), 1.0, 0.5); gtk_misc_set_alignment(GTK_MISC(lbl_rem_port), 1.0, 0.5); gtk_misc_set_alignment(GTK_MISC(lbl_loc_stats), 1.0, 0.5); gtk_misc_set_alignment(GTK_MISC(lbl_rem_stats), 1.0, 0.5); /* create text boxes */ g_tbx_loc_port = gtk_entry_new(); g_tbx_rem_ip = gtk_entry_new(); g_tbx_rem_port = gtk_entry_new(); g_tbx_loc_stats = gtk_entry_new(); g_tbx_rem_stats = gtk_entry_new(); /* stat text boxes are read only */ gtk_entry_set_editable(GTK_ENTRY(g_tbx_loc_stats), FALSE); gtk_entry_set_editable(GTK_ENTRY(g_tbx_rem_stats), FALSE); /* enable when debugging */ #if 0 gtk_entry_set_text(GTK_ENTRY(g_tbx_loc_port), "1234"); gtk_entry_set_text(GTK_ENTRY(g_tbx_rem_ip), "192.168.2.20"); gtk_entry_set_text(GTK_ENTRY(g_tbx_rem_port), "43222"); #endif /* setup buttons inside a HBox */ g_btn_start = gtk_button_new_with_label("Start listening"); GtkWidget *btn_clear = gtk_button_new_with_label("Clear receive stats"); GtkWidget *btn_quit = gtk_button_new_with_label("Quit application"); GtkWidget *hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start_defaults(GTK_BOX(hbox), g_btn_start); gtk_box_pack_start_defaults(GTK_BOX(hbox), btn_clear); gtk_box_pack_start_defaults(GTK_BOX(hbox), btn_quit); #if 0 g_txtvu_loc_port = gtk_text_view_new(); g_txtvu_rem_port = gtk_text_view_new(); #endif /* create table */ GtkWidget *table = gtk_table_new(8, 3, FALSE); int row = 0; /* insert labels into table */ gtk_table_attach(GTK_TABLE(table), lbl_loc_port, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), lbl_rem_ip, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), lbl_rem_port, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), lbl_loc_stats, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), lbl_rem_stats, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; row = 0; /* insert text boxes into table */ gtk_table_attach(GTK_TABLE(table), g_tbx_loc_port, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), g_tbx_rem_ip, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), g_tbx_rem_port, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), g_tbx_loc_stats, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; gtk_table_attach(GTK_TABLE(table), g_tbx_rem_stats, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; row++; /* insert hbox with buttons into table */ gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; #if 0 /* text view to display hexdumps */ gtk_table_attach(GTK_TABLE(table), g_txtvu_loc_port, 0, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); row++; #endif /* status bar to display messages */ g_statusbar = gtk_statusbar_new(); gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(g_statusbar), TRUE); gtk_table_attach(GTK_TABLE(table), g_statusbar, 0, 2, row, row + 1, GTK_FILL, GTK_FILL, 5, 0); /* setup main window */ GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width(GTK_CONTAINER(window), 5); gtk_window_set_default_size(GTK_WINDOW(window), 640, 480); gtk_window_set_title(GTK_WINDOW(window), WINDOW_TITLE); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_set_resizable(GTK_WINDOW(window), FALSE); gtk_container_add(GTK_CONTAINER(window), table); gtk_widget_show_all(window); /* setup callbacks */ g_signal_connect(window, "delete-event", G_CALLBACK(on_delete_event), NULL); g_signal_connect(window, "destroy", G_CALLBACK(on_destroy), NULL); g_signal_connect(g_btn_start, "clicked", G_CALLBACK(on_start_clicked), NULL); g_signal_connect(btn_clear, "clicked", G_CALLBACK(on_clear_clicked), NULL); g_signal_connect(btn_quit, "clicked", G_CALLBACK(on_quit_clicked), NULL); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); return 0; } /** * Start listening on specified local socket; when we get a connection, * connect to specified remote server and transfer data between local * and remote server *****************************************************************************/ static void *tcp_proxy(void *arg) { char buf[1024 * 32]; int lis_skt = -1; int acc_skt = -1; int con_skt = -1; int sel = 0; int rv = 0; int i = 0; int count = 0; int sent = 0; /* create listener socket */ if ((lis_skt = tcp_socket_create()) < 0) { show_msg(MAIN_THREAD_NO, MSG_ERROR, "Creating socket", "\nOperation failed. System out of resources"); enable_btn_start(MAIN_THREAD_NO); return NULL; } /* place it in non blocking mode */ tcp_set_non_blocking(lis_skt); if ((rv = tcp_bind(lis_skt, get_local_port())) != 0) { show_msg(MAIN_THREAD_NO, MSG_ERROR, "Bind error", "\nUnable to bind socket, cannot continue"); tcp_close(lis_skt); enable_btn_start(MAIN_THREAD_NO); return NULL; } /* listen for incoming connection */ if (tcp_listen(lis_skt)) { show_msg(MAIN_THREAD_NO, MSG_ERROR, "Listen error", "\nUnable to listen on socket, cannot continue"); tcp_close(lis_skt); enable_btn_start(MAIN_THREAD_NO); return NULL; } show_status(MAIN_THREAD_NO, "Waiting for client connections"); /* accept incoming connection */ while (g_keep_running) { acc_skt = tcp_accept(lis_skt); if (acc_skt > 0) { /* client connected */ show_status(MAIN_THREAD_NO, "Client connected"); tcp_close(lis_skt); lis_skt = -1; break; } if ((acc_skt < 0) && (tcp_last_error_would_block())) { /* no connection, try again */ usleep(250); continue; } else { tcp_close(lis_skt); lis_skt = -1; enable_btn_start(MAIN_THREAD_NO); return NULL; } } /* we have a client connection, try connecting to server */ if ((con_skt = tcp_socket()) < 0) { show_msg(MAIN_THREAD_NO, MSG_ERROR, "Creating socket", "\nOperation failed. System out of resources"); tcp_close(lis_skt); tcp_close(acc_skt); enable_btn_start(MAIN_THREAD_NO); return NULL; } /* place it in non blocking mode */ tcp_set_non_blocking(con_skt); rv = tcp_connect(con_skt, get_remote_ip(), get_remote_port()); #if 0 if (rv < 0) { show_status(MAIN_THREAD_NO, "Could not connect to server"); tcp_close(lis_skt); tcp_close(acc_skt); enable_btn_start(MAIN_THREAD_NO); return NULL; } #endif if ((rv < 0) && (tcp_last_error_would_block(con_skt))) { for (i = 0; i < 100; i++) { if (tcp_can_send(con_skt, 100)) { break; } usleep(100); } if (i == 100) { show_status(MAIN_THREAD_NO, "Could not connect to server"); tcp_close(lis_skt); tcp_close(acc_skt); enable_btn_start(MAIN_THREAD_NO); return NULL; } } show_status(MAIN_THREAD_NO, "Connected to server"); rv = 0; while (g_keep_running && rv == 0) { if ((sel = tcp_select(con_skt, acc_skt)) == 0) { usleep(10); continue; } if (sel & 1) { /* can read from con_skt without blocking */ count = tcp_recv(con_skt, buf, 1024 * 16, 0); rv = count < 1; if (rv == 0) { g_loc_io_count += count; show_loc_port_stats(MAIN_THREAD_NO, g_loc_io_count); /* TODO: hexdump data here */ sent = 0; while ((sent < count) && (rv == 0) && (g_keep_running)) { i = tcp_send(acc_skt, buf + sent, count - sent, 0); if ((i == -1) && tcp_last_error_would_block(acc_skt)) { tcp_can_send(acc_skt, 1000); } else if (i < 1) { rv = 1; } else { sent += i; } } } } if (sel & 2) { /* can read from acc_skt without blocking */ count = tcp_recv(acc_skt, buf, 1024 * 16, 0); rv = count < 1; if (rv == 0) { g_rem_io_count += count; show_rem_port_stats(MAIN_THREAD_NO, g_rem_io_count); /* TODO: hexdump data here */ sent = 0; while ((sent < count) && (rv == 0) && (g_keep_running)) { i = tcp_send(con_skt, buf + sent, count - sent, 0); if ((i == -1) && tcp_last_error_would_block(con_skt)) { tcp_can_send(con_skt, 1000); } else if (i < 1) { rv = 1; } else { sent += i; } } } } } tcp_close(lis_skt); tcp_close(con_skt); tcp_close(acc_skt); show_status(MAIN_THREAD_NO, "Connection closed"); enable_btn_start(MAIN_THREAD_NO); return NULL; } /** * Display a message using specified style dialog * * @param style information, warning or error * @param title text to be displayed in title bar * @param msg message to be displayed *****************************************************************************/ static void show_msg(int not_main_window, int style, const gchar *title, const gchar *msg) { GtkWidget *dialog; if (not_main_window) { gdk_threads_enter(); } dialog = gtk_message_dialog_new(GTK_WINDOW(NULL), GTK_DIALOG_DESTROY_WITH_PARENT, style, GTK_BUTTONS_OK, "%s", msg); gtk_window_set_title(GTK_WINDOW(dialog), title); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); if (not_main_window) { gdk_threads_leave(); } } /** * Write message to status bar *****************************************************************************/ static void show_status(int not_main_thread, char *msg) { if (not_main_thread) { gdk_threads_enter(); } gtk_statusbar_push(GTK_STATUSBAR(g_statusbar), CONTEXT_ID, msg); if (not_main_thread) { gdk_threads_leave(); } } /** * Clear status bar *****************************************************************************/ static void clear_status(int not_main_thread) { if (not_main_thread) { gdk_threads_enter(); } gtk_statusbar_remove_all(GTK_STATUSBAR(g_statusbar), CONTEXT_ID); if (not_main_thread) { gdk_threads_leave(); } } /** * Enable 'Start Listening' button *****************************************************************************/ static void enable_btn_start(int not_main_thread) { if (not_main_thread) { gdk_threads_enter(); } gtk_widget_set_sensitive(GTK_WIDGET(g_btn_start), TRUE); if (not_main_thread) { gdk_threads_leave(); } } /** * Disable 'Start Listening' button *****************************************************************************/ static void disable_btn_start(int not_main_thread) { if (not_main_thread) { gdk_threads_enter(); } gtk_widget_set_sensitive(GTK_WIDGET(g_btn_start), FALSE); if (not_main_thread) { gdk_threads_leave(); } } /** * Return local port setting *****************************************************************************/ static char *get_local_port() { const char *cptr = gtk_entry_get_text(GTK_ENTRY(g_tbx_loc_port)); return (char *) cptr; } /** * Return remote IP setting *****************************************************************************/ static char *get_remote_ip() { const char *cptr = gtk_entry_get_text(GTK_ENTRY(g_tbx_rem_ip)); return (char *) cptr; } /** * Return remote port setting *****************************************************************************/ static char *get_remote_port() { const char *cptr = gtk_entry_get_text(GTK_ENTRY(g_tbx_rem_port)); return (char *) cptr; } /** * Update local port stat counter *****************************************************************************/ static void show_loc_port_stats(int not_main_thread, int count) { char buf[128]; sprintf(buf, "%d", count); if (not_main_thread) { gdk_threads_enter(); } gtk_entry_set_text(GTK_ENTRY(g_tbx_loc_stats), buf); if (not_main_thread) { gdk_threads_leave(); } } /** * Update remote port stat counter *****************************************************************************/ static void show_rem_port_stats(int not_main_thread, int count) { char buf[128]; sprintf(buf, "%d", count); if (not_main_thread) { gdk_threads_enter(); } gtk_entry_set_text(GTK_ENTRY(g_tbx_rem_stats), buf); if (not_main_thread) { gdk_threads_leave(); } } /** * User clicked on window close button *****************************************************************************/ static gboolean on_delete_event(GtkWidget *widget, GdkEvent *ev, gpointer data) { return FALSE; } /** * Close application *****************************************************************************/ static void on_destroy(GtkWidget *widget, gpointer data) { /* this will destroy all windows and return control to gtk_main() */ gtk_main_quit(); } /** * Start a thread that listens for incoming connections *****************************************************************************/ static void on_start_clicked(GtkWidget *widget, gpointer data) { /* local port must be specified */ if (gtk_entry_get_text_length(GTK_ENTRY(g_tbx_loc_port)) == 0) { show_msg(MAIN_THREAD_YES, MSG_ERROR, "Invalid entry", "\nYou must enter a value for Local Port"); return; } /* remote IP must be specified */ if (gtk_entry_get_text_length(GTK_ENTRY(g_tbx_rem_ip)) == 0) { show_msg(MAIN_THREAD_YES, MSG_ERROR, "Invalid entry", "\nYou must enter a value for Remote IP"); return; } /* remote port must be specified */ if (gtk_entry_get_text_length(GTK_ENTRY(g_tbx_rem_port)) == 0) { show_msg(MAIN_THREAD_YES, MSG_ERROR, "Invalid entry", "\nYou must enter a value for Remote Port"); return; } if (pthread_create(&g_tid, NULL, tcp_proxy, NULL)) { show_msg(MAIN_THREAD_YES, MSG_ERROR, "Starting listener", "\nThread create error. System out of resources"); return; } disable_btn_start(MAIN_THREAD_YES); } /** * Clear stat counters *****************************************************************************/ static void on_clear_clicked(GtkWidget *widget, gpointer data) { g_loc_io_count = 0; g_rem_io_count = 0; show_loc_port_stats(MAIN_THREAD_YES, g_loc_io_count); show_rem_port_stats(MAIN_THREAD_YES, g_rem_io_count); } /** * Quit application *****************************************************************************/ static void on_quit_clicked(GtkWidget *widget, gpointer data) { /* this will destroy all windows and return control to gtk_main() */ gtk_main_quit(); } xrdp-0.10.1/tools/devel/gtcp_proxy/Makefile000644 001751 000000 00000000715 14652432047 020735 0ustar00metawheel000000 000000 # := evaluates the expression just once # = evaluates the expression each time it is used CFLAGS := $(shell pkg-config --cflags gtk+-2.0) CFLAGS += -O2 -Wall #LDFLAGS = -Wl LIBS := $(shell pkg-config --libs gtk+-2.0) LIBS += -ldl -lgthread-2.0 OBJS = gtcp-proxy.o gtcp.o all: gtcp-proxy gtcp-proxy: $(OBJS) gcc -Wall $(CFLAGS) $(LDFLAGS) gtcp-proxy.c gtcp.o -o gtcp-proxy $(LIBS) gtcp.o: gtcp.c gcc -c gtcp.c clean:: -rm gtcp-proxy.o gtcp.o gtcp-proxy xrdp-0.10.1/xrdp/xrdp_main_utils.c000644 001751 000000 00000016764 14652432047 017175 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * * @file xrdp_main_utils.c * @brief Functions used by XRDP's main() routine and needed elsewhere. * @author Jay Sorg, Christopher Pitstick * */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "log.h" #define THREAD_WAITING 100 static long g_threadid = 0; /* main threadid */ static long g_sync_mutex = 0; static long g_sync1_mutex = 0; static tbus g_term_event = 0; static tbus g_sigchld_event = 0; static tbus g_sync_event = 0; /* synchronize stuff */ static int g_sync_command = 0; static long g_sync_result = 0; static long g_sync_param1 = 0; static long g_sync_param2 = 0; static long (*g_sync_func)(long param1, long param2); /*****************************************************************************/ /* This function is used to run a function from the main thread. Sync_func is the function pointer that will run from main thread The function can have two long in parameters and must return long */ long g_xrdp_sync(long (*sync_func)(long param1, long param2), long sync_param1, long sync_param2) { long sync_result; int sync_command; /* If the function is called from the main thread, the function can * be called directly. g_threadid= main thread ID*/ if (tc_threadid_equal(tc_get_threadid(), g_threadid)) { /* this is the main thread, call the function directly */ /* in fork mode, this always happens too */ sync_result = sync_func(sync_param1, sync_param2); LOG_DEVEL(LOG_LEVEL_DEBUG, "g_xrdp_sync processed IN main thread -> continue"); } else { /* All threads have to wait here until the main thread * process the function. g_process_waiting_function() is called * from the listening thread. g_process_waiting_function() process the function*/ tc_mutex_lock(g_sync1_mutex); tc_mutex_lock(g_sync_mutex); g_sync_param1 = sync_param1; g_sync_param2 = sync_param2; g_sync_func = sync_func; /* set a value THREAD_WAITING so the g_process_waiting_function function * know if any function must be processed */ g_sync_command = THREAD_WAITING; tc_mutex_unlock(g_sync_mutex); /* set this event so that the main thread know if * g_process_waiting_function() must be called */ g_set_wait_obj(g_sync_event); do { g_sleep(100); tc_mutex_lock(g_sync_mutex); /* load new value from global to see if the g_process_waiting_function() * function has processed the function */ sync_command = g_sync_command; sync_result = g_sync_result; tc_mutex_unlock(g_sync_mutex); } while (sync_command != 0); /* loop until g_process_waiting_function() * has processed the request */ tc_mutex_unlock(g_sync1_mutex); LOG_DEVEL(LOG_LEVEL_DEBUG, "g_xrdp_sync processed BY main thread -> continue"); } return sync_result; } /*****************************************************************************/ /* Signal handler for SIGCHLD in the child * Note: only signal safe code (eg. setting wait event) should be executed in * this function. For more details see `man signal-safety` */ static void xrdp_child_sigchld_handler(int sig) { while (g_waitchild(NULL) > 0) { } } /*****************************************************************************/ /* called in child just after fork */ int xrdp_child_fork(void) { int pid; char text[256]; /* SIGCHLD in the child is of no interest to us */ g_signal_child_stop(xrdp_child_sigchld_handler); /* SIGCHLD */ g_close_wait_obj(g_term_event); g_close_wait_obj(g_sigchld_event); g_close_wait_obj(g_sync_event); pid = g_getpid(); g_snprintf(text, 255, "xrdp_%8.8x_main_term", pid); g_term_event = g_create_wait_obj(text); g_sigchld_event = -1; g_snprintf(text, 255, "xrdp_%8.8x_main_sync", pid); g_sync_event = g_create_wait_obj(text); return 0; } /*****************************************************************************/ long g_get_sync_mutex(void) { return g_sync_mutex; } /*****************************************************************************/ void g_set_sync_mutex(long mutex) { g_sync_mutex = mutex; } /*****************************************************************************/ long g_get_sync1_mutex(void) { return g_sync1_mutex; } /*****************************************************************************/ void g_set_sync1_mutex(long mutex) { g_sync1_mutex = mutex; } /*****************************************************************************/ void g_set_term_event(tbus event) { g_term_event = event; } /*****************************************************************************/ void g_set_sigchld_event(tbus event) { g_sigchld_event = event; } /*****************************************************************************/ tbus g_get_sync_event(void) { return g_sync_event; } /*****************************************************************************/ void g_set_sync_event(tbus event) { g_sync_event = event; } /*****************************************************************************/ long g_get_threadid(void) { return g_threadid; } /*****************************************************************************/ void g_set_threadid(long id) { g_threadid = id; } /*****************************************************************************/ tbus g_get_term(void) { return g_term_event; } /*****************************************************************************/ tbus g_get_sigchld(void) { return g_sigchld_event; } /*****************************************************************************/ int g_is_term(void) { return g_is_wait_obj_set(g_term_event); } /*****************************************************************************/ void g_set_term(int in_val) { if (in_val) { g_set_wait_obj(g_term_event); } else { g_reset_wait_obj(g_term_event); } } /*****************************************************************************/ void g_set_sigchld(int in_val) { if (in_val) { g_set_wait_obj(g_sigchld_event); } else { g_reset_wait_obj(g_sigchld_event); } } /*****************************************************************************/ /*Some function must be called from the main thread. if g_sync_command==THREAD_WAITING a function is waiting to be processed*/ void g_process_waiting_function(void) { tc_mutex_lock(g_sync_mutex); if (g_sync_command != 0) { if (g_sync_func != 0) { if (g_sync_command == THREAD_WAITING) { g_sync_result = g_sync_func(g_sync_param1, g_sync_param2); } } g_sync_command = 0; } tc_mutex_unlock(g_sync_mutex); } xrdp-0.10.1/xrdp/xrdp_listen.c000644 001751 000000 00000072710 14652432047 016320 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * listen for incoming connection */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "log.h" #include "string_calls.h" /* 'g_process' is protected by the semaphore 'g_process_sem'. One thread sets g_process and waits for the other to process it */ static tbus g_process_sem = 0; static struct xrdp_process *g_process = 0; int xrdp_listen_conn_in(struct trans *self, struct trans *new_self); /*****************************************************************************/ static int xrdp_listen_create_pro_done(struct xrdp_listen *self) { int pid; char text[256]; pid = g_getpid(); g_snprintf(text, 255, "xrdp_%8.8x_listen_pro_done_event", pid); self->pro_done_event = g_create_wait_obj(text); if (self->pro_done_event == 0) { LOG(LOG_LEVEL_WARNING, "Failure creating pro_done_event"); } return 0; } /*****************************************************************************/ struct xrdp_listen * xrdp_listen_create(void) { struct xrdp_listen *self; self = (struct xrdp_listen *)g_malloc(sizeof(struct xrdp_listen), 1); xrdp_listen_create_pro_done(self); self->trans_list = list_create(); self->process_list = list_create(); self->fork_list = list_create(); if (g_process_sem == 0) { g_process_sem = tc_sem_create(0); } return self; } /*****************************************************************************/ void xrdp_listen_delete(struct xrdp_listen *self) { int index; struct trans *ltrans; if (self == NULL) { return; } if (self->trans_list != NULL) { for (index = 0; index < self->trans_list->count; index++) { ltrans = (struct trans *) list_get_item(self->trans_list, index); trans_delete(ltrans); } list_delete(self->trans_list); } if (g_process_sem != 0) { tc_sem_delete(g_process_sem); g_process_sem = 0; } g_delete_wait_obj(self->pro_done_event); list_delete(self->process_list); list_delete(self->fork_list); g_free(self); } /*****************************************************************************/ /* returns error */ static int xrdp_listen_add_pro(struct xrdp_listen *self, struct xrdp_process *process) { list_add_item(self->process_list, (tbus)process); return 0; } /*****************************************************************************/ static int xrdp_listen_delete_done_pro(struct xrdp_listen *self) { int i; struct xrdp_process *pro; for (i = self->process_list->count - 1; i >= 0; i--) { pro = (struct xrdp_process *)list_get_item(self->process_list, i); if (pro != 0) { if (pro->status < 0) { xrdp_process_delete(pro); list_remove_item(self->process_list, i); } } } return 0; } /*****************************************************************************/ /* i can't get stupid in_val to work, hum using global var for now */ THREAD_RV THREAD_CC xrdp_process_run(void *in_val) { struct xrdp_process *process; LOG_DEVEL(LOG_LEVEL_TRACE, "process started"); process = g_process; g_process = 0; tc_sem_inc(g_process_sem); xrdp_process_main_loop(process); LOG_DEVEL(LOG_LEVEL_TRACE, "process done"); return 0; } /*****************************************************************************/ static int xrdp_listen_get_startup_params(struct xrdp_listen *self) { int fd; int index; int port_override; int fork_override; char *val; struct list *names; struct list *values; struct xrdp_startup_params *startup_params; startup_params = self->startup_params; port_override = startup_params->port[0] != 0; fork_override = startup_params->fork; fd = g_file_open_ro(startup_params->xrdp_ini); if (fd != -1) { names = list_create(); names->auto_free = 1; values = list_create(); values->auto_free = 1; if (file_read_section(fd, "globals", names, values) == 0) { for (index = 0; index < names->count; index++) { val = (char *)list_get_item(names, index); if (val != 0) { if (g_strcasecmp(val, "port") == 0) { if (port_override == 0) { val = (char *) list_get_item(values, index); g_strncpy(startup_params->port, val, sizeof(startup_params->port) - 1); } } if (g_strcasecmp(val, "fork") == 0) { if (fork_override == 0) { val = (char *) list_get_item(values, index); startup_params->fork = g_text2bool(val); } } if (g_strcasecmp(val, "tcp_nodelay") == 0) { val = (char *)list_get_item(values, index); startup_params->tcp_nodelay = g_text2bool(val); } if (g_strcasecmp(val, "tcp_keepalive") == 0) { val = (char *)list_get_item(values, index); startup_params->tcp_keepalive = g_text2bool(val); } if (g_strcasecmp(val, "tcp_send_buffer_bytes") == 0) { val = (char *)list_get_item(values, index); startup_params->tcp_send_buffer_bytes = g_atoi(val); } if (g_strcasecmp(val, "tcp_recv_buffer_bytes") == 0) { val = (char *)list_get_item(values, index); startup_params->tcp_recv_buffer_bytes = g_atoi(val); } if (g_strcasecmp(val, "use_vsock") == 0) { val = (char *)list_get_item(values, index); startup_params->use_vsock = g_text2bool(val); } } } } list_delete(names); list_delete(values); g_file_close(fd); } return 0; } /*****************************************************************************/ static int xrdp_listen_stop_all_listen(struct xrdp_listen *self) { int index; struct trans *ltrans; if (self->trans_list == NULL) { return 0; } for (index = 0; index < self->trans_list->count; index++) { ltrans = (struct trans *) list_get_item(self->trans_list, index); trans_delete(ltrans); } list_clear(self->trans_list); return 0; } /*****************************************************************************/ static int xrdp_listen_parse_filename(char *strout, int strout_max, const char *strin, int strin_max) { int count; int in; int strin_index; int strout_index; strin_index = 0; strout_index = 0; in = 0; count = 0; while ((strin_index < strin_max) && (strout_index < strout_max)) { if (in) { if ((strin[strin_index] > ' ') && (strin[strin_index] != ',')) { strout[strout_index++] = strin[strin_index++]; count++; continue; } else { break; } } else { if ((strin[strin_index] > ' ') && (strin[strin_index] != ',')) { in = 1; strout[strout_index++] = strin[strin_index++]; count++; continue; } } strin_index++; count++; } strout[strout_index] = 0; return count; } /*****************************************************************************/ static int xrdp_listen_parse_integer(char *strout, int strout_max, const char *strin, int strin_max) { int count; int in; int strin_index; int strout_index; strin_index = 0; strout_index = 0; in = 0; count = 0; while ((strin_index < strin_max) && (strout_index < strout_max)) { if (in) { if ((strin[strin_index] >= '0') && (strin[strin_index] <= '9')) { strout[strout_index++] = strin[strin_index++]; count++; continue; } else { break; } } else { if ((strin[strin_index] >= '0') && (strin[strin_index] <= '9')) { in = 1; strout[strout_index++] = strin[strin_index++]; count++; continue; } } strin_index++; count++; } strout[strout_index] = 0; return count; } /*****************************************************************************/ static int xrdp_listen_parse_vsock(char *strout, int strout_max, const char *strin, int strin_max) { int count; int in; int strin_index; int strout_index; strin_index = 0; strout_index = 0; in = 0; count = 0; while ((strin_index < strin_max) && (strout_index < strout_max)) { if (in) { if ((strin[strin_index] >= '0') && (strin[strin_index] <= '9')) { strout[strout_index++] = strin[strin_index++]; count++; continue; } else { break; } } else { if (((strin[strin_index] >= '0') && (strin[strin_index] <= '9')) || (strin[strin_index] == '-')) { in = 1; strout[strout_index++] = strin[strin_index++]; count++; continue; } } strin_index++; count++; } strout[strout_index] = 0; return count; } /*****************************************************************************/ static int xrdp_listen_parse_ipv4(char *strout, int strout_max, const char *strin, int strin_max) { int count; int in; int strin_index; int strout_index; strin_index = 0; strout_index = 0; in = 0; count = 0; while ((strin_index < strin_max) && (strout_index < strout_max)) { if (in) { if (((strin[strin_index] >= '0') && (strin[strin_index] <= '9')) || (strin[strin_index] == '.')) { strout[strout_index++] = strin[strin_index++]; count++; continue; } else { break; } } else { if ((strin[strin_index] >= '0') && (strin[strin_index] <= '9')) { in = 1; strout[strout_index++] = strin[strin_index++]; count++; continue; } } strin_index++; count++; } strout[strout_index] = 0; return count; } /*****************************************************************************/ static int xrdp_listen_parse_ipv6(char *strout, int strout_max, const char *strin, int strin_max) { int count; int in; int strin_index; int strout_index; strin_index = 0; strout_index = 0; in = 0; count = 0; while ((strin_index < strin_max) && (strout_index < strout_max)) { if (in) { if (strin[strin_index] != '}') { strout[strout_index++] = strin[strin_index++]; count++; continue; } else { break; } } else { if (strin[strin_index] == '{') { in = 1; strin_index++; count++; continue; } } strin_index++; count++; } strout[strout_index] = 0; return count; } /*****************************************************************************/ /* address and port are assumed 128 bytes */ static int xrdp_listen_pp(struct xrdp_listen *self, int *index, char *address, char *port, int *mode) { struct xrdp_startup_params *startup_params; const char *str; const char *str_end; int lindex; int bytes; startup_params = self->startup_params; lindex = *index; str = startup_params->port + lindex; str_end = startup_params->port + g_strlen(startup_params->port); while (str < str_end) { if (g_strncmp(str, "unix://.", 8) == 0) { str += 8; lindex += 8; address[0] = 0; bytes = xrdp_listen_parse_filename(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_UNIX; *index = lindex; return 0; } else if (g_strncmp(str, "tcp://.:", 8) == 0) { str += 8; lindex += 8; g_strncpy(address, "127.0.0.1", 127); bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_TCP4; *index = lindex; return 0; } else if (g_strncmp(str, "tcp://:", 7) == 0) { str += 7; lindex += 7; g_strncpy(address, "0.0.0.0", 127); bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_TCP4; *index = lindex; return 0; } else if (g_strncmp(str, "tcp://", 6) == 0) { str += 6; lindex += 6; bytes = xrdp_listen_parse_ipv4(address, 128, str, str_end - str); str += bytes; lindex += bytes; bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_TCP4; *index = lindex; return 0; } else if (g_strncmp(str, "tcp6://.:", 9) == 0) { str += 9; lindex += 9; g_strncpy(address, "::1", 127); bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_TCP6; *index = lindex; return 0; } else if (g_strncmp(str, "tcp6://:", 8) == 0) { str += 8; lindex += 8; g_strncpy(address, "::", 127); bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_TCP6; *index = lindex; return 0; } else if (g_strncmp(str, "tcp6://", 7) == 0) { str += 7; lindex += 7; bytes = xrdp_listen_parse_ipv6(address, 128, str, str_end - str); str += bytes; lindex += bytes; bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_TCP6; *index = lindex; return 0; } else if (g_strncmp(str, "vsock://", 8) == 0) { str += 8; lindex += 8; bytes = xrdp_listen_parse_vsock(address, 128, str, str_end - str); str += bytes; lindex += bytes; bytes = xrdp_listen_parse_vsock(port, 128, str, str_end - str); str += bytes; lindex += bytes; *mode = TRANS_MODE_VSOCK; *index = lindex; return 0; } else if ((str[0] >= '0') && (str[0] <= '9')) { g_strncpy(address, "0.0.0.0", 127); bytes = xrdp_listen_parse_integer(port, 128, str, str_end - str); str += bytes; lindex += bytes; if (startup_params->use_vsock) { *mode = TRANS_MODE_VSOCK; } else { *mode = TRANS_MODE_TCP; } *index = lindex; return 0; } else { str++; lindex++; } } if (lindex == *index) { return 1; } if (str >= str_end) { return 1; } *index = lindex; return 0; } /*****************************************************************************/ static int xrdp_listen_process_startup_params(struct xrdp_listen *self) { int mode; /* TRANS_MODE_TCP*, TRANS_MODE_UNIX, TRANS_MODE_VSOCK */ int error; int cont; int bytes; int index; struct trans *ltrans; char address[128]; char port[128]; struct xrdp_startup_params *startup_params; startup_params = self->startup_params; index = 0; cont = 1; while (cont) { if (xrdp_listen_pp(self, &index, address, port, &mode) != 0) { LOG(LOG_LEVEL_INFO, "xrdp_listen_pp done"); cont = 0; break; } LOG(LOG_LEVEL_INFO, "address [%s] port [%s] mode %d", address, port, mode); ltrans = trans_create(mode, 16, 16); if (ltrans == NULL) { LOG(LOG_LEVEL_ERROR, "trans_create failed"); xrdp_listen_stop_all_listen(self); return 1; } LOG(LOG_LEVEL_INFO, "listening to port %s on %s", port, address); error = trans_listen_address(ltrans, port, address); if (error != 0) { LOG(LOG_LEVEL_ERROR, "trans_listen_address failed"); trans_delete(ltrans); xrdp_listen_stop_all_listen(self); return 1; } if ((mode == TRANS_MODE_TCP) || (mode == TRANS_MODE_TCP4) || (mode == TRANS_MODE_TCP6)) { if (startup_params->tcp_nodelay) { if (g_tcp_set_no_delay(ltrans->sck)) { LOG(LOG_LEVEL_ERROR, "Error setting tcp_nodelay"); } } if (startup_params->tcp_keepalive) { if (g_tcp_set_keepalive(ltrans->sck)) { LOG(LOG_LEVEL_ERROR, "Error setting " "tcp_keepalive"); } } if (startup_params->tcp_send_buffer_bytes > 0) { bytes = startup_params->tcp_send_buffer_bytes; if (g_sck_set_send_buffer_bytes(ltrans->sck, bytes) != 0) { LOG(LOG_LEVEL_WARNING, "error setting send buffer"); } else if (g_sck_get_send_buffer_bytes(ltrans->sck, &bytes) != 0) { LOG(LOG_LEVEL_WARNING, "error getting send buffer"); } else if (bytes != startup_params->tcp_send_buffer_bytes) { LOG(LOG_LEVEL_WARNING, "send buffer set to %d " "bytes but %d bytes requested", bytes, startup_params->tcp_send_buffer_bytes); } else { LOG(LOG_LEVEL_INFO, "send buffer set to %d bytes", bytes); } } if (startup_params->tcp_recv_buffer_bytes > 0) { bytes = startup_params->tcp_recv_buffer_bytes; if (g_sck_set_recv_buffer_bytes(ltrans->sck, bytes) != 0) { LOG(LOG_LEVEL_WARNING, "error setting recv buffer"); } else if (g_sck_get_recv_buffer_bytes(ltrans->sck, &bytes) != 0) { LOG(LOG_LEVEL_WARNING, "error getting recv buffer"); } else if (bytes != startup_params->tcp_recv_buffer_bytes) { LOG(LOG_LEVEL_WARNING, "recv buffer set to %d " "bytes but %d bytes requested", bytes, startup_params->tcp_recv_buffer_bytes); } else { LOG(LOG_LEVEL_INFO, "recv buffer set to %d bytes", bytes); } } } ltrans->trans_conn_in = xrdp_listen_conn_in; ltrans->callback_data = self; list_add_item(self->trans_list, (intptr_t) ltrans); } return 0; } /*****************************************************************************/ static int xrdp_listen_fork(struct xrdp_listen *self, struct trans *server_trans) { int pid; int index; struct xrdp_process *process; struct trans *ltrans; pid = g_fork(); if (pid == 0) { /* child */ /* recreate some main globals */ xrdp_child_fork(); /* recreate the process done wait object, not used in fork mode */ /* close, don't delete this */ g_close_wait_obj(self->pro_done_event); xrdp_listen_create_pro_done(self); /* delete listener, child need not listen */ for (index = 0; index < self->trans_list->count; index++) { ltrans = (struct trans *) list_get_item(self->trans_list, index); trans_delete_from_child(ltrans); } list_delete(self->trans_list); self->trans_list = NULL; /* new connect instance */ process = xrdp_process_create(self, 0); process->server_trans = server_trans; g_process = process; xrdp_process_run(0); tc_sem_dec(g_process_sem); xrdp_process_delete(process); /* mark this process to exit */ g_set_term(1); return 1; } /* parent */ trans_delete(server_trans); return 0; } /*****************************************************************************/ /* a new connection is coming in */ int xrdp_listen_conn_in(struct trans *self, struct trans *new_self) { struct xrdp_process *process; struct xrdp_listen *lis; lis = (struct xrdp_listen *)(self->callback_data); if (lis->startup_params->fork) { list_add_item(lis->fork_list, (intptr_t) new_self); return 0; } process = xrdp_process_create(lis, lis->pro_done_event); if (xrdp_listen_add_pro(lis, process) == 0) { /* start thread */ process->server_trans = new_self; g_process = process; tc_thread_create(xrdp_process_run, 0); tc_sem_dec(g_process_sem); /* this will wait */ } else { xrdp_process_delete(process); } return 0; } /*****************************************************************************/ /** * Process pending SIGCHLD events in the listen process * * The main reason for this is to log children which fail * on a signal. This should be investigated. */ static void process_pending_sigchld_events(void) { struct exit_status e; int pid; while ((pid = g_waitchild(&e)) > 0) { if (e.reason == E_XR_SIGNAL) { char sigstr[MAXSTRSIGLEN]; LOG(LOG_LEVEL_ERROR, "Child %d terminated unexpectedly with signal %s", pid, g_sig2text(e.val, sigstr)); } } } /*****************************************************************************/ /* wait for incoming connections passes through trans_listen_address return value */ int xrdp_listen_main_loop(struct xrdp_listen *self) { int robjs_count; int cont; int index; int timeout; intptr_t robjs[32]; intptr_t term_obj; intptr_t sigchld_obj; intptr_t sync_obj; intptr_t done_obj; struct trans *ltrans; self->status = 1; if (xrdp_listen_get_startup_params(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_listen_main_loop: xrdp_listen_get_port failed"); self->status = -1; return 1; } if (xrdp_listen_process_startup_params(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_listen_main_loop: xrdp_listen_get_port failed"); self->status = -1; return 1; } term_obj = g_get_term(); /*Global termination event */ sigchld_obj = g_get_sigchld(); sync_obj = g_get_sync_event(); done_obj = self->pro_done_event; cont = 1; while (cont) { /* build the wait obj list */ robjs_count = 0; robjs[robjs_count++] = term_obj; robjs[robjs_count++] = sigchld_obj; robjs[robjs_count++] = sync_obj; robjs[robjs_count++] = done_obj; timeout = -1; for (index = 0; index < self->trans_list->count; index++) { ltrans = (struct trans *) list_get_item(self->trans_list, index); if (trans_get_wait_objs(ltrans, robjs, &robjs_count) != 0) { cont = 0; break; } } if (cont == 0) { break; } /* wait - timeout -1 means wait indefinitely*/ if (g_obj_wait(robjs, robjs_count, 0, 0, timeout) != 0) { /* error, should not get here */ g_sleep(100); } if (g_is_wait_obj_set(term_obj)) /* termination called */ { LOG(LOG_LEVEL_INFO, "Received termination signal, stopping the server accept new " "connections thread"); break; } if (g_is_wait_obj_set(sigchld_obj)) /* SIGCHLD caught */ { g_set_sigchld(0); process_pending_sigchld_events(); } /* some function must be processed by this thread */ if (g_is_wait_obj_set(sync_obj)) { g_reset_wait_obj(sync_obj); g_process_waiting_function(); /* run the function */ } if (g_is_wait_obj_set(done_obj)) /* pro_done_event */ { g_reset_wait_obj(done_obj); /* a process has died remove it from lists*/ xrdp_listen_delete_done_pro(self); } /* Run the callback when accept() returns a new socket*/ for (index = 0; index < self->trans_list->count; index++) { ltrans = (struct trans *) list_get_item(self->trans_list, index); if (trans_check_wait_objs(ltrans) != 0) { cont = 0; break; } } if (cont == 0) { break; } while (self->fork_list->count > 0) { ltrans = (struct trans *) list_get_item(self->fork_list, 0); list_remove_item(self->fork_list, 0); if (xrdp_listen_fork(self, ltrans) != 0) { cont = 0; break; } } if (cont == 0) { break; } } /* stop listening */ xrdp_listen_stop_all_listen(self); /* second loop to wait for all process threads to close */ cont = 1; while (cont) { if (self->process_list->count == 0) { break; } timeout = -1; /* build the wait obj list */ robjs_count = 0; robjs[robjs_count++] = sync_obj; robjs[robjs_count++] = done_obj; /* wait - timeout -1 means wait indefinitely*/ if (g_obj_wait(robjs, robjs_count, 0, 0, timeout) != 0) { /* error, should not get here */ g_sleep(100); } /* some function must be processed by this thread */ if (g_is_wait_obj_set(sync_obj)) { g_reset_wait_obj(sync_obj); g_process_waiting_function(); /* run the function that is waiting*/ } if (g_is_wait_obj_set(done_obj)) /* pro_done_event */ { g_reset_wait_obj(done_obj); xrdp_listen_delete_done_pro(self); } } self->status = -1; return 0; } /*****************************************************************************/ /* returns 0 if xrdp can listen returns 1 if xrdp cannot listen */ int xrdp_listen_test(struct xrdp_startup_params *startup_params) { struct xrdp_listen *xrdp_listen; xrdp_listen = xrdp_listen_create(); xrdp_listen->startup_params = startup_params; if (xrdp_listen_get_startup_params(xrdp_listen) != 0) { xrdp_listen_delete(xrdp_listen); return 1; } if (xrdp_listen_process_startup_params(xrdp_listen) != 0) { xrdp_listen_delete(xrdp_listen); return 1; } xrdp_listen_delete(xrdp_listen); return 0; } xrdp-0.10.1/xrdp/ad24b.bmp000644 001751 000000 00000162746 14652432047 015226 0ustar00metawheel000000 000000 BM6(  fffffffff333ffffffffffff̙f̙f̙fffffffffffffffffffffffffffff̙fffffffffffffff̙ffffffffff333fff̙fffffffffffff̙̙̙̙̙̙̙ffffffffffff33ffffffffffffffffffffffff333ff̙̙̙̙̙̙̙̙̙ffffffff̙fffffffffffffffffffffffffffffffffffffff̙̙̙̙̙̙̙̙̙̙ff3f3ffffffffff̙f̙ffffffffffffffffffffffffffff̙fffff̙̙̙̙̙̙̙̙̙ff3fffffff333̙fffffffffffffffffffffffff̙̙fffff̙̙̙̙̙̙̙̙ffffffffff̙f̙ffff̙fff3ff̙fffffffffffffffffff̙̙̙333̙̙̙̙̙̙̙̙ffffff̙ffff̙ffff̙fff3̙f̙fffffffffffffffff̙̙̙fffff̙̙̙̙̙̙ffffff̙̙fff̙f̙ffff̙fff3̙fffffffffffffffffffffffffff3ffffffffffffffffff̙̙̙fffff̙̙̙̙̙ffffff̙̙̙ff3ff33ffff3̙ffffff3f3fff̙̙̙̙fffffffffff̙fffffffffffffffffff̙̙̙fffff̙̙̙̙ffffff̙̙̙fffffff3̙ffffff̙ffffffffff̙̙̙̙̙ffffffff333ffffffffffffffffff̙̙̙̙3f3ff̙̙ffffff̙̙̙̙fffffffffffffffffffffffff̙̙̙̙̙fffffffffff333fffff3̙fffffffffffffffffffff̙̙̙̙fffff̙ffffff̙̙̙̙̙ffffffffffffffff̙fffffffff̙̙̙̙f̙ffffffffffffffffffffffffff333fff̙fffffffffff̙̙̙̙fff333ff̙̙̙̙̙̙̙ffffffffffffff̙ffff3f3ff̙̙̙̙ffffffff̙ffffffffffffffffffffffff̙̙fffff3ff333f̙̙̙̙̙̙̙̙ffff̙fff3ffffffffffff3f3̙̙̙̙ffffffffffffffffffffffffffffffffffffffffff̙ff3f3̙̙̙̙̙̙̙fff̙fffffffffffffffffffff̙̙̙fffffff̙fff3̙f̙fff3̙fffffffffff3f3fff̙̙̙̙fffff̙̙̙̙̙̙fffffff333ffffffffffff̙̙fffff̙fff3̙ffffff̙fffffffffffffff̙̙̙̙̙ffffff̙̙̙̙̙̙ffffffffff3fffffff3̙f̙fffffffff̙fffff̙fff3fffffff̙fffffffffffff̙̙̙̙̙ffffff̙̙̙̙̙̙fff̙fffff3fff̙ffffff̙ffff3f3ffffffff̙fffffffffffffffffffffffff̙̙̙̙̙ffffff̙̙̙̙̙ffff3fff̙fffffffffff333ffffff̙ffffffffff3̙f333fffffffffffff̙̙̙̙̙fffff̙̙̙̙̙ffffffffffffffff3fff̙fffffff̙fff3̙fffffffffffffffffff̙̙̙̙̙3f3ff̙̙̙̙̙fffffffffffffffff̙ffffffffffff̙ffffffffffffffffff̙̙̙̙ff3f3ff̙̙̙̙̙fff̙fffffff̙fffffff̙fffffffffffffffffffffffffff̙̙̙̙ff3f3f̙̙̙̙̙̙fff̙f̙fff3ff̙fffffff̙ffffff̙ffffffffffffffffffff̙̙̙̙fffff̙̙̙̙̙f̙fff̙f̙fff3̙fffffffffff̙fff3̙f̙ff33ffffff33ffffffff̙̙̙̙fffff̙̙̙̙̙fffff̙f̙fff3̙ffffffffff̙fff3̙f̙ffffffffff333ffffffffffff̙̙̙̙̙ffffff̙̙̙̙̙ffffffffff3̙fffffffff̙fff3ff̙fffffffffffffffff̙̙̙̙̙ffffff̙̙̙̙̙ffffffffff̙ff33̙ffffffffffffffffffffff̙̙̙̙̙ffffff̙̙̙̙̙ffffffffffffff3̙ffffffffffffffffffffff̙̙̙̙̙fffff̙̙̙̙̙fffffffffffffffffffffffffffffffffffffffffff̙̙̙̙̙3f3ff̙̙̙̙̙fffffffffffffffff̙fffffffffffffffffff̙̙̙̙ff3f3ff̙̙̙̙̙fffffffffffffffffffffffffff̙̙̙̙ff3f3f̙̙̙̙̙̙fff̙f̙fff3fffffffffffffffffff̙̙̙̙fffff̙̙̙̙̙̙fff̙f̙fff3̙fffffffff̙fffffffffffffffff̙̙ffff3f33f3̙̙̙̙̙f̙fff̙f̙fff3̙f̙fffffff̙fffffffffffffffffff333ffffff333ff̙̙̙̙̙̙fffff̙fffff3̙f̙fffffff̙fffffffffffffffffff̙̙ffffff̙̙̙̙̙̙̙̙fffffffffffffffff̙ffffffffffffffffffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙fffffffffffffffffffffffffffffffffffffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙fffffffffffffffffffffffffffffffffffffff3f3ff̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙fffffffffff̙fffffff̙333ffffffffffffffffff̙̙fffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fffffffffff̙fffffffffffffffffffffffff̙̙ff3f3ff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fffff̙fff3ffffffffffffffffffffffff̙̙ff3f3ff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fff̙f̙fff3̙ffffffffffffffffffffffff̙̙̙3f3ff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fff̙f̙fff3̙ffffffffffffffffffffffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙f̙fff̙f̙ffffff333̙f̙fffffff33fffffffffffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fff̙̙̙̙̙ffffffffffffff33ffffff333ffffffffffffffffffffffffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fff3f3fff̙̙̙̙̙ffffffff̙ffffffffffffffffff333ffffff̙̙̙fffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙ffffff̙fffff̙̙̙fffffffffffffffffffffffffffffffff̙̙̙fffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙ff3f3̙̙̙3f3ff̙fffffffffffffffff33ffffffffffffffffff̙̙ff3f3f̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙3f3ff̙̙̙ff3f3ffffffffff3̙ffffffffff̙̙ff3f3ff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fffffffff̙̙̙̙ffffffffff3̙f̙fffffffff̙̙̙3ffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙ffffffff̙̙fffff̙fff3̙f̙fffffffff̙̙̙fffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fffffffffffff̙f̙fff3ffffffffffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙fffffffff̙f̙fff3fffffffffffffffffffffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙ffffff̙ffffffffffffffffffffff333fff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙ffffff̙fffffff̙fffffffff̙̙̙fffffffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙̙ffffffffffffffff̙fffffff̙̙̙fffff̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙̙ffffffffffffff3ffffffff̙̙̙fffff̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙̙̙ffffffffffff3̙fffffffff̙̙̙3f3̙̙̙̙̙ffffff̙̙̙̙̙̙̙̙̙̙̙ffffff̙fff3̙f̙fffffffff̙̙̙fffff̙̙̙̙̙̙ffffff̙̙̙̙̙̙̙̙̙ffffffff̙fff3fffff3f33̙f̙fffffff̙̙̙fffff̙̙̙̙̙̙̙ffffff̙̙̙̙̙̙̙ffffffff̙fffffffffff̙fff3̙f̙ffffffff̙̙̙fffff̙̙̙̙̙̙̙̙ffffff̙̙̙̙̙̙ffffff̙fffffffffffffffffffffffff̙̙̙fff̙̙̙̙̙̙̙̙̙ffffff̙̙̙̙ffffff̙fffffffffff3̙ffffffffffffff̙̙̙3f3̙̙̙̙̙̙̙̙̙̙fffff̙̙ffffff̙ffffff̙fff3̙fffffffffffffff̙̙ffffff̙̙̙̙̙̙̙̙̙̙fffffffffffff̙fffffffffffff̙ffffffffffffffff̙̙3f3ff̙̙̙̙̙̙̙̙̙̙fffffffffffffff3̙fffffffff̙fffffff̙ffffffffff̙ffffff̙̙̙̙̙̙̙̙̙ffffffffff̙fff3̙f̙fffffff̙f̙fff3̙f̙ffffffffff3333f3fff̙̙̙̙̙fffffffffffff̙fff3ff̙fffffff̙f̙fff3̙fff333fff3f33f3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333ffff̙f̙fffffffffffffffffffffffff3f̙fffffffffffffffff333f33f33̙f̙ffffffffffffffffff3̙fffffffffffffffffff̙f̙fffffffffffffffffffffffffffffffffffff̙fffffffff̙fff3ffffff3fffffff̙f̙fff3̙fffff3̙fffffffff̙f̙fff3̙fffff̙ffffffffffff̙fff3̙f̙fffffff̙ffffff̙ffffffffffffff33f̙fff3̙f̙fffffff̙ffffffffff3ffffff̙fff3̙fff3̙fffffff̙ffffffffff3̙f̙fffffff̙f̙ffff̙fff3̙fffffffffffffffffffffffff̙ffffff̙fff3ffffffffffffffffffff3fffffff̙fffff̙fff3ff̙fffffff̙f̙f̙ff̙fff3ffff3̙fffffffffffff̙fff3ff̙fffffff333333ff3ff3ff3ffffffff3fffffffffff̙ffff̙fff3fffffffffffffffffff̙fffffff̙ffffffffff33̙fff3ffffffffffffffff3333333ffffffffffffffffffffff̙f̙ffffffffffffff̙ffffff̙ffffff̙fffffff̙ffffff̙ffffff3fff̙f̙fff3̙f̙fffffffff̙ffffff̙ffffffffffffffffff33ff̙fffffffff333333fffff̙f̙ff̙fffffffffffffffffffffxrdp-0.10.1/xrdp/xrdp_encoder.h000644 001751 000000 00000005647 14652432047 016453 0ustar00metawheel000000 000000 #ifndef _XRDP_ENCODER_H #define _XRDP_ENCODER_H #include "arch.h" #include "fifo.h" #include "xrdp_client_info.h" #define ENC_IS_BIT_SET(_flags, _bit) (((_flags) & (1 << (_bit))) != 0) #define ENC_SET_BIT(_flags, _bit) do { _flags |= (1 << (_bit)); } while (0) #define ENC_CLR_BIT(_flags, _bit) do { _flags &= ~(1 << (_bit)); } while (0) #define ENC_SET_BITS(_flags, _mask, _bits) \ do { _flags &= ~(_mask); _flags |= (_bits) & (_mask); } while (0) struct xrdp_enc_data; /* for codec mode operations */ struct xrdp_encoder { struct xrdp_mm *mm; int in_codec_mode; int codec_id; int codec_quality; int max_compressed_bytes; tbus xrdp_encoder_event_to_proc; tbus xrdp_encoder_event_processed; tbus xrdp_encoder_term_request; tbus xrdp_encoder_term_done; struct fifo *fifo_to_proc; struct fifo *fifo_processed; tbus mutex; int (*process_enc)(struct xrdp_encoder *self, struct xrdp_enc_data *enc); void *codec_handle_rfx; void *codec_handle_jpg; void *codec_handle_h264; void *codec_handle_prfx_gfx[16]; void *codec_handle_h264_gfx[16]; int frame_id_client; /* last frame id received from client */ int frame_id_server; /* last frame id received from Xorg */ int frame_id_server_sent; int frames_in_flight; int gfx; int gfx_ack_off; const char *quants; int num_quants; int quant_idx_y; int quant_idx_u; int quant_idx_v; }; /* cmd_id = 0 */ struct xrdp_enc_surface_command { struct xrdp_mod *mod; int num_drects; int pad0; short *drects; /* 4 * num_drects */ int num_crects; int pad1; short *crects; /* 4 * num_crects */ char *data; int left; int top; int width; int height; int flags; int frame_id; }; struct xrdp_enc_gfx_cmd { char *cmd; char *data; int cmd_bytes; int data_bytes; }; typedef struct xrdp_enc_data XRDP_ENC_DATA; #define ENC_DONE_FLAGS_GFX_BIT 0 #define ENC_DONE_FLAGS_FRAME_ID_BIT 1 /* used when scheduling tasks from xrdp_encoder.c */ struct xrdp_enc_data_done { int comp_bytes; int pad_bytes; char *comp_pad_data; struct xrdp_enc_data *enc; int last; /* true is this is last message for enc */ int continuation; /* true if this isn't the start of a frame */ int x; int y; int cx; int cy; int flags; /* ENC_DONE_FLAGS_* */ int frame_id; }; #define ENC_FLAGS_GFX_BIT 0 /* used when scheduling tasks in xrdp_encoder.c */ struct xrdp_enc_data { struct xrdp_mod *mod; int flags; /* ENC_FLAGS_* */ int pad0; void *shmem_ptr; int shmem_bytes; int pad1; union _u { struct xrdp_enc_surface_command sc; struct xrdp_enc_gfx_cmd gfx; } u; }; typedef struct xrdp_enc_data_done XRDP_ENC_DATA_DONE; struct xrdp_encoder * xrdp_encoder_create(struct xrdp_mm *mm); void xrdp_encoder_delete(struct xrdp_encoder *self); THREAD_RV THREAD_CC proc_enc_msg(void *arg); #endif xrdp-0.10.1/xrdp/xrdp_logo.bmp000644 001751 000000 00000154512 14652432047 016317 0ustar00metawheel000000 000000 BMJlBGRs&P^_ѭӔ߷Ȉ"""""""""""""""""""_""""""""""""""""""%` s3333333333333333333333333333333333}""""""""""""""""""%"""""""""""""""""""_` 33333333333333333333333333333333333337"""""""""""""""""""_""""""""""""""""""%` s3333333333333333333333333333333333333333}DH""""""""""""""""""%"""""""""""""""""""_` s333333333333333333333333333333333333333333=L"""""""""""""""""""_""""""""""""""""""%` 33333333333333333333333333333333333333333333}R""""""""""""""""""%""""""""""""""""""".` 3333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""` 333333333333333333333333333333333333333333333337R""""""""""""""""""%""""""""""""""""""".` 333333333333333333333333333333333333333333333333>O"""""""""""""""""""_"""""""""""""""""""` 33333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""".` 33333333333333333333333333333333333333333333333333?N"""""""""""""""""""_"""""""""""""""""""` 3333333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""")` 3333333333333333333333333333333333333333333333333333O"""""""""""""""""""_"""""""""""""""""""` 3333333333333333333333333333333333333333333333333333>R""""""""""""""""""%""""""""""""""""""")` 333333333333333333333333333333333333333333333333333337"""""""""""""""""""_"""""""""""""""""""` 333333333333333333333333333333333333333333333333333333O"""""""""""""""""""%""""""""""""""""""")` 333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""` 333333333333333333333333333333333333333333333333333333?"""""""""""""""""""%"""""""""""""""""""%` s333333333333333333333333333333333333333333333333333333="""""""""""""""""""_"""""""""""""""""""_` 33333333333333333333333333333333333333333333333333333337"""""""""""""""""""%"""""""""""""""""""%` 33333333333333333333333333333333333333333333333333333333O"""""""""""""""""""_"""""""""""""""""""_` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""%"""""""""""""""""""%` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""_` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""%"""""""""""""""""""%` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""R"""""""""""""""""""_` 33333333333333333333333333333333333333333333333333333333""""""""""""""""""""""""""""""""""""""%` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""""""""""""""""""""_` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""""""""""""""""""""` 33333333333333333333333333333333333333333333333333333333R""""""""""""""""""""""""""""""""""".` 333333333333337wwwwwwwwwwwwwwwwwwwwwwwwwws33333333333333"""""""""""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""""""""".` 3333333333333333333333333333"""""""""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""""""")` 3333333333333333333333333333DDDDDDDDDDDDDDDDDDDDDDDDDDDA"""""""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""""")` 3333333333333333333333333333"""""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""")` 3333333333333333333333333333"""""""""""""""""""""""""""` 3333333333333333333333333333"""""""""""""""""""""""""")` 3333333333333333333333333333"""""""""""""""""""""""""_` 3333333333333333333333333333""""""""""""""""""""""""%` 3333333333333333333333333333"""""""""""""""""""""""_` 3333333333333333333333333333""""""""""""""""""""""%` 3333333333333333333333333333"""""""""""""""""""""_` 3333333333333333333333333333""""""""""""""""""""%` 3333333333333333333333333333""""""""""""""""""""%` 3333333333333333333333333333"""""""""""""""""""""_` 3333333333333333333333333333""""""""""""""""""""""%` 3333333333333333333333333333"""""""""""""""""""""""` 3333333333333333333333333333"""""""""""""""""""""""")` 3333333333333333333333333333"""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""")` 3333333333333333333333333333"""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""")` 3333333333333333333333333333"""""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""""".` 3333333333333333333333333333"""""""""""""""""""""""""""""""` 3333333333333333333333333333R""""""""""""""""""""""""""""""".` 3333333333333333333333333333"""""""""""""""""""""""""""""""""` 뻻3333333333333333333333333333""""""""""""""""""""""""""""""""".` `3333333333333333333333333333""""""""""""""""""""""""""""""""""%` `3333333333333333333333333333"""""""""""""""""""""""""""""""""""_`ffffffffffffffffffffffffffff` 33333333333333wwwwwwwwwwwwwwwwwwwwwwwwwwww33333333333333""""""""""""""""""""""""""""""""""""%` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""""""""""""""""""""_` 33333333333333333333333333333333333333333333333333333333""""""""""""""""""""""""""""""""""""""%` 33333333333333333333333333333333333333333333333333333333"""""""""""""""""""R"""""""""""""""""""_`33333333333333333333333333333333333333333333333333333333A"""""""""""""""""""%"""""""""""""""""""%`33333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""_`o33333333333333333333333333333333333333333333333333333333"""""""""""""""""""%"""""""""""""""""""%o33333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""_33333333333333333333333333333333333333333333333333333333"""""""""""""""""""%""""""""""""""""""")33333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""33333333333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""")s3333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""3333333333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""")`o3333333333333333333333333333333333333333333333333333333O"""""""""""""""""""_"""""""""""""""""""3333333333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""".3333333333333333333333333333333333333333333333333333333A"""""""""""""""""""_""""""""""""""""""" s333333333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""".`o333333333333333333333333333333333333333333333333333333"""""""""""""""""""_"""""""""""""""""""333333333333333333333333333333333333333333333333333333R""""""""""""""""""%""""""""""""""""""".333333333333333333333333333333333333333333333333333333A"""""""""""""""""""_"""""""""""""""""""o33333333333333333333333333333333333333333333333333333""""""""""""""""""%"""""""""""""""""""^33333333333333333333333333333333333333333333333333333"""""""""""""""""""_""""""""""""""""""%o3333333333333333333333333333333333333333333333333333""""""""""""""""""%"""""""""""""""""""_`s333333333333333333333333333333333333333333333333333"""""""""""""""""""_""""""""""""""""""%`o333333333333333333333333333333333333333333333333333""""""""""""""""""%"""""""""""""""""""_ 33333333333333333333333333333333333333333333333333A"""""""""""""""""""_""""""""""""""""""%` 3333333333333333333333333333333333333333333333333O""""""""""""""""""%"""""""""""""""""""_ks33333333333333333333333333333333333333333333333L"""""""""""""""""""_""""""""""""""""""%f`fs333333333333333333333333333333333333333333333L33333333333333AL33333333333333AD33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333wwwwwwwwwwwwwwxrdp-0.10.1/xrdp/ad256.bmp000644 001751 000000 00000046466 14652432047 015153 0ustar00metawheel000000 000000 BM6M(L  fff333ff̙fff33ff3ff3f3̙fff̙ff3ff33fffff                                                                                                                                                                                                                                                                                                                                                                                       xrdp-0.10.1/xrdp/xrdp_logo.png000644 001751 000000 00000014510 14652432047 016316 0ustar00metawheel000000 000000 PNG  IHDR^Se pHYsodtEXtSoftwarewww.inkscape.org<IDATx{uϷ*]&FhA q 0 O:al"BpD3,.ΈNҹtu=#,~O~G>'9;U]swV =LA t"@A L =*KK[z5?PKD0Z.46{enf?: V%dn?mڴ/^<zDT l |3fooo}y~˲wg2?\or@ISC)QH Ϗckmwwd:XA -~~\ۿYL\Z!ypiC [?<뾉~sZT{Efr|E]|-QKeΜ9n] qŇ[\0~[|8^۶u,2i7 }jjs_Sfs=e}tCx~ۋAj:̾Cj6%i.^vtI맺m:X8{J̞my4pI&]qyMMI^wO\qՆi*ҤŒg2JvAј_Mx'<["8wyFs6 ~\ټs͚5{޲3CgEG==NI Sp܏:JTI="QzsV3%!\So:s|=1ZIkT0zchR9gsn' Xico]WJu3KtǓ[qFҎu܊0^YܱR^*LHӥ%#^4yIsK3\ŵ6N=TOgq-y*{^+V4}?ߟHZ "z1tF$?-v7zpaL2%U*;H"[g´νqG9gΜlweݏ#wi$Ƀdx5^;M6VYNB1. ;iBߔG^xᅅf1e9><#6}p[y gϝ.KmycPLvlIށq;1t48]r%[mv(],y'I-9W-9*$j`+;5(J!zeK >:::Nl'aQ/xS3V6%zmG&uqs n=vWeґѱ@3 G1wI{{{[KG/iJCT>?-(cC͜2:tl& ɒ~r0=Di< 6 mJO=jɛbtY˃ޒ{IJ q===B _f^tuDh|_=d%d\ׅ {-}|ҥj$Vf~h4NZbP!/e-?z綔)<1uäw;`\~M-v$_js$]N]bCyk#+i?=srZts+lS׷o5< :I ߅8.''I)y Bu{YVH$Ԇu<1I_*zǢV9?jyZ#Ȓ$;lٲ =7yZ@#m$9s$xG(JZtCAWwwwSGذ3$q!<蒔$Ic>G]4MH$gpZAIlDRw__C(L%)I-5zKNf8I=B]$yViW-K(?V.II!My%#.iyooTȠKR__FGGOVxi$#*l%iV.OozE$_=B].)%2IBįA$IH]z$z`AG%.8$I>z`6A$w_R%kvsMЫYfNR?捌ܶj*hz^?nz8ٹn`` G z^*ij-5sBfppXwKҌ[&aqWWW]Wa^Վ.JwJ+ \TVWW!^VtCoɊ}VS^dfJ?\YV/ =B}ppIK:(kڲ;q)LЯ?)JH:$WՋCģA_vFq#Coi3j^P!8U^h4tL--Vvk_w1[r崙3gdžPRVZt]@˸_QY7]j{$ߡfO͆X?zҠW/Y3%388BZ]ejS:ͽT*ݻf͚7h- zV\iY9ttttի =P|^B>gIáw4MjB[A=^q)iBىco|3CWnAV }v|I8gΜ󻻻I<(44fr|ڵk)\^V2uy\?/| my###Z3D h S^df7JyE=NT*7 }~!\ܻko錑C@\ȹ2 .yfQ<4#kfl1SKZUWqzv˖rӮ=sQ-W~w!ǧNL[Fca GtXo =x'Jc-,ҖCAn]sfs}VЭjIe-3c>Q7jCAAA>             c݀݀c>px$ll$   >c݀Հc>``   ``@  |t@ @@@ppllؐ  ACB` `  ACB    c` `   `p ""AA ""AA ""AA :.""AA ""AA ">AA  #>BB  ""AA xx|t ""AA H0x|t ""AA x|t   AA> 0H|̄|L8  $>AA> Hp|̄|L8  >AA>  |̄|L8  >AA> |̄|L8  $ p .1!!!!!  @@@@@@@  @@@\bBBBBB         p  p     0 p  p `    @@  @@@@@@@@@@@     @@@x@@@~ @@@@`@@@@@   Ą   Ą   $ H0Ą  @@1!!!!!  Ƃ Ą8  <BB<  xȀp ~C@@@@C~        >~~ ||̄| x̄hx   >  x  ?AA> BB$$$$  ` ` ` @@@@@@@@  ఘ ` @@@@@@@@@@ (0P((dDD  `s 0@0@(@$@&@"@!@  Ą  @  ~Ņy рp̄   |||ppp `0 @  @@@@@@@p  ~ 0@@@@@@@@p  @<t BBB<  | ÀD@(@( DD((0 `   ~0 @x`  <|  @ x| ~@ 8<  Xpx 0 0` ~@@@~~ |@@@xx @@`0 Ą      (| | ` |0 @̀|     `  @@@@@@@@@@  @@@@@@@@@  Ņ ""AA H0x|t P  P   BB  {`  q  >AA> |̄|D8   >AA> P |̄|L8 ( p "$(0($"  AA> 0 |̄|L8   ‚    Ą ">AA 2LH0x|t  #>BB  {`  q =BB 0 |̔ (""AA ((x|t ""AA 8Hx|t P( ((x̄x 0H 8,x̄x PH   `@@@@@@@@@ p@@@@@@@  (dHP``| @@@@@@@~   ,L p    @`0 < p@@ ~AAA~AA~ @@@@@@a? ""cAA @ x|@  p  @@@@@@@@@  =CC= |̄| |BBBDBBAX`@@@@ $ BFd(0`Ąx|̄|̄ p̄pȀx@|̄|  |̄|x̄xxx  x 5Āxxpxppp  p qp  xrx  <|    D$ 4D  || p0 p  pȀ` p  @w  @0t0  @w @@DDC@@@@? DDDDDDD<  @@LHHIN? 8 `l@l@l@l@l@l@@@   tlHth@@@BBBBBF:@@@BBBBBF:𐐐@@@@@@  0tlHP` @а@@@@@`@@p`  `````````@@ @  @@@@@@@@@@@```аP 0@` ``p`        ``PP    ``   а        @ @`ppPp @pPPp`P Pp`@@@  @@@ @@@@@` p @@`x@ PPppp @ 0 @@x @ @  @pp@ ` @а@H`@ ` @    @ Px  `` ``   0@O ``                   ȀȀȀ @    pȀpHH@@@@      @@ `H""AA _ @@ @ @ @? @ @ @ @ @   @1 @@@ 1  H@ @ O@ @ @@@9 @` ""AA    ""cAA    @    II> B$$B  ɀk>  aa>  |Ƃ|  >@@8 |@0 0  `BLt  @@@ 8!#&$ 0(T  @@ J`y  Aw  2B‚F:  dDt   0>FN2 >c ``?  x0`D8 $<<$B4<& |Ƃ| px   ,(8HȎ x̸̄@|pȀp @@@@@@@@@@  AA>  |€||  @@@@@@@@@  ?!!!!!!A    Ȅ   $DD,(8`   ""AA       ?!!!!!!A  b02`' " B  |x    $  Ȅ  ?!!!!!!A      II> B$$B    ~     ? ?      ||     ~~"bBx|t 8@̄x  >""""Bx̄x  D@$?$D@`ppp H0𐈌>""""B ƪx̄x ̄pȀp  DD((  ɀɀD((D  |   @@   pxp  ||dD @ x̄x Hx̄x@@@@@\bBBB  pȀpppp  @@@@@@@ @@@@@@@@@@  >""#" B  @@ @@@@@\bBBB  𐈌 @  ,8DD((     @@ J@q  Aw  ? ? >!!>  `   ??d@D`  1/DD @`ɐوш  @   DD((|TD(|T  @ǀ@ 0  HPp8 t P`p@ `LLm-- D`Dd%%5  Aw    0 c30`0#cC  d@4&d@D   |xp ppp `   ؈   clxtfbaa @@FHPxlDB @@` $(<$"#      `  @@@@@ ẁŀG? dޒ  22"""     À    ~ |   ҀԀԀ̀@    ""AA H0x|t ""AA Hx|t  #>BB  {`  q Pp H0x̄x  80 c2&cA F$8dB c2&cAF$~8dB  ~~||    ~ y  @|@@@{  x@8@ @@@@  pp  x8  pp   `p  >"" " " B   @@@@  >AA>xĀx   |p|xpx  ?!!!!!!A >""""B  ?! ` ` aA  ?1 00!!   ŀ@  ŀ >&fF   dD  ""#" B 0  @@@@@  À               F  8f‚ 8̆ 8̆  B|  fÁ   8f‚  c ‚|  ‚   @@@@@  ƃ|  f: `@`  fÁ"ގ{ 8̆ f88(LƂ  B| fB| !!  ?AB<  8f‚ 8fLp  ~  fÁ{   8f  < : 8lp<|  8f‚  fBB~  > 3!!!1>     @@>  @@> @  ddlx ddlx0lx 0lx !&,@8 $!&,@8 0``~ @0``~      @`  p   x<$ |`$4 8 8(pp0pp0`pp@@ ```       @@@@@@p@@@@@V^| 0@@`xpPpDD(((88((hDD @H @ pP  @@  p          @@  @@  @@  @@  @@  @@  @@  @@ 0  @@>  @@>  @@>  @Ȁ@> 0 @@>  @Ԁ@>  @Ԁ@>   P`     `  ` @`  `@  ``     $       ddl@x ddlx@ ddlx@0lx 0lx &!&,@8 `0``~  `  ` @` @` `  `  p   p  0 0 @          @             x x x x( | | 88| |( (| 0,*  @Ԁ@>       $4   $4 $4   $4 8  P`8  8    `                          @@@@@@p@@@@@V^| x@@@@@pPp@@x0`@DD(((88((hDD                                                                                                                                                                                                       xHHx 8         pp  x̄x PP ,$FB pp    p    @@  `  x   """""""" DDD(((     x~   (((DDD ` x0   𐐐  pp  x x0    dX`Xd@@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            " |~  |   |Ƃ:   ~xƎ   rb|       |̴ !9)9 Jr  """‚| ‚| ƒ  ⒒ Ғ  Ғ  !!!!! rb| |||  ~q xx    gcs[kn  Dx x| x||  0XǀY#  ~~|p |l|o|l~o`@@ ~bp rN     P( 8( xX0 8(8 @@p0 0(88  Ĥ| F@@p  x̄xd 0`x  #### 0`> `> = """ 촄ĥ/0 򒒒Ҳ    D{  D{                                                                                                                                                                                                                                                                                                                                                                                                                                                                   0`a> DĄ| p >AC> x̄ p  008?000 bB```b>  | π@@@@ |@@@@@x@ | cc>  D| @@@@@x x  cc> ?ɀȀ  8̄ | |x  a@a? x 𐀀 pȄ@0 x  1 #` @@@@@  8H`0Ƃ| "" x0000 |~          ` 0 @` pp p0Ȅx F  p 0 pPxHDDDLx  wp p @ 0c pxp xp  B  0p 8hh 0`@B p xԖDx $$$DDDx !? `0L H( $$  x̀  !!>  x̀  ـ  |̈́x  ـ  |̈́x  >!!  ̀x   >!!  ̀x  @|bB¢0Аp  yͅ|  x̀̀  }̈́x  ̀x x̄$$x̄ x̄ x̄ x x  x x x    x̄  !  x  !  x    x    x  !  x   !  x  @@@@¢ $$          ?    ?     ?     ?    ?    ?     ?    @@@@~xx     @@   8$$8x  x  p   @@   @@   @@  x  x   @@  ـ  x̀ ـ  x̀  (x`|$$  @@  $$`  `  `  @@  @@  @@  `  ` 0  @@   0`   0` 0  @@ @0  @@    `0    `0@|  >< @`   `@ `@  `@      @a  <     <       a@    a@  <     <    @x 0`p`         0X   Hx  Hx  xL` B`!  xL` B`!  !B`F L`x  !B`F L`x  6"@@ 0X`   @@"&  `Hx  @@"&  `Hx 0 xxLl B`! 0 xxLl B`!  p؈0!BlF L`x  p؈0!BlF L`xL  @pHHp@   @   @@   @  @  @    @   @     @   ?  @     ?  @@     @     @   ?    @   ?    @  @~0 @ @@@P `P  x  @@@@    @@@@  $$x  x  x          ||  || ||    ||pp  x|  FDD(( $$((DDF  ((DDF  ((DDF  `  `  wp  wp      w pp  `₂B|  B|  8f‚r  8f‚  8f‚r  8f‚   ņ`? ņ`?    @`?0؀x          8lFF~ Pp0 Pp0 :@fF| :@fF| 0P 0P@(D8  P `P q t   q t   q t   p q      p q     tw     tw      tv      x  P00  x  00P44`xz  `xz  `xz  ` z   ` @` z   ` `z x `z x `z  bP            `  `  @@0  @@0  `  `@|  @  ```  ``` @`  @`  `` @``@@8  ̄                                                    ?aa?                                                                                                     @P @                                      `` q t    `ff>&FFFF&>ff>x   @@@ DD((  IUU"" @ 0  ((DDD >""""B 0PH0P^  8DD8@@@@@@計аЀ0LD8HHxx `Zjf$pp`pp` ~``p``pp `ppp  𐐐p``pp@`@@`P`  ࠠP` 0@ppxp P` `PP` ࠠP` xp P` `P             |Ć̸  @@@@  ^bBBb\@@@        `@                     pppp Pp `@@@@@@@@ppp @@@@@@@@@@@  pHHHаppp pp @0`@@@@@@`@@` pPp PPp @p @p pp ppPPp    @xxhh                                                       ""AA x|t8H8   ̄   ̄  x ̄x AA> |̄|L8   Ą   Ą   @@@@\bBBBBB @@@@@@@@ @@@@\bBBBBB   $8ĄHp @@@@@@@@@а @@@@@@@@Р`@ @@  `   < x  @@@@@@@@~@@@@@@@@@@@@ x @@@@@@@@@@@ 0H@@@@@@@@@@@@                Ą   Ą  < Ąx  ( Ą0H , @ P@@     Aw  Aw  Aw   4,Aw  4,Aw G@     @ @1 @@@ 1 G@    @@ O@ @ @@@9   |PАT<       (0xc#&<   >###                       @@    ր    H                               `x@x8{Hx `x@xx{H`8x b`> ad  xx? @xA`z @xAzHHHHx |p|  ||  gd  h`H@H@@p`  #-0P  〢  >"bBBBF `X|DĄ h 08  @x (0PP``@@ HHOHH@H@H@HO  ɩ `pPHDFBA  >AA> FJqBb  fe> iHH  p c   @  € wqq '(@(@/@(@' OMI Is2"64\H (HP  x0@x    AA !! r`>>  @@?8D dL@ P|   | 0(`   " 0p cuc  xxx   p ppppp  ~D((D  66653     H$  $H  8΃|   <$B R }|ļ 0P```` (000PPP`  y0xLG     ACC @@  ACB   ACB   ACB    #b    ACC     #c     c     0Q     ACB`   `    ACB    c      !CBE   ACB      @@ AA"" A@A@"@"@@@@ ȀAHAH"H"HHHH ʀAJAJ"J"JJJJ   B$$B @B@$@@@@$@B@@ HBH$HHHH$HBHH       `          @@   p    p  1``1  p p    0` `0    BH  1#   y  HH  pp     p p  AA  a  @@  p    p   p p  @@    DD  13  A݀C  MS  @L(*  @d$    $D`    n< C@   @@X0  6AE@  x`pX    FEAb<  0QQAAc>  0`  @   ࠀ  `        `  !@@  z"""""*/  @@!  @@@` "w""""""   """"""w"  0`  @  {{  w  1    pPPPPPP    PPPPPPP    pPPPP  $   $H  H$   $Ȑ      @ހ@  _  p   p  @@  p    p     ?@@@@?  (D((((((8  @@  8(((((l(  (D(((888  (D(((((|  (T((((|  8T88888|  (T(D((((8  (T(D(((|  `0  (D((((l(  yI;  /*"""""z   DD    IK  JJ  *))+(  UW  `    a@@ A""6 0Hx `  $$D@ ?CA 6"cAA ACb"4  ?`@@`?  ?bDHx? ~@@>           @ 0 0`      `@@@ @@@@  8|pp H(00 9H(00 vT" wU"   0 `  $b  tBt   0   PPPPPXpPPPPP 00pPHȈ HXP00  x ( +"&$$$$$$$  +P"@&@$@$@$@$@$@$@$@ɀ ( pp +"&~~$$  +P"@&@PPP$@$@ɀ ( `(  ( pp  ( pp      y  y  p  qG  pHI @@@@@@@   y  p  }  }     &  qq  }x0  0y  0}p      66  6        @@@@  $  $    "  "    >  ~l  6***   `@      xx  <<    <<0  0 `99p 9p`9 ```𐐐p```    x   <  |    <  x  <  |    <0  <  xxx  <  |xx   x  `80`  x  08ǀ`  xx  08x   x  d80`@@  @@?    DH?   0  ?@@    ?DH     ?@@   x x x        >II>  >AA>  >AA>  >AA>  >AA>  >AA>  >II>  >AA>  >AA>                       |  `p`p     a9   @@  @@    @@@@@@@@  BFd$,8  8($dDF  BFd$,(   "B 1! @@@@` @@@@` 1   >A  A>0xx0@`  Ik66kH  ` `  ``  ``   1``  ` 1``  `1``  0 Bd,( ($D  ?@߀_`?    6A  ]c>  |T    q  CG<c9009s 89sc90  xx8  <p  x  x<  <  `g<`  |# @@  48׀`@@            x   <   xx  08x    @@  e9   䜏 @   @@  @@  @@  0  ?`@@`? ~B@>  ?`@@`?  ?`@@`? ~~@@>  ?`@@`?  ?`@@`?         fFRb| l0H p؈ p  p؈ p؈ @@@@       x  x           〢    `    x @ x ld hȍȰh ۶vn     H@00`H0 ec                                                                      ` x̸̄  Aw     r΄v    !!?          0  xx             ? @@@ @@@@       0 @@@@@@@` 0@@` 0 @@ x@  @x   @8@                                  @@?@@@@@?  ?                    ic   ? @A  RbbRL                                                           8/1!!!1.                                                             3Ȁ@@@A> 3܀@@@A> 3܀@@@A> 3Ā@@@A> 3ހ@@@A> 3΀@@@I>  3^@@@@@? 3̀@@@I> 3̀@@@A> 3Ӏ@A>                                                                                                                                                                               ((((((( ((((((   ((((((( (((((((((((((((((((((((((((((((( ((((((( (((((( ((((((( ((((((((((((((((((((((((((((((((x@@x  @@ @@  @A!# #!A@                1111  k@k@k@k@k@k@k@  {@{@{@{@                  @@@@@@@@  @@@@@@@@  @@@@@@@@  @@@@  @@@@@@@@  @@@@  @@@@@  @@@@@  @@    @@@    ??  ? @A  ??  "!A@08x|0HH    ?? @@!! |x80HH0 ?? @ @0@@ @@@ <<  4$  @  @@8@@ ?? !@@@! -^@^- >M@@@\# 00HHHP00 >A@@@@# A@@@@ >UՀ@@@ՀU7 >A@@@@#   >y@@x; >GG' >A@? >@@# >G@@# >G?  8xx8    @@  @  @8@` @   >A@@  @@# @? ?@`  @@@@@@@@   @@@@@@@@   @@@@@@@@  "-A@  99xx  &'GG 0@@ @ `  @@@@@@@@  @@@@@@@@  @@@@@@@  @@@@@@@ >I@@@# >A@@H+ >A@H+ >I@@#  @@@@@@@     @@@@@@ @@@  ! !H  ?? ?    2Z+! `  ?2! A"">!  @@    ?@@@A>> 〒@@ 〒@a> <|x   " p ?d;p;0;x8? 䔤k\7LLG  @@@@@@@  @@@@@@@  @@@@@@@P` P @@@;@ ??  a  ?   i{k  }    x  | 8 4􄄄  | t AA7ـ  ?0 '<<  ?c@_>> !!?ր, 33 |xTxx00  8( (x0  V<88|V  p  @@  >``p  I@@  8ֺz8   #|@@  ?I@@ii  @@         {{T^k{ `@@ @@  `@@ O@  `o`p?  ! )H  p(((0`  8`P88 xHx x   |‚||  <  ?Xw~  ""bH JJK@K@J@J@JJ  "!" [mIIIIIIH`  @@D@((D  XXh('    BD$$$$D   6MH?A?  ok_km3???  |DDD|  p0XpPP  pHĂbB~~  8$D(V   6o{?_?  +j[[=#???  B|||||  00Xpppx  P0|~~>  <<8~  8<~T  @A"  8(DBD(   w{  (DT  w?   8<~~<  >"" {  0T4 K@?   ,$   &"""""b     А ࠠ  `  ~ Z  >M6〢@~M2  EĀ@  EȀ@  M€@  Uހ@  ]€@  ]Ԁ@  EĀ@  A@  76a{?  ?i逞@H  @ဿA>>  @@A>>  `@@0xx  ?@@@A>>  ?@@@A>>  ?  ?           p~~~~ sa@ q!!   ?Ȁ??  BD(8fn  8`@8`0 Msb@@ O@@@ <$$v8  -?!ɀL!?( (  8(zj8  ۽|(   px  <@ *)A@  0``  ` ` ?pF0pВV@<@ 8;n` `|  @~@||  8px  wct>"B"6>  8|8DD8  0M@x x̄x xx `` ||  뀜H  q  ~~ pPЈPp  |‚|  80   ,Fd8|  Pt8 c瀀A>        а  >IX@t pj6   @ +Vp  |   @  \xp` l88lƂ  "w>>c  f,88h  |x8|̀ <,뀈o,       x̂HHH8  xXXX8 >ɀ>  cBc ɀ ɀɀ  <Kk  >  "C4  @!!${ w瀀Àɀ]>  s!! ^//${  w.+1  {%!  '+1  a#-;0 Y> 6$wɀ I**I  $5 k^nvVy  I>> J>>*H {>>~I *>>* ,]>]*  ɀ  ɀ    ] Ccv $]Iv Հ^ w݀݀~  T  >kk >k*. IIˀ_  ˀ I* *I ]"݀*] K*kI k*<kI  <C@@@@  @@@@@@@ @@@@@@@@ @@@@@@@ @@@@@@@@     ?o       @@HX    ~|ddLx  p ppp  L|0888  >  p|>p y>~~<2  LlހN   ``   00   00``````00  ``0000000p``  00````00  ``0000``  8p`p88   p08  88p  88pppp88  pp8888pp  @@   @@@@@@@@@@@  800000000  p0000<000p ?w> ?c> ?a> ?{> ?a>  ?c߀C> ?a> ?s>  ?y|t? ?o@@@Ā> $\@ @_@  ,S@ @_@  .S@ @^@  "F@ @B@  >P@ @^@  &X@ @N@  ?A@ @H@  .S@ @^@  ,[@ @^@  3T[@  ;c{`? 3lw`? 1l~a? =y}}? !o~a? 9gnq?  ~{w? 1lna? 3d~a? .M@o@D@?      `0   0`            ..    @80@  @8"\  @p<??<p@           ~@@@  @@@@?@ 䂃      ~ ||   0x8  y 8x0  x8   8x    b}  y  }           @@@p pP@                           0(HDHH00      𠠠 PPPPPPPPPP  @@@@@@  @@@ @@@ ((PPPPPP(( PPH((XPP     6wՀՀUUUU UUUUՀU6  @\@8 @@  6AG@CAb> %DDD%@@0``0@@WW                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      8|TTTTT  TTTTTT8                                                      >MEAAc> >YQAAc>                                                                   (((((((((  ((((&(((((                                                                           q9     ` `  ``  ``  ``  ``1``                      08x||x80                &&&&&&&  *******      @@@`00` " BBBb02`  PPHHpp0`          &+V"L&L$H$H$H$H$H$H$Hɐ (  (  ( 8`  ( pp  ( (`  ( 8(8  ( 0(0  ( 88  ( pp  (  PRP` ( p`  ( p  ( ` ( (                    D((D                                                            y  y@@                   p  <  q <  #p  <  p <  x  <  x   <   x  <  |<>  x>  x  <  <}|  |>}<  x  |  |ǀ<À>>À<  >>  qp8  <8p  qp9 <8p  <<    <ǀ<À<<    0  0<x  0  0xx               6  x  08  x  08  |  p`  |0  p`0  00  `<800  48  `<848                                                                x<  <<<       $H` $  `H$   $Ȑ  ?@@@@?  ?0  8|8888888  888888|8 Ą 0H䄌  D@@@@@DĄ   E@@@@ Ą nrBFDDx@Dx @@D@@@@@@@@@ ns0B0B F F`  Ȁɀ䄌 Ą  DĄ䄌 ~bBFDDD@D<  >Ą @@@@ nrBB@\b bbBFFDx@@8 FzD,00L@@  @@@@@0@@@䄌@`0@| DĄ  Ƅ0 ?@@           |Ƃ|  >cc>  >kɀɀk>  f<"""  ƃ   Ƥ  >kɀɀk>  ?cÀc~   8,F    j<$B     `0 @     """""""        `~  ||||  >cc>  >cÀc?       >cc>  ?cÀc>  ?eǀe?  B$$B  ?ee?  ""cAA   ` 0 @  I>>I   I>>I                                                                                                                                                                                   `         y             p؀`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   xrdp-0.10.1/xrdp/xrdp_keyboard.ini000644 001751 000000 00000007165 14652432047 017161 0ustar00metawheel000000 000000 ; ; RDP Keyboard <-> X11 Keyboard layout map ; ; How this file works: ; 1. load the file and scan each section to find matching "keyboard_type" ; and "keyboard_subtype" based on the values received from the client. ; If not found, then jump to default section. ; 2. in the selected section, look for "rdp_layouts" and "layouts_map". ; Based on the "keylayout" value from the client, find the right x11 ; layout value. ; 3. model/variant are inferred based on the "keyboard_type" and ; "keyboard_subtype", but they can be overridden. ; ; ; RDP Keyboard Type (http://msdn.microsoft.com/en-us/library/cc240563.aspx) ; ; 0 is not a valid value ; ; 1 - IBM PC/XT or compatible (83-key) keyboard ; 2 - Olivetti "ICO" (102-key) keyboard ; 3 - IBM PC/AT (84-key) or similar keyboard ; 4 - IBM enhanced (101- or 102-key) keyboard ; 5 - Nokia 1050 and similar keyboards ; 6 - Nokia 9140 and similar keyboards ; 7 - Japanese keyboard ; ; RDP Keyboard Subtype is vendor dependent. XRDP defines as follows: ; ; 0 is not a valid value ; ; 1 - Standard ; 2 - FreeRDP JP keyboard ; 3 - Macintosh ; ... - < any vendor dependent subtype > ; ; The list can be augmented. ; ; default [default] ; keyboard_type and keyboard_subtype is not read for default section. It ; is only a placeholder to keep consistency. Default model/variant are ; platform dependent, and could be overridden if needed. keyboard_type=0 keyboard_subtype=0 ; user could override variant and model, but generally they should be inferred ; automatically based on keyboard type and subtype ;variant= ;model= ; A list of supported RDP keyboard layouts rdp_layouts=default_rdp_layouts ; The map from RDP keyboard layout to X11 keyboard layout layouts_map=default_layouts_map [default_rdp_layouts] rdp_layout_us=0x00000409 rdp_layout_us_dvorak=0x00010409 rdp_layout_us_dvp=0x19360409 rdp_layout_dk=0x00000406 rdp_layout_de=0x00000407 rdp_layout_es=0x0000040A rdp_layout_fi=0x0000040B rdp_layout_fr=0x0000040C rdp_layout_it=0x00000410 rdp_layout_jp=0x00000411 rdp_layout_jp=0xe0010411 rdp_layout_jp=0xe0200411 rdp_layout_jp=0xe0210411 rdp_layout_kr=0x00000412 rdp_layout_no=0x00000414 rdp_layout_pl=0x00000415 rdp_layout_br=0x00000416 rdp_layout_ru=0x00000419 rdp_layout_se=0x0000041D rdp_layout_ch=0x00000807 rdp_layout_ch_fr=0x0000100C rdp_layout_gb=0x00000809 rdp_layout_latam=0x0000080A rdp_layout_be=0x00000813 rdp_layout_pt=0x00000816 ; = [default_layouts_map] rdp_layout_us=us rdp_layout_us_dvorak=us(dvorak) rdp_layout_us_dvp=us(dvp) rdp_layout_dk=dk rdp_layout_de=de rdp_layout_es=es rdp_layout_fi=fi rdp_layout_fr=fr rdp_layout_it=it rdp_layout_jp=jp rdp_layout_kr=kr rdp_layout_no=no rdp_layout_pl=pl rdp_layout_br=br(abnt2) rdp_layout_ru=ru rdp_layout_se=se rdp_layout_ch=ch rdp_layout_ch_fr=ch(fr) rdp_layout_gb=gb rdp_layout_latam=latam rdp_layout_be=be rdp_layout_pt=pt ; if two sections have the same keyboard_type and keyboard_subtype, then ; the latter could override the former. [rdp_keyboard_mac] keyboard_type=4 keyboard_subtype=3 rdp_layouts=default_rdp_layouts layouts_map=rdp_layouts_map_mac [rdp_keyboard_jp] keyboard_type=7 keyboard_subtype=2 model=pc105 rdp_layouts=default_rdp_layouts layouts_map=default_layouts_map [rdp_layouts_map_mac] rdp_layout_us=us rdp_layout_us_dvorak=us(dvorak) rdp_layout_us_dvp=us(dvp) rdp_layout_dk=dk rdp_layout_de=de rdp_layout_es=es rdp_layout_fi=fi rdp_layout_fr=fr rdp_layout_it=it rdp_layout_jp=jp rdp_layout_kr=kr rdp_layout_pl=pl rdp_layout_br=br(abnt2) rdp_layout_ru=ru rdp_layout_se=se rdp_layout_ch=ch rdp_layout_ch_fr=ch(fr) rdp_layout_gb=gb rdp_layout_latam=latam rdp_layout_be=be rdp_layout_pt=pt xrdp-0.10.1/xrdp/xrdp_egfx.c000644 001751 000000 00000107753 14652432047 015761 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2019 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * MS-RDPEGFX */ /** * * @file xrdp_egfx.c * @brief Stream functions for the EGFX extension to the MSRDP protocol. * @author Jay Sorg, Christopher Pitstick * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "arch.h" #include "os_calls.h" #include "parse.h" #include "xrdp_egfx.h" #include "libxrdp.h" #include "xrdp_channel.h" #include #define MAX_PART_SIZE 0xFFFF #define PACKET_COMPR_TYPE_RDP8 0x04 /* MS-RDPEGFX 2.2.5.3 */ /******************************************************************************/ int xrdp_egfx_send_data(struct xrdp_egfx *egfx, const char *data, int bytes) { int error; int to_send; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_data:"); if (bytes <= 1500) { error = libxrdp_drdynvc_data(egfx->session, egfx->channel_id, data, bytes); } else { error = libxrdp_drdynvc_data_first(egfx->session, egfx->channel_id, data, 1500, bytes); data += 1500; bytes -= 1500; while ((bytes > 0) && (error == 0)) { to_send = bytes; if (to_send > 1500) { to_send = 1500; } error = libxrdp_drdynvc_data(egfx->session, egfx->channel_id, data, to_send); data += to_send; bytes -= to_send; } } return error; } /******************************************************************************/ int xrdp_egfx_send_s(struct xrdp_egfx *egfx, struct stream *s) { int error; int bytes; if (s == NULL) { return 1; } bytes = (int) (s->end - s->data); error = xrdp_egfx_send_data(egfx, s->data, bytes); return error; } /******************************************************************************/ struct stream * xrdp_egfx_create_surface(struct xrdp_egfx_bulk *bulk, int surface_id, int width, int height, int pixel_format) { int bytes; struct stream *s; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_egfx_create_surface:"); make_stream(s); init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_CREATESURFACE); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint16_le(s, surface_id); out_uint16_le(s, width); out_uint16_le(s, height); out_uint8(s, pixel_format); s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_create_surface(struct xrdp_egfx *egfx, int surface_id, int width, int height, int pixel_format) { int error; struct stream *s; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_egfx_send_create_surface:"); s = xrdp_egfx_create_surface(egfx->bulk, surface_id, width, height, pixel_format); error = xrdp_egfx_send_s(egfx, s); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_egfx_send_create_surface: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_delete_surface(struct xrdp_egfx_bulk *bulk, int surface_id) { int bytes; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_delete_surface:"); make_stream(s); init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_DELETESURFACE); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint16_le(s, surface_id); s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_delete_surface(struct xrdp_egfx *egfx, int surface_id) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_delete_surface:"); s = xrdp_egfx_delete_surface(egfx->bulk, surface_id); error = xrdp_egfx_send_s(egfx, s); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_egfx_send_delete_surface: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_map_surface(struct xrdp_egfx_bulk *bulk, int surface_id, int x, int y) { int bytes; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_map_surface:"); make_stream(s); init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_MAPSURFACETOOUTPUT); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint16_le(s, surface_id); out_uint16_le(s, 0); out_uint32_le(s, x); out_uint32_le(s, y); s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_map_surface(struct xrdp_egfx *egfx, int surface_id, int x, int y) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_map_surface:"); s = xrdp_egfx_map_surface(egfx->bulk, surface_id, x, y); error = xrdp_egfx_send_s(egfx, s); LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_map_surface: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_fill_surface(struct xrdp_egfx_bulk *bulk, int surface_id, int fill_color, int num_rects, const struct xrdp_egfx_rect *rects) { int bytes; int index; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_fill_surface:"); make_stream(s); init_stream(s, 1024 + num_rects * 8); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_SOLIDFILL); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint16_le(s, surface_id); out_uint32_le(s, fill_color); out_uint16_le(s, num_rects); for (index = 0; index < num_rects; index++) { out_uint16_le(s, rects[index].x1); out_uint16_le(s, rects[index].y1); out_uint16_le(s, rects[index].x2); out_uint16_le(s, rects[index].y2); } s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_fill_surface(struct xrdp_egfx *egfx, int surface_id, int fill_color, int num_rects, const struct xrdp_egfx_rect *rects) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_fill_surface:"); s = xrdp_egfx_fill_surface(egfx->bulk, surface_id, fill_color, num_rects, rects); error = xrdp_egfx_send_s(egfx, s); LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_fill_surface: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_surface_to_surface(struct xrdp_egfx_bulk *bulk, int src_surface_id, int dst_surface_id, const struct xrdp_egfx_rect *src_rect, int num_dst_points, const struct xrdp_egfx_point *dst_points) { int bytes; int index; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_surface_to_surface:"); make_stream(s); init_stream(s, 1024 + num_dst_points * 4); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_SURFACETOSURFACE); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint16_le(s, src_surface_id); out_uint16_le(s, dst_surface_id); out_uint16_le(s, src_rect->x1); out_uint16_le(s, src_rect->y1); out_uint16_le(s, src_rect->x2); out_uint16_le(s, src_rect->y2); out_uint16_le(s, num_dst_points); for (index = 0; index < num_dst_points; index++) { out_uint16_le(s, dst_points[index].x); out_uint16_le(s, dst_points[index].y); } s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_surface_to_surface(struct xrdp_egfx *egfx, int src_surface_id, int dst_surface_id, const struct xrdp_egfx_rect *src_rect, int num_dst_points, const struct xrdp_egfx_point *dst_points) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_surface_to_surface:"); s = xrdp_egfx_surface_to_surface(egfx->bulk, src_surface_id, dst_surface_id, src_rect, num_dst_points, dst_points); error = xrdp_egfx_send_s(egfx, s); LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_surface_to_surface: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_frame_start(struct xrdp_egfx_bulk *bulk, int frame_id, int timestamp) { int bytes; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_frame_start:"); make_stream(s); init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_STARTFRAME); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint32_le(s, timestamp); out_uint32_le(s, frame_id); s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_frame_start(struct xrdp_egfx *egfx, int frame_id, int timestamp) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_frame_start:"); s = xrdp_egfx_frame_start(egfx->bulk, frame_id, timestamp); error = xrdp_egfx_send_s(egfx, s); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_frame_start: xrdp_egfx_send_s " "error %d", error); } free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_frame_end(struct xrdp_egfx_bulk *bulk, int frame_id) { int bytes; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_frame_end:"); make_stream(s); init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_ENDFRAME); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint32_le(s, frame_id); s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_frame_end(struct xrdp_egfx *egfx, int frame_id) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_frame_end:"); s = xrdp_egfx_frame_end(egfx->bulk, frame_id); error = xrdp_egfx_send_s(egfx, s); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_frame_end: xrdp_egfx_send_s " "error %d", error); } free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_capsconfirm(struct xrdp_egfx_bulk *bulk, int version, int flags) { int bytes; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_capsconfirm:"); make_stream(s); init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_CAPSCONFIRM); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ s_push_layer(s, iso_hdr, 4); /* pduLength, set later */ out_uint32_le(s, version); /* version */ out_uint32_le(s, 4); /* capsDataLength */ out_uint32_le(s, flags); s_mark_end(s); bytes = (int) ((s->end - s->iso_hdr) + 4); s_pop_layer(s, iso_hdr); out_uint32_le(s, bytes); return s; } /******************************************************************************/ int xrdp_egfx_send_capsconfirm(struct xrdp_egfx *egfx, int version, int flags) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_capsconfirm:"); s = xrdp_egfx_capsconfirm(egfx->bulk, version, flags); error = xrdp_egfx_send_s(egfx, s); LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_capsconfirm: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_wire_to_surface1(struct xrdp_egfx_bulk *bulk, int surface_id, int codec_id, int pixel_format, struct xrdp_egfx_rect *dest_rect, void *bitmap_data, int bitmap_data_length) { int bytes; int index; int segment_size; int segment_count; struct stream *s; char *bitmap_data8; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_wire_to_surface1:"); make_stream(s); bytes = bitmap_data_length + 8192; bytes += 5 * (bitmap_data_length / MAX_PART_SIZE); init_stream(s, bytes); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE1); /* descriptor = MULTIPART */ s_push_layer(s, iso_hdr, 2); /* segmentCount, set later */ out_uint32_le(s, 25 + bitmap_data_length); /* uncompressedSize */ /* RDP_DATA_SEGMENT */ out_uint32_le(s, 1 + 25); /* segmentArray size */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_WIRETOSURFACE_1); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ out_uint32_le(s, 25 + bitmap_data_length); /* pduLength */ out_uint16_le(s, surface_id); out_uint16_le(s, codec_id); out_uint8(s, pixel_format); out_uint16_le(s, dest_rect->x1); out_uint16_le(s, dest_rect->y1); out_uint16_le(s, dest_rect->x2); out_uint16_le(s, dest_rect->y2); out_uint32_le(s, bitmap_data_length); segment_count = 1; index = 0; bitmap_data8 = (char *) bitmap_data; while (index < bitmap_data_length) { segment_size = bitmap_data_length - index; if (segment_size > MAX_PART_SIZE) { segment_size = MAX_PART_SIZE; } /* RDP_DATA_SEGMENT */ out_uint32_le(s, 1 + segment_size); /* segmentArray size */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ out_uint8a(s, bitmap_data8 + index, segment_size); LOG_DEVEL(LOG_LEVEL_DEBUG, " segment index %d segment_size %d", segment_count, segment_size); index += segment_size; segment_count++; } s_mark_end(s); s_pop_layer(s, iso_hdr); out_uint16_le(s, segment_count); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_egfx_wire_to_surface1: segment_count %d", segment_count); return s; } /******************************************************************************/ int xrdp_egfx_send_wire_to_surface1(struct xrdp_egfx *egfx, int surface_id, int codec_id, int pixel_format, struct xrdp_egfx_rect *dest_rect, void *bitmap_data, int bitmap_data_length) { int error; struct stream *s; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_egfx_send_wire_to_surface1:"); s = xrdp_egfx_wire_to_surface1(egfx->bulk, surface_id, codec_id, pixel_format, dest_rect, bitmap_data, bitmap_data_length); error = xrdp_egfx_send_s(egfx, s); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_egfx_send_wire_to_surface1: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_wire_to_surface2(struct xrdp_egfx_bulk *bulk, int surface_id, int codec_id, int codec_context_id, int pixel_format, void *bitmap_data, int bitmap_data_length) { int bytes; int index; int segment_size; int segment_count; struct stream *s; char *bitmap_data8; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_egfx_wire_to_surface2:"); make_stream(s); bytes = bitmap_data_length + 8192; bytes += 5 * (bitmap_data_length / MAX_PART_SIZE); init_stream(s, bytes); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE1); /* descriptor = MULTIPART */ s_push_layer(s, iso_hdr, 2); /* segmentCount, set later */ out_uint32_le(s, 21 + bitmap_data_length); /* uncompressedSize */ /* RDP_DATA_SEGMENT */ out_uint32_le(s, 1 + 21); /* segmentArray size */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_WIRETOSURFACE_2); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ out_uint32_le(s, 21 + bitmap_data_length); /* pduLength */ out_uint16_le(s, surface_id); out_uint16_le(s, codec_id); out_uint32_le(s, codec_context_id); out_uint8(s, pixel_format); out_uint32_le(s, bitmap_data_length); segment_count = 1; index = 0; bitmap_data8 = (char *) bitmap_data; while (index < bitmap_data_length) { segment_size = bitmap_data_length - index; if (segment_size > MAX_PART_SIZE) { segment_size = MAX_PART_SIZE; } /* RDP_DATA_SEGMENT */ out_uint32_le(s, 1 + segment_size); /* segmentArray size */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ out_uint8a(s, bitmap_data8 + index, segment_size); LOG_DEVEL(LOG_LEVEL_DEBUG, " segment index %d segment_size %d", segment_count, segment_size); index += segment_size; segment_count++; } s_mark_end(s); s_pop_layer(s, iso_hdr); out_uint16_le(s, segment_count); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_egfx_wire_to_surface2: segment_count %d", segment_count); return s; } /******************************************************************************/ int xrdp_egfx_send_wire_to_surface2(struct xrdp_egfx *egfx, int surface_id, int codec_id, int codec_context_id, int pixel_format, void *bitmap_data, int bitmap_data_length) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_wire_to_surface2:"); s = xrdp_egfx_wire_to_surface2(egfx->bulk, surface_id, codec_id, codec_context_id, pixel_format, bitmap_data, bitmap_data_length); error = xrdp_egfx_send_s(egfx, s); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_egfx_send_wire_to_surface2: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ struct stream * xrdp_egfx_reset_graphics(struct xrdp_egfx_bulk *bulk, int width, int height, int monitor_count, struct monitor_info *mi) { int bytes; int index; struct stream *s; LOG(LOG_LEVEL_INFO, "xrdp_egfx_reset_graphics:"); if (monitor_count > 16) { return NULL; } make_stream(s); /* this should always be enough because limited to 16 monitors and message is always 340 bytes */ init_stream(s, 8192); /* RDP_SEGMENTED_DATA */ out_uint8(s, 0xE0); /* descriptor = SINGLE */ /* RDP8_BULK_ENCODED_DATA */ out_uint8(s, PACKET_COMPR_TYPE_RDP8); /* header */ /* RDPGFX_HEADER */ out_uint16_le(s, XR_RDPGFX_CMDID_RESETGRAPHICS); /* cmdId */ out_uint16_le(s, 0); /* flags = 0 */ out_uint32_le(s, 340); /* pduLength */ out_uint32_le(s, width); out_uint32_le(s, height); /* TODO: Fix hack where working around 0 monitors is necessary. In cases where multi-mon is not used for XRDP, internally 0 monitors are represented, even though we implicitly have one: The entire session! Some Microsoft clients (Mainly the Mac OS one) require that at least one monitor be transmitted for EGFX to function, which is why this change was necessary. See https://github.com/neutrinolabs/xrdp/pull/2338#discussion_r944685856 https://github.com/neutrinolabs/xrdp/issues/2503 */ out_uint32_le(s, monitor_count == 0 ? 1 : monitor_count); if (monitor_count == 0) { out_uint32_le(s, 0); out_uint32_le(s, 0); out_uint32_le(s, width - 1); out_uint32_le(s, height - 1); out_uint32_le(s, 1); monitor_count = 1; } else { for (index = 0; index < monitor_count; ++index) { out_uint32_le(s, mi[index].left); out_uint32_le(s, mi[index].top); out_uint32_le(s, mi[index].right); out_uint32_le(s, mi[index].bottom); out_uint32_le(s, mi[index].is_primary); LOG(LOG_LEVEL_INFO, "xrdp_egfx_reset_graphics: (index %d) " "monitor left %d top %d right %d bottom %d is_primary %d", index, mi[index].left, mi[index].top, mi[index].right, mi[index].bottom, mi[index].is_primary); } } LOG(LOG_LEVEL_INFO, "xrdp_egfx_reset_graphics: width %d height %d " "monitorcount %d", width, height, monitor_count); if (monitor_count < 16) { bytes = 340 - (20 + (monitor_count * 20)); out_uint8s(s, bytes); } s_mark_end(s); return s; } /******************************************************************************/ int xrdp_egfx_send_reset_graphics(struct xrdp_egfx *egfx, int width, int height, int monitor_count, struct monitor_info *mi) { int error; struct stream *s; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_send_reset_graphics:"); s = xrdp_egfx_reset_graphics(egfx->bulk, width, height, monitor_count, mi); error = xrdp_egfx_send_s(egfx, s); LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_send_reset_graphics: xrdp_egfx_send_s " "error %d", error); free_stream(s); return error; } /******************************************************************************/ /* RDPGFX_CMDID_FRAMEACKNOWLEDGE */ static int xrdp_egfx_process_frame_ack(struct xrdp_egfx *egfx, struct stream *s) { uint32_t queueDepth; uint32_t intframeId; uint32_t totalFramesDecoded; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_process_frame_ack:"); if (!s_check_rem(s, 12)) { return 1; } in_uint32_le(s, queueDepth); in_uint32_le(s, intframeId); in_uint32_le(s, totalFramesDecoded); LOG(LOG_LEVEL_TRACE, "xrdp_egfx_process_frame_ack: queueDepth %d" " intframeId %d totalFramesDecoded %d", queueDepth, intframeId, totalFramesDecoded); if (egfx->frame_ack != NULL) { egfx->frame_ack(egfx->user, queueDepth, intframeId, totalFramesDecoded); } return 0; } /******************************************************************************/ /* RDPGFX_CMDID_CAPSADVERTISE */ static int xrdp_egfx_process_capsadvertise(struct xrdp_egfx *egfx, struct stream *s) { int index; int capsSetCount; int caps_count; int version; int capsDataLength; int flags; char *holdp; int *versions; int *flagss; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_process_capsadvertise:"); if (egfx->caps_advertise == NULL) { return 0; } in_uint16_le(s, capsSetCount); if ((capsSetCount < 1) || (capsSetCount > 1024)) { return 1; } caps_count = 0; versions = g_new(int, capsSetCount); if (versions == NULL) { return 1; } flagss = g_new(int, capsSetCount); if (flagss == NULL) { g_free(versions); return 1; } for (index = 0; index < capsSetCount; index++) { if (!s_check_rem(s, 8)) { return 1; } in_uint32_le(s, version); in_uint32_le(s, capsDataLength); if (!s_check_rem(s, capsDataLength)) { return 1; } holdp = s->p; // This implicity excludes caps version 101. if (capsDataLength == 4) { in_uint32_le(s, flags); versions[caps_count] = version; flagss[caps_count] = flags; caps_count++; } s->p = holdp + capsDataLength; } if (caps_count > 0) { egfx->caps_advertise(egfx->user, caps_count, versions, flagss); } g_free(versions); g_free(flagss); return 0; } /******************************************************************************/ static int xrdp_egfx_process(struct xrdp_egfx *egfx, struct stream *s) { int error; int cmdId; int flags; int pduLength; char *holdp; char *holdend; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_process:"); error = 0; while (s_check_rem(s, 8)) { holdp = s->p; holdend = s->end; in_uint16_le(s, cmdId); in_uint16_le(s, flags); in_uint32_le(s, pduLength); s->end = holdp + pduLength; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_process: cmdId 0x%x flags %d" " pduLength %d", cmdId, flags, pduLength); if (pduLength < 8) { return 1; } if (!s_check_rem(s, pduLength - 8)) { return 1; } switch (cmdId) { case XR_RDPGFX_CMDID_FRAMEACKNOWLEDGE: error = xrdp_egfx_process_frame_ack(egfx, s); break; case XR_RDPGFX_CMDID_CAPSADVERTISE: error = xrdp_egfx_process_capsadvertise(egfx, s); break; case XR_RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE: break; /* TODO: Handle Cache Import PDU here. https://github.com/neutrinolabs/xrdp/issues/2502 case XR_RDPGFX_CMDID_CACHEIMPORTOFFER: 2.2.2.16 RDPGFX_CACHE_IMPORT_OFFER_PDU Reply with 2.2.2.17 RDPGFX_CACHE_IMPORT_REPLY_PDU */ default: LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_process:" " unknown cmdId 0x%x", cmdId); break; } if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_process: error %d", error); return error; } s->p = holdp + pduLength; s->end = holdend; } return error; } /******************************************************************************/ /* from client */ static int xrdp_egfx_open_response(intptr_t id, int chan_id, int creation_status) { LOG(LOG_LEVEL_TRACE, "xrdp_egfx_open_response:"); return 0; } int advance_resize_state_machine(struct xrdp_mm *mm, enum display_resize_state new_state); /******************************************************************************/ /* from client */ static int xrdp_egfx_close_response(intptr_t id, int chan_id) { struct xrdp_process *process; struct xrdp_mm *mm; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_close_response:"); process = (struct xrdp_process *) id; mm = process->wm->mm; if (mm->resize_queue == 0 || mm->resize_queue->count <= 0) { return 0; } if (mm->resize_data != NULL && mm->resize_data->state == WMRZ_EGFX_CONN_CLOSING) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_close_response: egfx deleted."); advance_resize_state_machine(mm, WMRZ_EGFX_CONN_CLOSED); } return 0; } /******************************************************************************/ /* from client */ static int xrdp_egfx_data_first(intptr_t id, int chan_id, char *data, int bytes, int total_bytes) { struct xrdp_process *process; struct xrdp_egfx *egfx; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_data_first: bytes %d" " total_bytes %d", bytes, total_bytes); process = (struct xrdp_process *) id; egfx = process->wm->mm->egfx; if (egfx->s != NULL) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_data_first: Error!" " Stream is not working on initial data received!"); } make_stream(egfx->s); init_stream(egfx->s, total_bytes); out_uint8a(egfx->s, data, bytes); return 0; } /******************************************************************************/ /* from client */ static int xrdp_egfx_data(intptr_t id, int chan_id, char *data, int bytes) { int error; struct stream ls; struct xrdp_process *process; struct xrdp_wm *wm; struct xrdp_mm *mm; struct xrdp_egfx *egfx; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_data:"); process = (struct xrdp_process *) id; if (process == NULL) { return 0; } wm = process->wm; if (wm == NULL) { return 0; } mm = wm->mm; if (mm == NULL) { return 0; } egfx = mm->egfx; if (egfx == NULL) { return 0; } if (egfx->s == NULL) { g_memset(&ls, 0, sizeof(ls)); ls.data = data; ls.size = bytes; ls.p = data; ls.end = data + bytes; return xrdp_egfx_process(egfx, &ls); } if (!s_check_rem_out(egfx->s, bytes)) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_data: error"); return 1; } out_uint8a(egfx->s, data, bytes); if (!s_check_rem_out(egfx->s, 1)) { s_mark_end(egfx->s); egfx->s->p = egfx->s->data; error = xrdp_egfx_process(egfx, egfx->s); free_stream(egfx->s); egfx->s = NULL; return error; } return 0; } /******************************************************************************/ int xrdp_egfx_create(struct xrdp_mm *mm, struct xrdp_egfx **egfx) { int error; struct xrdp_drdynvc_procs procs; struct xrdp_egfx *self; struct xrdp_process *process; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_create:"); self = g_new0(struct xrdp_egfx, 1); if (self == NULL) { return 1; } procs.open_response = xrdp_egfx_open_response; procs.close_response = xrdp_egfx_close_response; procs.data_first = xrdp_egfx_data_first; procs.data = xrdp_egfx_data; process = mm->wm->pro_layer; error = libxrdp_drdynvc_open(process->session, "Microsoft::Windows::RDS::Graphics", 1, /* WTS_CHANNEL_OPTION_DYNAMIC */ &procs, &(self->channel_id)); LOG(LOG_LEVEL_INFO, "xrdp_egfx_create: error %d channel_id %d", error, self->channel_id); self->session = process->session; self->surface_id = 0; *egfx = self; return 0; } /******************************************************************************/ int xrdp_egfx_shutdown_delete_surface(struct xrdp_egfx *egfx) { int error; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_shutdown_delete_surface:"); if (egfx == 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_delete_surface:" " EGFX is already null!"); return 0; } error = xrdp_egfx_send_delete_surface(egfx, egfx->surface_id); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_delete_surface:" " xrdp_egfx_send_delete_surface failed %d", error); } return error; } /******************************************************************************/ int xrdp_egfx_shutdown_close_connection(struct xrdp_egfx *egfx) { int error; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_shutdown_close_connection:"); if (egfx == 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_close_connection:" " EGFX is already null!"); return 0; } error = libxrdp_drdynvc_close(egfx->session, egfx->channel_id); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_close_connection:" " libxrdp_drdynvc_close failed %d", error); return error; } // Ignore any messages we haven't processed yet egfx->caps_advertise = NULL; egfx->frame_ack = NULL; return error; } /******************************************************************************/ int xrdp_egfx_shutdown_delete(struct xrdp_egfx *egfx) { int error = 0; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_delete:"); if (egfx == 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_delete: EGFX is already null!"); return 0; } g_free(egfx); return error; } /******************************************************************************/ int xrdp_egfx_shutdown_full(struct xrdp_egfx *egfx) { int error; LOG(LOG_LEVEL_TRACE, "xrdp_egfx_shutdown_full:"); if (egfx == 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_full: EGFX is already null!"); return 0; } error = xrdp_egfx_shutdown_delete_surface(egfx); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_full:" " xrdp_egfx_shutdown_delete_surface failed %d", error); return error; } error = xrdp_egfx_shutdown_close_connection(egfx); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_full:" " xrdp_egfx_shutdown_close_connection failed %d", error); return error; } error = xrdp_egfx_shutdown_delete(egfx); if (error != 0) { LOG(LOG_LEVEL_DEBUG, "xrdp_egfx_shutdown_full:" " xrdp_egfx_shutdown_delete failed %d", error); return error; } return error; } xrdp-0.10.1/xrdp/xrdp_bitmap_load.c000644 001751 000000 00000074662 14652432047 017305 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Load xrdp_bitmap from file */ #if defined(HAVE_CONFIG_H) #include #endif #ifdef USE_IMLIB2 # include #endif #include "xrdp.h" #include "log.h" /* Rounds up to the nearest multiple of 4 */ #define ROUND4(x) (((x) + 3) / 4 * 4) /* Are we using the builtin BMP format-only loader */ #ifdef USE_BUILTIN_LOADER # undef USE_BUILTIN_LOADER #endif #ifndef USE_IMLIB2 # define USE_BUILTIN_LOADER #endif /** * Describes a box within an image */ struct box { int left_margin; int width; int top_margin; int height; }; /**************************************************************************//** * Calculates a zoom box, from source and destination image dimensions * * The zoom box is the largest centred part of the source image which * preserves the aspect ratio of the destination image. We find it * by cutting off the left and right sides of the source, or the top * and bottom. * * @param src_width Width of source image * @param src_height Height of source image * @param dst_width Width of destination image * @param dst_height Height of destination image * @param[out] zb_return Zoom box * @return 0 for success */ static int calculate_zoom_box(int src_width, int src_height, int dst_width, int dst_height, struct box *zb_return) { int result = 1; struct box zb; if (dst_height == 0 || src_height == 0) { LOG(LOG_LEVEL_ERROR, "Can't zoom to or from zero-width images"); } else { double dst_ratio = (double)dst_width / dst_height; double src_ratio = (double)src_width / src_height; if (src_ratio > dst_ratio) { /* Source is relatively wider than source. Select a box * narrower than the source, but the same height */ zb.width = (int)(dst_ratio * src_height + .5); zb.left_margin = (src_width - zb.width) / 2; zb.height = src_height; zb.top_margin = 0; } else { /* Source is relatively taller than source (or same shape) */ zb.width = src_width; zb.left_margin = 0; zb.height = (int)(src_width / dst_ratio + .5); zb.top_margin = (src_height - zb.height) / 2; } /* Only allow meaningful zoom boxes */ if (zb.width < 1 || zb.height < 1) { LOG(LOG_LEVEL_WARNING, "Ignoring pathological zoom" " request (%dx%d) -> (%dx%d)", src_width, src_height, dst_width, dst_height); } else { *zb_return = zb; result = 0; } } return result; } /*****************************************************************************/ static int xrdp_bitmap_get_index(struct xrdp_bitmap *self, const int *palette, int color) { int r = 0; int g = 0; int b = 0; r = (color & 0xff0000) >> 16; g = (color & 0x00ff00) >> 8; b = (color & 0x0000ff) >> 0; r = (r >> 5) << 0; g = (g >> 5) << 3; b = (b >> 6) << 6; return (b | g | r); } #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * Private routine to swap pixel data between two pixmaps * @param a First bitmap * @param b Second bitmap * * The main use-case for this routine is to modify an existing bitmap using * the following logic:- * - Create a temporary WND_TYPE_BITMAP * - Process the data in a bitmap in some way, moving it to the temporary * - Call this routine * - Delete the temporary * */ static void swap_pixel_data(struct xrdp_bitmap *a, struct xrdp_bitmap *b) { int tmp_width = a->width; int tmp_height = a->height; int tmp_bpp = a->bpp; int tmp_line_size = a->line_size; char *tmp_data = a->data; int tmp_do_not_free_data = a->do_not_free_data; a->width = b->width; a->height = b->height; a->bpp = b->bpp; a->line_size = b->line_size; a->data = b->data; a->do_not_free_data = b->do_not_free_data; b->width = tmp_width; b->height = tmp_height; b->bpp = tmp_bpp; b->line_size = tmp_line_size; b->data = tmp_data; b->do_not_free_data = tmp_do_not_free_data; } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * Scales a bitmap image * * @param self Bitmap to scale * @param target_width target width * @param target_height target height * @return 0 for success */ static int xrdp_bitmap_scale(struct xrdp_bitmap *self, int targ_width, int targ_height) { int src_width = self->width; int src_height = self->height; if (src_width != targ_width || src_height != targ_height) { struct xrdp_bitmap *target = xrdp_bitmap_create(targ_width, targ_height, self->bpp, WND_TYPE_BITMAP, 0); int targ_x, targ_y; if (target == NULL) { /* Error is logged */ return 1; } /* For each pixel in the target pixmap, scale to one in the source */ for (targ_x = 0 ; targ_x < targ_width; ++targ_x) { int src_x = targ_x * src_width / targ_width; for (targ_y = 0 ; targ_y < targ_height; ++targ_y) { int src_y = targ_y * src_height / targ_height; int pixel = xrdp_bitmap_get_pixel(self, src_x, src_y); xrdp_bitmap_set_pixel(target, targ_x, targ_y, pixel); } } swap_pixel_data(self, target); xrdp_bitmap_delete(target); } return 0; } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * Zooms a bitmap image * * @param self Bitmap to zoom * @param target_width target width * @param target_height target height * @return 0 for success * * This works the same way as a scaled image, but the aspect ratio is * maintained by removing pixels from the top-and-bottom, * or the left-and-right before scaling. */ static int xrdp_bitmap_zoom(struct xrdp_bitmap *self, int targ_width, int targ_height) { struct box zb; int result = 0; if (calculate_zoom_box(self->width, self->height, targ_width, targ_height, &zb) == 0) { /* Need to chop anything? */ if (zb.top_margin != 0 || zb.left_margin != 0) { struct xrdp_bitmap *zbitmap; zbitmap = xrdp_bitmap_create(zb.width, zb.height, self->bpp, WND_TYPE_BITMAP, 0); if (zbitmap == NULL) { LOG(LOG_LEVEL_ERROR, "xrdp_bitmap_zoom: no memory"); result = 1; } else { result = xrdp_bitmap_copy_box(self, zbitmap, zb.left_margin, zb.top_margin, zb.width, zb.height); if (result != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_bitmap_zoom: can't copy box"); } else { swap_pixel_data(self, zbitmap); } xrdp_bitmap_delete(zbitmap); } } } if (result == 0) { result = xrdp_bitmap_scale(self, targ_width, targ_height); } return result; } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * reads the palette from a bmp file with a palette embedded in it * * @pre The read position in the file is at the end of the bmp DIB header. * * @param filename Name of file * @param fd File descriptor for file * @param header Pointer to BMP header info struct * @param palette output. Must be at least 256 elements */ static void read_palette(const char *filename, int fd, const struct xrdp_bmp_header *header, int *palette) { struct stream *s; int clr_used; int palette_size; int len; int i; /* Find the number of colors used in the bitmap */ if (header->clr_used != 0) { clr_used = header->clr_used; /* Is the header value sane? */ if (clr_used < 0 || clr_used > 256) { clr_used = 256; LOG(LOG_LEVEL_WARNING, "%s : Invalid palette size %d in file %s", __func__, header->clr_used, filename); } } else if (header->bit_count == 4) { clr_used = 16; } else { clr_used = 256; } palette_size = clr_used * 4; make_stream(s); init_stream(s, palette_size); /* Pre-fill the buffer, so if we get short reads we're * not working with uninitialised data */ g_memset(s->data, 0, palette_size); s->end = s->data + palette_size; len = g_file_read(fd, s->data, palette_size); if (len != palette_size) { LOG(LOG_LEVEL_WARNING, "%s: unexpected read length in file %s", __func__, filename); } for (i = 0; i < clr_used; ++i) { in_uint32_le(s, palette[i]); } free_stream(s); } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * Process a row of data from a 24-bit bmp file * * @param self Bitmap we're filling in * @param s Stream containing bitmap data * @param in_palette Palette from bmp file (unused) * @param out_palette Palette for output bitmap * @param row Row number */ static void process_row_data_24bit(struct xrdp_bitmap *self, struct stream *s, const int *in_palette, const int *out_palette, int row) { int j; int k; int color; for (j = 0; j < self->width; ++j) { in_uint8(s, k); color = k; in_uint8(s, k); color |= k << 8; in_uint8(s, k); color |= k << 16; if (self->bpp == 8) { color = xrdp_bitmap_get_index(self, out_palette, color); } else if (self->bpp == 15) { color = COLOR15((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } else if (self->bpp == 16) { color = COLOR16((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } xrdp_bitmap_set_pixel(self, j, row, color); } } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * Process a row of data from an 8-bit bmp file * * @param self Bitmap we're filling in * @param s Stream containing bitmap data * @param in_palette Palette from bmp file * @param out_palette Palette for output bitmap * @param row Row number */ static void process_row_data_8bit(struct xrdp_bitmap *self, struct stream *s, const int *in_palette, const int *out_palette, int row) { int j; int k; int color; for (j = 0; j < self->width; ++j) { in_uint8(s, k); color = in_palette[k]; if (self->bpp == 8) { color = xrdp_bitmap_get_index(self, out_palette, color); } else if (self->bpp == 15) { color = COLOR15((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } else if (self->bpp == 16) { color = COLOR16((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } xrdp_bitmap_set_pixel(self, j, row, color); } } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /**************************************************************************//** * Process a row of data from an 4-bit bmp file * * @param self Bitmap we're filling in * @param s Stream containing bitmap data * @param in_palette Palette from bmp file * @param out_palette Palette for output bitmap * @param row Row number */ static void process_row_data_4bit(struct xrdp_bitmap *self, struct stream *s, const int *in_palette, const int *out_palette, int row) { int j; int k = 0; int color; for (j = 0; j < self->width; ++j) { if ((j & 1) == 0) { in_uint8(s, k); color = (k >> 4) & 0xf; } else { color = k & 0xf; } color = in_palette[color]; if (self->bpp == 8) { color = xrdp_bitmap_get_index(self, out_palette, color); } else if (self->bpp == 15) { color = COLOR15((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } else if (self->bpp == 16) { color = COLOR16((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } xrdp_bitmap_set_pixel(self, j, row, color); } } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /*****************************************************************************/ /* load a bmp file */ /* return 0 ok */ /* return 1 error */ static int xrdp_bitmap_load_bmp(struct xrdp_bitmap *self, const char *filename, const int *out_palette) { int fd = 0; int len = 0; int row = 0; int row_size = 0; int bmp_palette[256] = {0}; char fixed_header[14] = {0}; struct xrdp_bmp_header header = {0}; struct stream *s = (struct stream *)NULL; /* Pointer to row data processing function */ void (*process_row_data)(struct xrdp_bitmap * self, struct stream * s, const int *in_palette, const int *out_palette, int row); if (!g_file_exist(filename)) { LOG(LOG_LEVEL_ERROR, "%s: error bitmap file [%s] does not exist", __func__, filename); return 1; } fd = g_file_open_ro(filename); if (fd == -1) { LOG(LOG_LEVEL_ERROR, "%s: error loading bitmap from file [%s]", __func__, filename); return 1; } /* read the fixed file header */ if (g_file_read(fd, fixed_header, 14) != 14) { LOG(LOG_LEVEL_ERROR, "%s: error bitmap file [%s] read error", __func__, filename); g_file_close(fd); return 1; } if ((fixed_header[0] != 'B') || (fixed_header[1] != 'M')) { LOG(LOG_LEVEL_ERROR, "%s: error bitmap file [%s] not BMP file", __func__, filename); g_file_close(fd); return 1; } /* read information header */ make_stream(s); init_stream(s, 8192); len = g_file_read(fd, s->data, 40); /* size better be 40 */ if (len != 40) { LOG(LOG_LEVEL_ERROR, "%s: unexpected read length %d in file %s", __func__, len, filename); free_stream(s); g_file_close(fd); return 1; } s->end = s->data + len; in_uint32_le(s, header.size); in_uint32_le(s, header.image_width); in_uint32_le(s, header.image_height); in_uint16_le(s, header.planes); in_uint16_le(s, header.bit_count); in_uint32_le(s, header.compression); in_uint32_le(s, header.image_size); in_uint32_le(s, header.x_pels_per_meter); in_uint32_le(s, header.y_pels_per_meter); in_uint32_le(s, header.clr_used); in_uint32_le(s, header.clr_important); if (header.compression != 0) { LOG(LOG_LEVEL_WARNING, "%s: error bitmap file [%s]" " unsupported compression value %d", __func__, filename, header.compression); } if (g_file_seek(fd, 14 + header.size) < 0) { LOG(LOG_LEVEL_WARNING, "%s: seek error in file %s", __func__, filename); } /* Validate the bit count for the file, read any palette, and * determine the row size and row processing function */ switch (header.bit_count) { case 24: row_size = ROUND4(header.image_width * 3); process_row_data = process_row_data_24bit; break; case 8: read_palette(filename, fd, &header, bmp_palette); row_size = ROUND4(header.image_width); process_row_data = process_row_data_8bit; break; case 4: read_palette(filename, fd, &header, bmp_palette); /* The storage for a row is a complex calculation for 4 bit pixels. * a width of 1-8 pixels takes 4 bytes * a width of 9-16 pixels takes 8 bytes, etc * So bytes = (width + 7) / 8 * 4 */ row_size = ((header.image_width + 7) / 8 * 4); process_row_data = process_row_data_4bit; break; default: LOG(LOG_LEVEL_ERROR, "%s: error bitmap file [%s] bad bpp %d", __func__, filename, header.bit_count); free_stream(s); g_file_close(fd); return 1; } xrdp_bitmap_resize(self, header.image_width, header.image_height); /* Set up the row data buffer. Pre fill it, so if we get short reads * we're not working with uninitialised data */ init_stream(s, row_size); g_memset(s->data, 0, row_size); s->end = s->data + row_size; /* read and process the pixel data a row at a time */ for (row = header.image_height - 1; row >= 0; row--) { len = g_file_read(fd, s->data, row_size); if (len != row_size) { LOG(LOG_LEVEL_WARNING, "%s: error bitmap file [%s] read", __func__, filename); } s->p = s->data; (*process_row_data)(self, s, bmp_palette, out_palette, row); } g_file_close(fd); free_stream(s); return 0; } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_BUILTIN_LOADER /*****************************************************************************/ int xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, const int *palette, int background, enum xrdp_bitmap_load_transform transform, int twidth, int theight) { /* this is the default bmp-only implementation if a graphics library * isn't built in */ int result = xrdp_bitmap_load_bmp(self, filename, palette); if (result == 0) { switch (transform) { case XBLT_NONE: break; case XBLT_SCALE: result = xrdp_bitmap_scale(self, twidth, theight); break; case XBLT_ZOOM: result = xrdp_bitmap_zoom(self, twidth, theight); break; default: LOG(LOG_LEVEL_WARNING, "Invalid bitmap transform %d specified", transform); } } return result; } #endif /* USE_BUILTIN_LOADER */ #ifdef USE_IMLIB2 /**************************************************************************//** * Log an error from the Imlib2 library * * @param level Log level to use * @param filename file we're trying to load * @param lerr Error return from imlib2 */ static void log_imlib2_error(enum logLevels level, const char *filename, Imlib_Load_Error lerr) { const char *msg; char buff[256]; switch (lerr) { case IMLIB_LOAD_ERROR_NONE: msg = "No error"; break; case IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST: msg = "No such file"; break; case IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ: msg = "Permission denied"; break; case IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT: msg = "Unrecognised file format"; break; case IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY: case IMLIB_LOAD_ERROR_PATH_TOO_LONG: case IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT: case IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE: case IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS: msg = "Bad filename"; break; case IMLIB_LOAD_ERROR_OUT_OF_MEMORY: msg = " No memory"; break; case IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS: msg = "No file descriptors"; break; case IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE: msg = "No disk space"; break; case IMLIB_LOAD_ERROR_UNKNOWN: msg = "Unknown error"; break; default: g_snprintf(buff, sizeof(buff), "Unrecognised code %d", lerr); msg = buff; } LOG(LOG_LEVEL_ERROR, "Error loading %s [%s]", filename, msg); } #endif /* USE_IMLIB2 */ #ifdef USE_IMLIB2 /**************************************************************************//** * Blend an imlib2 image onto a background of the specified color * * The current context image is merged. On return the new image is the * current context image, and the old image is deleted. * * @param filename Filename we're working on (for error reporting) * @param r Background red * @param g Background green * @param g Background blue * * @return 0 for success. On failure the current context image is unchanged. */ static int blend_imlib_image_onto_background(const char *filename, int r, int g, int b) { int result = 0; Imlib_Image img = imlib_context_get_image(); if (img == NULL) { LOG(LOG_LEVEL_ERROR, "No context for blending image"); result = 1; } else { int width = imlib_image_get_width(); int height = imlib_image_get_height(); /* Create a suitable image to merge this one onto */ Imlib_Image bg = imlib_create_image(width, height); if (bg == NULL) { log_imlib2_error(LOG_LEVEL_ERROR, filename, IMLIB_LOAD_ERROR_OUT_OF_MEMORY); result = 1; } else { imlib_context_set_image(bg); imlib_context_set_color(r, g, b, 0xff); imlib_image_fill_rectangle(0, 0, width, height); imlib_blend_image_onto_image(img, 0, 0, 0, width, height, 0, 0, width, height); imlib_context_set_image(img); imlib_free_image(); imlib_context_set_image(bg); } } return result; } #endif /* USE_IMLIB2 */ #ifdef USE_IMLIB2 /**************************************************************************//** * Scales an imlib2 image * * The current context image is scaled. On return the new image is the * current context image, and the old image is deleted. * * @param filename Filename we're working on (for error reporting) * @param twidth target width * @param theight target height * @return 0 for success */ static int scale_imlib_image(const char *filename, int twidth, int theight) { int result = 0; Imlib_Image img = imlib_context_get_image(); if (img == NULL) { LOG(LOG_LEVEL_ERROR, "No context for scaling image"); result = 1; } else { int width = imlib_image_get_width(); int height = imlib_image_get_height(); Imlib_Image newimg = imlib_create_cropped_scaled_image( 0, 0, width, height, twidth, theight); if (newimg == NULL) { log_imlib2_error(LOG_LEVEL_ERROR, filename, IMLIB_LOAD_ERROR_OUT_OF_MEMORY); result = 1; } else { imlib_free_image(); imlib_context_set_image(newimg); } } return result; } #endif /* USE_IMLIB2 */ #ifdef USE_IMLIB2 /**************************************************************************//** * Zooms an imlib2 image * * @param filename Filename we're working on (for error reporting) * @param twidth target width * @param theight target height * @return 0 for success */ static int zoom_imlib_image(const char *filename, int twidth, int theight) { int result = 0; Imlib_Image img = imlib_context_get_image(); if (img == NULL) { LOG(LOG_LEVEL_ERROR, "No context for zooming image"); result = 1; } else { struct box zb; Imlib_Image newimg = NULL; int width = imlib_image_get_width(); int height = imlib_image_get_height(); if (calculate_zoom_box(width, height, twidth, theight, &zb) == 0) { newimg = imlib_create_cropped_scaled_image( zb.left_margin, zb.top_margin, zb.width, zb.height, twidth, theight); } else { /* Can't zoom - scale the image instead */ newimg = imlib_create_cropped_scaled_image( 0, 0, width, height, twidth, theight); } if (newimg == NULL) { log_imlib2_error(LOG_LEVEL_ERROR, filename, IMLIB_LOAD_ERROR_OUT_OF_MEMORY); result = 1; } else { imlib_free_image(); imlib_context_set_image(newimg); } } return result; } #endif /* USE_IMLIB2 */ #ifdef USE_IMLIB2 /**************************************************************************//** * Copies imlib2 image data to a bitmap * * @param self bitmap to copy data to * @param out_palette Palette for output bitmap * @return 0 for success */ static int copy_imlib_data_to_bitmap(struct xrdp_bitmap *self, const int *out_palette) { int result = 0; Imlib_Image img = imlib_context_get_image(); if (img == NULL) { LOG(LOG_LEVEL_ERROR, "No context for zooming image"); result = 1; } else { int width = imlib_image_get_width(); int height = imlib_image_get_height(); int i; int j; DATA32 *bdata; int color; xrdp_bitmap_resize(self, width, height); bdata = imlib_image_get_data_for_reading_only(); for (j = 0 ; j < height; ++j) { for (i = 0 ; i < width ; ++i) { color = (*bdata++ & 0xffffff); if (self->bpp == 8) { color = xrdp_bitmap_get_index(self, out_palette, color); } else if (self->bpp == 15) { color = COLOR15((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } else if (self->bpp == 16) { color = COLOR16((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff) >> 0); } xrdp_bitmap_set_pixel(self, i, j, color); } } } return result; } #endif /* USE_IMLIB2 */ #ifdef USE_IMLIB2 /** * Converts an xrdp HCOLOR into RGB values used by imlib2 * * @param hcolor Color to convert * @param bpp Bits-per-pixel for the hcolor * @param[out] r Red value * @param[out] g Green value * @param[out] b Blue value */ static void hcolor_to_rgb(int hcolor, int bpp, int *r, int *g, int *b) { switch (bpp) { case 8: *r = (hcolor & 0x7) << 5; *g = (hcolor & 0x38) << 2; *b = (hcolor & 0xc0); break; case 15: SPLITCOLOR15(*r, *g, *b, hcolor); break; case 16: SPLITCOLOR16(*r, *g, *b, hcolor); break; default: /* Beware : HCOLOR is BGR, not RGB */ *r = hcolor & 0xff; *g = (hcolor >> 8) & 0xff; *b = (hcolor >> 16) & 0xff; break; } } #endif #ifdef USE_IMLIB2 /*****************************************************************************/ int xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, const int *palette, int background, enum xrdp_bitmap_load_transform transform, int twidth, int theight) { int result = 0; Imlib_Load_Error lerr; int free_context_image = 0; /* Set if we've got an image loaded */ Imlib_Image img = imlib_load_image_with_error_return(filename, &lerr); /* Load the image */ if (img == NULL) { log_imlib2_error(LOG_LEVEL_ERROR, filename, lerr); result = 1; } else { imlib_context_set_image(img); free_context_image = 1; } /* Sort out the background */ if (result == 0 && imlib_image_has_alpha()) { int r; int g; int b; hcolor_to_rgb(background, self->bpp, &r, &g, &b); result = blend_imlib_image_onto_background(filename, r, g, b); } if (result == 0) { switch (transform) { case XBLT_NONE: break; case XBLT_SCALE: result = scale_imlib_image(filename, twidth, theight); break; case XBLT_ZOOM: result = zoom_imlib_image(filename, twidth, theight); break; default: LOG(LOG_LEVEL_WARNING, "Invalid bitmap transform %d specified", transform); } } if (result == 0) { result = copy_imlib_data_to_bitmap(self, palette); } if (free_context_image) { imlib_free_image(); } return result; } #endif /* USE_IMLIB2 */ xrdp-0.10.1/xrdp/xrdp_bitmap_common.c000644 001751 000000 00000027351 14652432047 017647 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Common bitmap functions for all xrdp_bitmap*.c files */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "xrdp.h" /*****************************************************************************/ /* Allocate bitmap for specified dimensions, checking for int overflow */ static char * alloc_bitmap_data(int width, int height, int Bpp) { char *result = NULL; if (width > 0 && height > 0 && Bpp > 0) { int len = width; /* g_malloc() currently takes an 'int' size */ if (len < INT_MAX / height) { len *= height; if (len < INT_MAX / Bpp) { len *= Bpp; result = (char *)malloc(len); } } } return result; } /*****************************************************************************/ struct xrdp_bitmap * xrdp_bitmap_create(int width, int height, int bpp, int type, struct xrdp_wm *wm) { struct xrdp_bitmap *self = (struct xrdp_bitmap *)NULL; int Bpp = 0; self = (struct xrdp_bitmap *)g_malloc(sizeof(struct xrdp_bitmap), 1); if (self == NULL) { LOG(LOG_LEVEL_ERROR, "xrdp_bitmap_create: no memory"); return self; } self->type = type; self->width = width; self->height = height; self->bpp = bpp; Bpp = 4; switch (bpp) { case 8: Bpp = 1; break; case 15: Bpp = 2; break; case 16: Bpp = 2; break; } if (self->type == WND_TYPE_BITMAP || self->type == WND_TYPE_IMAGE) { self->data = alloc_bitmap_data(width, height, Bpp); if (self->data == NULL) { LOG(LOG_LEVEL_ERROR, "xrdp_bitmap_create: size overflow %dx%dx%d", width, height, Bpp); g_free(self); return NULL; } } #if defined(XRDP_PAINTER) if (self->type == WND_TYPE_SCREEN) /* noorders */ { LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_bitmap_create: noorders"); self->data = alloc_bitmap_data(width, height, Bpp); if (self->data == NULL) { LOG(LOG_LEVEL_ERROR, "xrdp_bitmap_create: size overflow %dx%dx%d", width, height, Bpp); g_free(self); return NULL; } } #endif if (self->type != WND_TYPE_BITMAP) { self->child_list = list_create(); } self->line_size = width * Bpp; if (self->type == WND_TYPE_COMBO) { self->string_list = list_create(); self->string_list->auto_free = 1; self->data_list = list_create(); self->data_list->auto_free = 1; } self->wm = wm; return self; } /*****************************************************************************/ struct xrdp_bitmap * xrdp_bitmap_create_with_data(int width, int height, int bpp, char *data, struct xrdp_wm *wm) { struct xrdp_bitmap *self = (struct xrdp_bitmap *)NULL; int Bpp; #if defined(NEED_ALIGN) tintptr data_as_int; #endif self = (struct xrdp_bitmap *)g_malloc(sizeof(struct xrdp_bitmap), 1); self->type = WND_TYPE_BITMAP; self->width = width; self->height = height; self->bpp = bpp; self->wm = wm; Bpp = 4; switch (bpp) { case 8: Bpp = 1; break; case 15: Bpp = 2; break; case 16: Bpp = 2; break; } self->line_size = width * Bpp; #if defined(NEED_ALIGN) data_as_int = (tintptr) data; if (((bpp >= 24) && (data_as_int & 3)) || (((bpp == 15) || (bpp == 16)) && (data_as_int & 1))) { /* got to copy data here, it's not aligned other calls in this file assume alignment */ self->data = (char *)g_malloc(width * height * Bpp, 0); g_memcpy(self->data, data, width * height * Bpp); return self; } #endif self->data = data; self->do_not_free_data = 1; return self; } /*****************************************************************************/ void xrdp_bitmap_delete(struct xrdp_bitmap *self) { int i = 0; struct xrdp_mod_data *mod_data = (struct xrdp_mod_data *)NULL; if (self == 0) { return; } if (self->wm != 0) { if (self->wm->focused_window != 0) { if (self->wm->focused_window->focused_control == self) { self->wm->focused_window->focused_control = 0; } } if (self->wm->focused_window == self) { self->wm->focused_window = 0; } if (self->wm->dragging_window == self) { self->wm->dragging_window = 0; } if (self->wm->button_down == self) { self->wm->button_down = 0; } if (self->wm->popup_wnd == self) { self->wm->popup_wnd = 0; } if (self->wm->login_window == self) { self->wm->login_window = 0; } if (self->wm->log_wnd == self) { self->wm->log_wnd = 0; } } if (self->child_list != 0) { for (i = self->child_list->count - 1; i >= 0; i--) { xrdp_bitmap_delete((struct xrdp_bitmap *)self->child_list->items[i]); } list_delete(self->child_list); } if (self->parent != 0) { i = list_index_of(self->parent->child_list, (long)self); if (i >= 0) { list_remove_item(self->parent->child_list, i); } } if (self->string_list != 0) /* for combo */ { list_delete(self->string_list); } if (self->data_list != 0) /* for combo */ { for (i = 0; i < self->data_list->count; i++) { mod_data = (struct xrdp_mod_data *)list_get_item(self->data_list, i); if (mod_data != 0) { list_delete(mod_data->names); list_delete(mod_data->values); } } list_delete(self->data_list); } if (!self->do_not_free_data) { g_free(self->data); } g_free(self->caption1); g_free(self); } /*****************************************************************************/ /* returns error */ int xrdp_bitmap_resize(struct xrdp_bitmap *self, int width, int height) { int Bpp = 0; if ((width == self->width) && (height == self->height)) { return 0; } if (self->do_not_free_data) { return 1; } Bpp = 4; switch (self->bpp) { case 8: Bpp = 1; break; case 15: Bpp = 2; break; case 16: Bpp = 2; break; } /* To prevent valgrind errors (particularly on a screen resize), clear extra memory */ unsigned long old_size = self->width * self->height * Bpp; unsigned long new_size = width * height * Bpp; char *new_data = (char *)realloc(self->data, new_size); if (new_data == NULL) { return 1; } self->width = width; self->height = height; if (new_data != self->data) { self->data = new_data; memset(self->data, 0, new_size); } else if (new_size > old_size) { memset(self->data + old_size, 0, new_size - old_size); } self->line_size = width * Bpp; return 0; } /*****************************************************************************/ int xrdp_bitmap_get_pixel(struct xrdp_bitmap *self, int x, int y) { if (self == 0) { return 0; } if (self->data == 0) { return 0; } if (x >= 0 && x < self->width && y >= 0 && y < self->height) { if (self->bpp == 8) { return GETPIXEL8(self->data, x, y, self->width); } else if (self->bpp == 15 || self->bpp == 16) { return GETPIXEL16(self->data, x, y, self->width); } else if (self->bpp >= 24) { return GETPIXEL32(self->data, x, y, self->width); } } return 0; } /*****************************************************************************/ int xrdp_bitmap_set_pixel(struct xrdp_bitmap *self, int x, int y, int pixel) { if (self == 0) { return 0; } if (self->data == 0) { return 0; } if (x >= 0 && x < self->width && y >= 0 && y < self->height) { if (self->bpp == 8) { SETPIXEL8(self->data, x, y, self->width, pixel); } else if (self->bpp == 15 || self->bpp == 16) { SETPIXEL16(self->data, x, y, self->width, pixel); } else if (self->bpp >= 24) { SETPIXEL32(self->data, x, y, self->width, pixel); } } return 0; } /*****************************************************************************/ /* copy part of self at x, y to 0, 0 in dest */ /* returns error */ int xrdp_bitmap_copy_box(struct xrdp_bitmap *self, struct xrdp_bitmap *dest, int x, int y, int cx, int cy) { int i; int destx; int desty; int incs; int incd; tui8 *s8; tui8 *d8; tui16 *s16; tui16 *d16; tui32 *s32; tui32 *d32; if (self == 0) { return 1; } if (dest == 0) { return 1; } if (self->type != WND_TYPE_BITMAP && self->type != WND_TYPE_IMAGE) { return 1; } if (dest->type != WND_TYPE_BITMAP && dest->type != WND_TYPE_IMAGE) { return 1; } if (self->bpp != dest->bpp) { return 1; } destx = 0; desty = 0; if (!check_bounds(self, &x, &y, &cx, &cy)) { return 1; } if (!check_bounds(dest, &destx, &desty, &cx, &cy)) { return 1; } if (self->bpp >= 24) { s32 = ((tui32 *)(self->data)) + (self->width * y + x); d32 = ((tui32 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { g_memcpy(d32, s32, cx * 4); s32 += cx; d32 += cx; s32 += incs; d32 += incd; } } else if (self->bpp == 15 || self->bpp == 16) { s16 = ((tui16 *)(self->data)) + (self->width * y + x); d16 = ((tui16 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { g_memcpy(d16, s16, cx * 2); s16 += cx; d16 += cx; s16 += incs; d16 += incd; } } else if (self->bpp == 8) { s8 = ((tui8 *)(self->data)) + (self->width * y + x); d8 = ((tui8 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { g_memcpy(d8, s8, cx); s8 += cx; d8 += cx; s8 += incs; d8 += incd; } } else { return 1; } return 0; } xrdp-0.10.1/xrdp/sans-18.fv1000644 001751 000000 00004343520 14652432047 015435 0ustar00metawheel000000 000000 FNT1DejaVu Sans  00 `@ @|?``?<f 80fcwx8p? 00``````00 ``000000`` `uu`````  8000``` ?p````00000000````p? < ?``` 0 ?@````0000?  80`` ````A````~ 8 p`πp000`0ppx?  0 p0000p??p0000p ?q`pppq?00`A> ```````  ~~~~  >À0pp0c80pcp8`` 0 0 08??``` `````0000`<p``p<x  x  8p`~~`p<  pÀÀp8  333cc xx88p``p8 ````8p``p88 ``````p00 p`pp000? `0pp?```0 0 8 0 0 0``x x `x`x``00001010````p0 8 p` `0880` `008p`8p` 8p` ```000  p88p   0 ?@````>` π`00000`π  ?p@``p@? 000000?p`p00000`pp?0 ?p`00`p ?00000000000000 0?pp00000pp?00p ? π`````````` ÀÀ χpp0`0`0`0`0`0`0`0`0`0 π`````````` ?p`00000`p? π`00000`π 0?p`p00000`pp?000000   ?? 0000000000000? `````````>` `0`0`p0`0`  aac1s333336 8pp8 0`pp8 `0`0pp0`0  |x  8p`    >                                  ?r@bbr@?  @w?`00000000`?w@ 0````009  ?p``8<oÀp=C>  0#NLN#0   >C?}  0p8qq8p 0  0'F1100@`F1F1&0   8DD8  x80`  8 0` ``````````8 ~`~`````~`>````````````   00000000  >cc> q8p8q0000 008000pp`00000 00000 008000sd`0p` 8 880x`X  8p`>`` 0 0 08??````` 0 0 08??`````` 0 0 08??````` 0 0 08??``````` 0 0 08??````  ```p 0 00 ??```00000 0 ??00??p0`0`??<p``p<@@    1 `0``````````````````p`p`7cÃxp|_  `0pp? `0pp?  `0pp?  `0pp?`008p` ```` `Àǀ000pπ 8?@````>`  ?@````>`  1?@````>` .'?@````>` ?@````>` ?@````>` ?@pp```>  ?p@``p@?  ?p`00`p ? ?p`00`p ? 0?p`00`p ?  ?p`00`p ?`0 0```````````````  `````````>`  1`````````>` `````````>` `0`0pp0`0  |x π`00000`π  `0`0pp0`0  |x`` 0 0 08??``` ???@````>` ``` 0 0 08??```  1?@````>``` 0 0 08??``` ?@````>`@p<p``p<  ?p@``p@?`0<p``p<   ?p@``p@?<p``p<  ?p@``p@?`@<p``p<   ?p@``p@? x  x333200?p`p00000`pp?0??000000000000??0000?p`p00000`pp?0  ?p`00`p ? ! @?p`00`p ?  ?p`00`p ?  ?p`00`p ? 1  ?p`00`p ?`08p`~~`p<  0?pp00000pp?00p ? 8p`~~`p< 0?pp00000pp?00p ?8p`~~`p< 0?pp00000pp?00p ?8p`~~`p< 0?pp00000pp?00p ?  <f          000000??00000000 ```gxpp0`0`0`0`0`0`0`0`0`0qq~~<@p@p      3a < p`pp000?  !2 ?? 0000000000000?   3300000000000? 00000000000? @`0pp? <@N@G`````````>` `0pp? ??`````````>` @`0pp?  1`````````>`  @@Ș`0pp? !!`````````>` `` `0pp? ` `````````>` `0pp? `````````>`@@pp0xx x `x`x``00001010```` 0aac1s333336 `008p`  `0`0pp0`0  |x `008p`8p` 8p`   8p`8p` 8p`  8p` 8p` 8p`  1 8p`000000000000000003?<880 0 0 0 0 8<8?3? `0000` π`00000`π0pp000??00 0 0 0 0??0pp3?<880 0 0 0 0 8<8?38 8 <p``p<  8x?p@``p@???000000000000???`p000000p` ??000000`00000`0 ??0000?p`p00000`pp?0 ?p``00000`p`?` ? ````````````?p<@`p8  `@`??pp     ??  8p`~~`p<`p0 88 0p``` 0 0 0σÀ````````````q?`|0000000000000000<~Ã`0 >~ÀÀ0000000000000000  `~# `0`00`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0`0p?>0 a a 1 1       π```````````````<~π`00000`π ``````000 `000pxp0 ?A@? p80p x 0000000000000?? 000000000000?@0pp?bb|``````>`??0 ``p8`0 8`p`?018p``?`1p10a0`  |x8p` 8p`  8p `pp 08?pp8? 08?pp ?  `?p`` >8p``````8 p8?  ``````````   p000 `À  "x8 p`  8px`x  8xp0l0808003?p`p00080p0`pp?3>8<8 |xxx8xx8φffffffffff<8``` 0 0 08??``` 1 ?@````>`f<Bd<`8p``p8 ?p`00000`p?  `0pp? 1 `````````>`  `0pp? ??`````````>`  `0pp?  33`````````>`   `0pp? 3 ;;`````````>`   `0pp? 0 33`````````>` ?@ 000``p?```` 0 0 08??``` ?@````>``` 0 0 08??``` ?@````>`00000 0 ??00??p0`0`???@pp```>8p`~~?`p<0?pp00000pp?0?p ? `8p`~~`p< 10?pp00000pp?00p ?1pÀÀp8f<8pp88p``p8 ?p`00000`p?8p``p8 ?p`00000`p? `pp #2 ```Bd<"x8 p`  8px`x  8xp000003?p`p00080p0`pp?38p`~~`p<  0?pp00000pp?00p ?         80pÀ xx8  π``````````f,8```p 0 00 ??``` 0?@````>` 00000 0 ??00??p0`0`??8p?@pp```>8>p`7cÃxp|_  ?p0000p`p ` `` 0 0 08??``` 3 ?@````>`0`` 0 0 08??``` @?@````>` f3  ?p`00`p ? 0  ` ?p`00`p ?f3df"3<~000000000000000000<~B0000000000000 `08p``p8 3 ?p`00000`p?08p``p8  ` ?p`00000`p? f63``````p00  df3gxp````````` ? ``````p00  ?!! ; `0pp? 23`````````>` @`0pp? @`````````>` p`pp000?   ??  0000000000000? ``? ```>  ? ?   f<          p000000=pp`p00037`|p}?0p p<0p8`p??pppp  `````??`````8p` 8p`   8p````` 0 0 08??``` ?@````>`  ?p`00`p ?``8p``p8 ?p`00000`p?8p``p8 @#?p`00000`p?8p``p8 ?p`00000`p?8p``p8 ?p`00000`p?`008p` `0`0pp0`0  |x ~````goyy``  `````````go}y?``000003?p8x0 0 0 0 0 xp8?33?p8x0 0 0 0 0 xp8?300000xp0 p ??xp`8000p`pqs76<>o@  p8`0qssv<88o  00000000000000?? 1a@  ?q|?`  8p p8p  ~??08000000??00 0 0??000000000000 `` 0 0 080 0 ``` ``00 =qc00ll|?00 ?? ~~8>p``p8>0?p`p00000`pp?0008??080000000p000000 0 0 3?<80000000`p``p0000p >< π```@ 0?p`p00000`pp?0 π`00000`π >~π`00000`π  ||  ?p@`ǀx?000000?p`p00000`pp?00088000?p`p00000`pp?0 ?``000`@? ?@ 000``p? ?~3<10``?  ?||?  ~ ~ ?p8`88`p8?~~8000?pp00000pp?00p ? ?p0000000`pp?00p ? ?p `0`0p0? 8`0pp0`   8pp8  `````````>`````` >~π`````````` >~π`````````````00000000000000 x8  00000000000000000t0000000  | x8 `Àp88 p? `0`0`0`0`0`0`0`0`0p>0`0`0`0`0`0`0`0`0`0p>000000χpp0`0`0`0`0`0`0`0`0`000p          π````````````p< `````````` ?p`000`p? ?x`x? ?xx` |8p?s8c cs8?      ~>  800000000   À`p p`  ??~>  xx~~   x  000000000000000000 000000008x 9p``0000pp?  ÀÀ>  0`0`p0`0`0 63333s3c1aa  00`p``0`0 p``09 8p```p<  ;v`f`  ``` `p?p`?0  ~  ?p@p>  ~  ?p@p@?<8p``ÀÀ`p08 `` ?p0~~0p?p```?p `0`0p0? ``````````` | p08000000080p000000  8000?p`p00000`pp?000000  ~  ?p@p>??00000=pp`p80p0013`wp~?00000=pp`p80p0011`p  |`< c6&c  <0       Dl(88  ffff     x̄x    q        0 0`8(lq |x x̄x3&dl(8f"3|x8|Ƃ0 ``@````@p 0`000 p@@0000000`~>pp``@@p l(88(l|x<~q   | 0` 00`@ 0` 0`@@@ Hx0xH` p 0`q@80` /{ {0qy !@a3``` 0`@p8|Ʋ00Hx0xH   `00` f ||?a>|0                `````````````` 8xx `````````    ||  ?p@``p@?  | |```````      0` 0` 3c`` 0 0 08??```3c `3`c`````````````` 3c  3g 00  ;p1``as? 83g```  0```````````p<`` 0 0 08??``` `````0000`  `` 0 0 080 0 `` 8p` 8p` 8p``p8pÀÀp8`` 0 0 080 0 ```333cc xx8 8p``p8  ````  p80p`008p`9aa9p0 8 p` `0880` aaq98p```0 ??000000000000000000 `008p` ?asx8   ?||? π```````````````0`x8  ff``````> ?asx8 ?aÀπ````` 0008p``  ?p@`x?0`p00000`p?  ?||?  8p`p? π``````````````` ?0````000000````0? x8 ÀÀ <> `0`00`0`0 ``````````8  ``````0`0`0  <0```8pp``` ?p`00000`p? 0`0`0`0`0`0`0`0`0`0x08 ?p``00000`π  ?p@``p? ?pp00000``p?  ``````>;s8 cs8? p`8 91q`p s8? 0 ``c~~<|``````````p< ff``````> ?p`00000`p?  ``````>8p0 ``c~~<|8p8 0`@ ?q`À````p? 80`0 0000000````p?8|;3`sp>p  8|?s8c cs8? 0``````a1??> x|8 x p 8px008p``p8 ?p`00000`p? 8````8```  ?p`p>   p 8800p1w~`x``pp 800p``?<    1 10pppppqq  ;070f000`````0`0`0`0`0`0`0`0``q?<0 ``c~>|8  8 p ` ` `p<8| 0<0p0`000000`pp?0000008  <x? ;``a>0000p>pp```p?  ```` π`00000`π<p``p<;3c 8x͘Ϙ 0000p8```p8p0xpog```8 8<p`````p<8    8   11  8p``p8 p`pp000?000000000000000000       8 p 0000000000000000??8pÀ`p0  8xx@ ``p80000`` >< `` 0 0 08??``` `0000` `````0000`      0   p 8    8p?  8 0 `   `000`0000p 8xx @8xx8pÀ`p0    8 p 333cc 8p``p8  ````<p``p< ``p80000`` ><8pÀ`8p0 8 p` `0880`  00000000`000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c3333c `0000`p8 ?? 8pp8À À8p ?8`````8 80` ?@````>` ?x`߀`00000`p? ``   0 0 0 0 000080 ?p`00`p ? p`8acgn c8a0`````p  ~ `````````  1````````` Àp       8 <?r    ?p>`# 80 0~c `C`` 0 8<><<|| 0 1ppppppp||0 `000000??00 0 0 0 0?? 0000000??080008?? pp ߀``p000p`p ````    `000000000`  p 8    8 p`?8   8 p ` p`8ac gn~ a0ap```p`p000 `000`0000p><  ~8pp08 p0008pp08 ـ`8888p89;?> p 8    8p?  8 0 `  p`8acgn c8a0`````p8p000000000p À    8 00000008000>> 0 0 ````````````` ppppppppp||0 ` 0000000`0000000 ?33ccc<````` 0 0 08??``` ?@````>`00000 0 ??00??p0`0`?? ?@pp```> ! @?p`00`p ??p<@`p8 ?@ 000``p?``?p<@`p8 ?@ 000``p?33 p 8    8p?  8 0 `  p`8acgn c8a0`````p `000`0000p  33~ `pp  ``` 8xx `````````  8xx ```````````8p``p8 ?p`00000`p?<< `0`0pp0`0  |x ``p80000`` >< `0`0pp0`0  |x0` ``p80000`` >< ` `0`0pp0`0  |x 00000000`00000000 33? 0000  00000c3333c ll ?>` p080p `p80p8` x` `pp890``000p` p080p `p80p` `pp890``p 00000000`00000`0 `````````?000000000000000000000x0p `````?```>```````1? ~>?| `````````xx ~??`````          8    0 0 00008p         ````````q?<p``p< ?p0`000`0pp?x         `@`??pp   ?||?    8 p        88xx x x  8 p``00880w~|| ߁Àgn|<8<~fÀρ?|0`0000`0x?? 008000p0`?? ?px8`ppp8pp008p`8p``p88 0?p`p00000`pp?000000x x `x`x``00001010```` aac1s3333368p0p08 ǀƀ@`      8 p    |x      8       ``````````````````ppppppppp||           `px??xp`8?xp`8p|?xp`8`8p8?88p  8p ?xp`88p?x``8p8?8  |3p<` ` x? `8xx?p88<8p??xx`   ?xp`8|8p00p8` `8p8??xp`8`88p8 88p` `p8? ?xp`888p`  88p?=qa?xx` ?xp`8 `0pp?`<x|? ?p`08`x?88p8 ?xp`88pp8``p88p8 p<  >p`À`ÀÀ`Àp88000088?700008p``p8=11=ÀÀÀÀay?  0``0pp``0`  >x0  ?a@   ``````````````````>?` `````=pp`p0000`0`ppp?00000````````||````` ````>`9pp`p0000`0`ppp?000>>  ``````````8 x00000?p0`0`0000`0`pp`? ``````````π`````````````````?`  8?p``p`00000`pp`? `````````>`````` π`````````` 8880````pppp`?p`````````````|| 8a`````>`||````````````>` 0000000000000888  c8p π``````````  00000p````````````````````>?``````  ?s````p80` `p000p` `````````>```````````````>````|| o}p`````````````````>`` `````````` 0?pp00000pp?00` ?  `````o}p`````````````````>```````76p<880 0 0 88<873000 ?p`00000`p?9ÀaÀy`````````>   ||                                      ̀̀11`f00        <|         ```0`0``<`nǀ`       ``@````````  0`````````` `````````` ǀ```````        ```````` o|08880000paa   p00000pp? ````````0`0`00| ```x``````````` ``x```  `08  `00  `@    C gf~|p0pp0?? 0         ̌ ̈ 0` `0a                 X!!1 00p`` !3 00p``  00`a 00`a000 ``        @@H|l     ``     >p8   |~> `0ЀP``````````````````    ````````````````````0ЀP< 4<x< |? ``  ll |ÀÀ~ ```` ```` 8p```p< 8p```p< 8p```p<    `````?  `````?0a8aaq80p0a8aaq80p3>>??00p3>>??00p  ? y  ` `  ? y  ?0pp`??8p``x? ?0pp`??8p``x?     880pll|`;`8p? 8p ``8 8x?  |ÀÀ~  `` x< |?x< |? | 8,<`  8,<<t x̄xA`Ѐ`Ѐ 0pp   Lx0       ``p0008  ``p?0088  `f`f`?0008  >8`p8|`?  <>wc>    ```q11;  ;11q``  >q   00`a  8pp``  ?1``|`;`8p?   0p`    0`` ````````` ` ```````` ````````````  8p```p< 8p```p< 8p``@@`p< 8paa`p< 8p```p< 8pc@c@`p< 8pc@c@@@`p< .2~ 62   .2~  66 66 66 66 6666   p`````?  0`````? `````?p `````? `````? `````?  `````?  `````?  `````?0a8aaq80p0a8aaq83`s`0a8aaq83`s`3>>??00s``3>>??00p 0 0 X X  ? y   ?0pp`??8p``x? 880p880p880p``880p880p````880p00|`;`8p?00ll|`;`8p? xp`p8>x  < `z`s`ap8>`< qxp`p8>`< q`z`s`ap8>XX`< qxp`p8>`< qxp`p8>`< qxp`p8>00XX`< qxp`p8>b&<8p 8p $$8p 8p  8x?  8x?  8x? 8x?   8x?  ǘ 8pc@c@`p<         ``  0``  ``    `` x< |? Fd<x< |? x< |?      |ÀÀ~                            ``p0008  ``p?0088  `f`f`?0008  n@|~@?7088  ;1a```n;  ?0pp0?80```  ```q11;  ;11q``  >q                                                                                                                                                                                                       ?p````00000000````p?       @ À p00p  ?q```q? ff<<< 90p``p0 ```````` `````` p00p <?    `p0 8xؘ ?aa                   `````````8000000```     ?``?   ```000000p`` ~~?``00`0y?    p00p ?``00`0y?    8(m8(l  Em8 0` ``                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ```ppp`                                                                  {8|   |x ?xxp8  088|   |s~| p0ǰ 00000 ?0q/>pxx?    < ` | 8       ?p000000000p0 q߰000000000p0 s8x qs3c<  8 | l | <  p0000p0 0`0000? 00000p0000p0 0`0000?xo~<  p nj| x x s c nj| x x s c nj|             < ` | 8 x88  ?x<~ۘq  ?p0000p000p  >|y1?}8q0q`q`q`q`q`q}?  ?`?`p``?? xppxd`s?8p p000?p000? p `00?  >q ppp0000000000 p0`0<p0`8< ?`0ǘǘ`8<?`0ǘǘ`8<0Ɔ|  ?8800<~ <~c18@`pppppp|ppp``    xx yx  xnw3`  ?``s&    ```p00??   000000x000000pp  00pp f0<~ pp   p``pppp`? ?pp0~r>80p <p``0x??8   <pa0`? <g>8pa0`?s?x8  p088888888888888880000004<0pt   ÌÌÌÌÌÌόx  1?}8q0q`q`q`q`q`s}?1=}8q0q`q`q`q``}}?x                                                                                                                                                                                                                                                                                                                                                                                                                                                                  0p````p088000p0`00000`0p08000000??a``0p``p0 ?p`p0000`0p0 0000000000`           8 0 p `` 0 0 0 0` 0` 0p 0 8    `00000`0`0p080000x~??000080`p0``0``0`0`0`0``0``0`pp`?`` ?```pppppppp80````08               8808p8`8`8`8`8`8p8888888888000000??0` 0`p0``0`0`0`0`0``0`p``? ``ppp```? ``pp``80p``p088p``p8 ?```ppppppppppppppp 000000000`0p?00000000 00000000`0`080000`0pp? ``ppppppppp80p````p0800000080p0`0`0000`0`0pp? `pp` ?p```p`pp8<p88`0p0? ppppppp``` 00```p 0880p~ À p8`` ` `p8? 000000000008000000000 00000000`0``p|??q>             aas?  03a`as? ;1!?p``p000p``p?>>aÀ၀`À`0~8? p8  ?a````a  ?a````a?  >wcCcc>1p``````````09 aaas?  a`aa1  `a >>a``p0  as?  ?xp xpa? ` ~>aCÀ``p8  w~30c8c ``008`  ~ ` ` ` ` `````p`p`````p`8?aas?  p  >`````a >>aÀ``0 8008  80`````?a  π?`as?  |À qaa`````000````0?  ?``as?  yÀÀ~  ?s```q?  Àw>  c @8|@  s?  À``q?  aaa3?s@  ```a  8x`a  ?`?pq?a``8  ?aa8p```````?  Àa {```p00p```9 0  ?a`p81   xȈXp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ``0 0 8 0 0 0``    `` 0 0 080 0 ```` 0 0 080 0 ```` 0 0 080 0 ``π>>ππ>>πffπ>>π π>>π>>>>>>>>??   ``0 0 8 0 0 0``   ??`` 0 0 080 0 ````   ??`` 0 0 080 0 ``|pp|π>pp>pπ|pp|π>pp>pππ>>π `<`````````<`` >>888>> `<`````````<`` >>888>>00>>>>   62#aA  80` @`p0  x x܌   x܌x 332ffD    0000 00000 `0`80 0 8 0 0 0``a` 0` 0p 0080 0 `` σ>`>π`>`0 >>>```0 0 8 0 0 0``    `` 0 0 080 0 ````` 0 0 080 0 ````` 0 0 080 0 ```>>>>x >>>>x33>>>>x >>>>x>>><>>><00   ```0 0 8 0 0 0``   00`` 0 0 080 0 `````   00`` 0 0 080 0 ```>>>>88>8>x>> >>88>8>x << >>888>< << >>888><00>>><  <<   `0pp?  @@?pp`0 ?pp`0 ?pp`0x  xx  x x  x x  x<p``p<<p``p<`0pp??pp`000?pp`0````x ``` x00````x ``` x? ?<p`````p< ? ?<p`````p<  ```0pp??pp`0``x`` `````` x00<0p0`000000`p< pp000pp?0000000 ?pp000p߀ ?pp000p߀ ?pp000p߀ 0000000?pp000pp ``0000000?pp000pp 0000000?pp000pp ߀p000pp? ``߀p000pp?pp000pp?0000000  ?pp000p߃00  ?pp000p߃0000000?ps000pp``0000000?ps000pp  ߀s000pp?  ``߀s000pp?  < ~Ɔ|ps333sp?0000000?ps333s߀3333333?pp000pp߃p000pp? ?pp00000000000000 ?pp00 ?pp00 ?pp00 00000000000000pp? ``00000000000000pp? 00000000000000pp? 00pp? ``00pp??pp00003330000000 ?pp0000 ?pp0000000000333000pp?``00000000333000pp? 00pp? ``00pp?  <  | ````````````````      ```````````````` `````````````````` ````````````````   `` ??``````ccc```````00 ??````````ccc````` ??``````````ccc```````    `p    À~`000pp `000pppp0000p? ~ÀÀ ~ÀÀ33~ÀÀ ?pp000pp?pp000pp 8 0 0 8 <  À~  ?pq000pp00?pq000pp?pp000pp 8  ~  `` `  @@ `p< `p<`p<  33 <p`<p`  8   ` p<00` p< 8   8     < p `00< p ` 0 >~ `p<```````` pp```` ```` `````` ````````<p` ``````````<p` ````````<p` ```` ```````p<g```````x````x``````````````<p```````````<p`x````x`````` 8      x<  ~        <ÀÀÀxÀÀ~00xÀÀ~ >```p`pp``0x``>```p`pp``0x xp80``p`p``?``xp80``p`p``?p 0 0 000000000`8`8<ÀÀÀ8`8`0`0000000 0 0 0xÀÀ~8`8`0`0000000 0 0 000xÀÀ~  ~ >c``p`pp``0x ~``>c``p`pp``0x |ぇ  xp80c`p`p``?|ぇ ``xp80c`p`p``?  000`  8p```````` 8DBBD80  0  0  ````````p8  00````````p8 ````````p8   0 `` 080` 8pc```````p0 0 p0 0 `08````````p8 `0800````````p8  0p 0 0p`` 0 0`  0`  0000  bf<>?x 00`0``p`00  00p````000x  00p````000x  00p````000x xx<xxxx<xx<~x<<<<~x<<<>``< <~x<888<<  <p 8|`8p8? `8p8? ?xp`8| ?xp`8 ?xp`8| ?xp`8<|0 x<|0 x08cpvp>```p8<08cpvp>```p8< p0p?08cpvp>``````p8<  ĀÀ`?         q`pppp?sswv||x>Àcc3;>Àcc3;xx|~vssq?pppppp?``xx|~vssq?pppppp?;3sÀ;3sÀ 00P   bf<<8~ÀCc3;8<>63310000000pp?;3cCÀ~!!8?``8?`` 8?``800000000000000pp?``800000000000000pp?8``?8``? 8 8~cCcx         8`p<8`p<````p ````p <p`8<p`8 0 @ 80`ppppp`0`0ppppppp0 00ppppppp0 8p`8p` ??  ߀p000p߀                                              x  x  <p``p<                                                                                                       0` 0p                                       c64"C~8pp8`~``p88x8```````````````$'8~?cpCpc00x$'8~?cpCpc00x!8~cCcx``p88p!008~cCcx``p88p$'8~cCcx00pp?$'``8~cCcx00pp?            000000000 111111111 111111111! !101010101010101010  000000000 111111111 111111111! !101010101010101010   8800p ``891800pp`1q cc891811qsc1q cc889810!!811qsc81pqp c`c`889911  0000000000 1111111111 1111111111! !10101010101010101010  09999088880 ~~8ǜ<}811??11??11??11??  @`0  0`@ @@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    00`p00  8??p` yx|880`0`8px? ```````pp`p  ?p@``p@? ````` ??0p08000080p??   ǀ??  ÀÀ 0000>8p000?? <` `````0000` π`00000`π `````0000` π`00000`π `````0000` π`00000`π`<p``p<@@   ?p@``p@?x  x 000000000?p`p00000`pp?0x  x 000000?p`p00000`pp?0x  x 000000?p`p00000`pp?0x  x>< 000000?p`p00000`pp?0><x  x  000000?p`p00000`pp?0    ?p`00`p ?  ?p`00`p ?  1 ?p`00`p ?  @&@# ?p`00`p ?   ! ?p`00`p ?   000000000000008p`~~`p< 0?pp00000pp?00p ?  π``````````  π``````````   000003?<8800000000000000000??00000000 000003?<880000000008 @ π`````````` !?000000000000000000qq]0 `````````````````` 00000000000000pÀÀp8 0`ÀÀpÀÀp8 ÀÀpÀÀp8 ÀÀ??    ````````````````00000000000000000088  000000000000000000  1`33 `0pp?   `````````>`@.# `0pp?  `````````>` 2#  `0pp?  <@N@G`````````>`  `0pp? `````````>`p```0 0 8 0 0 0`` @@#`0`0`p0`0` ```0 0 8 0 0 0`` `0`0`p0`0` `0x x `x`x``00001010````aac1s3333360`x x `x`x``00001010````0`aac1s333336x x `x`x``00001010````00aac1s33333600x x `x`x``00001010````aac1s333336x x `x`x``00001010````00aac1s333336p0 8 p` `0880`  8pp8 0`pp8 p0 8 p` `0880`  8pp8 0`pp8`008p` `0`0pp0`0  |x 8p` 8p`  2#8p`8p` 8p`  8p`8p` 8p`  8p`?? π``````````?? ff0000000000000?  aac1s333336 `0`0pp0`0  |x?@````>` 00000000000000 xx8X?0000000000000?xp`xÀ ?p@`x?0`p00000`p?`` 0 0 08??``` ?@````>` @@`` 0 0 08??``` ?@````>` ``` 0 0 08??``` 0`@1?@````>``0``` 0 0 08??``` `1?@````>`x``` 0 0 08??``` `@1?@````>```` 0 0 08??``` @#1?@````>```` 0 0 08??```  1?@````>` ` `` 0 0 08??``` !?@````>` `` 0 0 08??```  !?@````>`@@ `` 0 0 08??```  ?@````>` `` 0 0 08??``` @#!?@````>` ``` 0 0 08??```  1?@````>`  ?p`00`p ?  ?p`00`p ? @#  `?p`00`p ? 00` 0` ?p`00`p ? `1 ` ?p`00`p ? `@1 0 ?p`00`p ? @#1   ?p`00`p ? 1  ?p`00`p ?x 000000000000000000 00000000000008p``p8 ?p`00000`p?@@8p``p8 ?p`00000`p? `8p``p8 0` ?p`00000`p?`0`8p``p8 ` ?p`00000`p?<D`8p``p8  @ ?p`00000`p? `8p``p8 @# ?p`00000`p?`8p``p8 ?p`00000`p?@@8<@p``p 8<?p`p00000`pp?@@8<@p``p 8< ?p`p00000`pp?@@@@8<@p``p 8<?p`p00000`pp? @@8<@p``p 8<@@#?p`p00000`pp?@@8<@p``p 8<?p`p00000`pp? `0pp? `````````>` `0pp? " `````````>`@0pp? bb|``````>` @0pp?0 bb|``````>`@0pp?" bb|``````>` @0pp?<.'bb|``````>`@0pp?bb|``````>` `008p` 0 `0`0pp0`0  |x`008p` `0`0pp0`0  |x`008p` `0`0pp0`0  |x `008p` @@#`0`0pp0`0  |x  1111111111111111     ?asx8 ?asx8  `?asx8 ;90`?asx8 ?asx8 ` ?asx8 @3?asx8 <@#?asx88; 7`` 0 0 08??```8;#3`` 0 0 08??```#!63cca`000CA063cca`000p,8  0pFxLx   q``p00    ?0p``q    000  ?||?  ?||?  vs`?||?  vsa 0?||?  89 0?||?  89#3?||?  _Xx?#?!00000??000000???C?A000000??000000??,8FL` ```````````   π``````````````` π``````````````` ?; π``````````````` vsa`0π``````````````` 99 0π``````````````` 8933π``````````````` @#π``````````````` <'π```````````````XXx0#0!00000??000000000C0A000000??00000000` ,` 8` ` ` ` ` ` ` ` ` ` ` ` ` ` ` F` L` ` ` ` ` ` ` ` ` ` ` ` ` ` q````````````````q000 0000000000000 x8`x8 #! `00000000000 ,800000000000 `00000000000qq  XX x 0#0!000000000000000 0C0A0000000000000000 `,`8```````````````` `F`L` ```````````````  q   q  ?p`00000`p? ?p`00000`p? ;9`0?p`00000`p? ;9 0`?p`00000`p? ?p`00000`p? ` ?p`00000`p?  O\p````p0x8000``0008#!0p````p0CA08p``````p0?,9À`p0000p`?FL!p88p?    ``````>  ``````> #!``````> A```````> 9;0``````> qsGf0``````> xO ``````> y ``````> g p````````` 0C8 A0 0p` 0FL 80p q80` `09 `0 ``c~~<|`0 ``c~~<|`0 0 ``c~~<|`0 0 ``c~~<|0 ``c~~<|0`0 ``c~~<|p `0 ``c~~<|p`0 ``c~~<|O\0```````00 ~~|0000000 ??#!80```````00 ~~CA080```````00 ~~?,9p880`FLp!8     0``q? `0000``q 080``  ?asx8 ?asx8  8 ?||?   ?||?  π``````````````` π````````````````00`x8  ?p`00000`p? ?p`00000`p? `0 ``````>  ``````>0 ``c~~<|8p0 ``c~~<|   ?asx8 ?asx8  `?asx8 ;90`?asx8 ?asx8 ` ?asx8 @3?asx8 <@#?asx88; 7`` 0 0 08??```8;#3`` 0 0 08??```#!63cca`000 CA063cca`000 p,8  0```0pFxLx   0008q``p00    ?0p``q    000@@@` π``````````````````` π``````````````````` ?; π``````````````````` vsa`0π``````````````````` 99 0π``````````````````` 8933π``````````````````` @#π``````````````````` <'π```````````````````XX```px```p0#0!00000??000000000C0A000000??00000000` ,` 8` ` ` ` ` ` ` ` ` ` ` ` ` ` ` F` L` ` ` ` ` ` ` ` ` ` ` ` ` ` q```````````````` q000 0000000000000 `0 ``c~~<|`0 ``c~~<|`0 0 ``c~~<|`0 0 ``c~~<|0 ``c~~<|0`0 ``c~~<|p `0 ``c~~<|p`0 ``c~~<|O\0```````00 ~~|0000000 ??```p#!80```````00 ~~CA080```````00 ~~?,9p880`FLp!8     0``q? `0000`` q 080`` 0?asx8 ?asx8  ?asx8 ?asx8 ?asx8  @@#?asx8 @@#?asx8 `` 0 0 08??````` 0 0 08??```q9 `008   ?00`` 3c`` 0 0 08??````` 0 0 08??``` `  ` q qff  π``````````````````` π``````````````````` π```````````````````  @.#π``````````````` @.#π```````````````````s;3cs`;``````````````` `3`c``````````````   #a xp q B~<00000000000`0ff00000000000 0```````````p<  00000000000ff00000000000|000000000000000000`````````````````` s; 3c   `  ` q B~<``````> ``````> `0 ff``````>  ff``````> ?p``00000`π ?p``00000`π y]``````> yff``````>@`008p``008p`s`9 c7> ;p1``as? x     0 ff 0` 0  0 ``c~~<|0 ``c~~<|8p0 ``c~~<| p0 ``c~~<|p0 ``c~~<|p?8 `000000`? 3g 00 p?8 `0000``83g``` 8p```0 ?? 0` `         ````````````  ff ffff ffff gc#   8||8  <f 80fcØp000p>  Ì          8p    l, `uu``` 0xx  `uu``uu` ffl 8000`cc? x &@v??vf` ;63f&LdH 00 00000          0     0  >>?;;8888x8x88l<008    ` ```pswf`73100p0800À`>`~`?y700pp` pp0pps08880 |c`p`0```````` ?8scc88cs;` `p000pp `< 888 >r bbr ?   ~`p =N|  8 x   ??88888888888888                   0`      `@     ppcc     a@!                              ~gÎ8Ì3sc|~gÎxÌ1p`><<lLLLLl,< 8D80D`8```````08~@vFf??s ;?w g ?s 9?qa `@`??pp p8 ?? 8p8D```D`8`````````` 9|a@AA` > 2|$8 837p8808p0`0`0`0`0`p``` <;7p88008p8`0`0`0`0`p``  s?C  ~` `  |  664<8800ps1111111111111111قȂBB"2FF>88<<66331>1c0c0c0fc06>060 #c9C CCc3|16<< lMxXLDDDLXπx<lLLLLl,<8aA0 ~?GC 3~C@G>hdddddhȈLd&2ppppps?>;sppp``p08`@q  ``@`@`@``@`@`@`@`!!z!2!2!!``q19 ;8 00p`3!``fD0 ` 3"F 8?8??`pp``8p```0 ????0 ``p8?00 @88x0` pÀÀp8`  ```p 0 00 ??```#C8< p8gx?@00ppppp0 80p0`0`p@`? 0`00008` 0``?| o````````````@~ <n6pp00b0b0d0$04080808002>  >aaC>@p8 !``pp8x<<x@??  ???~  8||8<<<<<<<<<<8p`p< `@paP3 3a I$$ $ $ $ $ $ $ $ ' 1łDLl(8c1 @ 0c0` @1cx  8?  ````````````````  ```````````````` p8008p 2""& $ dDD L Hx r$6l4H$$$,hHq>x 04lHp ? <$$,,hHHHXА @@ 4 w>>7caa`|8     ?? 0000 008000wg ``@ 0000 008000qf`0000 !0000 008000sp`      0000 008000w``0``00` x 80`;00`0000000 008000wf00 x 80`;3c8 ;3c6&F ;3c0000 008000pc00 ~@@@| 8p1c0000 008000qgp0 8 83b~@@@| 83b  803b0000 008000p`  ``````````````````p``fl|<8```0 0 8 0 0 0`````````0 `0 `8``` 0` 0` 0`````````c`c`c`c0 c0 c8ccc 0c 0c 0c`c`ccccc c`c`c`c0 c0 c8ccc 0c 0c 0c`c`ccccc`w6<>vÀÀ`p0 8 p` `0880` p0 8 p` `0880` p0 8 p` `0880`   <p``p<x  x333cc ````````````````Æxp `0`0`p0`0` `3`3`s0c0c 0000`30`30`s00c00c0000 0 0003333`33`33`s30c30c3333 3 333ÆxpxÇ 8pp8 0`pp8;ps8 0cps;000;0ps0800 0000000c0ps0;0  ?p@``p@? 000000?p`p00000`pp?0 χpp0`0`0`0`0`0`0`0`0`0??8pp`````````p8<<  x??8ppa8`` ` ``a`ap8<8 8  ||8p````p0<   <f B;|00`000       8pp8  ?L    L?  8pp8  ?L L?  `0 <|8p` @`0  l< 8pÀ   0`p0`    8p@`ǀcA0<00  p1c1 p  ? ?L  q  m?L?   0`0   ` p88p` `  0`0  ?    L?  ? L?   0`0  p`    0`0  |n    0qo=0    |f0c`1  000p0co`|`x``  8pp`8`` `````````  ``````````8`p`p8 À  ;p  0`0    o?  8x` L@}?`088 xp|`l`ff``p 8>6ff``p08pp8  <|   L|< 8pp8   ?}l ̀  >  8pp88pp88pp8>?wf̀                        F w?>8pp8   ?`0`0?   ,f?``?      ?``?  ?s333333333333   333333333333ss?   ?``?  ?s333333ss? ` 0 `0f6 `1cF  a0` 60`0`  0``0      0yfg0   @g9  ?      L?   099`0  ?   ??  L?   0  0  /@@@@@/  0``    p0 0`` 0``p@ @  ?``p@ @  6f`vF F  0f` @p 0f` @pp@ @  @πp8@ @p@8@@@@@@@v@>@@@@@@ 0``p0  a   >  ̀ l}?    0 0000`0000 00     0`0   0`0     ,&1#a!1#& ,  (HH( @ (H@H(``p0?? 8 00p`` 8p``p``p`pp?   >cag> ppppppppppp pppppp p pppp0p`8``3!Ahp8><G`` 0 0800 p``p0 88 0 0p`0````08 800`0````aa3; ||00| ``00 ` p8<xp 8000``````0008 C60`` ` ` ` ` ` ` ` ` ` ` 0` 0` 0` 0`Ͷ`yx  ?mLLlm? xx?lLLll? 0 0 0 0Ͱyx>6 ```?llLdLfldll? 0` 0` 0` 0`Ͷ`yx   ?-LM xx  ?mLMlm? xx  ?mLMlm? xx 000 000  000000   ~~~~<~p< 8<ff  p `000000p``````0  >ރ 0`80 < < 0`>@?އ  ~ ~~  ?? `~>>~` `~> ``````@@@ @@  ?xx@ @`` @ @@)ZXЌ[P .30!!!!8p80   0p0>>?~~?@?~~?@ 0x>|p|>x0 `x|>p8|>x` 88 80~?><` pf~?> <8`0~?p>?|`p~?|`>0``n~?q?~f0``p`~`?}a>xxx>xx?xxx>x>xx?x<x>x<6>|xx  `y>x``` ?p``p? 0000?p``aq?``` ?p``8  <0?p```a; 0` < 0?p``8  ```````````p? ````````````p? ````````````p?  x9aaaa9x8 ````8 x8 dn6csl6`8 x8 ``6cl`8 x8 ````8 x8 `cc333cc`8 x8 aaݻݻaa8 x8 ````8 x8 ````8  3cs;   00 `@00 `  `@̀̀ 0 `̀̀x 88 xx??x~>>~ ~|>||>>8p|Gf|8p8p~~|8p  `0p00p0`8``   8`0`0p00p0 p0000p0`8``  @@ <l   0 `    800p```p````p08    8pp8 ;qp`1 >6"Cc00`  `00cC@8<@@@<<@@@8<<8@@8<8@@@8p<8@@<`0 80 0```` 000 `8pccp88fff8<<0 cgfc333333333333333333sgcp8 ?v`f`000000000  ?? `~``| "0 x<>|>p8|>>x<0  "`0x<|>|p8||>x<`0?~?~>>~??~>8?<p<|~<02f~?x x00``00``x?~>x``0`` 80`` 8~?>x?x=x>x2>~>?~ `||0```86>|} 0000p``|π 000 ?0````08 |0000|0````080````08 ||0````080```08 ``00 ` ``00 ` =``0p`y߀ >p0 1``000000  ?s @s?  ?s  ?s @`000``p00`      ??  ??  0@ @ @ @ @ @ @ @0      |~8       .f`` lx0  <~À``p8  "3aÁp8|8<n 0`q3cÁ|8<ns #Z[k{{{-i{o{Žĥ%;?K?k   ";sÃ8gp>`<0~ Ãs88 `9  8c88`                                                                       x8 ?p``00000`π 0 ``c~~<|     ?asx8           8 80`             @0``0@@`0 0`@         800p`````  `````p008  ``000    800``      ?`>p?`|?p                               @@@@ @@/@@@@@@/ ?                   88 cq  888`   `@   q                                                         <8    00000                                                             G@@@@GG0  Gx@0@p@@GG0  C8@@@ @ GG0  @`@`@`@`@`@`@a0  C@@8@@GG0  A@@8@@GA0  GG8@0@p@`@`@@A! C8@@@@GC0  C0@@8@@0GG0  ^6"#@c@c@#@"6_@0                                                                                                                                                        xx xxxx ݘݘ ݘݘݘݘ               ````````````` ``````````````  ```````````` `````````````                               ?` ` 80`` 00````08 ``00 ``08  80````0 0  0 0```````````````````````````````     ppppppppppsss99sss999sss999ss999sss999??????????      ````````````````@@@``````````@@`?``````````````````````````2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2`2``c`1،`F`#``b`1```c``ь`1c```1c```1c````99````````    ``````    ?  `@@??@0 0 `@ ??  0@ @` p8 `  x??@@  @ ?? @ `` @0 @??@@@@`@@@@`@0@ @@@0@ @@@ p?0 p`0 0 ?? >@@@p@<@@@@??@0 0``0  @0 3go7 @1gO@O@```@O@g#0   0 @``@ 0@0@ `` @0 0`@@@@```@@@` 00```@0 9iI@I@```@I@i)90`A@C@` ` `@C@` 0???@@```@@??~0`@@@` 00`@@@@``???`@@@` 0~0`@@`@@@` 0~0`@@??  ???  >>` `a ` ?  `a  8 `@   x @`0 0`@@@@`` `@@@` 0@????@xL0````````````````````````````````?@`@`@`@`@`@`@`@`@`@`@`@`@`@`@`@`@0 0 `@@??@ppxx| |~~0 `@0 0``@@@` 0 8p@`@`@`@`@`@`@``````````````````@`@`@`@`@`@`@`@````````@`@`@`@`@`@`@`@`@`@`@`@`@`@`@`````````NC0A`@@@@@@@@```@@@` 00`@@@@``@`@@@@@`@ @0AG\0`@@@@`@`@@@@@`@ @0AG\NC0A`@@@@@@@@``@@@` 0 8p0@@ @@@@@`@0@@ @@@@`0   @@@ @@0@`@@@@@@ @@0@0   ?@??@@@@@@@@H `  jAHH@@@@8Hx @@ ?@0  h  8p`0 8p`0 x @@@@@  8p`````p<f C``C`~<<f C``C `~<p````p880`?pp`0`8`0`08x    ;`@````@p?|^?>~~8C@A@@x?p ]s]> `@8p0   Ac&46bC@ 00@ @?@@@@@@@  @@? 0 0`@@@@@@?1~||0 怏?  |  @@@@@@@@@@  |`   @@@@k@@@@@@`  iJ\c g,s , 8px < |~?߀@@AC#  ?w@E dh?&0 @    <b02`:r`0  <xx px<(hŀŀĀĀH̀L̀& /RPX8XXϘ8xg0 @ ?8A0p 8p`à°ęhp08 @\@?????????????????????????>8<&cq7b1g.<<780``0CÏf0d00`80``0CÏg0c00`??|qpxy|?0 0 @|2 @@@@ @@@  @$$HHH$  ``a??````q???p0`p8=8p8`8pp?x`08pp?  ?aL ```````o}p`p``````````1111?1111``q11 | `  A``@```````0               ?~~~~@ >F0B ~  6gm91111 1 1 1 1 1`1`1@111v8    <m,y11!!!!!!!!!!!@!`@8 p08p`@Àc66@OYpppyO `w ?g= ``00 `@@`0`00`<3w@@@`?)5&V6n>*<<@@ ? ?@@   ;; ;0 @@vNA@@@ x   ??@@@00@ <3w^݀^^n?87I$M--=<<`??????????@ ;; ;??2>?o_/???????zx>A`@@   @ @ @@@ @?}~9@@ @JX2 >?? ???@   >|EB9< " $ $@$@@ @!(x 4x `  4x 84|x4x ‚ 興 EG^|DDCN|@@@@c c c  D$xo?1A!BB<p0  ``p?p0  r6`3`cq?p0  r6a`spq?p0 `ccfcwa`?p0  c`3p11?p0  gf#r1a?p0  &`c`Cp?p0 ``p?x~<<pxpo ??~>< 8ppǀ߀pp08'Gx0@$>O}O9 "8 @~s`! p 00ÀpÀ<@ 0 `ld<8886L  tD?@$< @`b " "@!@A@A @ >>80`>@@@@```` 0 0 0Cq9?< x111x |>>|@@@@tNrFb)49H4Œ2tL@=p5x5x5p @|?><~` @`xhldBBA ```@@` `<? 0@?pap0000pp=       x`0>vÛ9vp?|?9?xa`p0000a`x??p0`p8=xld`?p``` ```;0 >|?xmO>0w 00  p 6???0``@ 0@0````? ;`ll`mp̀? ?q```q? ??<~~< ?͘͘? <~߀v߀>π~ p00 0w> ??3;;saq3??p0`p8= @```p``  8pp88pp8`30;p;p30>@ 8~| 8pp8         8`@@>@@`0@@@@@>@@` 8c@@>@@g0G@@@@>@@g                              `# 8p8ǜ`8pp?                               qpp8 p|>|   P0!  0`Ca=}0 p <0c`A@@@@@GN-  <0aA @@@@@_>@  @``@  ဃ񀘙  CSS--5iճٱIE!!?8p '6?:> q@<f@ H$H, t~` >t ,6Hl @f<G@@@? pL` <xxx@p88p8pp8@8|>??|>88p=8x``x>x|<>??}@ @@@@@???   y  ?@@@@@`l2(8 (hD"@pÀxǀpÀ8ǀ||ǀxǀ<0 x0   0>@ 0<>???~@xxǀ1 <   0>C'7 <@   ( $   ?0 < @``/C Hh 4  ``p?  Cs?ca>| 0 8~>A0   @nt L \>a A91A@ ?D???g2Mw?g }c}`@c#?s@`"d_?s?~xx??0>gG00 "+-m@@@{'-m+>>/=bs @ s;q'?<"߻ѝ?ͽ_sN``9}Go=yً 9w?y 31q1}os0 y8À0X 1 1y 8 88<a<  @@@``` ```@   ```````````````???```````````````````````````````?````````````````   =~?~=   `` 00 `  !cc  11!a  ``~?~``````~`?```<`|`|@p`3 ?  ????? 0 >? >?~<?#C#A~@@X  @a7Saa <xxx8< <<|xxxxxx|<<xx<<>><|||>> |~>?>| ?>~|~~?? ~~???>~|0`p8@`08p@  ~?x?x????????xx??xyǀxx??||ǀ||????||?xx??|x߀px?aaɀ݀݀ɀ`? #@b``@` `0`````@` @` ``3 #@` `@ 0 0`@ A #`3 #@` `@ 0 @ @ " `3A 8 8@`X`@ 0G @ `0 #@c`C 0 @ @ "`3A !@c`C 0 F C # `1 #@` `@ 0000`@` @ `0 #@c `B 0  F F # `1 !@c `C 0@ @ "`3A '@a3`A! !aaaa!A!A1 !3`7<}?<<?~<<<=<ǀ?'ggx??<||=<>||y|<><????<|}yy<>>|| =<0|`|`p00000|`|`<`0  x<<x    `x<x    x<x` 8<<8      p.8>p p>8.p`x>??>x`      px\\xp phddhp@@@ `@|p``x~@ ` @@@ <x|> @ @  @  @  @ ?x88x?m?m s9@$<???<<d9s ?$ <?<4d? <p0< | |  ? HL$$LH       |l 00p````p> |fd` 000                             0 @``@ @ `` @          000``````000 ```000000```  333ffffff333  fff333333fff    8<>;7s33S33333333333333333S33s3;7><8xǀF?` ǀ88xpL@}? `p ?c a```À`` ac "8pp8 "88 "88pp88 " ?``? "8 " 8?``?  " 0`0  "8 " ?``?  "8 "8;gw@.                                                                                                                                                                                                                                                           ?``?     ;ps8>~߀߀@8<@@@??@@@??@@@<<@@@8??8@@                       ????              `````````````30303030303030303030303030    8pp8` x x x x x `p88px080pp08`000 0 0 0 0 0`0p0880p1x8ptf x p Æ ft8px          p>60`` ` ` ` ` ` ` ` a a a 0a 0a 0a 0aͶmyπx    xx    xx   @ < xx  ?mLLll> xx   ML-? xx    xx    xx  00 xx  ?aNNna? xx   LLLLLL xx 3cc 3 3   -??m xx  ?mllllll xx   llllll=? xx   xx   xx                  @p88p8pp8@                                                          ~ 000~                 ???~|~???~|~???```~|~???~|~>>>~?>>> > >?>?>>><`~?><`~>??>>?>~~~~~~?~~~~~~?>?>>?~~~~~~?>?>>?>>>>?~>~>>~?~~~>>~              `~>x?xx>xx?xx>x|xx?>x|xFbx?>x@`<?x~ރ~>|~ރ~<?x >|                                                              ~??~>~?       6b0af<`0 h0<fa0b 6 0x 0`  /@@/   ??  ? ??~<x0<~?0x  ??  ??  L?  ?oL  L?  ?L````````````````?````````````````??@px |~0``0 ~|x@?`0  @0 0`?@````````    p????p 8`0@@0`0 0`@@88 `88`?????????                                              000|``x 0                                                                                                                                                                                                                                                                             8888888888888??000000000000000  8888888z88888????8888888??8888888 ``````p00`~ {`?~pdpppp{p  3366<<888000xo ````````xx8p< ÀÀ00080p8p`  8p8>p``p8>33ccc>8``p0?? 8 00p``8   >?`s`ap000px`x`X`8p000001p9``` aacc s3332766 ?030gpn`|   ;s8ccs8?  |~ =pp`0000xx?    @@`a!3 `pppp080p8pp|                                                                                                                                 17px0p0`p````x 80808000000ppq~08`8p0? q~x``````````p00p `;p00p0`0`0`0`pp`c 1wpxp`p`p````````````paoxxp```````````````~ x 8808009? 07<<8p00`00`00`p0`pp`pp`````x`` cn`` pppp00017px0p0`0`0`p`p``````pp000 qwwxx8`p0`p0``0``0``0`p`p`x` 01?p8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????xrdp-0.10.1/xrdp/xrdp_mm.c000644 001751 000000 00000451412 14652432047 015433 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * module manager */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "log.h" #include "string_calls.h" #include "guid.h" #include "ms-rdpedisp.h" #include "ms-rdpbcgr.h" #include "scp.h" #include #include "xrdp_encoder.h" #include "xrdp_sockets.h" #include "xrdp_egfx.h" #include "libxrdp.h" #include "xrdp_channel.h" #include /* Forward declarations */ static int xrdp_mm_chansrv_connect(struct xrdp_mm *self, const char *port); static void xrdp_mm_connect_sm(struct xrdp_mm *self); /*****************************************************************************/ struct xrdp_mm * xrdp_mm_create(struct xrdp_wm *owner) { struct xrdp_mm *self; self = (struct xrdp_mm *)g_malloc(sizeof(struct xrdp_mm), 1); self->wm = owner; self->login_names = list_create(); self->login_names->auto_free = 1; self->login_values = list_create(); self->login_values->auto_free = 1; self->uid = -1; /* Never good to default UIDs to 0 */ LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_mm_create: bpp %d mcs_connection_type %d " "jpeg_codec_id %d v3_codec_id %d rfx_codec_id %d " "h264_codec_id %d", self->wm->client_info->bpp, self->wm->client_info->mcs_connection_type, self->wm->client_info->jpeg_codec_id, self->wm->client_info->v3_codec_id, self->wm->client_info->rfx_codec_id, self->wm->client_info->h264_codec_id); if ((self->wm->client_info->gfx == 0) && ((self->wm->client_info->h264_codec_id != 0) || (self->wm->client_info->jpeg_codec_id != 0) || (self->wm->client_info->rfx_codec_id != 0))) { self->encoder = xrdp_encoder_create(self); } return self; } /*****************************************************************************/ /* called from main thread */ static long xrdp_mm_sync_unload(long param1, long param2) { return g_free_library(param1); } /*****************************************************************************/ /* called from main thread */ static long xrdp_mm_sync_load(long param1, long param2) { long rv; char *libname; libname = (char *)param1; rv = g_load_library(libname); return rv; } /*****************************************************************************/ static void xrdp_mm_module_cleanup(struct xrdp_mm *self) { LOG(LOG_LEVEL_DEBUG, "xrdp_mm_module_cleanup"); if (self->mod != 0) { if (self->mod_exit != 0) { /* let the module cleanup */ self->mod_exit(self->mod); } } if (self->mod_handle != 0) { /* Let the main thread unload the module.*/ g_xrdp_sync(xrdp_mm_sync_unload, self->mod_handle, 0); } trans_delete(self->chan_trans); self->chan_trans = 0; self->mod_init = 0; self->mod_exit = 0; self->mod = 0; self->mod_handle = 0; if (self->wm->hide_log_window) { /* make sure autologin is off */ self->wm->session->client_info->rdp_autologin = 0; xrdp_wm_set_login_state(self->wm, WMLS_RESET); /* reset session */ } } /*****************************************************************************/ void xrdp_mm_delete(struct xrdp_mm *self) { if (self == 0) { return; } /* free any module stuff */ xrdp_mm_module_cleanup(self); /* shutdown thread */ xrdp_encoder_delete(self->encoder); trans_delete(self->sesman_trans); self->sesman_trans = 0; list_delete(self->login_names); list_delete(self->login_values); list_delete(self->resize_queue); g_free(self->resize_data); g_delete_wait_obj(self->resize_ready); xrdp_egfx_shutdown_full(self->egfx); g_free(self); } /**************************************************************************//** * Looks for a string value in the login_names/login_values array * * In the event of multiple matches, the LAST value matched is returned. * This currently allows for values to be replaced by writing a new value * to the end of the list * * Returned strings are valid until the module is destroyed. * * @param self This module * @param aname Name to lookup (case-insensitive) * * @return pointer to value, or NULL if not found. */ static const char * xrdp_mm_get_value(struct xrdp_mm *self, const char *aname) { const char *name; const char *value = NULL; unsigned int index = self->login_names->count; while (index > 0 && value == NULL) { --index; name = (const char *)list_get_item(self->login_names, index); if (name != NULL && g_strcasecmp(name, aname) == 0) { value = (const char *)list_get_item(self->login_values, index); } } return value; } /**************************************************************************//** * Looks for a numeric value in the login_names/login_values array * * Returned strings are valid until the module is destroyed. * * @param self This module * @param aname Name to lookup (case-insensitive) * @param def Default to return if value not found. * * @return value from name, or the specified default. */ static int xrdp_mm_get_value_int(struct xrdp_mm *self, const char *aname, int def) { const char *value = xrdp_mm_get_value(self, aname); return (value == NULL) ? def : g_atoi(value); } /*****************************************************************************/ /* Send gateway login information to sesman */ static int xrdp_mm_send_sys_login_request(struct xrdp_mm *self, const char *username, const char *password) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_DEBUG, "sending login info to session manager, please wait..."); return scp_send_sys_login_request( self->sesman_trans, username, password, self->wm->client_info->client_ip); } /*****************************************************************************/ /* Send a create session request to sesman */ static int xrdp_mm_create_session(struct xrdp_mm *self) { int rv = 0; int xserverbpp; enum scp_session_type type; /* Map the session code to an SCP session type */ switch (self->code) { case XVNC_SESSION_CODE: type = SCP_SESSION_TYPE_XVNC; break; case XORG_SESSION_CODE: type = SCP_SESSION_TYPE_XORG; break; default: xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Unrecognised session code %d", self->code); rv = 1; } if (rv == 0) { xserverbpp = xrdp_mm_get_value_int(self, "xserverbpp", self->wm->screen->bpp); xrdp_wm_log_msg(self->wm, LOG_LEVEL_DEBUG, "sending create session request to session" " manager. Please wait..."); rv = scp_send_create_session_request( self->sesman_trans, type, self->wm->screen->width, self->wm->screen->height, xserverbpp, self->wm->client_info->program, self->wm->client_info->directory); } return rv; } /*****************************************************************************/ static int xrdp_mm_setup_mod1(struct xrdp_mm *self) { void *func; const char *lib; char text[256]; if (self == 0) { return 1; } if ((lib = xrdp_mm_get_value(self, "lib")) == NULL) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "no library name specified in xrdp.ini, please add " "lib=libxrdp-vnc.so or similar"); return 1; } if (lib[0] == 0) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "empty library name specified in xrdp.ini, please " "add lib=libxrdp-vnc.so or similar"); return 1; } if (self->mod_handle == 0) { g_snprintf(text, sizeof(text), "%s/%s", XRDP_MODULE_PATH, lib); /* Let the main thread load the lib,*/ self->mod_handle = g_xrdp_sync(xrdp_mm_sync_load, (tintptr)text, 0); if (self->mod_handle != 0) { func = g_get_proc_address(self->mod_handle, "mod_init"); if (func == 0) { func = g_get_proc_address(self->mod_handle, "_mod_init"); } if (func == 0) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "error finding proc mod_init in %s, " "not a valid xrdp backend", lib); } self->mod_init = (struct xrdp_mod * ( *)(void))func; func = g_get_proc_address(self->mod_handle, "mod_exit"); if (func == 0) { func = g_get_proc_address(self->mod_handle, "_mod_exit"); } if (func == 0) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "error finding proc mod_exit in %s, " "not a valid xrdp backend", lib); } self->mod_exit = (int ( *)(struct xrdp_mod *))func; if ((self->mod_init != 0) && (self->mod_exit != 0)) { self->mod = self->mod_init(); if (self->mod != 0) { LOG(LOG_LEVEL_INFO, "loaded module '%s' ok, interface size %d, version %d", lib, self->mod->size, self->mod->version); } } else { LOG(LOG_LEVEL_ERROR, "no mod_init or mod_exit address found"); } } else { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "error loading %s specified in xrdp.ini, please " "add a valid entry like lib=libxrdp-vnc.so or " "similar", lib); return 1; } if (self->mod != 0) { self->mod->wm = (long)(self->wm); self->mod->server_begin_update = server_begin_update; self->mod->server_end_update = server_end_update; self->mod->server_bell_trigger = server_bell_trigger; self->mod->server_chansrv_in_use = server_chansrv_in_use; self->mod->server_fill_rect = server_fill_rect; self->mod->server_screen_blt = server_screen_blt; self->mod->server_paint_rect = server_paint_rect; self->mod->server_set_pointer = server_set_pointer; self->mod->server_set_pointer_ex = server_set_pointer_ex; self->mod->server_palette = server_palette; self->mod->server_msg = server_msg; self->mod->server_is_term = g_is_term; self->mod->server_set_clip = server_set_clip; self->mod->server_reset_clip = server_reset_clip; self->mod->server_set_fgcolor = server_set_fgcolor; self->mod->server_set_bgcolor = server_set_bgcolor; self->mod->server_set_opcode = server_set_opcode; self->mod->server_set_mixmode = server_set_mixmode; self->mod->server_set_brush = server_set_brush; self->mod->server_set_pen = server_set_pen; self->mod->server_draw_line = server_draw_line; self->mod->server_add_char = server_add_char; self->mod->server_draw_text = server_draw_text; self->mod->client_monitor_resize = client_monitor_resize; self->mod->server_monitor_resize_done = server_monitor_resize_done; self->mod->server_get_channel_count = server_get_channel_count; self->mod->server_query_channel = server_query_channel; self->mod->server_get_channel_id = server_get_channel_id; self->mod->server_send_to_channel = server_send_to_channel; self->mod->server_create_os_surface = server_create_os_surface; self->mod->server_switch_os_surface = server_switch_os_surface; self->mod->server_delete_os_surface = server_delete_os_surface; self->mod->server_paint_rect_os = server_paint_rect_os; self->mod->server_set_hints = server_set_hints; self->mod->server_window_new_update = server_window_new_update; self->mod->server_window_delete = server_window_delete; self->mod->server_window_icon = server_window_icon; self->mod->server_window_cached_icon = server_window_cached_icon; self->mod->server_notify_new_update = server_notify_new_update; self->mod->server_notify_delete = server_notify_delete; self->mod->server_monitored_desktop = server_monitored_desktop; self->mod->server_add_char_alpha = server_add_char_alpha; self->mod->server_create_os_surface_bpp = server_create_os_surface_bpp; self->mod->server_paint_rect_bpp = server_paint_rect_bpp; self->mod->server_composite = server_composite; self->mod->server_paint_rects = server_paint_rects; self->mod->server_session_info = server_session_info; self->mod->server_egfx_cmd = server_egfx_cmd; self->mod->server_set_pointer_large = server_set_pointer_large; self->mod->server_paint_rects_ex = server_paint_rects_ex; self->mod->si = &(self->wm->session->si); } } /* id self->mod is null, there must be a problem */ if (self->mod == 0) { LOG(LOG_LEVEL_ERROR, "problem loading lib in xrdp_mm_setup_mod1"); return 1; } return 0; } /*****************************************************************************/ static int xrdp_mm_setup_mod2(struct xrdp_mm *self) { char text[256]; const char *name; const char *value; int i; int rv; int key_flags; int device_flags; rv = 1; /* failure */ g_memset(text, 0, sizeof(text)); if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event)) { if (self->mod->mod_start(self->mod, self->wm->screen->width, self->wm->screen->height, self->wm->screen->bpp) != 0) { g_set_wait_obj(self->wm->pro_layer->self_term_event); /* kill session */ } } if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event)) { if (self->display > 0) { if (self->code == XVNC_SESSION_CODE) { g_snprintf(text, sizeof(text), "%d", 5900 + self->display); } else if (self->code == XORG_SESSION_CODE) { g_snprintf(text, sizeof(text), XRDP_X11RDP_STR, self->uid, self->display); } else { g_set_wait_obj(self->wm->pro_layer->self_term_event); /* kill session */ } } } if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event)) { /* this adds the port to the end of the list, it will already be in the list as -1 the module should use the last one */ if (g_strlen(text) > 0) { list_add_strdup(self->login_names, "port"); list_add_strdup(self->login_values, text); } /* always set these */ self->mod->mod_set_param(self->mod, "client_info", (const char *) (self->wm->session->client_info)); name = self->wm->session->client_info->hostname; self->mod->mod_set_param(self->mod, "hostname", name); g_snprintf(text, 255, "%d", self->wm->session->client_info->keylayout); self->mod->mod_set_param(self->mod, "keylayout", text); if (guid_is_set(&self->guid)) { self->mod->mod_set_param(self->mod, "guid", (char *) &self->guid); } for (i = 0; i < self->login_names->count; i++) { name = (const char *) list_get_item(self->login_names, i); value = (const char *) list_get_item(self->login_values, i); self->mod->mod_set_param(self->mod, name, value); } /* connect */ if (self->mod->mod_connect(self->mod) == 0) { rv = 0; /* connect success */ } else { xrdp_wm_show_log(self->wm); if (self->wm->hide_log_window) { rv = 1; } } } if (rv == 0) { /* sync modifiers */ key_flags = 0; device_flags = 0; if (self->wm->scroll_lock) { key_flags |= 1; } if (self->wm->num_lock) { key_flags |= 2; } if (self->wm->caps_lock) { key_flags |= 4; } if (self->mod != 0) { if (self->mod->mod_event != 0) { self->mod->mod_event(self->mod, WM_KEYBRD_SYNC, key_flags, device_flags, key_flags, device_flags); } } } return rv; } /*****************************************************************************/ /* returns error send a list of channels to the channel handler */ static int xrdp_mm_trans_send_channel_setup(struct xrdp_mm *self, struct trans *trans) { int chan_count; /* This value should be the same as chan_count, but we need to * cater for a possible failure of libxrdp_query_channel() */ int output_chan_count; int chan_id; int chan_flags; int size; struct stream *s; char chan_name[256]; g_memset(chan_name, 0, sizeof(char) * 256); s = trans_get_out_s(trans, 8192); if (s == 0) { return 1; } s_push_layer(s, iso_hdr, 8); s_push_layer(s, mcs_hdr, 8); s_push_layer(s, sec_hdr, 2); chan_count = libxrdp_get_channel_count(self->wm->session); output_chan_count = 0; for (chan_id = 0 ; chan_id < chan_count; ++chan_id) { if (libxrdp_query_channel(self->wm->session, chan_id, chan_name, &chan_flags) == 0) { out_uint8a(s, chan_name, 8); out_uint16_le(s, chan_id); out_uint16_le(s, chan_flags); ++output_chan_count; } } s_mark_end(s); s_pop_layer(s, sec_hdr); out_uint16_le(s, output_chan_count); s_pop_layer(s, mcs_hdr); size = (int)(s->end - s->p); out_uint32_le(s, 3); /* msg id */ out_uint32_le(s, size); /* msg size */ s_pop_layer(s, iso_hdr); size = (int)(s->end - s->p); out_uint32_le(s, 0); /* version */ out_uint32_le(s, size); /* block size */ return trans_force_write(trans); } /*****************************************************************************/ /* returns error data coming in from the channel handler, send it to the client */ static int xrdp_mm_trans_process_channel_data(struct xrdp_mm *self, struct stream *s) { unsigned int size; unsigned int total_size; int chan_id; int chan_flags; int rv = 0; if (!s_check_rem_and_log(s, 10, "Reading channel data header")) { rv = 1; } else { in_uint16_le(s, chan_id); in_uint16_le(s, chan_flags); in_uint16_le(s, size); in_uint32_le(s, total_size); if (!s_check_rem_and_log(s, size, "Reading channel data data")) { rv = 1; } else { rv = libxrdp_send_to_channel(self->wm->session, chan_id, s->p, size, total_size, chan_flags); } } return rv; } /*****************************************************************************/ /* returns error process rail create window order */ static int xrdp_mm_process_rail_create_window(struct xrdp_mm *self, struct stream *s) { int flags; int window_id; int title_bytes; int index; int bytes; int rv; struct rail_window_state_order rwso; g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); LOG(LOG_LEVEL_DEBUG, "xrdp_mm_process_rail_create_window: 0x%8.8x", window_id); in_uint32_le(s, rwso.owner_window_id); in_uint32_le(s, rwso.style); in_uint32_le(s, rwso.extended_style); in_uint32_le(s, rwso.show_state); in_uint16_le(s, title_bytes); if (title_bytes > 0) { rwso.title_info = g_new(char, title_bytes + 1); in_uint8a(s, rwso.title_info, title_bytes); rwso.title_info[title_bytes] = 0; } in_uint32_le(s, rwso.client_offset_x); in_uint32_le(s, rwso.client_offset_y); in_uint32_le(s, rwso.client_area_width); in_uint32_le(s, rwso.client_area_height); in_uint32_le(s, rwso.rp_content); in_uint32_le(s, rwso.root_parent_handle); in_uint32_le(s, rwso.window_offset_x); in_uint32_le(s, rwso.window_offset_y); in_uint32_le(s, rwso.window_client_delta_x); in_uint32_le(s, rwso.window_client_delta_y); in_uint32_le(s, rwso.window_width); in_uint32_le(s, rwso.window_height); in_uint16_le(s, rwso.num_window_rects); if (rwso.num_window_rects > 0) { bytes = sizeof(struct rail_window_rect) * rwso.num_window_rects; rwso.window_rects = (struct rail_window_rect *)g_malloc(bytes, 0); for (index = 0; index < rwso.num_window_rects; index++) { in_uint16_le(s, rwso.window_rects[index].left); in_uint16_le(s, rwso.window_rects[index].top); in_uint16_le(s, rwso.window_rects[index].right); in_uint16_le(s, rwso.window_rects[index].bottom); } } in_uint32_le(s, rwso.visible_offset_x); in_uint32_le(s, rwso.visible_offset_y); in_uint16_le(s, rwso.num_visibility_rects); if (rwso.num_visibility_rects > 0) { bytes = sizeof(struct rail_window_rect) * rwso.num_visibility_rects; rwso.visibility_rects = (struct rail_window_rect *)g_malloc(bytes, 0); for (index = 0; index < rwso.num_visibility_rects; index++) { in_uint16_le(s, rwso.visibility_rects[index].left); in_uint16_le(s, rwso.visibility_rects[index].top); in_uint16_le(s, rwso.visibility_rects[index].right); in_uint16_le(s, rwso.visibility_rects[index].bottom); } } in_uint32_le(s, flags); rv = libxrdp_orders_init(self->wm->session); if (rv == 0) { rv = libxrdp_window_new_update(self->wm->session, window_id, &rwso, flags); } if (rv == 0) { rv = libxrdp_orders_send(self->wm->session); } g_free(rwso.title_info); g_free(rwso.window_rects); g_free(rwso.visibility_rects); return rv; } #if 0 /*****************************************************************************/ /* returns error process rail configure window order */ static int xrdp_mm_process_rail_configure_window(struct xrdp_mm *self, struct stream *s) { int flags; int window_id; int index; int bytes; int rv; struct rail_window_state_order rwso; g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); LOG(LOG_LEVEL_DEBUG, "xrdp_mm_process_rail_configure_window: 0x%8.8x", window_id); in_uint32_le(s, rwso.client_offset_x); in_uint32_le(s, rwso.client_offset_y); in_uint32_le(s, rwso.client_area_width); in_uint32_le(s, rwso.client_area_height); in_uint32_le(s, rwso.rp_content); in_uint32_le(s, rwso.root_parent_handle); in_uint32_le(s, rwso.window_offset_x); in_uint32_le(s, rwso.window_offset_y); in_uint32_le(s, rwso.window_client_delta_x); in_uint32_le(s, rwso.window_client_delta_y); in_uint32_le(s, rwso.window_width); in_uint32_le(s, rwso.window_height); in_uint16_le(s, rwso.num_window_rects); if (rwso.num_window_rects > 0) { bytes = sizeof(struct rail_window_rect) * rwso.num_window_rects; rwso.window_rects = (struct rail_window_rect *)g_malloc(bytes, 0); for (index = 0; index < rwso.num_window_rects; index++) { in_uint16_le(s, rwso.window_rects[index].left); in_uint16_le(s, rwso.window_rects[index].top); in_uint16_le(s, rwso.window_rects[index].right); in_uint16_le(s, rwso.window_rects[index].bottom); } } in_uint32_le(s, rwso.visible_offset_x); in_uint32_le(s, rwso.visible_offset_y); in_uint16_le(s, rwso.num_visibility_rects); if (rwso.num_visibility_rects > 0) { bytes = sizeof(struct rail_window_rect) * rwso.num_visibility_rects; rwso.visibility_rects = (struct rail_window_rect *)g_malloc(bytes, 0); for (index = 0; index < rwso.num_visibility_rects; index++) { in_uint16_le(s, rwso.visibility_rects[index].left); in_uint16_le(s, rwso.visibility_rects[index].top); in_uint16_le(s, rwso.visibility_rects[index].right); in_uint16_le(s, rwso.visibility_rects[index].bottom); } } in_uint32_le(s, flags); rv = libxrdp_orders_init(self->wm->session); if (rv == 0) { rv = libxrdp_window_new_update(self->wm->session, window_id, &rwso, flags); } if (rv == 0) { rv = libxrdp_orders_send(self->wm->session); } g_free(rwso.window_rects); g_free(rwso.visibility_rects); return rv; } #endif /*****************************************************************************/ /* returns error process rail destroy window order */ static int xrdp_mm_process_rail_destroy_window(struct xrdp_mm *self, struct stream *s) { int window_id; int rv; in_uint32_le(s, window_id); LOG(LOG_LEVEL_DEBUG, "xrdp_mm_process_rail_destroy_window 0x%8.8x", window_id); rv = libxrdp_orders_init(self->wm->session); if (rv == 0) { rv = libxrdp_window_delete(self->wm->session, window_id); } if (rv == 0) { rv = libxrdp_orders_send(self->wm->session); } return rv; } /*****************************************************************************/ /* returns error process rail update window (show state) order */ static int xrdp_mm_process_rail_show_window(struct xrdp_mm *self, struct stream *s) { int window_id; int rv; int flags; struct rail_window_state_order rwso; g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); in_uint32_le(s, flags); in_uint32_le(s, rwso.show_state); LOG(LOG_LEVEL_DEBUG, "xrdp_mm_process_rail_show_window 0x%8.8x %x", window_id, rwso.show_state); rv = libxrdp_orders_init(self->wm->session); if (rv == 0) { rv = libxrdp_window_new_update(self->wm->session, window_id, &rwso, flags); } if (rv == 0) { rv = libxrdp_orders_send(self->wm->session); } return rv; } /*****************************************************************************/ /* returns error process rail update window (title) order */ static int xrdp_mm_process_rail_update_window_text(struct xrdp_mm *self, struct stream *s) { int size; int flags; int rv; int window_id; struct rail_window_state_order rwso; LOG(LOG_LEVEL_DEBUG, "xrdp_mm_process_rail_update_window_text:"); in_uint32_le(s, window_id); in_uint32_le(s, flags); LOG(LOG_LEVEL_DEBUG, " update window title info: 0x%8.8x", window_id); g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, size); /* title size */ if (size < 0 || !s_check_rem(s, size)) { LOG(LOG_LEVEL_ERROR, "%s : invalid window text size %d", __func__, size); return 1; } rwso.title_info = g_new(char, size + 1); in_uint8a(s, rwso.title_info, size); rwso.title_info[size] = 0; LOG(LOG_LEVEL_DEBUG, " set window title %s size %d 0x%8.8x", rwso.title_info, size, flags); rv = libxrdp_orders_init(self->wm->session); if (rv == 0) { rv = libxrdp_window_new_update(self->wm->session, window_id, &rwso, flags); } if (rv == 0) { rv = libxrdp_orders_send(self->wm->session); } LOG(LOG_LEVEL_DEBUG, " set window title %s %d", rwso.title_info, rv); g_free(rwso.title_info); return rv; } /*****************************************************************************/ /* returns error process alternate secondary drawing orders for rail channel */ static int xrdp_mm_process_rail_drawing_orders(struct xrdp_mm *self, struct stream *s) { int order_type; int rv; rv = 0; in_uint32_le(s, order_type); switch (order_type) { case 2: /* create_window */ xrdp_mm_process_rail_create_window(self, s); break; case 4: /* destroy_window */ xrdp_mm_process_rail_destroy_window(self, s); break; case 6: /* show_window */ rv = xrdp_mm_process_rail_show_window(self, s); break; case 8: /* update title info */ rv = xrdp_mm_process_rail_update_window_text(self, s); break; default: break; } return rv; } #define GFX_PLANAR_BYTES (32 * 1024) /******************************************************************************/ int xrdp_mm_egfx_send_planar_bitmap(struct xrdp_mm *self, struct xrdp_bitmap *bitmap, struct xrdp_rect *rect, int surface_id, int x, int y) { struct xrdp_egfx_rect gfx_rect; struct stream *comp_s; struct stream *temp_s; char *pixels; char *src8; char *dst8; int index; int lines; int comp_bytes; int xindex; int yindex; int bwidth; int bheight; int cx; int cy; int rv = 0; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_send_planar_bitmap:"); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_egfx_send_planar_bitmap: " "surface_id %d rect %d %d %d %d x %d y %d", surface_id, rect->left, rect->top, rect->right, rect->bottom, x, y); bwidth = rect->right - rect->left; bheight = rect->bottom - rect->top; if ((bwidth < 1) || (bheight < 1)) { return 0; } if (bwidth < 64) { cx = bwidth; cy = 4096 / cx; } else if (bheight < 64) { cy = bheight; cx = 4096 / cy; } else { cx = 64; cy = 64; } while (cx * cy < 4096) { if (cx < cy) { cx++; cy = 4096 / cx; } else { cy++; cx = 4096 / cy; } } LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_send_planar_bitmap: cx %d cy %d", cx, cy); pixels = g_new(char, GFX_PLANAR_BYTES); make_stream(comp_s); init_stream(comp_s, GFX_PLANAR_BYTES); make_stream(temp_s); init_stream(temp_s, GFX_PLANAR_BYTES); if (xrdp_egfx_send_frame_start(self->egfx, 1, 0) != 0) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_send_planar_bitmap: " "xrdp_egfx_send_frame_start error"); rv = 1; goto cleanup; } LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_send_planar_bitmap: left %d top %d right %d " "bottom %d", rect->left, rect->top, rect->right, rect->bottom); for (yindex = rect->top; yindex < rect->bottom; yindex += cy) { bheight = rect->bottom - yindex; bheight = MIN(bheight, cy); for (xindex = rect->left; xindex < rect->right; xindex += cx) { bwidth = rect->right - xindex; bwidth = MIN(bwidth, cx); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_send_planar_bitmap: xindex %d " "yindex %d, bwidth %d bheight %d", xindex, yindex, bwidth, bheight); src8 = bitmap->data + bitmap->line_size * yindex + xindex * 4; dst8 = pixels + (bheight - 1) * bwidth * 4; for (index = 0; index < bheight; index++) { g_memcpy(dst8, src8, bwidth * 4); src8 += bitmap->line_size; dst8 -= bwidth * 4; } lines = libxrdp_planar_compress(pixels, bwidth, bheight, comp_s, 32, GFX_PLANAR_BYTES, bheight - 1, temp_s, 0, 0x10); comp_s->end = comp_s->p; comp_s->p = comp_s->data; if (lines != bheight) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_send_planar_bitmap: " "lines(%d) != bheight(%d) error", lines, bheight); } else { comp_bytes = (int)(comp_s->end - comp_s->data); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_send_planar_bitmap: lines %d " "comp_bytes %d", lines, comp_bytes); gfx_rect.x1 = xindex - x; gfx_rect.y1 = yindex - y; gfx_rect.x2 = gfx_rect.x1 + bwidth; gfx_rect.y2 = gfx_rect.y1 + bheight; if (xrdp_egfx_send_wire_to_surface1(self->egfx, surface_id, XR_RDPGFX_CODECID_PLANAR, XR_PIXEL_FORMAT_XRGB_8888, &gfx_rect, comp_s->data, comp_bytes) != 0) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_send_planar_bitmap: " "xrdp_egfx_send_wire_to_surface1 error"); rv = 1; goto cleanup; } } } } if (xrdp_egfx_send_frame_end(self->egfx, 1) != 0) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_send_planar_bitmap: " "xrdp_egfx_send_frame_end error"); rv = 1; } cleanup: g_free(pixels); free_stream(comp_s); free_stream(temp_s); return rv; } /******************************************************************************/ static int xrdp_mm_egfx_invalidate_wm_screen(struct xrdp_mm *self) { int error = 0; LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_invalidate_wm_screen:"); // Only invalidate the WM screen if the module is using the WM screen, // or we haven't loaded the module yet. // // Otherwise we may send client updates which conflict with the // updates sent directly from the module via the encoder. if (self->mod_uses_wm_screen_for_gfx || self->mod_handle == 0) { struct xrdp_bitmap *screen = self->wm->screen; struct xrdp_rect xr_rect; xr_rect.left = 0; xr_rect.top = 0; xr_rect.right = screen->width; xr_rect.bottom = screen->height; if (self->wm->screen_dirty_region == NULL) { self->wm->screen_dirty_region = xrdp_region_create(self->wm); } error = xrdp_region_add_rect(self->wm->screen_dirty_region, &xr_rect); } return error; } /******************************************************************************/ static int dynamic_monitor_open_response(intptr_t id, int chan_id, int creation_status) { struct xrdp_process *pro; struct xrdp_wm *wm; struct stream *s; int bytes; LOG_DEVEL(LOG_LEVEL_TRACE, "dynamic_monitor_open_response: chan_id %d " "creation_status 0x%8.8x", chan_id, creation_status); if (creation_status != 0) { LOG(LOG_LEVEL_ERROR, "dynamic_monitor_open_response: error"); return 1; } pro = (struct xrdp_process *) id; wm = pro->wm; make_stream(s); init_stream(s, 1024); out_uint32_le(s, 5); /* DISPLAYCONTROL_PDU_TYPE_CAPS */ out_uint32_le(s, 8 + 12); out_uint32_le(s, CLIENT_MONITOR_DATA_MAXIMUM_MONITORS); /* MaxNumMonitors */ out_uint32_le(s, 4096); /* MaxMonitorAreaFactorA */ out_uint32_le(s, 2048); /* MaxMonitorAreaFactorB */ s_mark_end(s); bytes = (int) (s->end - s->data); libxrdp_drdynvc_data(wm->session, chan_id, s->data, bytes); free_stream(s); return 0; } /******************************************************************************/ static int dynamic_monitor_close_response(intptr_t id, int chan_id) { LOG_DEVEL(LOG_LEVEL_TRACE, "dynamic_monitor_close_response:"); return 0; } /******************************************************************************/ static int dynamic_monitor_data_first(intptr_t id, int chan_id, char *data, int bytes, int total_bytes) { LOG_DEVEL(LOG_LEVEL_TRACE, "dynamic_monitor_data_first:"); return 0; } /******************************************************************************/ int advance_resize_state_machine(struct xrdp_mm *mm, enum display_resize_state new_state) { struct display_control_monitor_layout_data *description = mm->resize_data; LOG_DEVEL(LOG_LEVEL_INFO, "advance_resize_state_machine:" " Processing resize to: %d x %d." " Advancing state from %s to %s." " Previous state took %d MS.", description->description.session_width, description->description.session_height, XRDP_DISPLAY_RESIZE_STATE_TO_STR(description->state), XRDP_DISPLAY_RESIZE_STATE_TO_STR(new_state), g_time3() - description->last_state_update_timestamp); description->state = new_state; description->last_state_update_timestamp = g_time3(); g_set_wait_obj(mm->resize_ready); return 0; } struct ver_flags_t { int version; int flags; }; /******************************************************************************/ static int cmpverfunc (const void *a, const void *b) { return ((struct ver_flags_t *)a)->version - ((struct ver_flags_t *)b)->version; } /******************************************************************************/ static int xrdp_mm_egfx_create_surfaces(struct xrdp_mm *self) { int surface_id; int index; int count; int left; int top; int width; int height; struct monitor_info *mi; struct xrdp_bitmap *screen; screen = self->wm->screen; count = self->wm->client_info->display_sizes.monitorCount; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_mm_egfx_create_surfaces: " "monitor count %d", count); if (count < 1) { left = 0; top = 0; width = screen->width; height = screen->height; xrdp_egfx_send_create_surface(self->egfx, self->egfx->surface_id, width, height, XR_PIXEL_FORMAT_XRGB_8888); xrdp_egfx_send_map_surface(self->egfx, self->egfx->surface_id, left, top); LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_create_surfaces: map " "surface_id %d left %d top %d width %d height %d", self->egfx->surface_id, left, top, width, height); return 0; } for (index = 0; index < count; index++) { surface_id = index; mi = self->wm->client_info->display_sizes.minfo_wm + index; left = mi->left; top = mi->top; width = mi->right - mi->left + 1; height = mi->bottom - mi->top + 1; xrdp_egfx_send_create_surface(self->egfx, surface_id, width, height, XR_PIXEL_FORMAT_XRGB_8888); xrdp_egfx_send_map_surface(self->egfx, surface_id, left, top); LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_create_surfaces: map " "surface_id %d left %d top %d width %d height %d", surface_id, left, top, width, height); } return 0; } /******************************************************************************/ static int xrdp_mm_egfx_caps_advertise(void *user, int caps_count, int *versions, int *flagss) { struct xrdp_mm *self; struct xrdp_bitmap *screen; int index; int best_index; int best_h264_index; int best_pro_index; int error; int version; int flags; struct ver_flags_t *ver_flags; LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_caps_advertise:"); self = (struct xrdp_mm *) user; screen = self->wm->screen; if (screen->data == NULL) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_caps_advertise: can not do gfx"); } /* create copy for sorting */ ver_flags = g_new(struct ver_flags_t, caps_count); if (ver_flags == NULL) { return 1; } for (index = 0; index < caps_count; index++) { ver_flags[index].version = versions[index]; ver_flags[index].flags = flagss[index]; } /* sort by version */ g_qsort(ver_flags, caps_count, sizeof(struct ver_flags_t), cmpverfunc); best_index = -1; best_h264_index = -1; best_pro_index = -1; for (index = 0; index < caps_count; index++) { version = ver_flags[index].version; flags = ver_flags[index].flags; LOG(LOG_LEVEL_INFO, " version 0x%8.8x flags 0x%8.8x (index: %d)", version, flags, index); switch (version) { case XR_RDPGFX_CAPVERSION_8: /* FALLTHROUGH */ case XR_RDPGFX_CAPVERSION_101: best_pro_index = index; break; case XR_RDPGFX_CAPVERSION_81: if (flags & XR_RDPGFX_CAPS_FLAG_AVC420_ENABLED) { best_h264_index = index; } best_pro_index = index; break; case XR_RDPGFX_CAPVERSION_10: if (!(flags & XR_RDPGFX_CAPS_FLAG_AVC_DISABLED)) { best_h264_index = index; } best_pro_index = index; break; case XR_RDPGFX_CAPVERSION_102: /* FALLTHROUGH */ case XR_RDPGFX_CAPVERSION_103: /* FALLTHROUGH */ case XR_RDPGFX_CAPVERSION_104: /* FALLTHROUGH */ case XR_RDPGFX_CAPVERSION_105: /* FALLTHROUGH */ case XR_RDPGFX_CAPVERSION_106: /* FALLTHROUGH */ case XR_RDPGFX_CAPVERSION_107: if (!(flags & XR_RDPGFX_CAPS_FLAG_AVC_DISABLED)) { best_h264_index = index; } best_pro_index = index; break; default: /* just skip unknwown */ LOG(LOG_LEVEL_INFO, "unknown version 0x%8.8x", version); break; } } if (best_pro_index >= 0) { best_index = best_pro_index; self->egfx_flags = XRDP_EGFX_RFX_PRO; } /* prefer h264, todo use setting in xrdp.ini for this */ if (best_h264_index >= 0) { #if defined(XRDP_X264) || defined(XRDP_NVENC) best_index = best_h264_index; self->egfx_flags = XRDP_EGFX_H264; #endif } if (best_index >= 0) { LOG(LOG_LEVEL_INFO, " replying version 0x%8.8x flags 0x%8.8x", ver_flags[best_index].version, ver_flags[best_index].flags); error = xrdp_egfx_send_capsconfirm(self->egfx, ver_flags[best_index].version, ver_flags[best_index].flags); LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_caps_advertise: xrdp_egfx_send_capsconfirm " "error %d best_index %d", error, best_index); error = xrdp_egfx_send_reset_graphics(self->egfx, screen->width, screen->height, self->wm->client_info->display_sizes.monitorCount, self->wm->client_info->display_sizes.minfo); LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_caps_advertise: xrdp_egfx_send_reset_graphics " "error %d monitorCount %d", error, self->wm->client_info->display_sizes.monitorCount); self->egfx_up = 1; xrdp_mm_egfx_create_surfaces(self); self->encoder = xrdp_encoder_create(self); xrdp_mm_egfx_invalidate_wm_screen(self); if (self->resize_data != NULL && self->resize_data->state == WMRZ_EGFX_INITALIZING) { advance_resize_state_machine(self, WMRZ_EGFX_INITIALIZED); } LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_caps_advertise: egfx created."); if (self->gfx_delay_autologin) { self->gfx_delay_autologin = 0; xrdp_wm_set_login_state(self->wm, WMLS_START_CONNECT); } } else { struct xrdp_rect lrect; LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_caps_advertise: no good gfx, canceling"); lrect.left = 0; lrect.top = 0; lrect.right = screen->width; lrect.bottom = screen->height; self->wm->client_info->gfx = 0; xrdp_encoder_delete(self->encoder); self->encoder = xrdp_encoder_create(self); xrdp_bitmap_invalidate(screen, &lrect); } g_free(ver_flags); return 0; } /*****************************************************************************/ static int xrdp_mm_update_module_frame_ack(struct xrdp_mm *self) { int fif; struct xrdp_encoder *encoder; encoder = self->encoder; fif = encoder->frames_in_flight; if (encoder->frame_id_client + fif > encoder->frame_id_server) { if (encoder->frame_id_server > encoder->frame_id_server_sent) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_update_module_ack: " "frame_id_server %d", encoder->frame_id_server); encoder->frame_id_server_sent = encoder->frame_id_server; self->mod->mod_frame_ack(self->mod, 0, encoder->frame_id_server); } } return 0; } static int xrdp_mm_egfx_frame_ack(void *user, uint32_t queue_depth, int frame_id, int frames_decoded) { struct xrdp_mm *self; struct xrdp_encoder *encoder; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_frame_ack:"); self = (struct xrdp_mm *) user; encoder = self->encoder; if (encoder == NULL) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_frame_ack: encoder is nil"); return 0; } if (queue_depth == XR_SUSPEND_FRAME_ACKNOWLEDGEMENT) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_frame_ack: " "queue_depth %d frame_id %d frames_decoded %d", queue_depth, frame_id, frames_decoded); if (encoder->gfx_ack_off == 0) { LOG(LOG_LEVEL_INFO, "xrdp_mm_egfx_frame_ack: " "client request turn off frame acks."); encoder->gfx_ack_off = 1; frame_id = -1; } } else { if (encoder->gfx_ack_off) { LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_frame_ack: " "client request turn on frame acks"); encoder->gfx_ack_off = 0; } } LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_egfx_frame_ack: " "incoming %d, client %d, server %d", frame_id, encoder->frame_id_client, encoder->frame_id_server); if (frame_id < 0 || frame_id > encoder->frame_id_server) { /* if frame_id is negative or bigger then what server last sent just ack all sent frames */ /* some clients can send big number just to clear all pending frames */ encoder->frame_id_client = encoder->frame_id_server; } else { /* frame acks can come out of order so ignore older one */ encoder->frame_id_client = MAX(frame_id, encoder->frame_id_client); } xrdp_mm_update_module_frame_ack(self); return 0; } /******************************************************************************/ int egfx_initialize(struct xrdp_mm *self) { LOG_DEVEL(LOG_LEVEL_TRACE, "egfx_initialize"); if (!(self->wm->client_info->gfx)) { return 0; } LOG_DEVEL(LOG_LEVEL_INFO, "egfx_initialize: gfx capable client"); if (xrdp_egfx_create(self, &(self->egfx)) == 0) { self->egfx->user = self; self->egfx->caps_advertise = xrdp_mm_egfx_caps_advertise; self->egfx->frame_ack = xrdp_mm_egfx_frame_ack; return 0; } LOG_DEVEL(LOG_LEVEL_INFO, "egfx_initialize: xrdp_egfx_create failed"); return 1; } /******************************************************************************/ static const int MAXIMUM_MONITOR_SIZE = sizeof(struct monitor_info) * CLIENT_MONITOR_DATA_MAXIMUM_MONITORS; /******************************************************************************/ static void sync_dynamic_monitor_data(struct xrdp_wm *wm, struct display_size_description *description) { struct display_size_description *display_sizes = &(wm->client_info->display_sizes); display_sizes->monitorCount = description->monitorCount; display_sizes->session_width = description->session_width; display_sizes->session_height = description->session_height; g_memcpy(display_sizes->minfo, description->minfo, MAXIMUM_MONITOR_SIZE); g_memcpy(display_sizes->minfo_wm, description->minfo_wm, MAXIMUM_MONITOR_SIZE); } /******************************************************************************/ static int dynamic_monitor_data(intptr_t id, int chan_id, char *data, int bytes) { int error = 0; struct stream ls; struct stream *s; int msg_type; int msg_length; struct xrdp_process *pro; struct xrdp_wm *wm; int monitor_layout_size; struct display_size_description *display_size_data; LOG_DEVEL(LOG_LEVEL_TRACE, "dynamic_monitor_data:"); pro = (struct xrdp_process *) id; wm = pro->wm; if (OUTPUT_SUPPRESSED_FOR_REASON(wm->client_info, XSO_REASON_CLIENT_REQUEST)) { LOG(LOG_LEVEL_INFO, "dynamic_monitor_data: Not allowing resize." " Suppress output requested by client"); return error; } g_memset(&ls, 0, sizeof(ls)); ls.data = data; ls.p = ls.data; ls.size = bytes; ls.end = ls.data + bytes; s = &ls; in_uint32_le(s, msg_type); in_uint32_le(s, msg_length); LOG_DEVEL(LOG_LEVEL_DEBUG, "dynamic_monitor_data: msg_type %d msg_length %d", msg_type, msg_length); if (msg_type != DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT && msg_length >= 0) { // Unsupported message types switch (msg_type) { case DISPLAYCONTROL_PDU_TYPE_CAPS: LOG(LOG_LEVEL_ERROR, "dynamic_monitor_data: Received" " DISPLAYCONTROL_PDU_TYPE_CAPS. Per MS-RDPEDISP 2.2.2.1," " this is a server-to-client message, client should never" " send this. Ignoring message"); break; default: LOG(LOG_LEVEL_ERROR, "dynamic_monitor_data: Received neither" " DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT nor" " DISPLAYCONTROL_PDU_TYPE_CAPS. Ignoring message."); break; } return 0; } in_uint32_le(s, monitor_layout_size); if (monitor_layout_size != 40) { /* 2.2.2.2 DISPLAYCONTROL_MONITOR_LAYOUT_PDU */ LOG(LOG_LEVEL_ERROR, "dynamic_monitor_data: monitor_layout_size" " is %d. Per spec ([MS-RDPEDISP] 2.2.2.2" " DISPLAYCONTROL_MONITOR_LAYOUT_PDU) it must be 40.", monitor_layout_size); return 1; } display_size_data = (struct display_size_description *) g_malloc(sizeof(struct display_size_description), 1); if (!display_size_data) { return 1; } error = libxrdp_process_monitor_stream(s, display_size_data, 1); if (error) { LOG(LOG_LEVEL_ERROR, "dynamic_monitor_data:" " libxrdp_process_monitor_stream" " failed with error %d.", error); g_free(display_size_data); return error; } list_add_item(wm->mm->resize_queue, (tintptr)display_size_data); g_set_wait_obj(wm->mm->resize_ready); LOG(LOG_LEVEL_DEBUG, "dynamic_monitor_data:" " received width %d, received height %d.", display_size_data->session_width, display_size_data->session_height); return 0; } /******************************************************************************/ static int advance_error(int error, struct xrdp_mm *mm) { advance_resize_state_machine(mm, WMRZ_ERROR); return error; } /******************************************************************************/ static int process_display_control_monitor_layout_data(struct xrdp_wm *wm) { int error = 0; struct xrdp_mm *mm; struct xrdp_mod *module; struct xrdp_rdp *rdp; struct xrdp_sec *sec; struct xrdp_channel *chan; int in_progress; LOG_DEVEL(LOG_LEVEL_TRACE, "process_display_control_monitor_layout_data:"); if (wm == NULL) { return 1; } mm = wm->mm; if (mm == NULL) { return 1; } module = mm->mod; if (module == NULL) { return 1; } if (!xrdp_wm_can_resize(wm)) { return 0; } struct display_control_monitor_layout_data *description = mm->resize_data; const unsigned int desc_width = description->description.session_width; const unsigned int desc_height = description->description.session_height; switch (description->state) { case WMRZ_ENCODER_DELETE: // Stop any output from the module rdp = (struct xrdp_rdp *) (wm->session->rdp); xrdp_rdp_suppress_output(rdp, 1, XSO_REASON_DYNAMIC_RESIZE, 0, 0, 0, 0); // Disable the encoder until the resize is complete. if (mm->encoder != NULL) { xrdp_encoder_delete(mm->encoder); mm->encoder = NULL; } if (mm->resize_data->using_egfx == 0) { advance_resize_state_machine(mm, WMRZ_SERVER_MONITOR_RESIZE); } else { advance_resize_state_machine(mm, WMRZ_EGFX_DELETE_SURFACE); } break; case WMRZ_EGFX_DELETE_SURFACE: if (error == 0 && module != 0) { xrdp_egfx_shutdown_delete_surface(mm->egfx); } advance_resize_state_machine(mm, WMRZ_EGFX_CONN_CLOSE); break; case WMRZ_EGFX_CONN_CLOSE: if (error == 0 && module != 0) { xrdp_egfx_shutdown_close_connection(wm->mm->egfx); mm->egfx_up = 0; } advance_resize_state_machine(mm, WMRZ_EGFX_CONN_CLOSING); break; // Also processed in xrdp_egfx_close_response case WMRZ_EGFX_CONN_CLOSING: rdp = (struct xrdp_rdp *) (wm->session->rdp); sec = rdp->sec_layer; chan = sec->chan_layer; // Continue to check to see if the connection is closed. If it // ever is, advance the state machine! if (chan->drdynvcs[mm->egfx->channel_id].status == XRDP_DRDYNVC_STATUS_CLOSED || (g_time3() - description->last_state_update_timestamp) > 100) { advance_resize_state_machine(mm, WMRZ_EGFX_CONN_CLOSED); break; } g_set_wait_obj(mm->resize_ready); break; case WMRZ_EGFX_CONN_CLOSED: advance_resize_state_machine(mm, WRMZ_EGFX_DELETE); break; case WRMZ_EGFX_DELETE: if (error == 0 && module != 0) { xrdp_egfx_shutdown_delete(wm->mm->egfx); mm->egfx = NULL; } advance_resize_state_machine(mm, WMRZ_SERVER_MONITOR_RESIZE); break; case WMRZ_SERVER_MONITOR_RESIZE: error = module->mod_server_monitor_resize( module, desc_width, desc_height, description->description.monitorCount, description->description.minfo, &in_progress); if (error != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_display_control_monitor_layout_data:" " mod_server_monitor_resize failed %d", error); return advance_error(error, mm); } else if (in_progress) { // Call is proceeding asynchronously advance_resize_state_machine( mm, WMRZ_SERVER_MONITOR_MESSAGE_PROCESSING); } else { // Call is done advance_resize_state_machine( mm, WMRZ_SERVER_MONITOR_MESSAGE_PROCESSED); } break; // Not processed here. Processed in client_monitor_resize // case WMRZ_SERVER_MONITOR_MESSAGE_PROCESSING: case WMRZ_SERVER_MONITOR_MESSAGE_PROCESSED: advance_resize_state_machine(mm, WMRZ_XRDP_CORE_RESET); break; case WMRZ_XRDP_CORE_RESET: sync_dynamic_monitor_data(wm, &(description->description)); error = libxrdp_reset(wm->session); if (error != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_display_control_monitor_layout_data:" " libxrdp_reset failed %d", error); return advance_error(error, mm); } /* reset cache */ error = xrdp_cache_reset(wm->cache, wm->client_info); if (error != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_display_control_monitor_layout_data:" " xrdp_cache_reset failed %d", error); return advance_error(error, mm); } advance_resize_state_machine(mm, WMRZ_XRDP_CORE_RESET_PROCESSING); break; // Not processed here. Processed in xrdp_mm_up_and_running() // case WMRZ_XRDP_CORE_RESET_PROCESSING: case WMRZ_XRDP_CORE_RESET_PROCESSED: /* load some stuff */ error = xrdp_wm_load_static_colors_plus(wm, 0); if (error != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_display_control_monitor_layout_data:" " xrdp_wm_load_static_colors_plus failed %d", error); return advance_error(error, mm); } error = xrdp_wm_load_static_pointers(wm); if (error != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_display_control_monitor_layout_data:" " xrdp_wm_load_static_pointers failed %d", error); return advance_error(error, mm); } /* resize the main window */ error = xrdp_bitmap_resize( wm->screen, desc_width, desc_height); if (error != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_display_control_monitor_layout_data:" " xrdp_bitmap_resize failed %d", error); return advance_error(error, mm); } advance_resize_state_machine(mm, WMRZ_EGFX_INITIALIZE); break; case WMRZ_EGFX_INITIALIZE: if (mm->resize_data->using_egfx) { egfx_initialize(mm); advance_resize_state_machine(mm, WMRZ_EGFX_INITALIZING); } else { advance_resize_state_machine(mm, WMRZ_EGFX_INITIALIZED); } break; // Not processed here. Processed in xrdp_mm_egfx_caps_advertise // case WMRZ_EGFX_INITALIZING: case WMRZ_EGFX_INITIALIZED: advance_resize_state_machine(mm, WMRZ_ENCODER_CREATE); break; case WMRZ_ENCODER_CREATE: if (mm->encoder == NULL) { mm->encoder = xrdp_encoder_create(mm); } advance_resize_state_machine(mm, WMRZ_SERVER_INVALIDATE); break; case WMRZ_SERVER_INVALIDATE: if (module != 0) { // Ack all frames to speed up resize. module->mod_frame_ack(module, 0, INT_MAX); } // Restart module output after invalidating // the screen. This causes an automatic redraw. xrdp_bitmap_invalidate(wm->screen, 0); rdp = (struct xrdp_rdp *) (wm->session->rdp); xrdp_rdp_suppress_output(rdp, 0, XSO_REASON_DYNAMIC_RESIZE, 0, 0, desc_width, desc_height); advance_resize_state_machine(mm, WMRZ_COMPLETE); break; default: break; } return 0; } /******************************************************************************/ static int dynamic_monitor_process_queue(struct xrdp_mm *self) { LOG_DEVEL(LOG_LEVEL_TRACE, "dynamic_monitor_process_queue:"); if (self == 0) { return 0; } struct xrdp_wm *wm = self->wm; if (!xrdp_wm_can_resize(wm)) { return 0; } if (self->resize_data == NULL && self->resize_queue != NULL) { if (self->resize_queue->count <= 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "Resize queue is empty."); return 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, "dynamic_monitor_process_queue: Queue is" " not empty. Filling out description."); const struct display_size_description *queue_head = (struct display_size_description *) list_get_item(self->resize_queue, 0); const int invalid_dimensions = queue_head->session_width <= 0 || queue_head->session_height <= 0; if (invalid_dimensions) { LOG(LOG_LEVEL_DEBUG, "dynamic_monitor_process_queue: Not allowing" " resize due to invalid dimensions (w: %d x h: %d)", queue_head->session_width, queue_head->session_height); } const struct display_size_description *current_size = &wm->client_info->display_sizes; const int already_this_size = queue_head->session_width == current_size->session_width && queue_head->session_height == current_size->session_height; if (already_this_size) { LOG(LOG_LEVEL_DEBUG, "dynamic_monitor_process_queue: Not resizing." " Already this size. (w: %d x h: %d)", queue_head->session_width, queue_head->session_height); } if (!invalid_dimensions && !already_this_size) { const int LAYOUT_DATA_SIZE = sizeof(struct display_control_monitor_layout_data); self->resize_data = (struct display_control_monitor_layout_data *) g_malloc(LAYOUT_DATA_SIZE, 1); g_memcpy(&(self->resize_data->description), queue_head, sizeof(struct display_size_description)); const int time = g_time3(); self->resize_data->start_time = time; self->resize_data->last_state_update_timestamp = time; self->resize_data->using_egfx = (self->egfx != NULL); advance_resize_state_machine(self, WMRZ_ENCODER_DELETE); } else { g_set_wait_obj(self->resize_ready); } list_remove_item(self->resize_queue, 0); return 0; } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "dynamic_monitor_process_queue:" " Resize data is not null."); } if (self->resize_data == NULL) { return 0; } if (self->resize_data->state == WMRZ_COMPLETE) { LOG(LOG_LEVEL_INFO, "dynamic_monitor_process_queue: Clearing" " completed resize (w: %d x h: %d). It took %d milliseconds.", self->resize_data->description.session_width, self->resize_data->description.session_height, g_time3() - self->resize_data->start_time); g_set_wait_obj(self->resize_ready); } else if (self->resize_data->state == WMRZ_ERROR) { LOG(LOG_LEVEL_INFO, "dynamic_monitor_process_queue: Clearing" " failed request to resize to: (w: %d x h: %d)", self->resize_data->description.session_width, self->resize_data->description.session_height); g_set_wait_obj(self->resize_ready); } else { // No errors, process it! return process_display_control_monitor_layout_data(self->wm); } g_free(self->resize_data); self->resize_data = NULL; return 0; } /******************************************************************************/ int dynamic_monitor_initialize(struct xrdp_mm *self) { struct xrdp_drdynvc_procs d_procs; int flags; int error; char buf[1024]; int pid; LOG_DEVEL(LOG_LEVEL_TRACE, "dynamic_monitor_initialize:"); g_memset(&d_procs, 0, sizeof(d_procs)); d_procs.open_response = dynamic_monitor_open_response; d_procs.close_response = dynamic_monitor_close_response; d_procs.data_first = dynamic_monitor_data_first; d_procs.data = dynamic_monitor_data; flags = 0; error = libxrdp_drdynvc_open(self->wm->session, "Microsoft::Windows::RDS::DisplayControl", flags, &d_procs, &(self->dynamic_monitor_chanid)); if (error != 0) { LOG(LOG_LEVEL_ERROR, "dynamic_monitor_initialize: " "libxrdp_drdynvc_open failed %d", error); return error; } // Initialize xrdp_mm specific variables. self->resize_queue = list_create(); self->resize_queue->auto_free = 1; pid = g_getpid(); /* setup wait objects for signaling */ g_snprintf(buf, sizeof(buf), "xrdp_%8.8x_resize_ready", pid); self->resize_ready = g_create_wait_obj(buf); self->resize_data = NULL; return error; } /******************************************************************************/ int xrdp_mm_drdynvc_up(struct xrdp_mm *self) { struct display_control_monitor_layout_data *ignore_marker; const char *enable_dynamic_resize; int error = 0; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_drdynvc_up:"); error = egfx_initialize(self); if (error != 0) { return error; } enable_dynamic_resize = xrdp_mm_get_value(self, "enable_dynamic_resizing"); /* * User can disable dynamic resizing if necessary */ if (enable_dynamic_resize != NULL && enable_dynamic_resize[0] != '\0' && !g_text2bool(enable_dynamic_resize)) { LOG(LOG_LEVEL_INFO, "User has disabled dynamic resizing."); return error; } error = dynamic_monitor_initialize(self); if (error != 0) { LOG(LOG_LEVEL_INFO, "Dynamic monitor initialize failed." " Client likely does not support it."); return error; } ignore_marker = (struct display_control_monitor_layout_data *) g_malloc(sizeof(struct display_control_monitor_layout_data), 1); list_add_item(self->resize_queue, (tintptr)ignore_marker); return error; } /******************************************************************************/ int xrdp_mm_suppress_output(struct xrdp_mm *self, int suppress, int left, int top, int right, int bottom) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_suppress_output: suppress %d " "left %d top %d right %d bottom %d", suppress, left, top, right, bottom); if (self->mod != NULL) { if (self->mod->mod_suppress_output != NULL) { self->mod->mod_suppress_output(self->mod, suppress, left, top, right, bottom); } } return 0; } /******************************************************************************/ int xrdp_mm_up_and_running(struct xrdp_mm *self) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_up_and_running:"); if (self->resize_data != NULL && self->resize_data->state == WMRZ_XRDP_CORE_RESET_PROCESSING) { LOG(LOG_LEVEL_INFO, "xrdp_mm_up_and_running: Core reset done."); advance_resize_state_machine(self, WMRZ_XRDP_CORE_RESET_PROCESSED); } return 0; } /*****************************************************************************/ /* open response from client going to channel server */ static int xrdp_mm_drdynvc_open_response(intptr_t id, int chan_id, int creation_status) { struct trans *trans; struct stream *s; struct xrdp_wm *wm; struct xrdp_process *pro; int chansrv_chan_id; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_drdynvc_open_response: " " chan_id %d creation_status %d", chan_id, creation_status); pro = (struct xrdp_process *) id; wm = pro->wm; trans = wm->mm->chan_trans; s = trans_get_out_s(trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 24); /* size */ out_uint32_le(s, 13); /* msg id */ out_uint32_le(s, 16); /* size */ chansrv_chan_id = wm->mm->xr2cr_cid_map[chan_id]; out_uint32_le(s, chansrv_chan_id); out_uint32_le(s, creation_status); /* status */ s_mark_end(s); return trans_write_copy(trans); } /*****************************************************************************/ /* close response from client going to channel server */ static int xrdp_mm_drdynvc_close_response(intptr_t id, int chan_id) { struct trans *trans; struct stream *s; struct xrdp_wm *wm; struct xrdp_process *pro; int chansrv_chan_id; pro = (struct xrdp_process *) id; wm = pro->wm; trans = wm->mm->chan_trans; s = trans_get_out_s(trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 20); /* size */ out_uint32_le(s, 15); /* msg id */ out_uint32_le(s, 12); /* size */ chansrv_chan_id = wm->mm->xr2cr_cid_map[chan_id]; out_uint32_le(s, chansrv_chan_id); s_mark_end(s); return trans_write_copy(trans); } /*****************************************************************************/ /* part data from client going to channel server */ static int xrdp_mm_drdynvc_data_first(intptr_t id, int chan_id, char *data, int bytes, int total_bytes) { struct trans *trans; struct stream *s; struct xrdp_wm *wm; struct xrdp_process *pro; int chansrv_chan_id; pro = (struct xrdp_process *) id; wm = pro->wm; trans = wm->mm->chan_trans; s = trans_get_out_s(trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 8 + 8 + 4 + 4 + 4 + bytes); out_uint32_le(s, 17); /* msg id */ out_uint32_le(s, 8 + 4 + 4 + 4 + bytes); chansrv_chan_id = wm->mm->xr2cr_cid_map[chan_id]; out_uint32_le(s, chansrv_chan_id); out_uint32_le(s, bytes); out_uint32_le(s, total_bytes); out_uint8a(s, data, bytes); s_mark_end(s); return trans_write_copy(trans); } /*****************************************************************************/ /* data from client going to channel server */ static int xrdp_mm_drdynvc_data(intptr_t id, int chan_id, char *data, int bytes) { struct trans *trans; struct stream *s; struct xrdp_wm *wm; struct xrdp_process *pro; int chansrv_chan_id; pro = (struct xrdp_process *) id; wm = pro->wm; trans = wm->mm->chan_trans; s = trans_get_out_s(trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 8 + 8 + 4 + 4 + bytes); out_uint32_le(s, 19); /* msg id */ out_uint32_le(s, 8 + 4 + 4 + bytes); chansrv_chan_id = wm->mm->xr2cr_cid_map[chan_id]; out_uint32_le(s, chansrv_chan_id); out_uint32_le(s, bytes); out_uint8a(s, data, bytes); s_mark_end(s); return trans_write_copy(trans); } /*****************************************************************************/ /* open message from channel server going to client */ static int xrdp_mm_trans_process_drdynvc_channel_open(struct xrdp_mm *self, struct stream *s) { int name_bytes; int flags; int error; int chan_id; int chansrv_chan_id; char name[1024 + 1]; struct xrdp_drdynvc_procs procs; if (!s_check_rem(s, 2)) { return 1; } in_uint32_le(s, name_bytes); if ((name_bytes < 1) || (name_bytes > (int)(sizeof(name) - 1))) { return 1; } if (!s_check_rem(s, name_bytes)) { return 1; } in_uint8a(s, name, name_bytes); name[name_bytes] = 0; if (!s_check_rem(s, 8)) { return 1; } in_uint32_le(s, flags); in_uint32_le(s, chansrv_chan_id); if (chansrv_chan_id < 0 || chansrv_chan_id > 255) { LOG(LOG_LEVEL_ERROR, "Attempting to open invalid chansrv channel %d", chansrv_chan_id); return 1; } if (flags == 0) { /* open static channel, not supported */ return 1; } else { /* dynamic channel */ g_memset(&procs, 0, sizeof(procs)); procs.open_response = xrdp_mm_drdynvc_open_response; procs.close_response = xrdp_mm_drdynvc_close_response; procs.data_first = xrdp_mm_drdynvc_data_first; procs.data = xrdp_mm_drdynvc_data; chan_id = 0; error = libxrdp_drdynvc_open(self->wm->session, name, flags, &procs, &chan_id); if (error != 0) { return 1; } self->xr2cr_cid_map[chan_id] = chansrv_chan_id; self->cs2xr_cid_map[chansrv_chan_id] = chan_id; } return 0; } /*****************************************************************************/ /* close message from channel server going to client */ static int xrdp_mm_trans_process_drdynvc_channel_close(struct xrdp_mm *self, struct stream *s) { int chansrv_chan_id; int chan_id; int error; if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, chansrv_chan_id); if (chansrv_chan_id < 0 || chansrv_chan_id > 255) { LOG(LOG_LEVEL_ERROR, "Attempting to close invalid chansrv channel %d", chansrv_chan_id); return 1; } chan_id = self->cs2xr_cid_map[chansrv_chan_id]; /* close dynamic channel */ error = libxrdp_drdynvc_close(self->wm->session, chan_id); if (error != 0) { return 1; } return 0; } /*****************************************************************************/ /* data from channel server going to client */ static int xrdp_mm_trans_process_drdynvc_data_first(struct xrdp_mm *self, struct stream *s) { int chansrv_chan_id; int chan_id; int error; int data_bytes; int total_bytes; char *data; if (!s_check_rem(s, 12)) { return 1; } in_uint32_le(s, chansrv_chan_id); in_uint32_le(s, data_bytes); in_uint32_le(s, total_bytes); if ((!s_check_rem(s, data_bytes))) { return 1; } in_uint8p(s, data, data_bytes); chan_id = self->cs2xr_cid_map[chansrv_chan_id]; error = libxrdp_drdynvc_data_first(self->wm->session, chan_id, data, data_bytes, total_bytes); if (error != 0) { return 1; } return 0; } /*****************************************************************************/ /* data from channel server going to client */ static int xrdp_mm_trans_process_drdynvc_data(struct xrdp_mm *self, struct stream *s) { int chansrv_chan_id; int chan_id; int error; int data_bytes; char *data; if (!s_check_rem(s, 8)) { return 1; } in_uint32_le(s, chansrv_chan_id); in_uint32_le(s, data_bytes); if ((!s_check_rem(s, data_bytes))) { return 1; } in_uint8p(s, data, data_bytes); chan_id = self->cs2xr_cid_map[chansrv_chan_id]; error = libxrdp_drdynvc_data(self->wm->session, chan_id, data, data_bytes); if (error != 0) { return 1; } return 0; } /*****************************************************************************/ /* returns error process a message for the channel handler */ static int xrdp_mm_chan_process_msg(struct xrdp_mm *self, struct trans *trans, struct stream *s) { int rv; int id; int size; char *next_msg; char *s_end; rv = 0; while (s_check_rem(s, 8)) { next_msg = s->p; in_uint32_le(s, id); in_uint32_le(s, size); if (size < 8) { return 1; } if (!s_check_rem(s, size - 8)) { return 1; } next_msg += size; s_end = s->end; s->end = next_msg; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_chan_process_msg: got msg id %d", id); switch (id) { case 8: /* channel data */ rv = xrdp_mm_trans_process_channel_data(self, s); break; case 10: /* rail alternate secondary drawing orders */ rv = xrdp_mm_process_rail_drawing_orders(self, s); break; case 12: rv = xrdp_mm_trans_process_drdynvc_channel_open(self, s); break; case 14: rv = xrdp_mm_trans_process_drdynvc_channel_close(self, s); break; case 16: rv = xrdp_mm_trans_process_drdynvc_data_first(self, s); break; case 18: rv = xrdp_mm_trans_process_drdynvc_data(self, s); break; default: LOG(LOG_LEVEL_ERROR, "xrdp_mm_chan_process_msg: unknown id %d", id); break; } s->end = s_end; if (rv != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_mm_chan_process_msg: error rv %d id %d", rv, id); rv = 0; } s->p = next_msg; } return rv; } /*****************************************************************************/ /* this is callback from trans obj returns error */ static int xrdp_mm_chan_data_in(struct trans *trans) { struct xrdp_mm *self; struct stream *s; int size; int error; if (trans == NULL) { return 1; } self = (struct xrdp_mm *)(trans->callback_data); s = trans_get_in_s(trans); if (s == 0) { return 1; } if (trans->extra_flags == 0) { in_uint8s(s, 4); /* id */ in_uint32_le(s, size); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_chan_data_in: got header, size %d", size); if (size > 8) { self->chan_trans->header_size = size; trans->extra_flags = 1; return 0; } } /* here, the entire message block is read in, process it */ error = xrdp_mm_chan_process_msg(self, trans, s); self->chan_trans->header_size = 8; trans->extra_flags = 0; init_stream(s, 0); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_chan_data_in: got whole message, reset for " "next header"); return error; } /*****************************************************************************/ /* does the section in xrdp.ini has any channel.*=true | false */ static int xrdp_mm_update_allowed_channels(struct xrdp_mm *self) { int index; int count; int chan_id; int disabled; const char *name; const char *value; const char *chan_name; struct xrdp_session *session; session = self->wm->session; count = self->login_names->count; for (index = 0; index < count; index++) { name = (const char *) list_get_item(self->login_names, index); if (g_strncasecmp(name, "channel.", 8) == 0) { value = (const char *) list_get_item(self->login_values, index); chan_name = name + 8; chan_id = libxrdp_get_channel_id(session, chan_name); disabled = !g_text2bool(value); libxrdp_disable_channel(session, chan_id, disabled); if (disabled) { LOG(LOG_LEVEL_INFO, "xrdp_mm_update_allowed_channels: channel %s " "channel id %d is disabled", chan_name, chan_id); } else { LOG(LOG_LEVEL_INFO, "xrdp_mm_update_allowed_channels: channel %s " "channel id %d is allowed", chan_name, chan_id); } } } return 0; } /*****************************************************************************/ static int xrdp_mm_get_sesman_port(char *port, int port_bytes) { int fd; int error; int index; char *val; char cfg_file[256]; struct list *names; struct list *values; g_memset(cfg_file, 0, sizeof(char) * 256); /* default to port 3350 */ g_strncpy(port, "3350", port_bytes - 1); /* see if port is in sesman.ini file */ g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); fd = g_file_open_ro(cfg_file); if (fd >= 0) { names = list_create(); names->auto_free = 1; values = list_create(); values->auto_free = 1; if (file_read_section(fd, "Globals", names, values) == 0) { for (index = 0; index < names->count; index++) { val = (char *)list_get_item(names, index); if (val != 0) { if (g_strcasecmp(val, "ListenPort") == 0) { val = (char *)list_get_item(values, index); error = g_atoi(val); if ((error > 0) && (error < 65000)) { g_strncpy(port, val, port_bytes - 1); } break; } } } } list_delete(names); list_delete(values); g_file_close(fd); } return 0; } /*****************************************************************************/ /* returns error data coming from client that need to go to channel handler */ int xrdp_mm_process_channel_data(struct xrdp_mm *self, tbus param1, tbus param2, tbus param3, tbus param4) { struct stream *s; int rv; int length; int total_length; int flags; int id; char *data; rv = 0; if ((self->chan_trans != 0) && self->chan_trans->status == TRANS_STATUS_UP) { s = trans_get_out_s(self->chan_trans, 8192); if (s != 0) { id = LOWORD(param1); flags = HIWORD(param1); length = param2; data = (char *)param3; total_length = param4; if (total_length < length) { LOG(LOG_LEVEL_WARNING, "WARNING in xrdp_mm_process_channel_data(): total_len < length"); total_length = length; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 8 + 8 + 2 + 2 + 2 + 4 + length); out_uint32_le(s, 5); /* msg id */ out_uint32_le(s, 8 + 2 + 2 + 2 + 4 + length); out_uint16_le(s, id); out_uint16_le(s, flags); out_uint16_le(s, length); out_uint32_le(s, total_length); out_uint8a(s, data, length); s_mark_end(s); rv = trans_force_write(self->chan_trans); } } return rv; } /*****************************************************************************/ static int xrdp_mm_process_login_response(struct xrdp_mm *self) { enum scp_login_status login_result; int rv; int server_closed; self->mmcs_expecting_msg = 0; rv = scp_get_login_response(self->sesman_trans, &login_result, &server_closed, &self->uid); if (rv == 0) { if (login_result != E_SCP_LOGIN_OK) { char buff[128]; scp_login_status_to_str(login_result, buff, sizeof(buff)); xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "%s", buff); if (login_result == E_SCP_LOGIN_NOT_AUTHENTICATED && self->wm->pamerrortxt[0] != '\0') { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "%s", self->wm->pamerrortxt); } if (self->wm->client_info->require_credentials) { /* Credentials had to be specified, but were invalid */ g_set_wait_obj(self->wm->pro_layer->self_term_event); LOG(LOG_LEVEL_ERROR, "require_credentials is set, " "but the user could not be logged in"); } if (server_closed) { if (login_result == E_SCP_LOGIN_NOT_AUTHENTICATED) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "%s", "Login retry limit reached"); } xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "%s", "Close the log window to exit."); self->wm->fatal_error_in_log_window = 1; /* Transport can be deleted now */ self->delete_sesman_trans = 1; } /* If the server hasn't closed, inform the window manager * of the fail, but leave the sesman connection open for * further login attempts */ xrdp_wm_mod_connect_done(self->wm, 1); } else { /* login successful */ xrdp_mm_connect_sm(self); } } return rv; } /*****************************************************************************/ static int xrdp_mm_process_create_session_response(struct xrdp_mm *self) { enum scp_screate_status status; int display; struct guid guid; int rv; self->mmcs_expecting_msg = 0; rv = scp_get_create_session_response(self->sesman_trans, &status, &display, &guid); if (rv == 0) { const char *username; /* Sort out some logging information */ if ((username = xrdp_mm_get_value(self, "username")) == NULL) { username = "???"; } if (status == E_SCP_SCREATE_OK) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "session is available on display %d for user %s", display, username); /* Carry on with the connect state machine */ self->display = display; self->guid = guid; xrdp_mm_connect_sm(self); } else { char buff[128]; scp_screate_status_to_str(status, buff, sizeof(buff)); xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "Can't create session for user %s - %s", username, buff); /* Leave the sesman connection open for further login attenpts */ xrdp_wm_mod_connect_done(self->wm, 1); } } return rv; } /*****************************************************************************/ /* This is the callback registered for sesman communication replies. */ static int xrdp_mm_scp_data_in(struct trans *trans) { int rv = 0; int available; rv = scp_msg_in_check_available(trans, &available); if (rv == 0 && available) { struct xrdp_mm *self = (struct xrdp_mm *)(trans->callback_data); enum scp_msg_code msgno; switch ((msgno = scp_msg_in_get_msgno(trans))) { case E_SCP_LOGIN_RESPONSE: rv = xrdp_mm_process_login_response(self); break; case E_SCP_CREATE_SESSION_RESPONSE: rv = xrdp_mm_process_create_session_response(self); break; default: { char buff[64]; scp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "Ignored SCP message %s from sesman", buff); } } scp_msg_in_reset(trans); } return rv; } /*****************************************************************************/ /* This routine clears all states to make sure that our next login will be * as expected. If the user does not press ok on the log window and try to * connect again we must make sure that no previous information is stored. * * This routine does not clear a sesman_trans if it is allocated, as this * would break the password retry limit mechanism */ static void cleanup_states(struct xrdp_mm *self) { if (self != NULL) { self->connect_state = MMCS_CONNECT_TO_SESMAN; self->use_sesman = 0; /* true if this is a sesman session */ self->use_chansrv = 0; /* true if chansrvport is set in xrdp.ini or using sesman */ self->use_gw_login = 0; /* true if we're to use the gateway login facility */ //self->sesman_trans = NULL; /* connection to sesman */ self->chan_trans = NULL; /* connection to chansrv */ self->delete_sesman_trans = 0; self->display = 0; /* 10 for :10.0, 11 for :11.0, etc */ guid_clear(&self->guid); self->code = 0; /* ???_SESSION_CODE value */ } } /*************************************************************************//** * Parses a chansrvport string * * This will be in one of the following formats:- * UNIX path to a domain socket * DISPLAY() Use chansrv on X Display * * @param value assigned to chansrvport * @param dest Output buffer * @param dest_size Total size of output buffer, including terminator space * @param uid of destination * * Pass in dest of NULL, dest_size of 0 and uid of -1 to simply see if * the string parses OK. * * @return 0 for success */ static int parse_chansrvport(const char *value, char *dest, int dest_size, int uid) { int rv = 0; if (g_strncmp(value, "DISPLAY(", 8) == 0) { const char *p = value + 8; const char *end = p; /* Check next chars are digits followed by ')' */ while (isdigit(*end)) { ++end; } if (end == p || *end != ')') { LOG(LOG_LEVEL_WARNING, "Ignoring invalid chansrvport string '%s'", value); rv = -1; } else { g_snprintf(dest, dest_size, XRDP_CHANSRV_STR, uid, g_atoi(p)); } } else { g_strncpy(dest, value, dest_size - 1); } return rv; } /*****************************************************************************/ static struct trans * xrdp_mm_scp_connect(struct xrdp_mm *self) { char port[128]; char port_description[128]; struct trans *t; xrdp_mm_get_sesman_port(port, sizeof(port)); scp_port_to_display_string(port, port_description, sizeof(port_description)); xrdp_wm_log_msg(self->wm, LOG_LEVEL_DEBUG, "connecting to sesman on %s", port_description); t = scp_connect(port, "xrdp", g_is_term); if (t != NULL) { /* fully connected */ t->trans_data_in = xrdp_mm_scp_data_in; t->callback_data = self; xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "sesman connect ok"); } else { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Error connecting to sesman on %s", port_description); trans_delete(t); t = NULL; } return t; } /*****************************************************************************/ static int xrdp_mm_sesman_connect(struct xrdp_mm *self) { trans_delete(self->sesman_trans); self->sesman_trans = xrdp_mm_scp_connect(self); return (self->sesman_trans == NULL); /* 0 for success */ } /*****************************************************************************/ static int xrdp_mm_chansrv_connect(struct xrdp_mm *self, const char *port) { if (self->wm->client_info->channels_allowed == 0) { LOG(LOG_LEVEL_DEBUG, "%s: " "skip connecting to chansrv because all channels are disabled", __func__); return 0; } /* connect channel redir */ self->chan_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); self->chan_trans->is_term = g_is_term; self->chan_trans->si = &(self->wm->session->si); self->chan_trans->my_source = XRDP_SOURCE_CHANSRV; self->chan_trans->trans_data_in = xrdp_mm_chan_data_in; self->chan_trans->header_size = 8; self->chan_trans->callback_data = self; self->chan_trans->no_stream_init_on_data_in = 1; self->chan_trans->extra_flags = 0; /* try to connect for up to 10 seconds */ trans_connect(self->chan_trans, NULL, port, 10 * 1000); if (self->chan_trans->status != TRANS_STATUS_UP) { LOG(LOG_LEVEL_ERROR, "xrdp_mm_chansrv_connect: error in " "trans_connect chan"); } else if (xrdp_mm_trans_send_channel_setup(self, self->chan_trans) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_mm_chansrv_connect: error in " "xrdp_mm_trans_send_channel_setup"); trans_delete(self->chan_trans); self->chan_trans = NULL; } else { LOG(LOG_LEVEL_DEBUG, "xrdp_mm_chansrv_connect: chansrv " "connect successful"); } return 0; } /*****************************************************************************/ static int xrdp_mm_user_session_connect(struct xrdp_mm *self) { int rv = 0; if (xrdp_mm_setup_mod1(self) != 0) { LOG(LOG_LEVEL_ERROR, "Failure setting up module"); xrdp_mm_module_cleanup(self); rv = 1; } else if (xrdp_mm_setup_mod2(self) != 0) { /* connect error */ xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Error connecting to user session"); xrdp_mm_module_cleanup(self); rv = 1; /* failure */ } LOG_DEVEL(LOG_LEVEL_DEBUG, "return value from %s %d", __func__, rv); return rv; } /**************************************************************************//** * Initialise and start the connect sequence * * @param self This object */ void xrdp_mm_connect(struct xrdp_mm *self) { const char *port = xrdp_mm_get_value(self, "port"); const char *gw_username = xrdp_mm_get_value(self, "pamusername"); /* make sure we start in correct state */ cleanup_states(self); self->code = xrdp_mm_get_value_int(self, "code", 0); /* Look at our module parameters to decide if we need to connect * to sesman or not */ if (port != NULL && g_strcmp(port, "-1") == 0) { self->use_sesman = 1; /* Connecting to a remote sesman is no longer supported. For purely * local session types, this setting could be removed. * The 'ip' value is still used for Xvnc sessions, to find the TCP * address that the X server is listening on */ if (xrdp_mm_get_value(self, "ip") != NULL) { if (self->code == XORG_SESSION_CODE) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_WARNING, "'ip' is not needed for this connection" " - please remove"); } } } if (gw_username != NULL) { /* Connecting to a remote sesman is no longer supported */ if (xrdp_mm_get_value(self, "pamsessionmng") != NULL) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_WARNING, "Parameter 'pamsessionmng' is obsolete." " Please remove from config"); } self->use_gw_login = 1; } /* Will we need chansrv ? We use it unconditionally for a * sesman session, but the user can also request it separately */ if (self->use_sesman) { self->use_chansrv = 1; } else { const char *csp = xrdp_mm_get_value(self, "chansrvport"); /* It's defined, but is it a valid string? */ if (csp != NULL && parse_chansrvport(csp, NULL, 0, -1) == 0) { self->use_chansrv = 1; } } xrdp_mm_connect_sm(self); } /*****************************************************************************/ static void xrdp_mm_connect_sm(struct xrdp_mm *self) { int status = 0; /* we set self->mmcs_expecting_msg in the loop when we've send a message to sesman, and we need to wait for a response */ self->mmcs_expecting_msg = 0; while (status == 0 && !self->mmcs_expecting_msg && self->connect_state != MMCS_DONE) { switch (self->connect_state) { case MMCS_CONNECT_TO_SESMAN: { if (self->sesman_trans == NULL && (self->use_sesman || self->use_gw_login)) { /* Synchronous call */ status = xrdp_mm_sesman_connect(self); } } break; case MMCS_GATEWAY_LOGIN: { if (self->use_gw_login) { const char *gw_username; const char *gw_password; gw_username = xrdp_mm_get_value(self, "pamusername"); gw_password = xrdp_mm_get_value(self, "pampassword"); if (!g_strcmp(gw_username, "same")) { gw_username = xrdp_mm_get_value(self, "username"); } if (gw_password == NULL || !g_strcmp(gw_password, "same")) { gw_password = xrdp_mm_get_value(self, "password"); } if (gw_username == NULL || gw_password == NULL) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Can't determine username and/or " "password for gateway login"); status = 1; } else { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "Performing access control for %s", gw_username); status = xrdp_mm_send_sys_login_request(self, gw_username, gw_password); if (status == 0) { /* Now waiting for a reply from sesman - see xrdp_mm_process_login_response() */ self->mmcs_expecting_msg = 1; } } } } break; case MMCS_SESSION_LOGIN: { // Finished with the gateway login if (self->use_gw_login) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "access control check was successful"); // No reply needed for this one status = scp_send_logout_request(self->sesman_trans); self->uid = -1; } if (status == 0 && self->use_sesman) { const char *username; const char *password; username = xrdp_mm_get_value(self, "username"); password = xrdp_mm_get_value(self, "password"); if (username == NULL || username[0] == '\0') { xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "No username is available"); status = 1; } else if (password == NULL) { /* Can't find a password definition at all - even * an empty one */ xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "No password field is available"); status = 1; } else { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "Performing login request for %s", username); status = xrdp_mm_send_sys_login_request(self, username, password); if (status == 0) { /* Now waiting for a reply from sesman - see xrdp_mm_process_create_session_response() */ self->mmcs_expecting_msg = 1; } } } } break; case MMCS_CREATE_SESSION: if (self->use_sesman) { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "login was successful - creating session"); if ((status = xrdp_mm_create_session(self)) == 0) { /* Now waiting for a reply from sesman. Note that * when it arrives, sesman is expecting us to * close the connection - we can do nothing else * with it */ self->mmcs_expecting_msg = 1; } } break; case MMCS_CONNECT_TO_SESSION: { xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "Connecting to session"); /* This is synchronous - no reply message expected */ status = xrdp_mm_user_session_connect(self); } break; case MMCS_CONNECT_TO_CHANSRV: { if (self->use_chansrv) { char portbuff[XRDP_SOCKETS_MAXPATH]; xrdp_wm_log_msg(self->wm, LOG_LEVEL_INFO, "Connecting to chansrv"); if (self->use_sesman) { g_snprintf(portbuff, sizeof(portbuff), XRDP_CHANSRV_STR, self->uid, self->display); } else { const char *cp = xrdp_mm_get_value(self, "chansrvport"); portbuff[0] = '\0'; parse_chansrvport(cp, portbuff, sizeof(portbuff), self->uid); } xrdp_mm_update_allowed_channels(self); xrdp_mm_chansrv_connect(self, portbuff); } } break; case MMCS_DONE: { /* Shouldn't get here */ LOG(LOG_LEVEL_ERROR, "xrdp_mm_connect_sm: state machine error"); status = 1; } break; } /* Move to the next state */ if (self->connect_state < MMCS_DONE) { self->connect_state = (enum mm_connect_state) (self->connect_state + 1); } } if (!self->mmcs_expecting_msg) { /* We don't need the sesman transport anymore */ if (self->sesman_trans != NULL) { self->delete_sesman_trans = 1; } xrdp_wm_mod_connect_done(self->wm, status); /* Make sure the module is cleaned up if we weren't successful */ if (status != 0) { xrdp_mm_module_cleanup(self); } } } #define MIN_MS_BETWEEN_FRAMES 40 #define MIN_MS_TO_WAIT_FOR_MORE_UPDATES 0 /*****************************************************************************/ int xrdp_mm_get_wait_objs(struct xrdp_mm *self, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout) { int rv = 0; if (self == 0) { return 0; } rv = 0; if (self->sesman_trans != 0 && self->sesman_trans->status == TRANS_STATUS_UP) { trans_get_wait_objs(self->sesman_trans, read_objs, rcount); } if ((self->chan_trans != 0) && self->chan_trans->status == TRANS_STATUS_UP) { trans_get_wait_objs_rw(self->chan_trans, read_objs, rcount, write_objs, wcount, timeout); } if (self->mod != 0) { if (self->mod->mod_get_wait_objs != 0) { rv = self->mod->mod_get_wait_objs(self->mod, read_objs, rcount, write_objs, wcount, timeout); } } if (self->encoder != 0) { read_objs[(*rcount)++] = self->encoder->xrdp_encoder_event_processed; } if (self->resize_queue != 0) { read_objs[(*rcount)++] = self->resize_ready; } if (self->wm->screen_dirty_region != NULL) { if (xrdp_region_not_empty(self->wm->screen_dirty_region)) { int now = g_time3(); int next_screen_draw_time = self->wm->last_screen_draw_time + MIN_MS_BETWEEN_FRAMES; int diff = next_screen_draw_time - now; int ltimeout = *timeout; diff = MAX(diff, MIN_MS_TO_WAIT_FOR_MORE_UPDATES); diff = MIN(diff, MIN_MS_BETWEEN_FRAMES); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_get_wait_objs:" " not empty diff %d", diff); if ((ltimeout < 0) || (ltimeout > diff)) { *timeout = diff; } } } return rv; } #define DUMP_JPEG 0 #if DUMP_JPEG /*****************************************************************************/ static int xrdp_mm_dump_jpeg(struct xrdp_mm *self, XRDP_ENC_DATA_DONE *enc_done) { static tbus ii; static int jj; struct _header { char tag[4]; int width; int height; int bytes_follow; } header; tui16 *pheader_bytes; int cx; int cy; pheader_bytes = (tui16 *) (enc_done->comp_pad_data + enc_done->pad_bytes); cx = enc_done->enc->crects[enc_done->index * 4 + 2]; cy = enc_done->enc->crects[enc_done->index * 4 + 3]; header.tag[0] = 'B'; header.tag[1] = 'E'; header.tag[2] = 'E'; header.tag[3] = 'F'; header.width = cx; header.height = cy; header.bytes_follow = enc_done->comp_bytes - (2 + pheader_bytes[0]); if (ii == 0) { ii = g_file_open_rw("/tmp/jpeg.beef.bin"); if (ii == -1) { ii = 0; } } if (ii != 0) { g_file_write(ii, (char *)&header, sizeof(header)); g_file_write(ii, enc_done->comp_pad_data + enc_done->pad_bytes + 2 + pheader_bytes[0], enc_done->comp_bytes - (2 + pheader_bytes[0])); jj++; LOG(LOG_LEVEL_INFO, "dumping jpeg index %d", jj); } return 0; } #endif /*****************************************************************************/ int xrdp_mm_check_chan(struct xrdp_mm *self) { LOG(LOG_LEVEL_TRACE, "xrdp_mm_check_chan:"); if ((self->chan_trans != 0) && self->chan_trans->status == TRANS_STATUS_UP) { if (trans_check_wait_objs(self->chan_trans) != 0) { /* This is safe to do here, as we're not in a chansrv * transport callback */ trans_delete(self->chan_trans); self->chan_trans = 0; } } return 0; } /*****************************************************************************/ static int xrdp_mm_process_enc_done(struct xrdp_mm *self) { XRDP_ENC_DATA *enc; XRDP_ENC_DATA_DONE *enc_done; int x; int y; int cx; int cy; int is_gfx; int got_frame_id; int client_ack; LOG(LOG_LEVEL_TRACE, "xrdp_mm_process_enc_done:"); while (1) { tc_mutex_lock(self->encoder->mutex); enc_done = (XRDP_ENC_DATA_DONE *) fifo_remove_item(self->encoder->fifo_processed); tc_mutex_unlock(self->encoder->mutex); if (enc_done == NULL) { break; } is_gfx = ENC_IS_BIT_SET(enc_done->flags, ENC_DONE_FLAGS_GFX_BIT); if (is_gfx) { got_frame_id = ENC_IS_BIT_SET(enc_done->flags, ENC_DONE_FLAGS_FRAME_ID_BIT); client_ack = self->encoder->gfx_ack_off == 0; } else { got_frame_id = 1; client_ack = self->wm->client_info->use_frame_acks; } LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_process_enc_done: message back " "bytes %d", enc_done->comp_bytes); if (enc_done->comp_bytes > 0) { if (is_gfx) { xrdp_egfx_send_data(self->egfx, enc_done->comp_pad_data + enc_done->pad_bytes, enc_done->comp_bytes); } else { x = enc_done->x; y = enc_done->y; cx = enc_done->cx; cy = enc_done->cy; if (client_ack && !enc_done->continuation) { libxrdp_fastpath_send_frame_marker(self->wm->session, 0, enc_done->frame_id); } libxrdp_fastpath_send_surface(self->wm->session, enc_done->comp_pad_data, enc_done->pad_bytes, enc_done->comp_bytes, x, y, x + cx, y + cy, 32, self->encoder->codec_id, cx, cy); if (client_ack && enc_done->last) { libxrdp_fastpath_send_frame_marker(self->wm->session, 1, enc_done->frame_id); } } } /* free enc_done */ if (enc_done->last) { enc = enc_done->enc; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_process_enc_done: last set"); if (got_frame_id) { if (client_ack) { self->encoder->frame_id_server = enc_done->frame_id; xrdp_mm_update_module_frame_ack(self); } else { self->mod->mod_frame_ack(self->mod, 0, enc_done->frame_id); } } if (is_gfx) { g_free(enc->u.gfx.cmd); } else { g_free(enc->u.sc.drects); g_free(enc->u.sc.crects); } if (enc->shmem_ptr != NULL) { g_munmap(enc->shmem_ptr, enc->shmem_bytes); } g_free(enc); } g_free(enc_done->comp_pad_data); g_free(enc_done); } return 0; } /*****************************************************************************/ void xrdp_mm_efgx_add_dirty_region_to_planar_list(struct xrdp_mm *self, struct xrdp_region *dirty_region) { int jndex = 0; struct xrdp_rect rect; int error = xrdp_region_get_rect(dirty_region, jndex, &rect); if (error == 0) { if (self->wm->screen_dirty_region == NULL) { self->wm->screen_dirty_region = xrdp_region_create(self->wm); } do { xrdp_region_add_rect(self->wm->screen_dirty_region, &rect); jndex++; error = xrdp_region_get_rect(dirty_region, jndex, &rect); } while (error == 0); if (self->mod_handle != 0) { // Module has been writing to WM screen using GFX self->mod_uses_wm_screen_for_gfx = 1; } } } /*****************************************************************************/ static int xrdp_mm_draw_dirty(struct xrdp_mm *self) { struct xrdp_rect rect; struct xrdp_rect mon_rect; struct xrdp_region *mon_reg; int error; int index; int jndex; int count; int surface_id; struct monitor_info *mi; int rv = 0; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_draw_dirty:"); count = self->wm->client_info->display_sizes.monitorCount; if (count < 1) { error = xrdp_region_get_bounds(self->wm->screen_dirty_region, &rect); if (error == 0) { rv = xrdp_mm_egfx_send_planar_bitmap(self, self->wm->screen, &rect, self->egfx->surface_id, 0, 0); } } else { for (index = 0; index < count; index++) { /* make a copy of screen_dirty_region */ mon_reg = xrdp_region_create(self->wm); if (mon_reg == NULL) { return 1; } jndex = 0; while (xrdp_region_get_rect(self->wm->screen_dirty_region, jndex, &mon_rect) == 0) { LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_mm_draw_dirty: jndex %d " "mon_rect %d %d %d %d", jndex, mon_rect.left, mon_rect.top, mon_rect.right, mon_rect.bottom); xrdp_region_add_rect(mon_reg, &mon_rect); jndex++; } /* intercect monitor */ mi = self->wm->client_info->display_sizes.minfo_wm + index; mon_rect.left = mi->left; mon_rect.top = mi->top; mon_rect.right = mi->right + 1; mon_rect.bottom = mi->bottom + 1; xrdp_region_intersect_rect(mon_reg, &mon_rect); if (xrdp_region_not_empty(mon_reg)) { error = xrdp_region_get_bounds(mon_reg, &rect); if (error == 0) { surface_id = index; rv = xrdp_mm_egfx_send_planar_bitmap(self, self->wm->screen, &rect, surface_id, mi->left, mi->top); } } xrdp_region_delete(mon_reg); } } return rv; } /*****************************************************************************/ int xrdp_mm_check_wait_objs(struct xrdp_mm *self) { int rv; if (self == 0) { return 0; } rv = 0; if (self->sesman_trans != NULL && !self->delete_sesman_trans && self->sesman_trans->status == TRANS_STATUS_UP) { if (trans_check_wait_objs(self->sesman_trans) != 0) { if (self->mmcs_expecting_msg) { /* The sesman transport has failed with an * outstanding message */ xrdp_wm_log_msg(self->wm, LOG_LEVEL_ERROR, "Unexpected sesman failure - check sesman log"); xrdp_wm_mod_connect_done(self->wm, 1); } self->delete_sesman_trans = 1; if (self->wm->hide_log_window) { /* if hide_log_window, this is fatal */ rv = 1; } } } if (self->delete_sesman_trans) { trans_delete(self->sesman_trans); self->sesman_trans = NULL; } if (self->chan_trans != NULL && self->chan_trans->status == TRANS_STATUS_UP) { if (trans_check_wait_objs(self->chan_trans) != 0) { /* This is safe to do here, as we're not in a chansrv * transport callback */ trans_delete(self->chan_trans); self->chan_trans = NULL; } } if (self->mod != NULL) { if (self->mod->mod_check_wait_objs != NULL) { rv = self->mod->mod_check_wait_objs(self->mod); } } if (g_is_wait_obj_set(self->resize_ready)) { g_reset_wait_obj(self->resize_ready); dynamic_monitor_process_queue(self); } if (self->encoder != NULL) { if (g_is_wait_obj_set(self->encoder->xrdp_encoder_event_processed)) { g_reset_wait_obj(self->encoder->xrdp_encoder_event_processed); xrdp_mm_process_enc_done(self); } } if (self->wm->screen_dirty_region != NULL) { if (xrdp_region_not_empty(self->wm->screen_dirty_region)) { int now = g_time3(); int diff = now - self->wm->last_screen_draw_time; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mm_check_wait_objs: not empty diff %d", diff); if ((diff < 0) || (diff >= 40)) { if (self->egfx_up) { rv = xrdp_mm_draw_dirty(self); xrdp_region_delete(self->wm->screen_dirty_region); self->wm->screen_dirty_region = NULL; self->wm->last_screen_draw_time = now; } else { LOG(LOG_LEVEL_TRACE, "xrdp_mm_check_wait_objs: egfx is not up"); } } } } return rv; } /*****************************************************************************/ /* frame ack from client */ int xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id) { struct xrdp_encoder *encoder; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_frame_ack:"); if (self->wm->client_info->use_frame_acks == 0) { return 1; } encoder = self->encoder; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mm_frame_ack: " "incoming %d, client %d, server %d", frame_id, encoder->frame_id_client, encoder->frame_id_server); if ((frame_id < 0) || (frame_id > encoder->frame_id_server)) { /* if frame_id is negative or bigger then what server last sent just ack all sent frames */ /* some clients can send big number just to clear all pending frames */ encoder->frame_id_client = encoder->frame_id_server; } else { /* frame acks can come out of order so ignore older one */ encoder->frame_id_client = MAX(frame_id, encoder->frame_id_client); } xrdp_mm_update_module_frame_ack(self); return 0; } #if 0 /*****************************************************************************/ struct xrdp_painter * get_painter(struct xrdp_mod *mod) { struct xrdp_wm *wm; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { wm = (struct xrdp_wm *)(mod->wm); p = xrdp_painter_create(wm, wm->session); mod->painter = (tintptr)p; } return p; } #endif /*****************************************************************************/ int server_begin_update(struct xrdp_mod *mod) { struct xrdp_wm *wm; struct xrdp_painter *p; wm = (struct xrdp_wm *)(mod->wm); p = xrdp_painter_create(wm, wm->session); xrdp_painter_begin_update(p); mod->painter = (long)p; return 0; } /*****************************************************************************/ int server_end_update(struct xrdp_mod *mod) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } xrdp_painter_end_update(p); xrdp_painter_delete(p); mod->painter = 0; return 0; } /*****************************************************************************/ /* got bell signal... try to send to client */ int server_bell_trigger(struct xrdp_mod *mod) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); xrdp_wm_send_bell(wm); return 0; } /*****************************************************************************/ /* Chansrv in use on this configuration? */ int server_chansrv_in_use(struct xrdp_mod *mod) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return wm->mm->use_chansrv; } /*****************************************************************************/ int server_fill_rect(struct xrdp_mod *mod, int x, int y, int cx, int cy) { struct xrdp_wm *wm; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); xrdp_painter_fill_rect(p, wm->target_surface, x, y, cx, cy); return 0; } /*****************************************************************************/ int server_screen_blt(struct xrdp_mod *mod, int x, int y, int cx, int cy, int srcx, int srcy) { struct xrdp_wm *wm; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); p->rop = 0xcc; xrdp_painter_copy(p, wm->screen, wm->target_surface, x, y, cx, cy, srcx, srcy); return 0; } /*****************************************************************************/ int server_paint_rect(struct xrdp_mod *mod, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy) { struct xrdp_wm *wm; struct xrdp_bitmap *b; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); b = xrdp_bitmap_create_with_data(width, height, wm->screen->bpp, data, wm); xrdp_painter_copy(p, b, wm->target_surface, x, y, cx, cy, srcx, srcy); xrdp_bitmap_delete(b); return 0; } /*****************************************************************************/ int server_paint_rect_bpp(struct xrdp_mod *mod, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy, int bpp) { struct xrdp_wm *wm; struct xrdp_bitmap *b; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); b = xrdp_bitmap_create_with_data(width, height, bpp, data, wm); xrdp_painter_copy(p, b, wm->target_surface, x, y, cx, cy, srcx, srcy); xrdp_bitmap_delete(b); return 0; } /*****************************************************************************/ int server_composite(struct xrdp_mod *mod, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat) { struct xrdp_wm *wm; struct xrdp_bitmap *b; struct xrdp_bitmap *msk; struct xrdp_painter *p; struct xrdp_os_bitmap_item *bi; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); b = 0; msk = 0; bi = xrdp_cache_get_os_bitmap(wm->cache, srcidx); if (bi != 0) { b = bi->bitmap; } if (mskflags & 1) { bi = xrdp_cache_get_os_bitmap(wm->cache, mskidx); if (bi != 0) { msk = bi->bitmap; } } if (b != 0) { xrdp_painter_composite(p, b, srcformat, srcwidth, srcrepeat, wm->target_surface, srctransform, mskflags, msk, mskformat, mskwidth, mskrepeat, op, srcx, srcy, mskx, msky, dstx, dsty, width, height, dstformat); } else { LOG(LOG_LEVEL_WARNING, "server_composite: error finding id %d or %d", srcidx, mskidx); } return 0; } /*****************************************************************************/ int server_paint_rects(struct xrdp_mod *mod, int num_drects, short *drects, int num_crects, short *crects, char *data, int width, int height, int flags, int frame_id) { return server_paint_rects_ex(mod, num_drects, drects, num_crects, crects, data, 0, 0, width, height, flags, frame_id, NULL, 0); } /*****************************************************************************/ int server_paint_rects_ex(struct xrdp_mod *mod, int num_drects, short *drects, int num_crects, short *crects, char *data, int left, int top, int width, int height, int flags, int frame_id, void *shmem_ptr, int shmem_bytes) { struct xrdp_wm *wm; struct xrdp_mm *mm; struct xrdp_painter *p; struct xrdp_bitmap *b; short *s; int index; XRDP_ENC_DATA *enc_data; wm = (struct xrdp_wm *)(mod->wm); mm = wm->mm; LOG(LOG_LEVEL_TRACE, "server_paint_rects_ex: %p", mm->encoder); if (mm->encoder != 0) { /* copy formal params to XRDP_ENC_DATA */ enc_data = (XRDP_ENC_DATA *) g_malloc(sizeof(XRDP_ENC_DATA), 1); if (enc_data == 0) { if (shmem_ptr != NULL) { g_munmap(shmem_ptr, shmem_bytes); } return 1; } enc_data->u.sc.drects = (short *) g_malloc(sizeof(short) * num_drects * 4, 0); if (enc_data->u.sc.drects == 0) { if (shmem_ptr != NULL) { g_munmap(shmem_ptr, shmem_bytes); } g_free(enc_data); return 1; } enc_data->u.sc.crects = (short *) g_malloc(sizeof(short) * num_crects * 4, 0); if (enc_data->u.sc.crects == 0) { if (shmem_ptr != NULL) { g_munmap(shmem_ptr, shmem_bytes); } g_free(enc_data->u.sc.drects); g_free(enc_data); return 1; } g_memcpy(enc_data->u.sc.drects, drects, sizeof(short) * num_drects * 4); g_memcpy(enc_data->u.sc.crects, crects, sizeof(short) * num_crects * 4); enc_data->mod = mod; enc_data->u.sc.num_drects = num_drects; enc_data->u.sc.num_crects = num_crects; enc_data->u.sc.data = data; enc_data->u.sc.left = left; enc_data->u.sc.top = top; enc_data->u.sc.width = width; enc_data->u.sc.height = height; enc_data->u.sc.flags = flags; enc_data->u.sc.frame_id = frame_id; enc_data->shmem_ptr = shmem_ptr; enc_data->shmem_bytes = shmem_bytes; if (width == 0 || height == 0) { LOG_DEVEL(LOG_LEVEL_WARNING, "server_paint_rects: error"); } /* insert into fifo for encoder thread to process */ tc_mutex_lock(mm->encoder->mutex); fifo_add_item(mm->encoder->fifo_to_proc, (void *) enc_data); tc_mutex_unlock(mm->encoder->mutex); /* signal xrdp_encoder thread */ g_set_wait_obj(mm->encoder->xrdp_encoder_event_to_proc); return 0; } if (wm->client_info->gfx) { LOG(LOG_LEVEL_DEBUG, "server_paint_rects: gfx session and no encoder"); mm->mod->mod_frame_ack(mm->mod, flags, frame_id); return 0; } p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } b = xrdp_bitmap_create_with_data(width, height, wm->screen->bpp, data, wm); s = crects; for (index = 0; index < num_crects; index++) { xrdp_painter_copy(p, b, wm->target_surface, s[0], s[1], s[2], s[3], s[0], s[1]); s += 4; } xrdp_bitmap_delete(b); mm->mod->mod_frame_ack(mm->mod, flags, frame_id); if (shmem_ptr != NULL) { g_munmap(shmem_ptr, shmem_bytes); } return 0; } /*****************************************************************************/ int server_session_info(struct xrdp_mod *mod, const char *data, int data_bytes) { struct xrdp_wm *wm; LOG_DEVEL(LOG_LEVEL_DEBUG, "server_session_info:"); wm = (struct xrdp_wm *)(mod->wm); return libxrdp_send_session_info(wm->session, data, data_bytes); } /*****************************************************************************/ int server_egfx_cmd(struct xrdp_mod *mod, char *cmd, int cmd_bytes, char *data, int data_bytes) { XRDP_ENC_DATA *enc; struct xrdp_wm *wm; struct xrdp_mm *mm; wm = (struct xrdp_wm *)(mod->wm); mm = wm->mm; if (mm->encoder == NULL) { // This can happen when we are in the resize state machine, if // there are messages queued up by the X server if (data != NULL) { g_munmap(data, data_bytes); } return 0; } enc = g_new0(struct xrdp_enc_data, 1); if (enc == NULL) { if (data != NULL) { g_munmap(data, data_bytes); } return 1; } ENC_SET_BIT(enc->flags, ENC_FLAGS_GFX_BIT); enc->u.gfx.cmd = g_new(char, cmd_bytes); if (enc->u.gfx.cmd == NULL) { if (data != NULL) { g_munmap(data, data_bytes); } g_free(enc); return 1; } g_memcpy(enc->u.gfx.cmd, cmd, cmd_bytes); enc->u.gfx.cmd_bytes = cmd_bytes; enc->u.gfx.data = data; enc->u.gfx.data_bytes = data_bytes; enc->shmem_ptr = data; enc->shmem_bytes = data_bytes; /* insert into fifo for encoder thread to process */ tc_mutex_lock(mm->encoder->mutex); fifo_add_item(mm->encoder->fifo_to_proc, enc); tc_mutex_unlock(mm->encoder->mutex); /* signal xrdp_encoder thread */ g_set_wait_obj(mm->encoder->xrdp_encoder_event_to_proc); return 0; } /*****************************************************************************/ int server_set_pointer(struct xrdp_mod *mod, int x, int y, char *data, char *mask) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); xrdp_wm_pointer(wm, data, mask, x, y, 0, 32, 32); return 0; } /*****************************************************************************/ int server_set_pointer_ex(struct xrdp_mod *mod, int x, int y, char *data, char *mask, int bpp) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); xrdp_wm_pointer(wm, data, mask, x, y, bpp, 32, 32); return 0; } /*****************************************************************************/ int server_set_pointer_large(struct xrdp_mod *mod, int x, int y, char *data, char *mask, int bpp, int width, int height) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); xrdp_wm_pointer(wm, data, mask, x, y, bpp, width, height); return 0; } /*****************************************************************************/ int server_palette(struct xrdp_mod *mod, int *palette) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (g_memcmp(wm->palette, palette, 255 * sizeof(int)) != 0) { g_memcpy(wm->palette, palette, 256 * sizeof(int)); xrdp_wm_send_palette(wm); } return 0; } /*****************************************************************************/ int server_msg(struct xrdp_mod *mod, const char *msg, int code) { struct xrdp_wm *wm; if (code == 1) { LOG(LOG_LEVEL_INFO, "%s", msg); return 0; } wm = (struct xrdp_wm *)(mod->wm); return xrdp_wm_log_msg(wm, LOG_LEVEL_DEBUG, "%s", msg); } /*****************************************************************************/ int server_set_clip(struct xrdp_mod *mod, int x, int y, int cx, int cy) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } return xrdp_painter_set_clip(p, x, y, cx, cy); } /*****************************************************************************/ int server_reset_clip(struct xrdp_mod *mod) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } return xrdp_painter_clr_clip(p); } /*****************************************************************************/ int server_set_fgcolor(struct xrdp_mod *mod, int fgcolor) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } p->fg_color = fgcolor; p->pen.color = p->fg_color; return 0; } /*****************************************************************************/ int server_set_bgcolor(struct xrdp_mod *mod, int bgcolor) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } p->bg_color = bgcolor; return 0; } /*****************************************************************************/ int server_set_opcode(struct xrdp_mod *mod, int opcode) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } p->rop = opcode; return 0; } /*****************************************************************************/ int server_set_mixmode(struct xrdp_mod *mod, int mixmode) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } p->mix_mode = mixmode; return 0; } /*****************************************************************************/ int server_set_brush(struct xrdp_mod *mod, int x_origin, int y_origin, int style, char *pattern) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } p->brush.x_origin = x_origin; p->brush.y_origin = y_origin; p->brush.style = style; g_memcpy(p->brush.pattern, pattern, 8); return 0; } /*****************************************************************************/ int server_set_pen(struct xrdp_mod *mod, int style, int width) { struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } p->pen.style = style; p->pen.width = width; return 0; } /*****************************************************************************/ int server_draw_line(struct xrdp_mod *mod, int x1, int y1, int x2, int y2) { struct xrdp_wm *wm; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); return xrdp_painter_line(p, wm->target_surface, x1, y1, x2, y2); } /*****************************************************************************/ int server_add_char(struct xrdp_mod *mod, int font, int character, int offset, int baseline, int width, int height, char *data) { struct xrdp_font_char fi; fi.offset = offset; fi.baseline = baseline; fi.width = width; fi.height = height; fi.incby = 0; fi.data = data; fi.bpp = 1; return libxrdp_orders_send_font(((struct xrdp_wm *)mod->wm)->session, &fi, font, character); } /*****************************************************************************/ int server_draw_text(struct xrdp_mod *mod, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len) { struct xrdp_wm *wm; struct xrdp_painter *p; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); return xrdp_painter_draw_text2(p, wm->target_surface, font, flags, mixmode, clip_left, clip_top, clip_right, clip_bottom, box_left, box_top, box_right, box_bottom, x, y, data, data_len); } /*****************************************************************************/ int client_monitor_resize(struct xrdp_mod *mod, int width, int height, int num_monitors, const struct monitor_info *monitors) { int error = 0; struct xrdp_wm *wm; struct display_size_description *display_size_data; LOG_DEVEL(LOG_LEVEL_TRACE, "client_monitor_resize:"); wm = (struct xrdp_wm *)(mod->wm); if (wm == 0 || wm->mm == 0 || wm->client_info == 0) { return 1; } if (wm->client_info->client_resize_mode == CRMODE_NONE) { LOG(LOG_LEVEL_WARNING, "Server is not allowed to resize this client"); return 1; } if (wm->client_info->client_resize_mode == CRMODE_SINGLE_SCREEN && num_monitors > 1) { LOG(LOG_LEVEL_WARNING, "Server cannot resize this client with multiple monitors"); return 1; } display_size_data = g_new0(struct display_size_description, 1); if (display_size_data == NULL) { LOG(LOG_LEVEL_ERROR, "client_monitor_resize: Out of memory"); return 1; } error = libxrdp_init_display_size_description(num_monitors, monitors, display_size_data); if (error) { LOG(LOG_LEVEL_ERROR, "client_monitor_resize:" " libxrdp_init_display_size_description" " failed with error %d.", error); free(display_size_data); return error; } list_add_item(wm->mm->resize_queue, (tintptr)display_size_data); g_set_wait_obj(wm->mm->resize_ready); return 0; } /*****************************************************************************/ /* Note : if this is called on a multimon setup, the client is resized * to a single monitor */ int server_monitor_resize_done(struct xrdp_mod *mod) { struct xrdp_wm *wm; struct xrdp_mm *mm; LOG(LOG_LEVEL_TRACE, "server_monitor_resize_done:"); wm = (struct xrdp_wm *)(mod->wm); if (wm == 0) { return 1; } mm = wm->mm; if (mm == 0) { return 1; } if (wm->client_info == 0) { return 1; } if (mm->resize_data != NULL && mm->resize_data->state == WMRZ_SERVER_MONITOR_MESSAGE_PROCESSING) { LOG(LOG_LEVEL_INFO, "server_monitor_resize_done: Advancing server monitor resized."); advance_resize_state_machine( mm, WMRZ_SERVER_MONITOR_MESSAGE_PROCESSED); } return 0; } /*****************************************************************************/ /*return -1 if channels are controlled by chansrv */ int server_get_channel_count(struct xrdp_mod *mod) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (wm->mm->use_chansrv) { return -1; } return libxrdp_get_channel_count(wm->session); } /*****************************************************************************/ /*return 0 if the index is not found*/ int server_query_channel(struct xrdp_mod *mod, int index, char *channel_name, int *channel_flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (wm->mm->use_chansrv) { return 1; } return libxrdp_query_channel(wm->session, index, channel_name, channel_flags); } /*****************************************************************************/ /* returns -1 on error */ int server_get_channel_id(struct xrdp_mod *mod, const char *name) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (wm->mm->use_chansrv) { return -1; } return libxrdp_get_channel_id(wm->session, name); } /*****************************************************************************/ int server_send_to_channel(struct xrdp_mod *mod, int channel_id, char *data, int data_len, int total_data_len, int flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (wm->mm->use_chansrv) { /* Modules should not be calling this if chansrv is running - * they can use server_chansrv_in_use() to avoid doing this */ LOG_DEVEL(LOG_LEVEL_ERROR, "Bad call of server_send_to_channel() detected"); return 1; } return libxrdp_send_to_channel(wm->session, channel_id, data, data_len, total_data_len, flags); } /*****************************************************************************/ int server_create_os_surface(struct xrdp_mod *mod, int rdpindex, int width, int height) { struct xrdp_wm *wm; struct xrdp_bitmap *bitmap; int error; wm = (struct xrdp_wm *)(mod->wm); bitmap = xrdp_bitmap_create(width, height, wm->screen->bpp, WND_TYPE_OFFSCREEN, wm); error = xrdp_cache_add_os_bitmap(wm->cache, bitmap, rdpindex); if (error != 0) { LOG(LOG_LEVEL_ERROR, "server_create_os_surface: xrdp_cache_add_os_bitmap failed"); return 1; } bitmap->item_index = rdpindex; bitmap->id = rdpindex; return 0; } /*****************************************************************************/ int server_create_os_surface_bpp(struct xrdp_mod *mod, int rdpindex, int width, int height, int bpp) { struct xrdp_wm *wm; struct xrdp_bitmap *bitmap; int error; wm = (struct xrdp_wm *)(mod->wm); bitmap = xrdp_bitmap_create(width, height, bpp, WND_TYPE_OFFSCREEN, wm); error = xrdp_cache_add_os_bitmap(wm->cache, bitmap, rdpindex); if (error != 0) { LOG(LOG_LEVEL_ERROR, "server_create_os_surface_bpp: xrdp_cache_add_os_bitmap failed"); return 1; } bitmap->item_index = rdpindex; bitmap->id = rdpindex; return 0; } /*****************************************************************************/ int server_switch_os_surface(struct xrdp_mod *mod, int rdpindex) { struct xrdp_wm *wm; struct xrdp_os_bitmap_item *bi; struct xrdp_painter *p; LOG(LOG_LEVEL_DEBUG, "server_switch_os_surface: id 0x%x", rdpindex); wm = (struct xrdp_wm *)(mod->wm); if (rdpindex == -1) { LOG(LOG_LEVEL_DEBUG, "server_switch_os_surface: setting target_surface to screen"); wm->target_surface = wm->screen; p = (struct xrdp_painter *)(mod->painter); if (p != 0) { LOG(LOG_LEVEL_DEBUG, "setting target"); wm_painter_set_target(p); } return 0; } bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex); if ((bi != 0) && (bi->bitmap != 0)) { LOG(LOG_LEVEL_DEBUG, "server_switch_os_surface: setting target_surface to rdpid %d", rdpindex); wm->target_surface = bi->bitmap; p = (struct xrdp_painter *)(mod->painter); if (p != 0) { LOG(LOG_LEVEL_DEBUG, "setting target"); wm_painter_set_target(p); } } else { LOG(LOG_LEVEL_WARNING, "server_switch_os_surface: error finding id %d", rdpindex); } return 0; } /*****************************************************************************/ int server_delete_os_surface(struct xrdp_mod *mod, int rdpindex) { struct xrdp_wm *wm; struct xrdp_painter *p; LOG(LOG_LEVEL_DEBUG, "server_delete_os_surface: id 0x%x", rdpindex); wm = (struct xrdp_wm *)(mod->wm); if (wm->target_surface->type == WND_TYPE_OFFSCREEN) { if (wm->target_surface->id == rdpindex) { LOG(LOG_LEVEL_DEBUG, "server_delete_os_surface: setting target_surface to screen"); wm->target_surface = wm->screen; p = (struct xrdp_painter *)(mod->painter); if (p != 0) { LOG(LOG_LEVEL_DEBUG, "setting target"); wm_painter_set_target(p); } } } xrdp_cache_remove_os_bitmap(wm->cache, rdpindex); return 0; } /*****************************************************************************/ int server_paint_rect_os(struct xrdp_mod *mod, int x, int y, int cx, int cy, int rdpindex, int srcx, int srcy) { struct xrdp_wm *wm; struct xrdp_bitmap *b; struct xrdp_painter *p; struct xrdp_os_bitmap_item *bi; p = (struct xrdp_painter *)(mod->painter); if (p == 0) { return 0; } wm = (struct xrdp_wm *)(mod->wm); bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex); if (bi != 0) { b = bi->bitmap; xrdp_painter_copy(p, b, wm->target_surface, x, y, cx, cy, srcx, srcy); } else { LOG(LOG_LEVEL_ERROR, "server_paint_rect_os: error finding id %d", rdpindex); } return 0; } /*****************************************************************************/ int server_set_hints(struct xrdp_mod *mod, int hints, int mask) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); if (mask & 1) { if (hints & 1) { wm->hints |= 1; } else { wm->hints &= ~1; } } return 0; } /*****************************************************************************/ int server_window_new_update(struct xrdp_mod *mod, int window_id, struct rail_window_state_order *window_state, int flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_window_new_update(wm->session, window_id, window_state, flags); } /*****************************************************************************/ int server_window_delete(struct xrdp_mod *mod, int window_id) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_window_delete(wm->session, window_id); } /*****************************************************************************/ int server_window_icon(struct xrdp_mod *mod, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_window_icon(wm->session, window_id, cache_entry, cache_id, icon_info, flags); } /*****************************************************************************/ int server_window_cached_icon(struct xrdp_mod *mod, int window_id, int cache_entry, int cache_id, int flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_window_cached_icon(wm->session, window_id, cache_entry, cache_id, flags); } /*****************************************************************************/ int server_notify_new_update(struct xrdp_mod *mod, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_notify_new_update(wm->session, window_id, notify_id, notify_state, flags); } /*****************************************************************************/ int server_notify_delete(struct xrdp_mod *mod, int window_id, int notify_id) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_notify_delete(wm->session, window_id, notify_id); } /*****************************************************************************/ int server_monitored_desktop(struct xrdp_mod *mod, struct rail_monitored_desktop_order *mdo, int flags) { struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); return libxrdp_monitored_desktop(wm->session, mdo, flags); } /*****************************************************************************/ int server_add_char_alpha(struct xrdp_mod *mod, int font, int character, int offset, int baseline, int width, int height, char *data) { struct xrdp_font_char fi; fi.offset = offset; fi.baseline = baseline; fi.width = width; fi.height = height; fi.incby = 0; fi.data = data; fi.bpp = 8; return libxrdp_orders_send_font(((struct xrdp_wm *)mod->wm)->session, &fi, font, character); } xrdp-0.10.1/xrdp/czech.txt000644 001751 000000 00000003103 14652432047 015444 0ustar00metawheel000000 000000 no shift 003b 002b 011b 0161 010d 0159 017e 00fd 00e1 00ed 0039 003d 00b4 ; + ě š č ř ž ý á í é = ´ 0071 0071 0065 0072 0074 007a 0075 0069 006f 0070 00fa 0029 00a8 q w e r t z u i o p ú ) ¨ 0061 0073 0064 0066 0067 0068 006a 006b 006c 016f 00a7 a s d f g h j k l ů § 0079 0078 0063 0076 0062 006e 006d 002c 002e 002d y x c v b n m , . - shift 00b0 0031 0032 0033 0034 0035 0036 0037 0038 0039 0030 0025 02c7 ° 1 2 3 4 5 6 7 8 9 0 % ˇ 0051 0057 0045 0052 0054 005a 0055 0049 004f 0050 002f 0028 0027 Q W E R T Z U I O P / ( ' 0041 0053 0044 0046 0047 0048 004a 004b 004c 0022 0021 A S D F G H J K L " ! 0059 0058 0043 0056 0042 004e 004d 003f 003a 005f Y X C V B N M ? : _ altgr 007e 02c7 005e 02d8 00b0 02db 0060 00b7 00b4 02dd 00a8 00b8 ~ ˇ ^ ˘ ° ˛ ` · ´ ˝ ¨ ¸ 005c 007c 20ac 00f7 00d7 00a4 \ | € ÷ × ¤ 0111 0110 005b 005d 0142 0141 0024 00df đ Đ [ ] ł Ł $ ß 0023 0026 0040 007b 007d 003c 003e 002a # & @ { } < > * xrdp-0.10.1/xrdp/xrdp.h000644 001751 000000 00000054172 14652432047 014751 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * main include file */ #ifndef _XRDP_XRDP_H_ #define _XRDP_XRDP_H_ /* include other h files */ #include "arch.h" #include "parse.h" #include "trans.h" #include "list.h" #include "list16.h" #include "libxrdpinc.h" #include "xrdp_constants.h" #include "xrdp_types.h" #include "defines.h" #include "os_calls.h" #include "ssl_calls.h" #include "thread_calls.h" #include "file.h" #include "xrdp_client_info.h" #include "log.h" /* xrdp.c */ long g_xrdp_sync(long (*sync_func)(long param1, long param2), long sync_param1, long sync_param2); int xrdp_child_fork(void); long g_get_sync_mutex(void); void g_set_sync_mutex(long mutex); long g_get_sync1_mutex(void); void g_set_sync1_mutex(long mutex); void g_set_term_event(tbus event); void g_set_sigchld_event(tbus event); void g_set_sync_event(tbus event); long g_get_threadid(void); void g_set_threadid(long id); tbus g_get_term(void); tbus g_get_sigchld(void); int g_is_term(void); void g_set_term(int in_val); void g_set_sigchld(int in_val); tbus g_get_sync_event(void); void g_process_waiting_function(void); /* xrdp_cache.c */ struct xrdp_cache * xrdp_cache_create(struct xrdp_wm *owner, struct xrdp_session *session, struct xrdp_client_info *client_info); void xrdp_cache_delete(struct xrdp_cache *self); int xrdp_cache_reset(struct xrdp_cache *self, struct xrdp_client_info *client_info); int xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, int hints); int xrdp_cache_add_palette(struct xrdp_cache *self, int *palette); int xrdp_cache_add_char(struct xrdp_cache *self, struct xrdp_font_char *font_item); int xrdp_cache_add_pointer(struct xrdp_cache *self, struct xrdp_pointer_item *pointer_item); int xrdp_cache_add_pointer_static(struct xrdp_cache *self, struct xrdp_pointer_item *pointer_item, int index); int xrdp_cache_add_brush(struct xrdp_cache *self, char *brush_item_data); int xrdp_cache_add_os_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, int rdpindex); int xrdp_cache_remove_os_bitmap(struct xrdp_cache *self, int rdpindex); struct xrdp_os_bitmap_item * xrdp_cache_get_os_bitmap(struct xrdp_cache *self, int rdpindex); /* xrdp_wm.c */ struct xrdp_wm * xrdp_wm_create(struct xrdp_process *owner, struct xrdp_client_info *client_info); void xrdp_wm_delete(struct xrdp_wm *self); int xrdp_wm_send_palette(struct xrdp_wm *self); int xrdp_wm_send_bell(struct xrdp_wm *self); int xrdp_wm_load_static_colors_plus(struct xrdp_wm *self, char *autorun_name); int xrdp_wm_load_static_pointers(struct xrdp_wm *self); int xrdp_wm_init(struct xrdp_wm *self); int xrdp_wm_send_bitmap(struct xrdp_wm *self, struct xrdp_bitmap *bitmap, int x, int y, int cx, int cy); int xrdp_wm_set_pointer(struct xrdp_wm *self, int cache_idx); unsigned int xrdp_wm_htoi (const char *ptr); int xrdp_wm_set_focused(struct xrdp_wm *self, struct xrdp_bitmap *wnd); int xrdp_wm_get_vis_region(struct xrdp_wm *self, struct xrdp_bitmap *bitmap, int x, int y, int cx, int cy, struct xrdp_region *region, int clip_children); int xrdp_wm_mouse_move(struct xrdp_wm *self, int x, int y); int xrdp_wm_mouse_touch(struct xrdp_wm *self, int gesture, int param); int xrdp_wm_mouse_click(struct xrdp_wm *self, int x, int y, int but, int down); int xrdp_wm_key(struct xrdp_wm *self, int device_flags, int scan_code); int xrdp_wm_key_sync(struct xrdp_wm *self, int device_flags, int key_flags); int xrdp_wm_pu(struct xrdp_wm *self, struct xrdp_bitmap *control); int xrdp_wm_send_pointer(struct xrdp_wm *self, int cache_idx, char *data, char *mask, int x, int y, int bpp, int width, int height); int xrdp_wm_pointer(struct xrdp_wm *self, char *data, char *mask, int x, int y, int bpp, int width, int height); int callback(intptr_t id, int msg, intptr_t param1, intptr_t param2, intptr_t param3, intptr_t param4); int xrdp_wm_delete_all_children(struct xrdp_wm *self); int xrdp_wm_show_log(struct xrdp_wm *self); int xrdp_wm_log_msg(struct xrdp_wm *self, enum logLevels loglevel, const char *fmt, ...) printflike(3, 4); int xrdp_wm_get_wait_objs(struct xrdp_wm *self, tbus *robjs, int *rc, tbus *wobjs, int *wc, int *timeout); int xrdp_wm_check_wait_objs(struct xrdp_wm *self); const char * xrdp_wm_login_state_to_str(enum wm_login_state login_state); int xrdp_wm_set_login_state(struct xrdp_wm *self, enum wm_login_state login_state); int xrdp_wm_can_resize(struct xrdp_wm *self); void xrdp_wm_mod_connect_done(struct xrdp_wm *self, int status); /* xrdp_process.c */ struct xrdp_process * xrdp_process_create(struct xrdp_listen *owner, tbus done_event); void xrdp_process_delete(struct xrdp_process *self); int xrdp_process_main_loop(struct xrdp_process *self); /* xrdp_listen.c */ struct xrdp_listen * xrdp_listen_create(void); void xrdp_listen_delete(struct xrdp_listen *self); int xrdp_listen_main_loop(struct xrdp_listen *self); int xrdp_listen_test(struct xrdp_startup_params *startup_params); /* xrdp_region.c */ struct xrdp_region * xrdp_region_create(struct xrdp_wm *wm); void xrdp_region_delete(struct xrdp_region *self); int xrdp_region_add_rect(struct xrdp_region *self, struct xrdp_rect *rect); int xrdp_region_subtract_rect(struct xrdp_region *self, struct xrdp_rect *rect); int xrdp_region_intersect_rect(struct xrdp_region *self, struct xrdp_rect *rect); int xrdp_region_get_rect(struct xrdp_region *self, int index, struct xrdp_rect *rect); int xrdp_region_get_bounds(struct xrdp_region *self, struct xrdp_rect *rect); int xrdp_region_not_empty(struct xrdp_region *self); /* xrdp_bitmap_common.c */ struct xrdp_bitmap * xrdp_bitmap_create(int width, int height, int bpp, int type, struct xrdp_wm *wm); struct xrdp_bitmap * xrdp_bitmap_create_with_data(int width, int height, int bpp, char *data, struct xrdp_wm *wm); void xrdp_bitmap_delete(struct xrdp_bitmap *self); int xrdp_bitmap_resize(struct xrdp_bitmap *self, int width, int height); int xrdp_bitmap_get_pixel(struct xrdp_bitmap *self, int x, int y); int xrdp_bitmap_set_pixel(struct xrdp_bitmap *self, int x, int y, int pixel); int xrdp_bitmap_copy_box(struct xrdp_bitmap *self, struct xrdp_bitmap *dest, int x, int y, int cx, int cy); /* xrdp_bitmap.c */ struct xrdp_bitmap * xrdp_bitmap_get_child_by_id(struct xrdp_bitmap *self, int id); int xrdp_bitmap_set_focus(struct xrdp_bitmap *self, int focused); int xrdp_bitmap_hash_crc(struct xrdp_bitmap *self); int xrdp_bitmap_copy_box_with_crc(struct xrdp_bitmap *self, struct xrdp_bitmap *dest, int x, int y, int cx, int cy); int xrdp_bitmap_compare(struct xrdp_bitmap *self, struct xrdp_bitmap *b); int xrdp_bitmap_invalidate(struct xrdp_bitmap *self, struct xrdp_rect *rect); int xrdp_bitmap_def_proc(struct xrdp_bitmap *self, int msg, int param1, int param2); int xrdp_bitmap_to_screenx(struct xrdp_bitmap *self, int x); int xrdp_bitmap_to_screeny(struct xrdp_bitmap *self, int y); int xrdp_bitmap_from_screenx(struct xrdp_bitmap *self, int x); int xrdp_bitmap_from_screeny(struct xrdp_bitmap *self, int y); int xrdp_bitmap_get_screen_clip(struct xrdp_bitmap *self, struct xrdp_painter *painter, struct xrdp_rect *rect, int *dx, int *dy); /* xrdp_bitmap_load.c */ /** * Loads a bitmap from a file and (optionally) transforms it * * @param self from rdp_bitmap_create() * @param filename Filename to load * @param[in] palette For 8-bit conversions. Currently unused * @param background Background color for alpha-blending * @param transform Transform to apply to the image after loading * @param twidth target width if transform != XBLT_NONE * @param theight target height if transform != XBLT_NONE * @return 0 for success. * * The background color is only used if the specified image contains * an alpha layer. It is in HCOLOR format, and the bpp must correspond to * the bpp used to create 'self'. * * After a successful call, the bitmap is resized to the image file size. * * If the call is not successful, the bitmap will be in an indeterminate * state and should not be used. */ int xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, const int *palette, int background, enum xrdp_bitmap_load_transform transform, int twidth, int theight); /* xrdp_painter.c */ struct xrdp_painter * xrdp_painter_create(struct xrdp_wm *wm, struct xrdp_session *session); void xrdp_painter_delete(struct xrdp_painter *self); int wm_painter_set_target(struct xrdp_painter *self); int xrdp_painter_begin_update(struct xrdp_painter *self); int xrdp_painter_end_update(struct xrdp_painter *self); int xrdp_painter_font_needed(struct xrdp_painter *self); int xrdp_painter_set_clip(struct xrdp_painter *self, int x, int y, int cx, int cy); int xrdp_painter_clr_clip(struct xrdp_painter *self); int xrdp_painter_fill_rect(struct xrdp_painter *self, struct xrdp_bitmap *bitmap, int x, int y, int cx, int cy); int xrdp_painter_draw_bitmap(struct xrdp_painter *self, struct xrdp_bitmap *bitmap, struct xrdp_bitmap *to_draw, int x, int y, int cx, int cy); int xrdp_painter_text_width(struct xrdp_painter *self, const char *text); /* As above, but have a maximum Unicode character count for the string */ int xrdp_painter_text_width_count(struct xrdp_painter *self, const char *text, unsigned int c32_count); /* Size of a string composed of a repeated number of Unicode characters */ int xrdp_painter_repeated_char_width(struct xrdp_painter *self, char32_t c32, unsigned int repeat_count); unsigned int xrdp_painter_font_body_height(const struct xrdp_painter *self); int xrdp_painter_draw_text(struct xrdp_painter *self, struct xrdp_bitmap *bitmap, int x, int y, const char *text); int xrdp_painter_draw_text2(struct xrdp_painter *self, struct xrdp_bitmap *bitmap, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int xrdp_painter_draw_char(struct xrdp_painter *self, struct xrdp_bitmap *bitmap, int x, int y, char32_t chr, unsigned int repeat_count); int xrdp_painter_copy(struct xrdp_painter *self, struct xrdp_bitmap *src, struct xrdp_bitmap *dst, int x, int y, int cx, int cy, int srcx, int srcy); int xrdp_painter_composite(struct xrdp_painter *self, struct xrdp_bitmap *src, int srcformat, int srcwidth, int srcrepeat, struct xrdp_bitmap *dst, int *srctransform, int mskflags, struct xrdp_bitmap *msk, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat); int xrdp_painter_line(struct xrdp_painter *self, struct xrdp_bitmap *bitmap, int x1, int y1, int x2, int y2); /* xrdp_font.c */ struct xrdp_font * xrdp_font_create(struct xrdp_wm *wm, unsigned int dpi); void xrdp_font_delete(struct xrdp_font *self); int xrdp_font_item_compare(struct xrdp_font_char *font1, struct xrdp_font_char *font2); /** * Gets a checked xrdp_font_char from a font * @param f Font * @param c32 Unicode codepoint */ #define XRDP_FONT_GET_CHAR(f, c32) \ (((unsigned int)(c32) >= ' ') && ((unsigned int)(c32) < (f)->char_count) \ ? ((f)->chars + (unsigned int)(c32)) \ : (f)->default_char) /* funcs.c */ int rect_contains_pt(struct xrdp_rect *in, int x, int y); int rect_intersect(struct xrdp_rect *in1, struct xrdp_rect *in2, struct xrdp_rect *out); int rect_contained_by(struct xrdp_rect *in1, int left, int top, int right, int bottom); int check_bounds(struct xrdp_bitmap *b, int *x, int *y, int *cx, int *cy); int set_string(char **in_str, const char *in); /* in lang.c */ struct xrdp_key_info * get_key_info_from_scan_code(int device_flags, int scan_code, int *keys, int caps_lock, int num_lock, int scroll_lock, struct xrdp_keymap *keymap); int get_keysym_from_scan_code(int device_flags, int scan_code, int *keys, int caps_lock, int num_lock, int scroll_lock, struct xrdp_keymap *keymap); char32_t get_char_from_scan_code(int device_flags, int scan_code, int *keys, int caps_lock, int num_lock, int scroll_lock, struct xrdp_keymap *keymap); int get_keymaps(int keylayout, struct xrdp_keymap *keymap); int km_load_file(const char *filename, struct xrdp_keymap *keymap); /* xrdp_login_wnd.c */ /** * Gets the DPI of the login (primary) monitor * * @param self xrdp_wm instance * @return DPI of primary monitor, or 0 if unavailable. */ unsigned int xrdp_login_wnd_get_monitor_dpi(struct xrdp_wm *self); int xrdp_login_wnd_create(struct xrdp_wm *self); int load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp); void xrdp_login_wnd_scale_config_values(struct xrdp_wm *self); /* xrdp_bitmap_compress.c */ int xrdp_bitmap_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp, int e); /* xrdp_mm.c */ struct display_control_monitor_layout_data { struct display_size_description description; enum display_resize_state state; int last_state_update_timestamp; int start_time; /// This flag is set if the state machine needs to /// shutdown/startup EGFX int using_egfx; }; int xrdp_mm_drdynvc_up(struct xrdp_mm *self); int xrdp_mm_suppress_output(struct xrdp_mm *self, int suppress, int left, int top, int right, int bottom); int xrdp_mm_up_and_running(struct xrdp_mm *self); struct xrdp_mm * xrdp_mm_create(struct xrdp_wm *owner); void xrdp_mm_delete(struct xrdp_mm *self); void xrdp_mm_connect(struct xrdp_mm *self); int xrdp_mm_process_channel_data(struct xrdp_mm *self, tbus param1, tbus param2, tbus param3, tbus param4); int xrdp_mm_get_wait_objs(struct xrdp_mm *self, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int xrdp_mm_check_chan(struct xrdp_mm *self); int xrdp_mm_check_wait_objs(struct xrdp_mm *self); int xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id); void xrdp_mm_efgx_add_dirty_region_to_planar_list(struct xrdp_mm *self, struct xrdp_region *dirty_region); int xrdp_mm_egfx_send_planar_bitmap(struct xrdp_mm *self, struct xrdp_bitmap *bitmap, struct xrdp_rect *rect, int surface_id, int x, int y); int server_begin_update(struct xrdp_mod *mod); int server_end_update(struct xrdp_mod *mod); int server_bell_trigger(struct xrdp_mod *mod); int server_chansrv_in_use(struct xrdp_mod *mod); int server_fill_rect(struct xrdp_mod *mod, int x, int y, int cx, int cy); int server_screen_blt(struct xrdp_mod *mod, int x, int y, int cx, int cy, int srcx, int srcy); int server_paint_rect(struct xrdp_mod *mod, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy); int server_paint_rect_bpp(struct xrdp_mod *mod, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy, int bpp); int server_composite(struct xrdp_mod *mod, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat); int server_paint_rects(struct xrdp_mod *mod, int num_drects, short *drects, int num_crects, short *crects, char *data, int width, int height, int flags, int frame_id); int server_set_pointer(struct xrdp_mod *mod, int x, int y, char *data, char *mask); int server_set_pointer_ex(struct xrdp_mod *mod, int x, int y, char *data, char *mask, int bpp); int server_set_pointer_large(struct xrdp_mod *mod, int x, int y, char *data, char *mask, int bpp, int width, int height); int server_paint_rects_ex(struct xrdp_mod *mod, int num_drects, short *drects, int num_crects, short *crects, char *data, int left, int top, int width, int height, int flags, int frame_id, void *shmem_ptr, int shmem_bytes); int server_palette(struct xrdp_mod *mod, int *palette); int server_msg(struct xrdp_mod *mod, const char *msg, int code); int server_set_clip(struct xrdp_mod *mod, int x, int y, int cx, int cy); int server_reset_clip(struct xrdp_mod *mod); int server_set_fgcolor(struct xrdp_mod *mod, int fgcolor); int server_set_bgcolor(struct xrdp_mod *mod, int bgcolor); int server_set_opcode(struct xrdp_mod *mod, int opcode); int server_set_mixmode(struct xrdp_mod *mod, int mixmode); int server_set_brush(struct xrdp_mod *mod, int x_origin, int y_origin, int style, char *pattern); int server_set_pen(struct xrdp_mod *mod, int style, int width); int server_draw_line(struct xrdp_mod *mod, int x1, int y1, int x2, int y2); int server_add_char(struct xrdp_mod *mod, int font, int character, int offset, int baseline, int width, int height, char *data); int server_draw_text(struct xrdp_mod *mod, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int client_monitor_resize(struct xrdp_mod *mod, int width, int height, int num_monitors, const struct monitor_info *monitors); int server_monitor_resize_done(struct xrdp_mod *mod); int is_channel_allowed(struct xrdp_wm *wm, int channel_id); int server_get_channel_count(struct xrdp_mod *mod); int server_query_channel(struct xrdp_mod *mod, int index, char *channel_name, int *channel_flags); int server_get_channel_id(struct xrdp_mod *mod, const char *name); int server_send_to_channel(struct xrdp_mod *mod, int channel_id, char *data, int data_len, int total_data_len, int flags); int server_create_os_surface(struct xrdp_mod *mod, int id, int width, int height); int server_create_os_surface_bpp(struct xrdp_mod *mod, int id, int width, int height, int bpp); int server_switch_os_surface(struct xrdp_mod *mod, int id); int server_delete_os_surface(struct xrdp_mod *mod, int id); int server_paint_rect_os(struct xrdp_mod *mod, int x, int y, int cx, int cy, int id, int srcx, int srcy); int server_set_hints(struct xrdp_mod *mod, int hints, int mask); int server_window_new_update(struct xrdp_mod *mod, int window_id, struct rail_window_state_order *window_state, int flags); int server_window_delete(struct xrdp_mod *mod, int window_id); int server_window_icon(struct xrdp_mod *mod, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags); int server_window_cached_icon(struct xrdp_mod *mod, int window_id, int cache_entry, int cache_id, int flags); int server_notify_new_update(struct xrdp_mod *mod, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags); int server_notify_delete(struct xrdp_mod *mod, int window_id, int notify_id); int server_monitored_desktop(struct xrdp_mod *mod, struct rail_monitored_desktop_order *mdo, int flags); int server_add_char_alpha(struct xrdp_mod *mod, int font, int character, int offset, int baseline, int width, int height, char *data); int server_session_info(struct xrdp_mod *mod, const char *data, int data_bytes); int server_egfx_cmd(struct xrdp_mod *v, char *cmd, int cmd_bytes, char *data, int data_bytes); #endif xrdp-0.10.1/xrdp/lang.c000644 001751 000000 00000023203 14652432047 014677 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * keylayout * maximum unicode 19996(0x4e00) */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "ms-rdpbcgr.h" #include "log.h" #include "string_calls.h" /* map for rdp to x11 scancodes code1 is regular scancode, code2 is extended scancode */ struct codepair { tui8 code1; tui8 code2; }; static struct codepair g_map[] = { { 0, 0 }, { 9, 0 }, { 10, 0 }, { 11, 0 }, { 12, 0 }, /* 0 - 4 */ { 13, 0 }, { 14, 0 }, { 15, 0 }, { 16, 0 }, { 17, 0 }, /* 5 - 9 */ { 18, 0 }, { 19, 0 }, { 20, 0 }, { 21, 0 }, { 22, 0 }, /* 10 - 14 */ { 23, 0 }, { 24, 0 }, { 25, 0 }, { 26, 0 }, { 27, 0 }, /* 15 - 19 */ { 28, 0 }, { 29, 0 }, { 30, 0 }, { 31, 0 }, { 32, 0 }, /* 20 - 24 */ { 33, 0 }, { 34, 0 }, { 35, 0 }, { 36, 108 }, { 37, 109 }, /* 25 - 29 */ { 38, 0 }, { 39, 0 }, { 40, 0 }, { 41, 0 }, { 42, 0 }, /* 30 - 34 */ { 43, 0 }, { 44, 0 }, { 45, 0 }, { 46, 0 }, { 47, 0 }, /* 35 - 39 */ { 48, 0 }, { 49, 0 }, { 50, 0 }, { 51, 0 }, { 52, 0 }, /* 40 - 44 */ { 53, 0 }, { 54, 0 }, { 55, 0 }, { 56, 0 }, { 57, 0 }, /* 45 - 49 */ { 58, 0 }, { 59, 0 }, { 60, 0 }, { 61, 112 }, { 62, 0 }, /* 50 - 54 */ { 63, 111 }, { 64, 113 }, { 65, 0 }, { 66, 0 }, { 67, 0 }, /* 55 - 59 */ { 68, 0 }, { 69, 0 }, { 70, 0 }, { 71, 0 }, { 72, 0 }, /* 60 - 64 */ { 73, 0 }, { 74, 0 }, { 75, 0 }, { 76, 0 }, { 77, 0 }, /* 65 - 69 */ { 78, 0 }, { 79, 97 }, { 80, 98 }, { 81, 99 }, { 82, 0 }, /* 70 - 74 */ { 83, 100 }, { 84, 0 }, { 85, 102 }, { 86, 0 }, { 87, 103 }, /* 75 - 79 */ { 88, 104 }, { 89, 105 }, { 90, 106 }, { 91, 107 }, { 92, 0 }, /* 80 - 84 */ { 93, 0 }, { 94, 0 }, { 95, 0 }, { 96, 0 }, { 97, 0 }, /* 85 - 89 */ { 98, 0 }, { 0, 115 }, { 0, 116 }, { 0, 117 }, { 102, 0 }, /* 90 - 94 */ { 103, 0 }, { 104, 0 }, { 105, 0 }, { 106, 0 }, { 107, 0 }, /* 95 - 99 */ { 108, 0 }, { 109, 0 }, { 110, 0 }, { 111, 0 }, { 112, 0 }, /* 100 - 104 */ { 113, 0 }, { 114, 0 }, { 115, 0 }, { 116, 0 }, { 117, 0 }, /* 105 - 109 */ { 118, 0 }, { 119, 0 }, { 120, 0 }, { 121, 0 }, { 122, 0 }, /* 110 - 114 */ { 123, 0 }, { 124, 0 }, { 125, 0 }, { 126, 0 }, { 127, 0 }, /* 115 - 119 */ { 128, 0 }, { 129, 0 }, { 130, 0 }, { 131, 0 }, { 132, 0 }, /* 120 - 124 */ { 133, 0 }, { 134, 0 }, { 135, 0 } /* 125 - 127 */ }; /*****************************************************************************/ struct xrdp_key_info * get_key_info_from_scan_code(int device_flags, int scan_code, int *keys, int caps_lock, int num_lock, int scroll_lock, struct xrdp_keymap *keymap) { struct xrdp_key_info *rv; int shift; int altgr; int ext; int index; ext = device_flags & KBD_FLAG_EXT; /* 0x0100 */ shift = keys[42] || keys[54]; altgr = keys[56] & KBD_FLAG_EXT; /* right alt */ rv = 0; scan_code = scan_code & 0x7f; index = ext ? g_map[scan_code].code2 : g_map[scan_code].code1; /* keymap file is created with numlock off so we have to do this */ if ((index >= 79) && (index <= 91)) { if (num_lock) { rv = &(keymap->keys_shift[index]); } else { rv = &(keymap->keys_noshift[index]); } } else if (shift && caps_lock && altgr) { rv = &(keymap->keys_shiftcapslockaltgr[index]); } else if (shift && caps_lock) { rv = &(keymap->keys_shiftcapslock[index]); } else if (shift && altgr) { rv = &(keymap->keys_shiftaltgr[index]); } else if (shift) { rv = &(keymap->keys_shift[index]); } else if (caps_lock && altgr) { rv = &(keymap->keys_capslockaltgr[index]); } else if (caps_lock) { rv = &(keymap->keys_capslock[index]); } else if (altgr) { rv = &(keymap->keys_altgr[index]); } else { rv = &(keymap->keys_noshift[index]); } return rv; } /*****************************************************************************/ int get_keysym_from_scan_code(int device_flags, int scan_code, int *keys, int caps_lock, int num_lock, int scroll_lock, struct xrdp_keymap *keymap) { struct xrdp_key_info *ki; ki = get_key_info_from_scan_code(device_flags, scan_code, keys, caps_lock, num_lock, scroll_lock, keymap); if (ki == 0) { return 0; } return ki->sym; } /*****************************************************************************/ char32_t get_char_from_scan_code(int device_flags, int scan_code, int *keys, int caps_lock, int num_lock, int scroll_lock, struct xrdp_keymap *keymap) { struct xrdp_key_info *ki; ki = get_key_info_from_scan_code(device_flags, scan_code, keys, caps_lock, num_lock, scroll_lock, keymap); if (ki == 0) { return 0; } return ki->chr; } /*****************************************************************************/ static int km_read_section(int fd, const char *section_name, struct xrdp_key_info *keymap) { struct list *names; struct list *values; int index; int code; int pos1; char *name; char *value; names = list_create(); names->auto_free = 1; values = list_create(); values->auto_free = 1; if (file_read_section(fd, section_name, names, values) == 0) { for (index = names->count - 1; index >= 0; index--) { name = (char *)list_get_item(names, index); value = (char *)list_get_item(values, index); if ((name != 0) && (value != 0)) { if (g_strncasecmp(name, "key", 3) == 0) { code = g_atoi(name + 3); } else { code = g_atoi(name); } if ((code >= 0) && (code < 256)) { pos1 = g_pos(value, ":"); if (pos1 >= 0) { keymap[code].chr = g_atoi(value + pos1 + 1); } keymap[code].sym = g_atoi(value); } } } } list_delete(names); list_delete(values); return 0; } /*****************************************************************************/ int get_keymaps(int keylayout, struct xrdp_keymap *keymap) { int basic_key_layout = keylayout & 0x0000ffff; char *filename; struct xrdp_keymap *lkeymap; filename = (char *)g_malloc(256, 0); /* check if there is a keymap file e.g. km-e00100411.ini */ g_snprintf(filename, 255, "%s/km-%08x.ini", XRDP_CFG_PATH, keylayout); /* if the file does not exist, use only lower 16 bits instead */ if (!g_file_exist(filename)) { LOG(LOG_LEVEL_WARNING, "Cannot find keymap file %s", filename); /* e.g. km-00000411.ini */ g_snprintf(filename, 255, "%s/km-%08x.ini", XRDP_CFG_PATH, basic_key_layout); } /* finally, use 'en-us' */ if (!g_file_exist(filename)) { LOG(LOG_LEVEL_WARNING, "Cannot find keymap file %s", filename); g_snprintf(filename, 255, "%s/km-00000409.ini", XRDP_CFG_PATH); } if (g_file_exist(filename)) { lkeymap = (struct xrdp_keymap *)g_malloc(sizeof(struct xrdp_keymap), 0); /* make a copy of the built-in keymap */ g_memcpy(lkeymap, keymap, sizeof(struct xrdp_keymap)); km_load_file(filename, keymap); if (g_memcmp(lkeymap, keymap, sizeof(struct xrdp_keymap)) != 0) { LOG(LOG_LEVEL_WARNING, "local keymap file for 0x%08x found and doesn't match " "built in keymap, using local keymap file", keylayout); } g_free(lkeymap); } else { LOG(LOG_LEVEL_WARNING, "File does not exist: %s", filename); } g_free(filename); return 0; } /*****************************************************************************/ int km_load_file(const char *filename, struct xrdp_keymap *keymap) { int fd; LOG(LOG_LEVEL_INFO, "Loading keymap file %s", filename); fd = g_file_open_ro(filename); if (fd != -1) { /* read the keymaps */ km_read_section(fd, "noshift", keymap->keys_noshift); km_read_section(fd, "shift", keymap->keys_shift); km_read_section(fd, "altgr", keymap->keys_altgr); km_read_section(fd, "shiftaltgr", keymap->keys_shiftaltgr); km_read_section(fd, "capslock", keymap->keys_capslock); km_read_section(fd, "capslockaltgr", keymap->keys_capslockaltgr); km_read_section(fd, "shiftcapslock", keymap->keys_shiftcapslock); km_read_section(fd, "shiftcapslockaltgr", keymap->keys_shiftcapslockaltgr); g_file_close(fd); } else { LOG(LOG_LEVEL_ERROR, "Error loading keymap file %s (%s)", filename, g_get_strerror()); return 1; } return 0; } xrdp-0.10.1/xrdp/cursor1.cur000644 001751 000000 00000000506 14652432047 015724 0ustar00metawheel000000 000000  0( @xrdp-0.10.1/xrdp/xrdp24b.bmp000644 001751 000000 00000440066 14652432047 015611 0ustar00metawheel000000 000000 BM6@6(@                   !!!!!!!!!!!!!!!!!!!!!     !!!"""###$$$%%%%%%&&&&&&&&&&&&&&&&&&%%%%%%$$$###"""    !!!"""$$$%%%&&&'''((()))******+++,,,,,,,,,,,,++++++***)))((('''%%%$$$"""    !!!"""###$$$%%%&&&((()))***,,,---...///000000111111111111111111111000///...,,,+++)))'''%%%###!!!   !!!"""$$$$$$&&&&&&'''(((***+++,,,---///000111333444555666666777777777777777777777666555444222000...,,,***(((%%%###!!!   !!!"""###$$$$$$$$$%%%%%%%%%%%%%%%$$$$$$$$$######""""""!!!  !!!!!!"""$$$%%%&&&'''((()))***+++,,,---...///111222333555666888999:::;;;<<<======```}}}}}}```===<<<;;;:::888666444222///---***(((%%%"""    """###%%%&&&'''((()))************************)))))))))(((''''''&&&%%%$$$$$$###"""!!!!!!  !!!"""###$$$%%%&&&'''((()))***,,,---...///000111222333555666777888:::;;;<<<>>>???@@@AAACCCCCCyyy䝝yyyCCCAAA@@@>>><<<:::888555222000---***'''$$$"""  !!!###$$$&&&(((***+++---...//////000000000000000000/////////......---,,,++++++))))))((('''&&&%%%%%%$$$#########""""""""""""#########$$$%%%&&&'''((()))***+++---...///000222333444666666888999:::;;;<<<>>>???@@@BBBCCCEEEFFFGGGHHHIIIffffffHHHGGGEEECCC@@@>>>;;;888555222///,,,)))&&&###    """%%%''')))+++---///111222333444555666666666666666666555555555444444333222111000///...---,,,+++******)))((((((((('''''''''''''''((())))))+++,,,---...///000111222444555777888999;;;<<<===>>>???AAABBBCCCDDDEEEGGGHHHJJJKKKMMMNNNOOOPPP䀀OOOMMMKKKIIIGGGDDDAAA>>>;;;888444111...***'''$$$!!!  !!!$$$&&&)))+++...000222444666888999:::;;;<<<<<<<<<<<<<<<<<<;;;;;;;;;:::999888888777666444333222111000000///...---------,,,,,,,,,,,,------...///000111222333555666777999:::<<<===???@@@AAACCCDDDEEEFFFGGGHHHJJJKKKLLLNNNOOOPPPRRRSSSTTTVVVWWWUUUTTTRRROOOMMMJJJGGGDDDAAA===:::666222///+++((($$$!!!  !!!$$$'''***---000222555888:::<<<>>>???@@@AAABBBBBBBBBBBBBBBBBBBBBAAAAAA@@@???>>>>>><<<;;;:::999888777666555444333333222222111111111222222333333444666777888999;;;<<<===???@@@BBBDDDEEEGGGHHHJJJKKKLLLMMMNNNOOOPPPRRRSSSTTTVVVWWWYYYZZZ[[[\\\]]]\\\ZZZXXXVVVSSSPPPMMMJJJFFFCCC???;;;777333000,,,((($$$   !!!$$$(((+++...111444777:::===???AAACCCEEEFFFGGGHHHHHHHHHHHHHHHHHHHHHGGGGGGFFFEEEDDDCCCBBBAAA???>>>===<<<;;;:::999999888777777777777666777777888999:::;;;<<<>>>???AAABBBDDDEEEGGGHHHJJJLLLMMMOOOPPPQQQSSSTTTUUUVVVWWWYYYZZZ[[[\\\^^^___aaabbbcccdddbbb```^^^\\\YYYVVVSSSOOOLLLHHHDDD@@@<<<888444000,,,(((###    $$$'''+++///<<>>======<<<<<<<<<<<<<<<<<<===>>>???AAABBBCCCEEEFFFHHHJJJKKKMMMOOOQQQRRRTTTUUUWWWXXXZZZ[[[\\\pkkss||ttrnncccdddfffggghhhiiijjjhhhfffdddbbb___\\\XXXUUUQQQMMMIIIEEE@@@<<<888333///+++'''###  """&&&***...===ww77 JJvvQQQLLLNNNPPPRRRSSSSSSTTTYYYuuPP 22xxZZZQQQOOONNNMMMLLLozo\\\\mymCCCBBBBBBAAAAAAAAAAAABBBBBBCCCDDDEEEFFFHHHIIIKKKLLL\\\igg{mmxxzzrrymmddd\\\^^^___```aaass^^^^uujjjlllmmmnnnooopppnnnllljjjgggmmmnnn\\\FFF@@@<<<777333...***%%%!!!   $$$)))---111eeq88..ww[[[SSSUUUWWWXXXYYY```ww5500qq}VVVUUUTTTRRReje]]\\aeaGGGGGGGGGFFFFFFFFFGGGGGGHHHIIIJJJLLLMMMOOOXXX~rrffBB(( 22kkvvllleeefffupp^^^^zuurrrssstttuuuuuusssqqquuuěPPP@@@;;;666111,,,((($$$  """'''+++///444ww ##xxcccZZZ\\\]]]fffyy))}}[[[ZZZYYYWWWrrqqLLLLLLLLLKKKKKKKKKLLLLLLMMMNNNOOOQQQSSSjffxx22""uuvrrllluuwwwwwxxxyyyzzzzzzxxx~~~Ӆfff???999444///***&&&!!!  $$$)))---222666wwwwjjlaaakkkxx{{```^^^]]]\\\~~~~QQQQQQPPPPPPPPPPPPQQQQQQRRRSSSTTTVVVlhhgg jj}vv~~~~|||}}}}}}~~~ccc<<<777222---(((###  !!!&&&***///444999bbkKKrruuzttCCqq}dddcccbbb```VVVUUUUUUTTTTTTUUUUUUVVVWWWXXXYYYaaaxx ww󄄄KKK999444///***%%%   """''',,,111666;;;CCCtt~>> HH77yyjjjhhhgggfffdddZZZYYYYYYYYYYYYYYYZZZZZZ[[[\\\]]]tt22 TTuuyy]]%%}}}}}<<<666000+++&&&"""  ###(((---222777<<>>CCCHHHOOOpp{WWQQwwqqqooonnnnnnlllkkkjjj`````````___``````aaaaaabbbcccsqqCCbb{yyxxxzzz|||~~~tt|||yyyvvvqqqqqqaaa888333...)))$$$   $$$***///444999???DDDIIINNNSSSooxbb]]wwrrrqqqqqqpppooonnnmmmlllccccccbbbbbbbbbbbbcccdddeeefffrr((zzyyy{{{}}}zz))膆}}}zzzvvvrrrnnnxxx999444...)))$$$    %%%***///555:::???EEEJJJOOOTTTXXXppv__XXxxssssssrrrrrrqqqpppooonnnmmmzzfffdddddddddddddddeeeeeefffhhhyy ((vv{{{}}}AAц}}}zzzvvvrrrnnnvvv󁁁:::444///***%%%    %%%***///444:::???EEEIIIOOOSSS^^^xx66..zzuuusssrrrrrrqqqpppooonnnmmmZZoooeeeeeeeeeeeeeeeffffffgggiiiyy ((vv|||~~~AAԆ|||yyyuuurrrmmmwww:::444///)))%%%    $$$)))///444999>>>DDDIIINNN]]]yy**$$zzuuuqqqqqqpppooonnnmmmlll##yykkkeeeeeeeeeeeefffggghhhiiiss((zz|||~~~{{))녅}}}zzzwwwtttppplllvvv999333...)))$$$   $$$)))...333888===CCCHHH]]]ww!!wwttuooonnnnnnmmmlllkkkwwqqpppkkknnnppprrrnnnhhhvttCCbb~||}}}tt}}}wwwtttqqqmmmqqq^^^888333---((($$$  ###(((---222777<<>>??????@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@???????????????>>>>>>???????????????????????????@@@@@@@@@AAABBBCCCDDDEEEGGGHHHIIIJJJLLLNNNOOOQQQSSSTTTVVVWWWYYYZZZZZZ~~~~XXXVVVUUUTTTSSSQQQPPPOOOMMMLLLKKKJJJIIIHHHGGGFFFEEECCCBBB@@@>>><<<:::888666333000...+++(((%%%""" ___ɾ*** """$$$'''))),,,...000222444555777888888999999999999::::::::::::::::::::::::999999999999999999999999999999999999::::::::::::::::::;;;<<<<<<===>>>???AAABBBCCCDDDFFFGGGIIIKKKLLLNNNOOOQQQRRRSSSTTTrrrrQQQPPPNNNMMMLLLKKKIIIHHHGGGFFFDDDCCCBBBAAA@@@???>>>===;;;:::888666444222000...,,,)))'''$$$!!! WWWɕɺɻ}}} !!!###%%%''')))+++---...000111222222333333333333444444444444444444444444333333333333333333333333333444444444444444444444444555555666666777888999;;;<<<===>>>???AAABBBDDDFFFGGGIIIJJJKKKLLLMMMhcc]]]]gbbJJJIIIHHHGGGEEEDDDBBBAAA@@@???>>><<<<<<;;;:::999888666555333222000///---+++)))'''%%%"""  (((Ɉɶɯwww  !!!"""$$$&&&''')))***+++,,,---------------...........................---...------------.........................../////////000111222222333555555777888999:::<<<>>>???AAABBBCCCDDDEEEFFFFFFznn\\\\ynnDDDCCCBBBAAA@@@???===<<<;;;999888777666555444333222111000///---,,,+++)))(((&&&$$$"""   {{{ǁɯɞhhh  !!!"""$$$%%%&&&&&&'''''''''((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))******++++++,,,---...///000111222333444666777999:::;;;===>>>>>>???@@@@@@a\\~oo||~ooa\\>>>>>>===<<<:::999888777666444333222111000///...---,,,+++***)))((('''%%%$$$###!!! 444ɾɪȍOOO  !!!!!!"""""""""""""""#####################444@@@MMMNNN(((#####################$$$$$$$$$$$$$$$$$$$$$$$$%%%&&&&&&'''((()))***+++,,,---...///111222444555666777888999999999:::999999999888888777666555444333222111///...---,,,+++***)))(((''''''&&&$$$$$$"""!!!  [[[ȁɢŃ333 ___~~~VVV''' !!!"""###$$$$$$%%%&&&'''(((***+++,,,...///000111222222333333333333333333222222111000///...---,,,+++***((('''&&&%%%$$$$$$###"""!!!  yyyɊɜɾ~~~ AAA}}}|||+++ !!!"""###$$$%%%'''((()))***+++,,,,,,------------------,,,,,,++++++***)))(((&&&%%%$$$###"""!!!   ɚǖɴzzz +++VVV|||ɯ|||+++ """###$$$%%%&&&&&&''''''((((((((('''''''''&&&&&&%%%$$$###"""!!!  ɬƑɣnnn ###LLLyyyɱ||| !!!""""""""""""""""""""""""!!!!!!  ~~~ōɒXXX qqqǏŅɗMMM qqqɨƅ;;; sssɕɺ}}}  PPPȌ### lllɞɨɗFFF  +++ɽɷ|||cccɧɕɴkkk  rrrɹɩsssWWWɰLJ}}}  ȳɗ```KKKɸɀ VVVljDDD===ɾɰɊ((( |||ɽÀ)))000…ɝɄ~~~ɷɻ}}}%%%ʼnɋɀ)))ɯɮvvv }}}ǏĄ~~~666ɧɝfff|||ɖɷVVVDDDɝȌMMMxxxɟɤSSSɔĂ000 tttɪɇrrraaaǎɽ~~~mmmɲɮuuukkkʼnɲɹɼ}}} sssɐɿł---xxxɽȇÆɎNNN|||ɷÃɢkkk~~~ɯɺɵzzz )))ɧ888ɝdž:::FFFɕɕ[[[UUUǎɪrrrbbbʼnɺ|||lllÀ((( tttɽȊGGGyyyɷɞfff|||ɯɱxxx ~~~ɧɾ~~~***ɝƃ333888ɕɑUUUHHHǏɦnnnVVVɿɷ{{{gggɓRRR ttt…Á,,,mmmƉɼ}}}cccȏɰxxx VVVɘɟjjjIIIɣɏRRR999ɭŃ666+++ɷɿ~~~"""~~~ɽɶ{{{|||…ɦpppzzzƊɔ\\\ uuuȑLJAAAnnnɚ€&&&dddɤɺ|||YYYɯɱɬuuuJJJɸɛeee;;;ɾɆǏȋKKK...ÆɔňĂ///###~~~Ƌɪɽ~~~}}}Ȓɿɹɳyyy zzzɛdž```ɯɢlll vvvɦɘ^^^NNNɣɑVVVoooɰɫttt[[[ɘƁOOOfffɸɻ}}}fffǎɬyyy[[[ɿā+++oooĈă333LLLÇɌLLL uuuɿɋɷsssXXXɠiiiyyyɹɫ~~~ }}}ɴyyy |||ɯÃɄ RRRLj~~~~~~ɢɋɚ:::ɢŋDž888)))ɗɫɩNNNbbbɽŎɔZZZ555Ǎƒɢ???{{{ɚƎɩrrrCCCćɊɖ444ɌƑɹ|||QQQɿɪɋ***(((ɃǒÀ''']]]ɸƒ~~~ CCCǕȊFFFgggɭɉɦYYYQQQɴȖɝeeepppɢȀ000ɰȚɱxxx yyyȑ```ɽɛɾ~~~nnnȑaaa|||Ȃɞƃ333555|||```dddɌɠɒUUU"""333@@@TTTgggvvv|||||||||WWW'''~~~ɜɣɦooo666ɽɦ{{{YYYɥɜ%%%pppȍɪ{{{---:::|||țttt NNN{{{êeee222YYYzzz}}}YYY&&& '''555EEEPPP&&&xrdp-0.10.1/xrdp/xrdp_region.c000644 001751 000000 00000010526 14652432047 016302 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * region */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #if defined(XRDP_PIXMAN) #include #else #include "pixman-region.h" #endif /*****************************************************************************/ struct xrdp_region * xrdp_region_create(struct xrdp_wm *wm) { struct xrdp_region *self; self = (struct xrdp_region *)g_malloc(sizeof(struct xrdp_region), 1); self->wm = wm; self->reg = (struct pixman_region16 *) g_malloc(sizeof(struct pixman_region16), 1); pixman_region_init(self->reg); return self; } /*****************************************************************************/ void xrdp_region_delete(struct xrdp_region *self) { if (self == 0) { return; } pixman_region_fini(self->reg); g_free(self->reg); g_free(self); } /*****************************************************************************/ /* returns error */ int xrdp_region_add_rect(struct xrdp_region *self, struct xrdp_rect *rect) { struct pixman_region16 lreg; pixman_region_init_rect(&lreg, rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top); if (!pixman_region_union(self->reg, self->reg, &lreg)) { pixman_region_fini(&lreg); return 1; } pixman_region_fini(&lreg); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_region_subtract_rect(struct xrdp_region *self, struct xrdp_rect *rect) { struct pixman_region16 lreg; pixman_region_init_rect(&lreg, rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top); if (!pixman_region_subtract(self->reg, self->reg, &lreg)) { pixman_region_fini(&lreg); return 1; } pixman_region_fini(&lreg); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_region_intersect_rect(struct xrdp_region *self, struct xrdp_rect *rect) { struct pixman_region16 lreg; pixman_region_init_rect(&lreg, rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top); if (!pixman_region_intersect(self->reg, self->reg, &lreg)) { pixman_region_fini(&lreg); return 1; } pixman_region_fini(&lreg); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_region_get_rect(struct xrdp_region *self, int index, struct xrdp_rect *rect) { struct pixman_box16 *box; int count; box = pixman_region_rectangles(self->reg, &count); if ((box != 0) && (index >= 0) && (index < count)) { rect->left = box[index].x1; rect->top = box[index].y1; rect->right = box[index].x2; rect->bottom = box[index].y2; return 0; } return 1; } /*****************************************************************************/ /* returns error */ int xrdp_region_get_bounds(struct xrdp_region *self, struct xrdp_rect *rect) { struct pixman_box16 *box; box = pixman_region_extents(self->reg); if (box != 0) { rect->left = box->x1; rect->top = box->y1; rect->right = box->x2; rect->bottom = box->y2; return 0; } return 1; } /*****************************************************************************/ /* returns boolean */ int xrdp_region_not_empty(struct xrdp_region *self) { pixman_bool_t not_empty; not_empty = pixman_region_not_empty(self->reg); return not_empty; } xrdp-0.10.1/xrdp/xrdp_login_wnd.c000644 001751 000000 00000152425 14652432047 017004 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * main login window and login help window */ #if defined(HAVE_CONFIG_H) #include #endif #include "base64.h" #include "xrdp.h" #include "log.h" #include "string_calls.h" #define ASK "ask" #define ASK_LEN g_strlen(ASK) #define BASE64PREFIX "{base64}" #define BASE64PREFIX_LEN g_strlen(BASE64PREFIX) /*****************************************************************************/ /* all login help screen events go here */ static int xrdp_wm_login_help_notify(struct xrdp_bitmap *wnd, struct xrdp_bitmap *sender, int msg, long param1, long param2) { struct xrdp_painter *p; if (wnd == 0) { return 0; } if (sender == 0) { return 0; } if (wnd->owner == 0) { return 0; } if (msg == 1) /* click */ { if (sender->id == 1) /* ok button */ { if (sender->owner->notify != 0) { wnd->owner->notify(wnd->owner, wnd, 100, 1, 0); /* ok */ } } } else if (msg == WM_PAINT) /* 3 */ { p = (struct xrdp_painter *)param1; if (p != 0) { const int x = 10; int y = xrdp_painter_font_body_height(p) * 2; const int row_height = xrdp_painter_font_body_height(p); const int end_para_height = row_height * 3 / 2; p->fg_color = wnd->wm->black; xrdp_painter_draw_text(p, wnd, x, y, "You must be authenticated \ before using this"); y += row_height; xrdp_painter_draw_text(p, wnd, x, y, "session."); y += end_para_height; xrdp_painter_draw_text(p, wnd, x, y, "Enter a valid username in \ the username edit box."); y += end_para_height; xrdp_painter_draw_text(p, wnd, x, y, "Enter the password in \ the password edit box."); y += end_para_height; xrdp_painter_draw_text(p, wnd, x, y, "Both the username and \ password are case"); y += row_height; xrdp_painter_draw_text(p, wnd, x, y, "sensitive."); y += end_para_height; xrdp_painter_draw_text(p, wnd, x, y, "Contact your system \ administrator if you are"); y += row_height; xrdp_painter_draw_text(p, wnd, x, y, "having problems \ logging on."); } } return 0; } #if 0 /*****************************************************************************/ static int xrdp_wm_popup_notify(struct xrdp_bitmap *wnd, struct xrdp_bitmap *sender, int msg, int param1, int param2) { return 0; } #endif /*****************************************************************************/ int xrdp_wm_delete_all_children(struct xrdp_wm *self) { int index; struct xrdp_bitmap *b; struct xrdp_rect rect; for (index = self->screen->child_list->count - 1; index >= 0; index--) { b = (struct xrdp_bitmap *)list_get_item(self->screen->child_list, index); MAKERECT(rect, b->left, b->top, b->width, b->height); xrdp_bitmap_delete(b); xrdp_bitmap_invalidate(self->screen, &rect); } return 0; } /*****************************************************************************/ static int set_mod_data_item(struct xrdp_mod_data *mod, char *name, char *value) { int index; for (index = 0; index < mod->names->count; index++) { if (g_strncmp(name, (char *)list_get_item(mod->names, index), 255) == 0) { list_remove_item(mod->values, index); list_insert_item(mod->values, index, (long)g_strdup(value)); } } return 0; } /*****************************************************************************/ static int xrdp_wm_help_clicked(struct xrdp_bitmap *wnd) { struct xrdp_bitmap *help; struct xrdp_bitmap *but; const int width = wnd->wm->xrdp_config->cfg_globals.ls_scaled.help_wnd_width; const int height = wnd->wm->xrdp_config->cfg_globals.ls_scaled.help_wnd_height; const int ok_height = wnd->wm->xrdp_config->cfg_globals.ls_scaled.default_btn_height; const char *ok_string = "OK"; /* Get a width for the OK button */ struct xrdp_painter *p = xrdp_painter_create(wnd->wm, wnd->wm->session); xrdp_painter_font_needed(p); const int ok_width = xrdp_painter_text_width(p, ok_string) + DEFAULT_BUTTON_MARGIN_W; xrdp_painter_delete(p); /* create help screen */ help = xrdp_bitmap_create(width, height, wnd->wm->screen->bpp, WND_TYPE_WND, wnd->wm); list_insert_item(wnd->wm->screen->child_list, 0, (long)help); help->parent = wnd->wm->screen; help->owner = wnd; wnd->modal_dialog = help; help->bg_color = wnd->wm->grey; help->left = wnd->wm->screen->width / 2 - help->width / 2; help->top = wnd->wm->screen->height / 2 - help->height / 2; help->notify = xrdp_wm_login_help_notify; set_string(&help->caption1, "Login help"); /* ok button */ but = xrdp_bitmap_create(ok_width, ok_height, wnd->wm->screen->bpp, WND_TYPE_BUTTON, wnd->wm); list_insert_item(help->child_list, 0, (long)but); but->parent = help; but->owner = help; but->left = ((help->width / 2) - (ok_width / 2)); /* center */ but->top = help->height - ok_height - 15; but->id = 1; but->tab_stop = 1; set_string(&but->caption1, ok_string); /* draw it */ help->focused_control = but; help->default_button = but; help->esc_button = but; xrdp_bitmap_invalidate(help, 0); xrdp_wm_set_focused(wnd->wm, help); return 0; } /*****************************************************************************/ static int xrdp_wm_cancel_clicked(struct xrdp_bitmap *wnd) { if (wnd != 0) { if (wnd->wm != 0) { if (wnd->wm->pro_layer != 0) { g_set_wait_obj(wnd->wm->pro_layer->self_term_event); } } } return 0; } /*****************************************************************************/ static int xrdp_wm_ok_clicked(struct xrdp_bitmap *wnd) { struct xrdp_bitmap *combo; struct xrdp_bitmap *label; struct xrdp_bitmap *edit; struct xrdp_wm *wm; struct xrdp_mod_data *mod_data; int i; wm = wnd->wm; combo = xrdp_bitmap_get_child_by_id(wnd, 6); if (combo != 0) { mod_data = (struct xrdp_mod_data *) list_get_item(combo->data_list, combo->item_index); if (mod_data != 0) { /* get the user typed values */ i = 100; label = xrdp_bitmap_get_child_by_id(wnd, i); edit = xrdp_bitmap_get_child_by_id(wnd, i + 1); while (label != 0 && edit != 0) { set_mod_data_item(mod_data, label->caption1, edit->caption1); i += 2; label = xrdp_bitmap_get_child_by_id(wnd, i); edit = xrdp_bitmap_get_child_by_id(wnd, i + 1); } list_delete(wm->mm->login_names); list_delete(wm->mm->login_values); wm->mm->login_names = list_create(); wm->mm->login_names->auto_free = 1; wm->mm->login_values = list_create(); wm->mm->login_values->auto_free = 1; /* will copy these cause dialog gets freed */ list_append_list_strdup(mod_data->names, wm->mm->login_names, 0); list_append_list_strdup(mod_data->values, wm->mm->login_values, 0); xrdp_wm_set_login_state(wm, WMLS_START_CONNECT); } } else { LOG(LOG_LEVEL_WARNING, "Combo is NULL - potential programming error"); } return 0; } /*****************************************************************************/ /** * This is an internal function in this file used to parse the domain * information sent from the client. If the information starts * with '_' the domain field contains the IP/DNS to connect to. * If the domain field contains an additional '__' the char that * follows this '__' is an index number of a preferred combo choice. * Valid values for this choice is 0-9. But this function will only return * index numbers between 0 and the max number of combo items -1. * Example: _192.168.1.2__1 result in a resultbuffer containing * 192.168.1.2 and the return value will be 1. Meaning that * index 1 is the preferred combo choice. * * Users can create shortcuts where this information is configured. These * shortcuts simplifies login. * @param originalDomainInfo indata to this function * @param comboMax the max number of combo choices * @param decode if true then we perform decoding of combo choice * @param resultBuffer must be pre allocated before calling this function. * Holds the IP. The size of this buffer must be 256 bytes * @return the index number of the combobox that the user prefer. * 0 if the user does not prefer any choice. */ static int xrdp_wm_parse_domain_information(char *originalDomainInfo, int comboMax, int decode, char *resultBuffer) { int ret; int pos; int comboxindex; char index[2]; /* If the first char in the domain name is '_' we use the domain name as IP*/ ret = 0; /* default return value */ /* resultBuffer assumed to be 256 chars */ g_memset(resultBuffer, 0, 256); if (originalDomainInfo[0] == '_') { /* we try to locate a number indicating what combobox index the user * prefer the information is loaded from domain field, from the client * We must use valid chars in the domain name. * Underscore is a valid name in the domain. * Invalid chars are ignored in microsoft client therefore we use '_' * again. this sec '__' contains the split for index.*/ pos = g_pos(&originalDomainInfo[1], "__"); if (pos > 0) { /* an index is found we try to use it */ LOG(LOG_LEVEL_DEBUG, "domain contains index char __"); if (decode) { g_memset(index, 0, 2); /* we just accept values 0-9 (one figure) */ g_strncpy(index, &originalDomainInfo[pos + 3], 1); comboxindex = g_htoi(index); LOG(LOG_LEVEL_DEBUG, "index value as string: %s, as int: %d, max: %d", index, comboxindex, comboMax - 1); /* limit to max number of items in combo box */ if ((comboxindex > 0) && (comboxindex < comboMax)) { LOG(LOG_LEVEL_DEBUG, "domain contains a valid " "index number"); ret = comboxindex; /* preferred index for combo box. */ } } /* pos limit the String to only contain the IP */ g_strncpy(resultBuffer, &originalDomainInfo[1], pos); } else { LOG(LOG_LEVEL_DEBUG, "domain does not contain _"); g_strncpy(resultBuffer, &originalDomainInfo[1], 255); } } return ret; } /******************************************************************************/ static int xrdp_wm_show_edits(struct xrdp_wm *self, struct xrdp_bitmap *combo) { int count; int index; int insert_index; int username_set; char *name; char *value; struct xrdp_mod_data *mod; struct xrdp_bitmap *b; struct xrdp_cfg_globals *globals; char resultIP[256]; char *plain; /* base64 decoded string */ size_t plain_length; /* length of decoded base64 string */ size_t base64_length; /* length of base64 string */ globals = &self->xrdp_config->cfg_globals; username_set = 0; /* free labels and edits, cause we will create them */ /* creation or combo changed */ for (index = 100; index < 200; index++) { b = xrdp_bitmap_get_child_by_id(combo->parent, index); xrdp_bitmap_delete(b); } insert_index = list_index_of(self->login_window->child_list, (long)combo); /* find combo in the list */ insert_index++; mod = (struct xrdp_mod_data *) list_get_item(combo->data_list, combo->item_index); if (mod != 0) { count = 0; for (index = 0; index < mod->names->count; index++) { value = (char *)list_get_item(mod->values, index); /* if the value begins with "{base64}", decode the string following it */ if (g_strncmp(BASE64PREFIX, value, BASE64PREFIX_LEN) == 0) { base64_length = g_strlen(value + BASE64PREFIX_LEN); plain = (char *)g_malloc(base64_length, 0); base64_decode(value + BASE64PREFIX_LEN, plain, base64_length, &plain_length); g_strncpy(value, plain, plain_length); g_free(plain); } else if (g_strncmp(ASK, value, ASK_LEN) == 0) { const int combo_height = self->xrdp_config->cfg_globals.ls_scaled.combo_height; const int edit_height = self->xrdp_config->cfg_globals.ls_scaled.edit_height; /* label */ b = xrdp_bitmap_create(globals->ls_scaled.label_width, edit_height, self->screen->bpp, WND_TYPE_LABEL, self); list_insert_item(self->login_window->child_list, insert_index, (long)b); insert_index++; b->parent = self->login_window; b->owner = self->login_window; b->left = globals->ls_scaled.label_x_pos; b->top = globals->ls_scaled.input_y_pos + combo_height + 5 + (edit_height + 5) * count; b->id = 100 + 2 * count; name = (char *)list_get_item(mod->names, index); set_string(&b->caption1, name); /* edit */ b = xrdp_bitmap_create(globals->ls_scaled.input_width, edit_height, self->screen->bpp, WND_TYPE_EDIT, self); list_insert_item(self->login_window->child_list, insert_index, (long)b); insert_index++; b->parent = self->login_window; b->owner = self->login_window; b->left = globals->ls_scaled.input_x_pos; b->top = globals->ls_scaled.input_y_pos + combo_height + 5 + (edit_height + 5) * count; b->id = 100 + 2 * count + 1; b->pointer = 1; b->tab_stop = 1; b->caption1 = (char *)g_malloc(256, 1); /* ask{base64}... 3 for "ask", 8 for "{base64}" */ if (g_strncmp(BASE64PREFIX, value + ASK_LEN, BASE64PREFIX_LEN) == 0) { base64_length = g_strlen(value + ASK_LEN + BASE64PREFIX_LEN); plain = (char *)g_malloc(base64_length, 0); base64_decode(value + ASK_LEN + BASE64PREFIX_LEN, plain, base64_length, &plain_length); plain[plain_length] = '\0'; g_strncpy(b->caption1, plain, 255); g_free(plain); } else { g_strncpy(b->caption1, value + ASK_LEN, 255); } b->edit_pos = utf8_char_count(b->caption1); if (self->login_window->focused_control == 0) { self->login_window->focused_control = b; } /* Use the domain name as the destination IP/DNS This is useful in a gateway setup. */ if (g_strncasecmp(name, "ip", 255) == 0) { /* If the first char in the domain name is '_' we use the domain name as IP */ if (self->session->client_info->domain[0] == '_') { xrdp_wm_parse_domain_information( self->session->client_info->domain, combo->data_list->count, 0, resultIP); g_strncpy(b->caption1, resultIP, 255); b->edit_pos = utf8_char_count(b->caption1); } } if (g_strncasecmp(name, "username", 255) == 0 && self->session->client_info->username[0]) { g_strncpy(b->caption1, self->session->client_info->username, 255); b->edit_pos = utf8_char_count(b->caption1); if (b->edit_pos > 0) { username_set = 1; } } if ((g_strncasecmp(name, "password", 255) == 0) || (g_strncasecmp(name, "pampassword", 255) == 0)) { b->password_char = '*'; if (username_set) { if (b->parent != 0) { b->parent->focused_control = b; } } } count++; } } } return 0; } /*****************************************************************************/ /* all login screen events go here */ static int xrdp_wm_login_notify(struct xrdp_bitmap *wnd, struct xrdp_bitmap *sender, int msg, long param1, long param2) { struct xrdp_bitmap *b; struct xrdp_rect rect; int i; if (wnd->modal_dialog != 0 && msg != 100) { return 0; } if (msg == 1) /* click */ { if (sender->id == 1) /* help button */ { xrdp_wm_help_clicked(wnd); } else if (sender->id == 2) /* cancel button */ { xrdp_wm_cancel_clicked(wnd); } else if (sender->id == 3) /* ok button */ { xrdp_wm_ok_clicked(wnd); } } else if (msg == 2) /* mouse move */ { } else if (msg == 100) /* modal result is done */ { i = list_index_of(wnd->wm->screen->child_list, (long)sender); if (i >= 0) { b = (struct xrdp_bitmap *) list_get_item(wnd->wm->screen->child_list, i); list_remove_item(sender->wm->screen->child_list, i); MAKERECT(rect, b->left, b->top, b->width, b->height); xrdp_bitmap_invalidate(wnd->wm->screen, &rect); xrdp_bitmap_delete(sender); wnd->modal_dialog = 0; xrdp_wm_set_focused(wnd->wm, wnd); } } else if (msg == CB_ITEMCHANGE) /* combo box change */ { xrdp_wm_show_edits(wnd->wm, sender); xrdp_bitmap_invalidate(wnd, 0); /* invalidate the whole dialog for now */ } return 0; } /******************************************************************************/ static int xrdp_wm_login_fill_in_combo(struct xrdp_wm *self, struct xrdp_bitmap *b) { struct list *sections; struct list *section_names; struct list *section_values; int fd; int i; int j; char *p; char *q; char *r; char name[256]; struct xrdp_mod_data *mod_data; const char *xrdp_ini = self->session->xrdp_ini; sections = list_create(); sections->auto_free = 1; section_names = list_create(); section_names->auto_free = 1; section_values = list_create(); section_values->auto_free = 1; fd = g_file_open_ro(xrdp_ini); if (fd < 0) { LOG(LOG_LEVEL_ERROR, "Could not read xrdp ini file %s", xrdp_ini); list_delete(sections); list_delete(section_names); list_delete(section_values); return 1; } file_read_sections(fd, sections); for (i = 0; i < sections->count; i++) { p = (char *)list_get_item(sections, i); file_read_section(fd, p, section_names, section_values); if ((g_strncasecmp(p, "globals", 255) == 0) || (g_strncasecmp(p, "channels", 255) == 0) || (g_strncasecmp(p, "Logging", 255) == 0) || (g_strncasecmp(p, "LoggingPerLogger", 255) == 0)) { } else { g_strncpy(name, p, 255); mod_data = (struct xrdp_mod_data *) g_malloc(sizeof(struct xrdp_mod_data), 1); mod_data->names = list_create(); mod_data->names->auto_free = 1; mod_data->values = list_create(); mod_data->values->auto_free = 1; for (j = 0; j < section_names->count; j++) { q = (char *)list_get_item(section_names, j); r = (char *)list_get_item(section_values, j); if (g_strncmp("name", q, 255) == 0) { g_strncpy(name, r, 255); } list_add_strdup(mod_data->names, q); list_add_strdup(mod_data->values, r); } list_add_strdup(b->string_list, name); list_add_item(b->data_list, (long)mod_data); } } g_file_close(fd); list_delete(sections); list_delete(section_names); list_delete(section_values); return 0; } /******************************************************************************/ unsigned int xrdp_login_wnd_get_monitor_dpi(struct xrdp_wm *self) { unsigned int result = 0; const struct display_size_description *display_sizes = &self->client_info->display_sizes; unsigned int height_pixels = 0; unsigned int height_mm = 0; unsigned int i; /* Look at the monitor data first */ for (i = 0; i < display_sizes->monitorCount; ++i) { const struct monitor_info *mi = &display_sizes->minfo_wm[i]; { if (mi->is_primary) { height_pixels = mi->bottom - mi->top + 1; height_mm = mi->physical_height; break; } } } /* No primary monitor, or values not defined - use the desktop size */ if (height_mm == 0) { height_pixels = display_sizes->session_height; height_mm = self->client_info->session_physical_height; if (height_mm == 0) { LOG(LOG_LEVEL_WARNING, "No information is available to determine login screen DPI"); } else if (height_pixels < 768) { /* A bug was encountered with mstsc.exe version 10.0.19041.1682 where the full physical monitor size was sent in TS_UD_CS_CORE when the desktop size was set to less than the screen size. To generate the bug, make a connection with a full-screen single window, cancel the login, and reconnect at (e.g.) 800x600. We can't detect that exact situation here, but if the session height is so small as to likely be in a window (rather than full screen), we should ignore the physical size */ LOG(LOG_LEVEL_WARNING, "Ignoring unlikely physical session size %u " "for height of %u pixels", height_mm, height_pixels); height_mm = 0; } } if (height_mm != 0) { /* * DPI = height_pixels / (height_mm / 25.4) * = (height_pixels * 25.4) / height_mm * = (height_pixels * 127) / (height_mm * 5) */ result = (height_pixels * 127 ) / (height_mm * 5); LOG(LOG_LEVEL_INFO, "Login screen monitor height is %u pixels over %u mm (%u DPI)", height_pixels, height_mm, result); } return result; } /******************************************************************************/ int xrdp_login_wnd_create(struct xrdp_wm *self) { struct xrdp_bitmap *but; struct xrdp_bitmap *combo; struct xrdp_cfg_globals *globals; char buf[256]; char buf1[256]; char resultIP[256]; int log_width; int log_height; int regular; int primary_width; /* Dimensions of primary screen */ int primary_height; int primary_x_offset; /* Offset of centre of primary screen */ int primary_y_offset; uint32_t index; int x; int y; int cx; int cy; const int combo_height = self->xrdp_config->cfg_globals.ls_scaled.combo_height; const int edit_height = self->xrdp_config->cfg_globals.ls_scaled.edit_height; globals = &self->xrdp_config->cfg_globals; primary_width = self->screen->width; primary_height = self->screen->height; primary_x_offset = primary_width / 2; primary_y_offset = primary_height / 2; log_width = globals->ls_scaled.width; log_height = globals->ls_scaled.height; regular = 1; if (self->screen->width < log_width) { if (self->screen->width < 240) { log_width = self->screen->width - 4; } else { log_width = 240; } regular = 0; } /* multimon scenario, draw login window on primary monitor */ if (self->client_info->display_sizes.monitorCount > 1) { for (index = 0; index < self->client_info->display_sizes.monitorCount; index++) { if (self->client_info->display_sizes.minfo_wm[index].is_primary) { x = self->client_info->display_sizes.minfo_wm[index].left; y = self->client_info->display_sizes.minfo_wm[index].top; cx = self->client_info->display_sizes.minfo_wm[index].right; cy = self->client_info->display_sizes.minfo_wm[index].bottom; primary_width = cx - x; primary_height = cy - y; primary_x_offset = x + (primary_width / 2); primary_y_offset = y + (primary_height / 2); break; } } } /* draw login window */ self->login_window = xrdp_bitmap_create(log_width, log_height, self->screen->bpp, WND_TYPE_WND, self); list_add_item(self->screen->child_list, (long)self->login_window); self->login_window->parent = self->screen; self->login_window->owner = self->screen; self->login_window->bg_color = globals->ls_bg_color; self->login_window->left = primary_x_offset - self->login_window->width / 2; self->login_window->top = primary_y_offset - self->login_window->height / 2; self->login_window->notify = xrdp_wm_login_notify; /* if window title not specified, use hostname as default */ if (globals->ls_title[0] == 0) { g_gethostname(buf1, 256); g_snprintf(buf, sizeof(buf), "Login to %s", buf1); set_string(&self->login_window->caption1, buf); } else { /*self->login_window->caption1 = globals->ls_title[0];*/ g_snprintf(buf, sizeof(buf), "%s", globals->ls_title); set_string(&self->login_window->caption1, buf); } if (regular) { /* Load the background image. */ /* If no file is specified no default image will be loaded. */ /* We only load the image if bpp > 8, and if the user hasn't * disabled wallpaper in the performance settings */ if (globals->ls_background_image[0] != 0) { if (self->screen->bpp <= 8) { LOG(LOG_LEVEL_INFO, "Login background not loaded for bpp=%d", self->screen->bpp); } else if ((self->client_info->rdp5_performanceflags & RDP5_NO_WALLPAPER) != 0) { LOG(LOG_LEVEL_INFO, "Login background not loaded as client " "has requested PERF_DISABLE_WALLPAPER"); } else { char fileName[256] ; but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self); if (globals->ls_background_image[0] == '/') { g_snprintf(fileName, 255, "%s", globals->ls_background_image); } else { g_snprintf(fileName, 255, "%s/%s", XRDP_SHARE_PATH, globals->ls_background_image); } LOG(LOG_LEVEL_DEBUG, "We try to load the following background file: %s", fileName); if (globals->ls_background_transform == XBLT_NONE) { xrdp_bitmap_load(but, fileName, self->palette, globals->ls_top_window_bg_color, globals->ls_background_transform, 0, 0); /* Place the background in the bottom right corner */ but->left = primary_x_offset + (primary_width / 2) - but->width; but->top = primary_y_offset + (primary_height / 2) - but->height; } else { xrdp_bitmap_load(but, fileName, self->palette, globals->ls_top_window_bg_color, globals->ls_background_transform, primary_width, primary_height); but->left = primary_x_offset - (primary_width / 2); but->top = primary_y_offset - (primary_height / 2); } but->parent = self->screen; but->owner = self->screen; list_add_item(self->screen->child_list, (long)but); } } /* if logo image not specified, use default */ if (globals->ls_logo_filename[0] == 0) { #ifdef USE_IMLIB2 g_snprintf(globals->ls_logo_filename, 255, "%s/xrdp_logo.png", XRDP_SHARE_PATH); #else g_snprintf(globals->ls_logo_filename, 255, "%s/xrdp_logo.bmp", XRDP_SHARE_PATH); #endif } /* logo image */ but = xrdp_bitmap_create(4, 4, self->screen->bpp, WND_TYPE_IMAGE, self); if (self->screen->bpp <= 8) { g_snprintf(globals->ls_logo_filename, 255, "%s/ad256.bmp", XRDP_SHARE_PATH); } LOG(LOG_LEVEL_DEBUG, "ls_logo_filename: %s", globals->ls_logo_filename); xrdp_bitmap_load(but, globals->ls_logo_filename, self->palette, globals->ls_bg_color, globals->ls_logo_transform, globals->ls_scaled.logo_width, globals->ls_scaled.logo_height); but->parent = self->login_window; but->owner = self->login_window; but->left = globals->ls_scaled.logo_x_pos; but->top = globals->ls_scaled.logo_y_pos; list_add_item(self->login_window->child_list, (long)but); } /* label */ but = xrdp_bitmap_create(globals->ls_scaled.label_width, edit_height, self->screen->bpp, WND_TYPE_LABEL, self); list_add_item(self->login_window->child_list, (long)but); but->parent = self->login_window; but->owner = self->login_window; but->left = globals->ls_scaled.label_x_pos; but->top = globals->ls_scaled.input_y_pos; set_string(&but->caption1, "Session"); /* combo */ combo = xrdp_bitmap_create(globals->ls_scaled.input_width, combo_height, self->screen->bpp, WND_TYPE_COMBO, self); list_add_item(self->login_window->child_list, (long)combo); combo->parent = self->login_window; combo->owner = self->login_window; combo->left = globals->ls_scaled.input_x_pos; combo->top = globals->ls_scaled.input_y_pos; combo->id = 6; combo->tab_stop = 1; xrdp_wm_login_fill_in_combo(self, combo); /* OK button */ but = xrdp_bitmap_create(globals->ls_scaled.btn_ok_width, globals->ls_scaled.btn_ok_height, self->screen->bpp, WND_TYPE_BUTTON, self); list_add_item(self->login_window->child_list, (long)but); but->parent = self->login_window; but->owner = self->login_window; but->left = globals->ls_scaled.btn_ok_x_pos; but->top = globals->ls_scaled.btn_ok_y_pos; but->id = 3; set_string(&but->caption1, "OK"); but->tab_stop = 1; self->login_window->default_button = but; /* Cancel button */ but = xrdp_bitmap_create(globals->ls_scaled.btn_cancel_width, globals->ls_scaled.btn_cancel_height, self->screen->bpp, WND_TYPE_BUTTON, self); list_add_item(self->login_window->child_list, (long)but); but->parent = self->login_window; but->owner = self->login_window; but->left = globals->ls_scaled.btn_cancel_x_pos; but->top = globals->ls_scaled.btn_cancel_y_pos; but->id = 2; set_string(&but->caption1, "Cancel"); but->tab_stop = 1; self->login_window->esc_button = but; /* labels and edits. * parameter: 1 = decode domain field index information from client. * We only perform this the first time for each connection. */ combo->item_index = xrdp_wm_parse_domain_information( self->session->client_info->domain, combo->data_list->count, 1, resultIP /* just a dummy place holder, we ignore */ ); xrdp_wm_show_edits(self, combo); return 0; } /** * Map a bitmap transform string to a value * * @param param Param we're trying to read * @param str String we're trying to map * * @return enum xrdp_bitmap_load_transform value * * A warning is logged if the string is not recognised *****************************************************************************/ static enum xrdp_bitmap_load_transform bitmap_transform_str_to_val(const char *param, const char *str) { enum xrdp_bitmap_load_transform rv; if (g_strcmp(str, "none") == 0) { rv = XBLT_NONE; } else if (g_strcmp(str, "scale") == 0) { rv = XBLT_SCALE; } else if (g_strcmp(str, "zoom") == 0) { rv = XBLT_ZOOM; } else { LOG(LOG_LEVEL_WARNING, "Param '%s' has unrecognised value '%s'" " - assuming 'none'", param, str); rv = XBLT_NONE; } return rv; } /** * Load configuration from xrdp.ini file * * @param config XRDP configuration to initialise * @param xrdp_ini Path to xrdp.ini * @param bpp bits-per-pixel for this connection * * @return 0 on success, -1 on failure *****************************************************************************/ int load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp) { struct xrdp_cfg_globals *globals; struct list *names; struct list *values; char *n; char *v; int fd; int i; if (!config) { return -1; } globals = &config->cfg_globals; /* set default values in case we can't get them from xrdp.ini file */ globals->ini_version = 1; globals->default_dpi = 96; globals->ls_top_window_bg_color = HCOLOR(bpp, xrdp_wm_htoi("009cb5")); globals->ls_bg_color = HCOLOR(bpp, xrdp_wm_htoi("dedede")); globals->ls_unscaled.width = 350; globals->ls_unscaled.height = 350; globals->ls_background_transform = XBLT_NONE; globals->ls_logo_transform = XBLT_NONE; globals->ls_unscaled.logo_x_pos = 63; globals->ls_unscaled.logo_y_pos = 50; globals->ls_unscaled.label_x_pos = 30; globals->ls_unscaled.label_width = 65; globals->ls_unscaled.input_x_pos = 110; globals->ls_unscaled.input_width = 210; globals->ls_unscaled.input_y_pos = 150; globals->ls_unscaled.btn_ok_x_pos = 150; globals->ls_unscaled.btn_ok_y_pos = 300; globals->ls_unscaled.btn_ok_width = 85; globals->ls_unscaled.btn_ok_height = 30; globals->ls_unscaled.btn_cancel_x_pos = 245; globals->ls_unscaled.btn_cancel_y_pos = 300; globals->ls_unscaled.btn_cancel_width = 85; globals->ls_unscaled.btn_cancel_height = 30; globals->ls_unscaled.default_btn_height = DEFAULT_FONT_PIXEL_SIZE + DEFAULT_BUTTON_MARGIN_H; globals->ls_unscaled.log_wnd_width = DEFAULT_WND_LOG_W; globals->ls_unscaled.log_wnd_height = DEFAULT_WND_LOG_H; globals->ls_unscaled.edit_height = DEFAULT_FONT_PIXEL_SIZE + DEFAULT_EDIT_MARGIN_H; globals->ls_unscaled.combo_height = DEFAULT_FONT_PIXEL_SIZE + DEFAULT_COMBO_MARGIN_H; globals->ls_unscaled.help_wnd_width = DEFAULT_WND_HELP_W; globals->ls_unscaled.help_wnd_height = DEFAULT_WND_HELP_H; /* open xrdp.ini file */ if ((fd = g_file_open_ro(xrdp_ini)) < 0) { LOG(LOG_LEVEL_ERROR, "load_config: Could not read " "xrdp.ini file %s", xrdp_ini); return -1; } names = list_create(); values = list_create(); names->auto_free = 1; values->auto_free = 1; if (file_read_section(fd, "globals", names, values) != 0) { list_delete(names); list_delete(values); g_file_close(fd); LOG(LOG_LEVEL_ERROR, "load_config: Could not read globals " "section from xrdp.ini file %s", xrdp_ini); return -1; } for (i = 0; i < names->count; i++) { n = (char *) list_get_item(names, i); v = (char *) list_get_item(values, i); /* * parse globals section */ if (g_strncmp(n, "ini_version", 64) == 0) { globals->ini_version = g_atoi(v); } else if (g_strncmp(n, "bitmap_cache", 64) == 0) { globals->use_bitmap_cache = g_text2bool(v); } else if (g_strncmp(n, "bitmap_compression", 64) == 0) { globals->use_bitmap_compression = g_text2bool(v); } else if (g_strncmp(n, "port", 64) == 0) { globals->port = g_atoi(v); } else if (g_strncmp(n, "crypt_level", 64) == 0) { if (g_strcmp(v, "low") == 0) { globals->crypt_level = 1; } else if (g_strcmp(v, "medium") == 0) { globals->crypt_level = 2; } else { globals->crypt_level = 3; } } else if (g_strncmp(n, "allow_channels", 64) == 0) { globals->allow_channels = g_text2bool(v); } else if (g_strncmp(n, "max_bpp", 64) == 0) { globals->max_bpp = g_atoi(v); } else if (g_strncmp(n, "fork", 64) == 0) { globals->fork = g_text2bool(v); } else if (g_strncmp(n, "tcp_nodelay", 64) == 0) { globals->tcp_nodelay = g_text2bool(v); } else if (g_strncmp(n, "tcp_keepalive", 64) == 0) { globals->tcp_keepalive = g_text2bool(v); } else if (g_strncmp(n, "tcp_send_buffer_bytes", 64) == 0) { globals->tcp_send_buffer_bytes = g_atoi(v); } else if (g_strncmp(n, "tcp_recv_buffer_bytes", 64) == 0) { globals->tcp_recv_buffer_bytes = g_atoi(v); } /* colors */ else if (g_strncmp(n, "grey", 64) == 0) { globals->grey = xrdp_wm_htoi(v); } else if (g_strncmp(n, "black", 64) == 0) { globals->black = xrdp_wm_htoi(v); } else if (g_strncmp(n, "dark_grey", 64) == 0) { globals->dark_grey = xrdp_wm_htoi(v); } else if (g_strncmp(n, "blue", 64) == 0) { globals->blue = xrdp_wm_htoi(v); } else if (g_strncmp(n, "dark_blue", 64) == 0) { globals->dark_blue = xrdp_wm_htoi(v); } else if (g_strncmp(n, "white", 64) == 0) { globals->white = xrdp_wm_htoi(v); } else if (g_strncmp(n, "red", 64) == 0) { globals->red = xrdp_wm_htoi(v); } else if (g_strncmp(n, "green", 64) == 0) { globals->green = xrdp_wm_htoi(v); } else if (g_strncmp(n, "background", 64) == 0) { globals->background = xrdp_wm_htoi(v); } /* misc stuff */ else if (g_strncmp(n, "autorun", 255) == 0) { g_strncpy(globals->autorun, v, 255); } else if (g_strncmp(n, "hidelogwindow", 64) == 0) { globals->hidelogwindow = g_text2bool(v); } else if (g_strncmp(n, "require_credentials", 64) == 0) { globals->require_credentials = g_text2bool(v); } else if (g_strncmp(n, "bulk_compression", 64) == 0) { globals->bulk_compression = g_text2bool(v); } else if (g_strncmp(n, "new_cursors", 64) == 0) { globals->new_cursors = g_text2bool(v); } else if (g_strncmp(n, "nego_sec_layer", 64) == 0) { globals->nego_sec_layer = g_atoi(v); } else if (g_strncmp(n, "allow_multimon", 64) == 0) { globals->allow_multimon = g_text2bool(v); } else if (g_strncmp(n, "enable_token_login", 64) == 0) { LOG(LOG_LEVEL_DEBUG, "Token login detection enabled x"); globals->enable_token_login = g_text2bool(v); } /* login screen values */ else if (g_strcmp(n, "default_dpi") == 0) { globals->default_dpi = g_atoi(v); } else if (g_strcmp(n, "fv1_select") == 0) { g_strncpy(globals->fv1_select, v, sizeof(globals->fv1_select) - 1); } else if (g_strncmp(n, "ls_top_window_bg_color", 64) == 0) { globals->ls_top_window_bg_color = HCOLOR(bpp, xrdp_wm_htoi(v)); } else if (g_strncmp(n, "ls_width", 64) == 0) { globals->ls_unscaled.width = g_atoi(v); } else if (g_strncmp(n, "ls_height", 64) == 0) { globals->ls_unscaled.height = g_atoi(v); } else if (g_strncmp(n, "ls_bg_color", 64) == 0) { globals->ls_bg_color = HCOLOR(bpp, xrdp_wm_htoi(v)); } else if (g_strncmp(n, "ls_title", 255) == 0) { g_strncpy(globals->ls_title, v, 255); globals->ls_title[255] = 0; } else if (g_strncmp(n, "ls_background_image", 255) == 0) { g_strncpy(globals->ls_background_image, v, 255); globals->ls_background_image[255] = 0; } else if (g_strncmp(n, "ls_background_transform", 255) == 0) { globals->ls_background_transform = bitmap_transform_str_to_val(n, v); } else if (g_strncmp(n, "ls_logo_filename", 255) == 0) { g_strncpy(globals->ls_logo_filename, v, 255); globals->ls_logo_filename[255] = 0; } else if (g_strncmp(n, "ls_logo_transform", 255) == 0) { globals->ls_logo_transform = bitmap_transform_str_to_val(n, v); } else if (g_strncmp(n, "ls_logo_width", 64) == 0) { globals->ls_unscaled.logo_width = g_atoi(v); } else if (g_strncmp(n, "ls_logo_height", 64) == 0) { globals->ls_unscaled.logo_height = g_atoi(v); } else if (g_strncmp(n, "ls_logo_x_pos", 64) == 0) { globals->ls_unscaled.logo_x_pos = g_atoi(v); } else if (g_strncmp(n, "ls_logo_y_pos", 64) == 0) { globals->ls_unscaled.logo_y_pos = g_atoi(v); } else if (g_strncmp(n, "ls_label_x_pos", 64) == 0) { globals->ls_unscaled.label_x_pos = g_atoi(v); } else if (g_strncmp(n, "ls_label_width", 64) == 0) { globals->ls_unscaled.label_width = g_atoi(v); } else if (g_strncmp(n, "ls_input_x_pos", 64) == 0) { globals->ls_unscaled.input_x_pos = g_atoi(v); } else if (g_strncmp(n, "ls_input_width", 64) == 0) { globals->ls_unscaled.input_width = g_atoi(v); } else if (g_strncmp(n, "ls_input_y_pos", 64) == 0) { globals->ls_unscaled.input_y_pos = g_atoi(v); } else if (g_strncmp(n, "ls_btn_ok_x_pos", 64) == 0) { globals->ls_unscaled.btn_ok_x_pos = g_atoi(v); } else if (g_strncmp(n, "ls_btn_ok_y_pos", 64) == 0) { globals->ls_unscaled.btn_ok_y_pos = g_atoi(v); } else if (g_strncmp(n, "ls_btn_ok_width", 64) == 0) { globals->ls_unscaled.btn_ok_width = g_atoi(v); } else if (g_strncmp(n, "ls_btn_ok_height", 64) == 0) { globals->ls_unscaled.btn_ok_height = g_atoi(v); } else if (g_strncmp(n, "ls_btn_cancel_x_pos", 64) == 0) { globals->ls_unscaled.btn_cancel_x_pos = g_atoi(v); } else if (g_strncmp(n, "ls_btn_cancel_y_pos", 64) == 0) { globals->ls_unscaled.btn_cancel_y_pos = g_atoi(v); } else if (g_strncmp(n, "ls_btn_cancel_width", 64) == 0) { globals->ls_unscaled.btn_cancel_width = g_atoi(v); } else if (g_strncmp(n, "ls_btn_cancel_height", 64) == 0) { globals->ls_unscaled.btn_cancel_height = g_atoi(v); } } LOG(LOG_LEVEL_DEBUG, "ini_version: %d", globals->ini_version); LOG(LOG_LEVEL_DEBUG, "use_bitmap_cache: %d", globals->use_bitmap_cache); LOG(LOG_LEVEL_DEBUG, "use_bitmap_compression: %d", globals->use_bitmap_compression); LOG(LOG_LEVEL_DEBUG, "port: %d", globals->port); LOG(LOG_LEVEL_DEBUG, "crypt_level: %d", globals->crypt_level); LOG(LOG_LEVEL_DEBUG, "allow_channels: %d", globals->allow_channels); LOG(LOG_LEVEL_DEBUG, "max_bpp: %d", globals->max_bpp); LOG(LOG_LEVEL_DEBUG, "fork: %d", globals->fork); LOG(LOG_LEVEL_DEBUG, "tcp_nodelay: %d", globals->tcp_nodelay); LOG(LOG_LEVEL_DEBUG, "tcp_keepalive: %d", globals->tcp_keepalive); LOG(LOG_LEVEL_DEBUG, "tcp_send_buffer_bytes: %d", globals->tcp_send_buffer_bytes); LOG(LOG_LEVEL_DEBUG, "tcp_recv_buffer_bytes: %d", globals->tcp_recv_buffer_bytes); LOG(LOG_LEVEL_DEBUG, "grey: %d", globals->grey); LOG(LOG_LEVEL_DEBUG, "black: %d", globals->black); LOG(LOG_LEVEL_DEBUG, "dark_grey: %d", globals->dark_grey); LOG(LOG_LEVEL_DEBUG, "blue: %d", globals->blue); LOG(LOG_LEVEL_DEBUG, "dark_blue: %d", globals->dark_blue); LOG(LOG_LEVEL_DEBUG, "white: %d", globals->white); LOG(LOG_LEVEL_DEBUG, "red: %d", globals->red); LOG(LOG_LEVEL_DEBUG, "green: %d", globals->green); LOG(LOG_LEVEL_DEBUG, "background: %d", globals->background); LOG(LOG_LEVEL_DEBUG, "autorun: %s", globals->autorun); LOG(LOG_LEVEL_DEBUG, "hidelogwindow: %d", globals->hidelogwindow); LOG(LOG_LEVEL_DEBUG, "require_credentials: %d", globals->require_credentials); LOG(LOG_LEVEL_DEBUG, "bulk_compression: %d", globals->bulk_compression); LOG(LOG_LEVEL_DEBUG, "new_cursors: %d", globals->new_cursors); LOG(LOG_LEVEL_DEBUG, "nego_sec_layer: %d", globals->nego_sec_layer); LOG(LOG_LEVEL_DEBUG, "allow_multimon: %d", globals->allow_multimon); LOG(LOG_LEVEL_DEBUG, "enable_token_login: %d", globals->enable_token_login); LOG(LOG_LEVEL_DEBUG, "ls_top_window_bg_color: %x", globals->ls_top_window_bg_color); LOG(LOG_LEVEL_DEBUG, "ls_width (unscaled): %d", globals->ls_unscaled.width); LOG(LOG_LEVEL_DEBUG, "ls_height (unscaled): %d", globals->ls_unscaled.height); LOG(LOG_LEVEL_DEBUG, "ls_bg_color: %x", globals->ls_bg_color); LOG(LOG_LEVEL_DEBUG, "ls_title: %s", globals->ls_title); LOG(LOG_LEVEL_DEBUG, "ls_logo_filename: %s", globals->ls_logo_filename); LOG(LOG_LEVEL_DEBUG, "ls_logo_x_pos : %d", globals->ls_unscaled.logo_x_pos); LOG(LOG_LEVEL_DEBUG, "ls_logo_y_pos : %d", globals->ls_unscaled.logo_y_pos); LOG(LOG_LEVEL_DEBUG, "ls_label_x_pos : %d", globals->ls_unscaled.label_x_pos); LOG(LOG_LEVEL_DEBUG, "ls_label_width : %d", globals->ls_unscaled.label_width); LOG(LOG_LEVEL_DEBUG, "ls_input_x_pos : %d", globals->ls_unscaled.input_x_pos); LOG(LOG_LEVEL_DEBUG, "ls_input_width : %d", globals->ls_unscaled.input_width); LOG(LOG_LEVEL_DEBUG, "ls_input_y_pos : %d", globals->ls_unscaled.input_y_pos); LOG(LOG_LEVEL_DEBUG, "ls_btn_ok_x_pos : %d", globals->ls_unscaled.btn_ok_x_pos); LOG(LOG_LEVEL_DEBUG, "ls_btn_ok_y_pos : %d", globals->ls_unscaled.btn_ok_y_pos); LOG(LOG_LEVEL_DEBUG, "ls_btn_ok_width : %d", globals->ls_unscaled.btn_ok_width); LOG(LOG_LEVEL_DEBUG, "ls_btn_ok_height : %d", globals->ls_unscaled.btn_ok_height); LOG(LOG_LEVEL_DEBUG, "ls_btn_cancel_x_pos : %d", globals->ls_unscaled.btn_cancel_x_pos); LOG(LOG_LEVEL_DEBUG, "ls_btn_cancel_y_pos : %d", globals->ls_unscaled.btn_cancel_y_pos); LOG(LOG_LEVEL_DEBUG, "ls_btn_cancel_width : %d", globals->ls_unscaled.btn_cancel_width); LOG(LOG_LEVEL_DEBUG, "ls_btn_cancel_height : %d", globals->ls_unscaled.btn_cancel_height); list_delete(names); list_delete(values); g_file_close(fd); return 0; } /** * Scale the configuration values * * After a font has been loaded, we can produce scaled versions of the * login screen layout parameters which will correspond to the size of the * font */ void xrdp_login_wnd_scale_config_values(struct xrdp_wm *self) { const struct xrdp_ls_dimensions *unscaled = &self->xrdp_config->cfg_globals.ls_unscaled; struct xrdp_ls_dimensions *scaled = &self->xrdp_config->cfg_globals.ls_scaled; /* Clear the scaled values, so if we add one and forget to scale it, * it will be obvious */ g_memset(scaled, '\0', sizeof(*scaled)); /* If we don't have a font, use zeros for everything */ if (self->default_font == NULL) { LOG(LOG_LEVEL_ERROR, "Can't scale login values - no font available"); } else { const int fheight = self->default_font->body_height; /* Define a Macro to scale to the nearest pixel value, * rounding up as appropriate */ #define SCALE_AND_ROUND(x) \ (((x) * fheight + (DEFAULT_FONT_PIXEL_SIZE / 2)) / \ DEFAULT_FONT_PIXEL_SIZE) LOG(LOG_LEVEL_DEBUG, "Login screen scale factor %f", (float)fheight / DEFAULT_FONT_PIXEL_SIZE); scaled->width = SCALE_AND_ROUND(unscaled->width); scaled->height = SCALE_AND_ROUND(unscaled->height); scaled->logo_width = SCALE_AND_ROUND(unscaled->logo_width); scaled->logo_height = SCALE_AND_ROUND(unscaled->logo_height); scaled->logo_x_pos = SCALE_AND_ROUND(unscaled->logo_x_pos); scaled->logo_y_pos = SCALE_AND_ROUND(unscaled->logo_y_pos); scaled->label_x_pos = SCALE_AND_ROUND(unscaled->label_x_pos); scaled->label_width = SCALE_AND_ROUND(unscaled->label_width); scaled->input_x_pos = SCALE_AND_ROUND(unscaled->input_x_pos); scaled->input_width = SCALE_AND_ROUND(unscaled->input_width); scaled->input_y_pos = SCALE_AND_ROUND(unscaled->input_y_pos); scaled->btn_ok_x_pos = SCALE_AND_ROUND(unscaled->btn_ok_x_pos); scaled->btn_ok_y_pos = SCALE_AND_ROUND(unscaled->btn_ok_y_pos); scaled->btn_ok_width = SCALE_AND_ROUND(unscaled->btn_ok_width); scaled->btn_ok_height = SCALE_AND_ROUND(unscaled->btn_ok_height); scaled->btn_cancel_x_pos = SCALE_AND_ROUND(unscaled->btn_cancel_x_pos); scaled->btn_cancel_y_pos = SCALE_AND_ROUND(unscaled->btn_cancel_y_pos); scaled->btn_cancel_width = SCALE_AND_ROUND(unscaled->btn_cancel_width); scaled->btn_cancel_height = SCALE_AND_ROUND(unscaled->btn_cancel_height); scaled->default_btn_height = fheight + DEFAULT_BUTTON_MARGIN_H; scaled->log_wnd_width = SCALE_AND_ROUND(unscaled->log_wnd_width); scaled->log_wnd_height = SCALE_AND_ROUND(unscaled->log_wnd_height); scaled->edit_height = fheight + DEFAULT_EDIT_MARGIN_H; scaled->combo_height = fheight + DEFAULT_COMBO_MARGIN_H; scaled->help_wnd_width = SCALE_AND_ROUND(unscaled->help_wnd_width); scaled->help_wnd_height = SCALE_AND_ROUND(unscaled->help_wnd_height); #undef SCALE_AND_ROUND } } xrdp-0.10.1/xrdp/xrdp.ini000644 001751 000000 00000023475 14652432105 015276 0ustar00metawheel000000 000000 [Globals] ; xrdp.ini file version number ini_version=1 ; fork a new process for each incoming connection fork=true ; ports to listen on, number alone means listen on all interfaces ; 0.0.0.0 or :: if ipv6 is configured ; space between multiple occurrences ; ALL specified interfaces must be UP when xrdp starts, otherwise xrdp will fail to start ; ; Examples: ; port=3389 ; port=unix://./tmp/xrdp.socket ; port=tcp://.:3389 127.0.0.1:3389 ; port=tcp://:3389 *:3389 ; port=tcp://:3389 192.168.1.1:3389 ; port=tcp6://.:3389 ::1:3389 ; port=tcp6://:3389 *:3389 ; port=tcp6://{}:3389 {FC00:0:0:0:0:0:0:1}:3389 ; port=vsock://: port=3389 ; 'port' above should be connected to with vsock instead of tcp ; use this only with number alone in port above ; prefer use vsock://: above use_vsock=false ; regulate if the listening socket use socket option tcp_nodelay ; no buffering will be performed in the TCP stack tcp_nodelay=true ; regulate if the listening socket use socket option keepalive ; if the network connection disappear without close messages the connection will be closed tcp_keepalive=true ; set tcp send/recv buffer ; These parameters are largely historic. On systems with dynamic TCP ; buffer sizes, setting them manually will either impact performance or ; waste memory #tcp_send_buffer_bytes=32768 #tcp_recv_buffer_bytes=32768 ; security layer can be 'tls', 'rdp' or 'negotiate' ; for client compatible layer security_layer=negotiate ; minimum security level allowed for client for classic RDP encryption ; use tls_ciphers to configure TLS encryption ; can be 'none', 'low', 'medium', 'high', 'fips' crypt_level=high ; X.509 certificate and private key ; openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365 certificate= key_file= ; set SSL protocols ; can be comma separated list of 'SSLv3', 'TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3' ssl_protocols=TLSv1.2, TLSv1.3 ; set TLS cipher suites #tls_ciphers=HIGH ; concats the domain name to the user if set for authentication with the separator ; for example when the server is multi homed with SSSd #domain_user_separator=@ ; The following options will override the keyboard layout settings. ; These options are for DEBUG and are not recommended for regular use. #xrdp.override_keyboard_type=0x04 #xrdp.override_keyboard_subtype=0x01 #xrdp.override_keylayout=0x00000409 ; Section name to use for automatic login if the client sends username ; and password. If empty, the domain name sent by the client is used. ; If empty and no domain name is given, the first suitable section in ; this file will be used. autorun= allow_channels=true allow_multimon=true bitmap_cache=true bitmap_compression=true bulk_compression=true #hidelogwindow=true max_bpp=32 new_cursors=true ; fastpath - can be 'input', 'output', 'both', 'none' use_fastpath=both ; when true, userid/password *must* be passed on cmd line. If the password ; is incorrect, the login will fail #require_credentials=true ; when true, the userid will be used to try to authenticate #enable_token_login=true ; You can set the PAM error text in a gateway setup (MAX 256 chars) #pamerrortxt=change your password according to policy at http://url ; ; colors used by windows in RGB format ; #black=000000 grey=e1e1e1 dark_grey=b4b4b4 blue=0078d7 dark_blue=0078d7 #white=ffffff #red=ff0000 #green=00ff00 #background=626c72 ; ; Select a default fv1 font ; ; This parameter is a comma-separated list of DPI:name pairs. ; The list is scanned from left-to-right. The font used is the first ; font whose DPI value is less-than-or-equal to the vertical DPI of ; the monitor used for the login screen. #fv1_select=130:sans-18.fv1,0:sans-10.fv1 ; Default DPI used for a monitor when that information is unknown #default_dpi=96 ; ; configure login screen ; ; Login Screen Window Title #ls_title=My Login Title ; top level window background color in RGB format ls_top_window_bg_color=003057 ; width and height of login screen ; ; When the sans-10.fv1 font is selected, these values are in pixels. ; For other fonts, these values (and other size values) will be scaled ; appropriately to preserve the proportions of the login screen. ; ; The default height allows for about 5 fields to be comfortably displayed ; above the buttons at the bottom. To display more fields, make ; larger, and also increase and ; below ; ls_width=350 ls_height=360 ; login screen background color in RGB format ls_bg_color=f0f0f0 ; optional background image filename. BMP format is always supported, ; but other formats will be supported if xrdp is build with imlib2 ; The transform can be one of the following:- ; none : No transformation. Image is placed in bottom-right corner ; of the screen. ; scale : Image is scaled to the screen size. The image aspect ; ratio is not preserved. ; zoom : Image is scaled to the screen size. The image aspect ; ratio is preserved by clipping the image. #ls_background_image= #ls_background_transform=none ; logo ; full path to file or file in shared folder. BMP format is always supported, ; but other formats will be supported if xrdp is build with imlib2 ; For transform values, see 'ls_background_transform'. The logo width and ; logo height are ignored for a transform of 'none'. ls_logo_filename= ls_logo_transform=scale ls_logo_width=250 ls_logo_height=110 ls_logo_x_pos=55 ls_logo_y_pos=35 ; for positioning labels such as username, password etc ls_label_x_pos=30 ls_label_width=68 ; for positioning text and combo boxes next to above labels ls_input_x_pos=110 ls_input_width=210 ; y pos for first label and combo box ls_input_y_pos=158 ; OK button ls_btn_ok_x_pos=142 ls_btn_ok_y_pos=308 ls_btn_ok_width=85 ls_btn_ok_height=30 ; Cancel button ls_btn_cancel_x_pos=237 ls_btn_cancel_y_pos=308 ls_btn_cancel_width=85 ls_btn_cancel_height=30 [Logging] ; Note: Log levels can be any of: core, error, warning, info, debug, or trace LogFile=xrdp.log LogLevel=INFO EnableSyslog=true #SyslogLevel=INFO #EnableConsole=false #ConsoleLevel=INFO #EnableProcessId=false [LoggingPerLogger] ; Note: per logger configuration is only used if xrdp is built with ; --enable-devel-logging #xrdp.c=INFO #main()=INFO [Channels] ; Channel names not listed here will be blocked by XRDP. ; You can block any channel by setting its value to false. ; IMPORTANT! All channels are not supported in all use ; cases even if you set all values to true. ; You can override these settings on each session type ; These settings are only used if allow_channels=true rdpdr=true rdpsnd=true drdynvc=true cliprdr=true rail=true xrdpvr=true ; for debugging xrdp, in section xrdp1, change port=-1 to this: #port=/tmp/.xrdp/xrdp_display_10 ; ; Session types ; ; Some session types such as Xorg and Xvnc start a display server. ; Startup command-line parameters for the display server are configured ; in sesman.ini. See and configure also sesman.ini. [Xorg] name=Xorg lib=libxup.so username=ask password=ask port=-1 code=20 [Xvnc] name=Xvnc lib=libvnc.so username=ask password=ask ip=127.0.0.1 port=-1 #xserverbpp=24 #delay_ms=2000 ; Disable requested encodings to support buggy VNC servers ; (1 = ExtendedDesktopSize) #disabled_encodings_mask=0 ; Use this to connect to a chansrv instance created outside of sesman ; (e.g. as part of an x11vnc console session). Replace '0' with the ; display number of the session #chansrvport=DISPLAY(0) ; Generic VNC Proxy ; Tailor this to specific hosts and VNC instances by specifying an ip ; and port and setting a suitable name. [vnc-any] name=vnc-any lib=libvnc.so ip=ask port=ask5900 username=na password=ask #pamusername=asksame #pampassword=asksame #delay_ms=2000 ; Generic RDP proxy using NeutrinoRDP ; Tailor this to specific hosts by specifying an ip and port and setting ; a suitable name. [neutrinordp-any] name=neutrinordp-any ; To use this section, you should build xrdp with configure option ; --enable-neutrinordp. lib=libxrdpneutrinordp.so ip=ask port=ask3389 username=ask password=ask ; Uncomment the following lines to enable PAM authentication for proxy ; connections. #pamusername=ask #pampassword=ask ; Currently NeutrinoRDP doesn't support dynamic resizing. Uncomment ; this line if you're using a client which does. #enable_dynamic_resizing=false ; By default, performance settings requested by the RDP client are ignored ; and chosen by NeutrinoRDP. Uncomment this line to allow the user to ; select performance settings in the RDP client. #perf.allow_client_experiencesettings=true ; Override any experience setting by uncommenting one or more of the ; following lines. #perf.wallpaper=false #perf.font_smoothing=false #perf.desktop_composition=false #perf.full_window_drag=false #perf.menu_anims=false #perf.themes=false #perf.cursor_blink=false ; By default NeutrinoRDP supports cursor shadows. If this is giving ; you problems (e.g. cursor is a black rectangle) try disabling cursor ; shadows by uncommenting the following line. #perf.cursor_shadow=false ; By default, NeutrinoRDP uses the keyboard layout of the remote RDP Server. ; If you want to tell the remote the keyboard layout of the RDP Client, ; by uncommenting the following line. #neutrinordp.allow_client_keyboardLayout=true ; The following options will override the remote keyboard layout settings. ; These options are for DEBUG and are not recommended for regular use. #neutrinordp.override_keyboardLayout_mask=0x0000FFFF #neutrinordp.override_kbd_type=0x04 #neutrinordp.override_kbd_subtype=0x01 #neutrinordp.override_kbd_fn_keys=12 #neutrinordp.override_kbd_layout=0x00000409 ; You can override the common channel settings for each session type #channel.rdpdr=true #channel.rdpsnd=true #channel.drdynvc=true #channel.cliprdr=true #channel.rail=true #channel.xrdpvr=true xrdp-0.10.1/xrdp/xrdp_cache.c000644 001751 000000 00000057342 14652432047 016071 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * cache */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "log.h" /*****************************************************************************/ static int xrdp_cache_reset_lru(struct xrdp_cache *self) { int index; int jndex; struct xrdp_lru_item *lru; for (index = 0; index < XRDP_MAX_BITMAP_CACHE_ID; index++) { /* fist item */ lru = &(self->bitmap_lrus[index][0]); lru->next = 1; lru->prev = -1; /* middle items */ for (jndex = 1; jndex < XRDP_MAX_BITMAP_CACHE_IDX - 1; jndex++) { lru = &(self->bitmap_lrus[index][jndex]); lru->next = jndex + 1; lru->prev = jndex - 1; } /* last item */ lru = &(self->bitmap_lrus[index][XRDP_MAX_BITMAP_CACHE_IDX - 1]); lru->next = -1; lru->prev = XRDP_MAX_BITMAP_CACHE_IDX - 2; self->lru_head[index] = 0; self->lru_tail[index] = XRDP_MAX_BITMAP_CACHE_IDX - 1; self->lru_reset[index] = 1; } return 0; } /*****************************************************************************/ static int xrdp_cache_reset_crc(struct xrdp_cache *self) { int index; int jndex; for (index = 0; index < XRDP_MAX_BITMAP_CACHE_ID; index++) { for (jndex = 0; jndex < 64 * 1024; jndex++) { /* it's ok to deinit a zeroed out struct list16 */ list16_deinit(&(self->crc16[index][jndex])); list16_init(&(self->crc16[index][jndex])); } } return 0; } /*****************************************************************************/ struct xrdp_cache * xrdp_cache_create(struct xrdp_wm *owner, struct xrdp_session *session, struct xrdp_client_info *client_info) { struct xrdp_cache *self; self = (struct xrdp_cache *)g_malloc(sizeof(struct xrdp_cache), 1); self->wm = owner; self->session = session; self->use_bitmap_comp = client_info->use_bitmap_comp; self->cache1_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX, client_info->cache1_entries); self->cache1_entries = MAX(self->cache1_entries, 0); self->cache1_size = client_info->cache1_size; self->cache2_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX, client_info->cache2_entries); self->cache2_entries = MAX(self->cache2_entries, 0); self->cache2_size = client_info->cache2_size; self->cache3_entries = MIN(XRDP_MAX_BITMAP_CACHE_IDX, client_info->cache3_entries); self->cache3_entries = MAX(self->cache3_entries, 0); self->cache3_size = client_info->cache3_size; self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable; self->bitmap_cache_version = client_info->bitmap_cache_version; self->pointer_cache_entries = client_info->pointer_cache_entries; self->xrdp_os_del_list = list_create(); xrdp_cache_reset_lru(self); xrdp_cache_reset_crc(self); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_create: 0 %d 1 %d 2 %d", self->cache1_entries, self->cache2_entries, self->cache3_entries); return self; } /*****************************************************************************/ static void clear_all_cached_items(struct xrdp_cache *self) { int i; int j; if (self == 0) { return; } /* free all the cached bitmaps */ for (i = 0; i < XRDP_MAX_BITMAP_CACHE_ID; i++) { for (j = 0; j < XRDP_MAX_BITMAP_CACHE_IDX; j++) { xrdp_bitmap_delete(self->bitmap_items[i][j].bitmap); } } /* free all the cached font items */ for (i = 0; i < 12; i++) { for (j = 0; j < 256; j++) { g_free(self->char_items[i][j].font_item.data); } } /* free all the off screen bitmaps */ for (i = 0; i < 2000; i++) { xrdp_bitmap_delete(self->os_bitmap_items[i].bitmap); } list_delete(self->xrdp_os_del_list); /* free all crc lists */ for (i = 0; i < XRDP_MAX_BITMAP_CACHE_ID; i++) { for (j = 0; j < 64 * 1024; j++) { list16_deinit(&(self->crc16[i][j])); } } } /*****************************************************************************/ void xrdp_cache_delete(struct xrdp_cache *self) { clear_all_cached_items(self); g_free(self); } /*****************************************************************************/ int xrdp_cache_reset(struct xrdp_cache *self, struct xrdp_client_info *client_info) { struct xrdp_wm *wm; struct xrdp_session *session; /* save these */ wm = self->wm; session = self->session; /* De-allocate any allocated memory */ clear_all_cached_items(self); /* set whole struct to zero */ g_memset(self, 0, sizeof(struct xrdp_cache)); /* set some stuff back */ self->wm = wm; self->session = session; self->use_bitmap_comp = client_info->use_bitmap_comp; self->cache1_entries = client_info->cache1_entries; self->cache1_size = client_info->cache1_size; self->cache2_entries = client_info->cache2_entries; self->cache2_size = client_info->cache2_size; self->cache3_entries = client_info->cache3_entries; self->cache3_size = client_info->cache3_size; self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable; self->bitmap_cache_version = client_info->bitmap_cache_version; self->pointer_cache_entries = client_info->pointer_cache_entries; xrdp_cache_reset_lru(self); xrdp_cache_reset_crc(self); return 0; } #define COMPARE_WITH_CRC32(_b1, _b2) \ ((_b1->crc32 == _b2->crc32) && \ (_b1->bpp == _b2->bpp) && \ (_b1->width == _b2->width) && (_b1->height == _b2->height)) /*****************************************************************************/ static int xrdp_cache_update_lru(struct xrdp_cache *self, int cache_id, int lru_index) { int tail_index; struct xrdp_lru_item *nextlru; struct xrdp_lru_item *prevlru; struct xrdp_lru_item *thislru; struct xrdp_lru_item *taillru; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_update_lru: lru_index %d", lru_index); if ((lru_index < 0) || (lru_index >= XRDP_MAX_BITMAP_CACHE_IDX)) { LOG(LOG_LEVEL_ERROR, "xrdp_cache_update_lru: error"); return 1; } if (self->lru_tail[cache_id] == lru_index) { /* nothing to do */ return 0; } else if (self->lru_head[cache_id] == lru_index) { /* moving head item to tail */ thislru = &(self->bitmap_lrus[cache_id][lru_index]); nextlru = &(self->bitmap_lrus[cache_id][thislru->next]); tail_index = self->lru_tail[cache_id]; taillru = &(self->bitmap_lrus[cache_id][tail_index]); /* unhook old */ nextlru->prev = -1; /* set head to next */ self->lru_head[cache_id] = thislru->next; /* move to tail and hook up */ taillru->next = lru_index; thislru->prev = tail_index; thislru->next = -1; /* update tail */ self->lru_tail[cache_id] = lru_index; } else { /* move middle item */ thislru = &(self->bitmap_lrus[cache_id][lru_index]); prevlru = &(self->bitmap_lrus[cache_id][thislru->prev]); nextlru = &(self->bitmap_lrus[cache_id][thislru->next]); tail_index = self->lru_tail[cache_id]; taillru = &(self->bitmap_lrus[cache_id][tail_index]); /* unhook old */ prevlru->next = thislru->next; nextlru->prev = thislru->prev; /* move to tail and hook up */ taillru->next = lru_index; thislru->prev = tail_index; thislru->next = -1; /* update tail */ self->lru_tail[cache_id] = lru_index; } return 0; } /*****************************************************************************/ /* returns cache id */ int xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, int hints) { int index; int jndex; int cache_id; int cache_idx; int bmp_size; int e; int Bpp; int crc16; int iig; int found; int cache_entries; int lru_index; struct list16 *ll; struct xrdp_bitmap *lbm; struct xrdp_lru_item *llru; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_add_bitmap:"); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_add_bitmap: crc16 0x%4.4x", bitmap->crc16); e = (4 - (bitmap->width % 4)) & 3; found = 0; cache_id = 0; cache_entries = 0; /* client Bpp, bmp_size */ Bpp = (bitmap->bpp + 7) / 8; bmp_size = (bitmap->width + e) * bitmap->height * Bpp; self->bitmap_stamp++; if (bmp_size <= self->cache1_size) { cache_id = 0; cache_entries = self->cache1_entries; } else if (bmp_size <= self->cache2_size) { cache_id = 1; cache_entries = self->cache2_entries; } else if (bmp_size <= self->cache3_size) { cache_id = 2; cache_entries = self->cache3_entries; } else { LOG(LOG_LEVEL_ERROR, "error in xrdp_cache_add_bitmap, " "too big(%d) bpp %d", bmp_size, bitmap->bpp); return 0; } crc16 = bitmap->crc16; ll = &(self->crc16[cache_id][crc16]); for (jndex = 0; jndex < ll->count; jndex++) { cache_idx = list16_get_item(ll, jndex); lbm = self->bitmap_items[cache_id][cache_idx].bitmap; if ((lbm != NULL) && COMPARE_WITH_CRC32(lbm, bitmap)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "found bitmap at %d %d", cache_idx, jndex); found = 1; break; } } if (found) { lru_index = self->bitmap_items[cache_id][cache_idx].lru_index; self->bitmap_items[cache_id][cache_idx].stamp = self->bitmap_stamp; xrdp_bitmap_delete(bitmap); /* update lru to end */ xrdp_cache_update_lru(self, cache_id, lru_index); return MAKELONG(cache_idx, cache_id); } /* find lru */ /* check for reset */ if (self->lru_reset[cache_id]) { self->lru_reset[cache_id] = 0; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_cache_add_bitmap: reset detected cache_id %d", cache_id); self->lru_tail[cache_id] = cache_entries - 1; index = self->lru_tail[cache_id]; llru = &(self->bitmap_lrus[cache_id][index]); llru->next = -1; } /* lru is item at head */ lru_index = self->lru_head[cache_id]; cache_idx = lru_index; /* update lru to end */ xrdp_cache_update_lru(self, cache_id, lru_index); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_add_bitmap: oldest %d %d", cache_id, cache_idx); LOG_DEVEL(LOG_LEVEL_DEBUG, "adding bitmap at %d %d old ptr %p new ptr %p", cache_id, cache_idx, self->bitmap_items[cache_id][cache_idx].bitmap, bitmap); /* remove old, about to be deleted, from crc16 list */ lbm = self->bitmap_items[cache_id][cache_idx].bitmap; if (lbm != 0) { crc16 = lbm->crc16; ll = &(self->crc16[cache_id][crc16]); iig = list16_index_of(ll, cache_idx); if (iig == -1) { LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_cache_add_bitmap: error removing cache_idx"); } LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_add_bitmap: removing index %d from crc16 %d", iig, crc16); list16_remove_item(ll, iig); xrdp_bitmap_delete(lbm); } /* set, send bitmap and return */ self->bitmap_items[cache_id][cache_idx].bitmap = bitmap; self->bitmap_items[cache_id][cache_idx].stamp = self->bitmap_stamp; self->bitmap_items[cache_id][cache_idx].lru_index = lru_index; /* add to crc16 list */ crc16 = bitmap->crc16; ll = &(self->crc16[cache_id][crc16]); list16_add_item(ll, cache_idx); if (ll->count > 1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_cache_add_bitmap: count %d", ll->count); } if (self->use_bitmap_comp) { if (self->bitmap_cache_version & 4) { if (libxrdp_orders_send_bitmap3(self->session, bitmap->width, bitmap->height, bitmap->bpp, bitmap->data, cache_id, cache_idx, hints) == 0) { return MAKELONG(cache_idx, cache_id); } } if (self->bitmap_cache_version & 2) { libxrdp_orders_send_bitmap2(self->session, bitmap->width, bitmap->height, bitmap->bpp, bitmap->data, cache_id, cache_idx, hints); } else if (self->bitmap_cache_version & 1) { libxrdp_orders_send_bitmap(self->session, bitmap->width, bitmap->height, bitmap->bpp, bitmap->data, cache_id, cache_idx); } } else { if (self->bitmap_cache_version & 2) { libxrdp_orders_send_raw_bitmap2(self->session, bitmap->width, bitmap->height, bitmap->bpp, bitmap->data, cache_id, cache_idx); } else if (self->bitmap_cache_version & 1) { libxrdp_orders_send_raw_bitmap(self->session, bitmap->width, bitmap->height, bitmap->bpp, bitmap->data, cache_id, cache_idx); } } return MAKELONG(cache_idx, cache_id); } /*****************************************************************************/ /* not used */ /* not sure how to use a palette in rdp */ int xrdp_cache_add_palette(struct xrdp_cache *self, int *palette) { int i; int oldest; int index; if (self == 0) { return 0; } if (palette == 0) { return 0; } if (self->wm->screen->bpp > 8) { return 0; } self->palette_stamp++; /* look for match */ for (i = 0; i < 6; i++) { if (g_memcmp(palette, self->palette_items[i].palette, 256 * sizeof(int)) == 0) { self->palette_items[i].stamp = self->palette_stamp; return i; } } /* look for oldest */ index = 0; oldest = 0x7fffffff; for (i = 0; i < 6; i++) { if (self->palette_items[i].stamp < oldest) { oldest = self->palette_items[i].stamp; index = i; } } /* set, send palette and return */ g_memcpy(self->palette_items[index].palette, palette, 256 * sizeof(int)); self->palette_items[index].stamp = self->palette_stamp; libxrdp_orders_send_palette(self->session, palette, index); return index; } /*****************************************************************************/ int xrdp_cache_add_char(struct xrdp_cache *self, struct xrdp_font_char *font_item) { int i; int j; int oldest; int f; int c; int datasize; struct xrdp_font_char *fi; self->char_stamp++; /* look for match */ for (i = 7; i < 12; i++) { for (j = 0; j < 250; j++) { if (xrdp_font_item_compare(&self->char_items[i][j].font_item, font_item)) { self->char_items[i][j].stamp = self->char_stamp; LOG_DEVEL(LOG_LEVEL_TRACE, "found font at %d %d", i, j); return MAKELONG(j, i); } } } /* look for oldest */ f = 0; c = 0; oldest = 0x7fffffff; for (i = 7; i < 12; i++) { for (j = 0; j < 250; j++) { if (self->char_items[i][j].stamp < oldest) { oldest = self->char_items[i][j].stamp; f = i; c = j; } } } LOG_DEVEL(LOG_LEVEL_TRACE, "adding char at %d %d", f, c); /* set, send char and return */ fi = &self->char_items[f][c].font_item; g_free(fi->data); datasize = FONT_DATASIZE(font_item); fi->data = (char *)g_malloc(datasize, 1); g_memcpy(fi->data, font_item->data, datasize); fi->offset = font_item->offset; fi->baseline = font_item->baseline; fi->width = font_item->width; fi->height = font_item->height; self->char_items[f][c].stamp = self->char_stamp; libxrdp_orders_send_font(self->session, fi, f, c); return MAKELONG(c, f); } /*****************************************************************************/ /* added the pointer to the cache and send it to client, it also sets the client if it finds it returns the index in the cache does not take ownership of pointer_item */ int xrdp_cache_add_pointer(struct xrdp_cache *self, struct xrdp_pointer_item *pointer_item) { int i; int oldest; int index; if (self == 0) { return 0; } self->pointer_stamp++; /* look for match */ for (i = 2; i < self->pointer_cache_entries; i++) { if (self->pointer_items[i].x == pointer_item->x && self->pointer_items[i].y == pointer_item->y && g_memcmp(self->pointer_items[i].data, pointer_item->data, 96 * 96 * 4) == 0 && g_memcmp(self->pointer_items[i].mask, pointer_item->mask, 96 * 96 / 8) == 0 && self->pointer_items[i].bpp == pointer_item->bpp && self->pointer_items[i].width == pointer_item->width && self->pointer_items[i].height == pointer_item->height) { self->pointer_items[i].stamp = self->pointer_stamp; xrdp_wm_set_pointer(self->wm, i); self->wm->current_pointer = i; LOG_DEVEL(LOG_LEVEL_TRACE, "found pointer at %d", i); return i; } } /* look for oldest */ index = 2; oldest = 0x7fffffff; for (i = 2; i < self->pointer_cache_entries; i++) { if (self->pointer_items[i].stamp < oldest) { oldest = self->pointer_items[i].stamp; index = i; } } self->pointer_items[index].x = pointer_item->x; self->pointer_items[index].y = pointer_item->y; g_memcpy(self->pointer_items[index].data, pointer_item->data, 96 * 96 * 4); g_memcpy(self->pointer_items[index].mask, pointer_item->mask, 96 * 96 / 8); self->pointer_items[index].stamp = self->pointer_stamp; self->pointer_items[index].bpp = pointer_item->bpp; self->pointer_items[index].width = pointer_item->width; self->pointer_items[index].height = pointer_item->height; xrdp_wm_send_pointer(self->wm, index, self->pointer_items[index].data, self->pointer_items[index].mask, self->pointer_items[index].x, self->pointer_items[index].y, self->pointer_items[index].bpp, self->pointer_items[index].width, self->pointer_items[index].height); self->wm->current_pointer = index; LOG_DEVEL(LOG_LEVEL_TRACE, "adding pointer at %d", index); return index; } /*****************************************************************************/ /* this does not take ownership of pointer_item, it makes a copy */ int xrdp_cache_add_pointer_static(struct xrdp_cache *self, struct xrdp_pointer_item *pointer_item, int index) { if (self == 0) { return 0; } self->pointer_items[index].x = pointer_item->x; self->pointer_items[index].y = pointer_item->y; g_memcpy(self->pointer_items[index].data, pointer_item->data, 96 * 96 * 4); g_memcpy(self->pointer_items[index].mask, pointer_item->mask, 96 * 96 / 8); self->pointer_items[index].stamp = self->pointer_stamp; self->pointer_items[index].bpp = pointer_item->bpp; xrdp_wm_send_pointer(self->wm, index, self->pointer_items[index].data, self->pointer_items[index].mask, self->pointer_items[index].x, self->pointer_items[index].y, self->pointer_items[index].bpp, self->pointer_items[index].width, self->pointer_items[index].height); self->wm->current_pointer = index; LOG_DEVEL(LOG_LEVEL_TRACE, "adding pointer at %d", index); return index; } /*****************************************************************************/ /* this does not take ownership of brush_item_data, it makes a copy */ int xrdp_cache_add_brush(struct xrdp_cache *self, char *brush_item_data) { int i; int oldest; int index; if (self == 0) { return 0; } self->brush_stamp++; /* look for match */ for (i = 0; i < 64; i++) { if (g_memcmp(self->brush_items[i].pattern, brush_item_data, 8) == 0) { self->brush_items[i].stamp = self->brush_stamp; LOG_DEVEL(LOG_LEVEL_TRACE, "found brush at %d", i); return i; } } /* look for oldest */ index = 0; oldest = 0x7fffffff; for (i = 0; i < 64; i++) { if (self->brush_items[i].stamp < oldest) { oldest = self->brush_items[i].stamp; index = i; } } g_memcpy(self->brush_items[index].pattern, brush_item_data, 8); self->brush_items[index].stamp = self->brush_stamp; libxrdp_orders_send_brush(self->session, 8, 8, 1, 0x81, 8, self->brush_items[index].pattern, index); LOG_DEVEL(LOG_LEVEL_TRACE, "adding brush at %d", index); return index; } /*****************************************************************************/ /* returns error */ int xrdp_cache_add_os_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, int rdpindex) { struct xrdp_os_bitmap_item *bi; if ((rdpindex < 0) || (rdpindex >= 2000)) { return 1; } bi = self->os_bitmap_items + rdpindex; bi->bitmap = bitmap; return 0; } /*****************************************************************************/ /* returns error */ int xrdp_cache_remove_os_bitmap(struct xrdp_cache *self, int rdpindex) { struct xrdp_os_bitmap_item *bi; int index; if ((rdpindex < 0) || (rdpindex >= 2000)) { return 1; } bi = self->os_bitmap_items + rdpindex; if (bi->bitmap->tab_stop) { index = list_index_of(self->xrdp_os_del_list, rdpindex); if (index == -1) { list_add_item(self->xrdp_os_del_list, rdpindex); } } xrdp_bitmap_delete(bi->bitmap); g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item)); return 0; } /*****************************************************************************/ struct xrdp_os_bitmap_item * xrdp_cache_get_os_bitmap(struct xrdp_cache *self, int rdpindex) { struct xrdp_os_bitmap_item *bi; if ((rdpindex < 0) || (rdpindex >= 2000)) { return 0; } bi = self->os_bitmap_items + rdpindex; return bi; } xrdp-0.10.1/xrdp/xrdp_bitmap.c000644 001751 000000 00000126566 14652432047 016307 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * bitmap, drawable * this is a object that can be drawn on with a painter * all windows, bitmaps, even the screen are of this type * maybe it should be called xrdp_drawable */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "log.h" #include "string_calls.h" static const unsigned int g_crc_table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; #define CRC_START(in_crc) (in_crc) = 0xFFFFFFFF #define CRC_PASS(in_pixel, in_crc) \ (in_crc) = g_crc_table[((in_crc) ^ (in_pixel)) & 0xff] ^ ((in_crc) >> 8) #define CRC_END(in_crc) (in_crc) = ((in_crc) ^ 0xFFFFFFFF) /*****************************************************************************/ struct xrdp_bitmap * xrdp_bitmap_get_child_by_id(struct xrdp_bitmap *self, int id) { int i = 0; struct xrdp_bitmap *b = (struct xrdp_bitmap *)NULL; for (i = 0; i < self->child_list->count; i++) { b = (struct xrdp_bitmap *)list_get_item(self->child_list, i); if (b->id == id) { return b; } } return 0; } /*****************************************************************************/ /* if focused is true focus this window else unfocus it */ /* returns error */ int xrdp_bitmap_set_focus(struct xrdp_bitmap *self, int focused) { struct xrdp_painter *painter = (struct xrdp_painter *)NULL; unsigned int font_height; if (self == 0) { return 0; } if (self->type != WND_TYPE_WND) /* 1 */ { return 0; } painter = xrdp_painter_create(self->wm, self->wm->session); xrdp_painter_font_needed(painter); xrdp_painter_begin_update(painter); font_height = xrdp_painter_font_body_height(painter); if (focused) { /* active title bar */ painter->fg_color = self->wm->blue; xrdp_painter_fill_rect(painter, self, 3, 3, self->width - 5, font_height + 5); painter->fg_color = self->wm->white; } else { /* inactive title bar */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 3, 3, self->width - 5, font_height + 5); painter->fg_color = self->wm->black; } xrdp_painter_draw_text(painter, self, 4, 4, self->caption1); xrdp_painter_end_update(painter); xrdp_painter_delete(painter); return 0; } /*****************************************************************************/ int xrdp_bitmap_hash_crc(struct xrdp_bitmap *self) { void *hash; int bytes; int crc; int index; char hash_data[16]; if (self->bpp >= 24) { bytes = self->width * self->height * 4; } else if (self->bpp == 15 || self->bpp == 16) { bytes = self->width * self->height * 2; } else if (self->bpp == 8) { bytes = self->width * self->height; } else { return 1; } hash = ssl_md5_info_create(); ssl_md5_clear(hash); ssl_md5_transform(hash, self->data, bytes); ssl_md5_complete(hash, hash_data); ssl_md5_info_delete(hash); CRC_START(crc); CRC_PASS(self->width, crc); CRC_PASS(self->width >> 8, crc); CRC_PASS(self->height, crc); CRC_PASS(self->height >> 8, crc); for (index = 0; index < 16; index++) { CRC_PASS(hash_data[index], crc); } CRC_END(crc); self->crc32 = crc; self->crc16 = self->crc32 & 0xffff; return 0; } /*****************************************************************************/ /* copy part of self at x, y to 0, 0 in dest */ /* returns error */ int xrdp_bitmap_copy_box_with_crc(struct xrdp_bitmap *self, struct xrdp_bitmap *dest, int x, int y, int cx, int cy) { int i; int j; int destx; int desty; int pixel; int crc; int incs; int incd; tui8 *s8; tui8 *d8; tui16 *s16; tui16 *d16; tui32 *s32; tui32 *d32; if (self == 0) { return 1; } if (dest == 0) { return 1; } if (self->type != WND_TYPE_BITMAP && self->type != WND_TYPE_IMAGE) { return 1; } if (dest->type != WND_TYPE_BITMAP && dest->type != WND_TYPE_IMAGE) { return 1; } if (self->bpp != dest->bpp) { return 1; } destx = 0; desty = 0; if (!check_bounds(self, &x, &y, &cx, &cy)) { return 1; } if (!check_bounds(dest, &destx, &desty, &cx, &cy)) { return 1; } CRC_START(crc); CRC_PASS(self->width, crc); CRC_PASS(self->width >> 8, crc); CRC_PASS(self->height, crc); CRC_PASS(self->height >> 8, crc); if (self->bpp == 32) { s32 = ((tui32 *)(self->data)) + (self->width * y + x); d32 = ((tui32 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { j = 0; while (j < cx - 4) { pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); CRC_PASS(pixel >> 24, crc); s32++; d32++; pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); CRC_PASS(pixel >> 24, crc); s32++; d32++; pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); CRC_PASS(pixel >> 24, crc); s32++; d32++; pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); CRC_PASS(pixel >> 24, crc); s32++; d32++; j += 4; } while (j < cx) { pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); CRC_PASS(pixel >> 24, crc); s32++; d32++; j += 1; } s32 += incs; d32 += incd; } } else if (self->bpp == 24) { s32 = ((tui32 *)(self->data)) + (self->width * y + x); d32 = ((tui32 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { j = 0; while (j < cx - 4) { pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); s32++; d32++; pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); s32++; d32++; pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); s32++; d32++; pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); s32++; d32++; j += 4; } while (j < cx) { pixel = *s32; *d32 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); CRC_PASS(pixel >> 16, crc); s32++; d32++; j += 1; } s32 += incs; d32 += incd; } } else if (self->bpp == 15 || self->bpp == 16) { s16 = ((tui16 *)(self->data)) + (self->width * y + x); d16 = ((tui16 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { for (j = 0; j < cx; j++) { pixel = *s16; *d16 = pixel; CRC_PASS(pixel, crc); CRC_PASS(pixel >> 8, crc); s16++; d16++; } s16 += incs; d16 += incd; } } else if (self->bpp == 8) { s8 = ((tui8 *)(self->data)) + (self->width * y + x); d8 = ((tui8 *)(dest->data)) + (dest->width * desty + destx); incs = self->width - cx; incd = dest->width - cx; for (i = 0; i < cy; i++) { for (j = 0; j < cx; j++) { pixel = *s8; *d8 = pixel; CRC_PASS(pixel, crc); s8++; d8++; } s8 += incs; d8 += incd; } } else { return 1; } CRC_END(crc); dest->crc32 = crc; dest->crc16 = dest->crc32 & 0xffff; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_bitmap_copy_box_with_crc: crc16 0x%4.4x", dest->crc16); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_bitmap_copy_box_with_crc: width %d height %d", dest->width, dest->height); return 0; } /*****************************************************************************/ /* returns true if they are the same, else returns false */ int xrdp_bitmap_compare(struct xrdp_bitmap *self, struct xrdp_bitmap *b) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_bitmap_compare:"); if (self == 0) { return 0; } if (b == 0) { return 0; } if (self->bpp != b->bpp) { return 0; } if (self->width != b->width) { return 0; } if (self->height != b->height) { return 0; } if (g_memcmp(self->data, b->data, b->height * b->line_size) == 0) { return 1; } return 0; } /*****************************************************************************/ static int xrdp_bitmap_draw_focus_box(struct xrdp_bitmap *self, struct xrdp_painter *painter, int x, int y, int cx, int cy) { painter->rop = 0xf0; xrdp_painter_begin_update(painter); painter->use_clip = 0; painter->mix_mode = 1; painter->brush.pattern[0] = 0xaa; painter->brush.pattern[1] = 0x55; painter->brush.pattern[2] = 0xaa; painter->brush.pattern[3] = 0x55; painter->brush.pattern[4] = 0xaa; painter->brush.pattern[5] = 0x55; painter->brush.pattern[6] = 0xaa; painter->brush.pattern[7] = 0x55; painter->brush.x_origin = x; painter->brush.y_origin = y; painter->brush.style = 3; painter->fg_color = self->wm->black; painter->bg_color = self->parent->bg_color; /* top */ xrdp_painter_fill_rect(painter, self, x, y, cx, 1); /* bottom */ xrdp_painter_fill_rect(painter, self, x, y + (cy - 1), cx, 1); /* left */ xrdp_painter_fill_rect(painter, self, x, y + 1, 1, cy - 2); /* right */ xrdp_painter_fill_rect(painter, self, x + (cx - 1), y + 1, 1, cy - 2); xrdp_painter_end_update(painter); painter->rop = 0xcc; painter->mix_mode = 0; return 0; } /*****************************************************************************/ /* x and y are in relation to self for 0, 0 is the top left of the control */ static int xrdp_bitmap_draw_button(struct xrdp_bitmap *self, struct xrdp_painter *painter, int x, int y, int w, int h, int down) { if (down) { /* gray box */ painter->fg_color = self->wm->grey; xrdp_painter_fill_rect(painter, self, x, y, w, h); /* black top line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, x, y, w, 1); /* black left line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, x, y, 1, h); /* dark grey top line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, x + 1, y + 1, w - 2, 1); /* dark grey left line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, x + 1, y + 1, 1, h - 2); /* dark grey bottom line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, x + 1, y + (h - 2), w - 1, 1); /* dark grey right line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, x + (w - 2), y + 1, 1, h - 1); /* black bottom line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, x, y + (h - 1), w, 1); /* black right line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, x + (w - 1), y, 1, h); } else { /* gray box */ painter->fg_color = self->wm->grey; xrdp_painter_fill_rect(painter, self, x, y, w, h); /* white top line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, x, y, w, 1); /* white left line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, x, y, 1, h); /* dark grey bottom line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, x + 1, y + (h - 2), w - 1, 1); /* dark grey right line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, (x + w) - 2, y + 1, 1, h - 1); /* black bottom line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, x, y + (h - 1), w, 1); /* black right line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, x + (w - 1), y, 1, h); } return 0; } /*****************************************************************************/ /* nil for rect means the whole thing */ /* returns error */ int xrdp_bitmap_invalidate(struct xrdp_bitmap *self, struct xrdp_rect *rect) { int i; int w; int h; int x; int y; struct xrdp_bitmap *b; struct xrdp_rect r1; struct xrdp_rect r2; struct xrdp_painter *painter; unsigned int font_height; char *p; if (self == 0) /* if no bitmap */ { return 0; } if (self->type == WND_TYPE_BITMAP) /* if 0, bitmap, leave */ { return 0; } painter = xrdp_painter_create(self->wm, self->wm->session); xrdp_painter_font_needed(painter); font_height = xrdp_painter_font_body_height(painter); painter->rop = 0xcc; /* copy */ if (rect == 0) { painter->use_clip = 0; } else { if (ISRECTEMPTY(*rect)) { xrdp_painter_delete(painter); return 0; } painter->clip = *rect; painter->use_clip = &painter->clip; } xrdp_painter_begin_update(painter); if (self->type == WND_TYPE_WND) /* 1 */ { /* draw grey background */ painter->fg_color = self->bg_color; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, self->height); /* top white line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 1, 1, self->width - 2, 1); /* left white line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 1, 1, 1, self->height - 2); /* bottom dark grey line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 1, self->height - 2, self->width - 2, 1); /* right dark grey line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, self->width - 2, 1, 1, self->height - 2); /* bottom black line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, 0, self->height - 1, self->width, 1); /* right black line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, self->width - 1, 0, 1, self->height); if (self->wm->focused_window == self) { /* active title bar */ painter->fg_color = self->wm->blue; xrdp_painter_fill_rect(painter, self, 3, 3, self->width - 5, font_height + 5); painter->fg_color = self->wm->white; } else { /* inactive title bar */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 3, 3, self->width - 5, font_height + 5); painter->fg_color = self->wm->black; } xrdp_painter_draw_text(painter, self, 4, 4, self->caption1); } else if (self->type == WND_TYPE_SCREEN) /* 2 */ { if (self->wm->mm->mod != 0) { if (self->wm->mm->mod->mod_event != 0) { if (rect != 0) { x = rect->left; y = rect->top; w = rect->right - rect->left; h = rect->bottom - rect->top; if (check_bounds(self->wm->screen, &x, &y, &w, &h)) { self->wm->mm->mod->mod_event(self->wm->mm->mod, WM_INVALIDATE, MAKELONG(y, x), MAKELONG(h, w), 0, 0); } } else { x = 0; y = 0; w = self->wm->screen->width; h = self->wm->screen->height; self->wm->mm->mod->mod_event(self->wm->mm->mod, WM_INVALIDATE, MAKELONG(y, x), MAKELONG(h, w), 0, 0); } } } else { painter->fg_color = self->bg_color; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, self->height); } } else if (self->type == WND_TYPE_BUTTON) /* 3 */ { if (self->state == BUTTON_STATE_UP) /* 0 */ { xrdp_bitmap_draw_button(self, painter, 0, 0, self->width, self->height, 0); w = xrdp_painter_text_width(painter, self->caption1); h = xrdp_painter_font_body_height(painter); painter->fg_color = self->wm->black; xrdp_painter_draw_text(painter, self, self->width / 2 - w / 2, self->height / 2 - h / 2, self->caption1); if (self->parent != 0) { if (self->wm->focused_window == self->parent) { if (self->parent->focused_control == self) { xrdp_bitmap_draw_focus_box(self, painter, 4, 4, self->width - 8, self->height - 8); } } } } else if (self->state == BUTTON_STATE_DOWN) /* 1 */ { xrdp_bitmap_draw_button(self, painter, 0, 0, self->width, self->height, 1); w = xrdp_painter_text_width(painter, self->caption1); h = xrdp_painter_font_body_height(painter); painter->fg_color = self->wm->black; xrdp_painter_draw_text(painter, self, (self->width / 2 - w / 2) + 1, (self->height / 2 - h / 2) + 1, self->caption1); if (self->parent != 0) if (self->wm->focused_window == self->parent) if (self->parent->focused_control == self) xrdp_bitmap_draw_focus_box(self, painter, 4, 4, self->width - 8, self->height - 8); } } else if (self->type == WND_TYPE_IMAGE) /* 4 */ { xrdp_painter_copy(painter, self, self, 0, 0, self->width, self->height, 0, 0); } else if (self->type == WND_TYPE_EDIT) /* 5 */ { /* draw gray box */ painter->fg_color = self->wm->grey; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, self->height); /* main white background */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 1, 1, self->width - 3, self->height - 3); /* dark grey top line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, 1); /* dark grey left line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 0, 0, 1, self->height); /* white bottom line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 0, self->height - 1, self->width, 1); /* white right line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, self->width - 1, 0, 1, self->height); /* black left line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, 1, 1, 1, self->height - 3); /* black top line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, 1, 1, self->width - 3, 1); /* draw text */ painter->fg_color = self->wm->black; if (self->password_char != 0) { unsigned int repeat_count = utf8_char_count(self->caption1); xrdp_painter_draw_char(painter, self, 4, 2, self->password_char, repeat_count); } else { xrdp_painter_draw_text(painter, self, 4, 2, self->caption1); } /* draw xor box(cursor) */ if (self->parent != 0) { if (self->parent->focused_control == self) { if (self->password_char != 0) { w = xrdp_painter_repeated_char_width(painter, self->password_char, self->edit_pos); } else { w = xrdp_painter_text_width_count(painter, self->caption1, self->edit_pos); } painter->fg_color = self->wm->white; painter->rop = 0x5a; xrdp_painter_fill_rect(painter, self, 4 + w, 3, 2, self->height - 6); } } /* reset rop back */ painter->rop = 0xcc; } else if (self->type == WND_TYPE_LABEL) /* 6 */ { painter->fg_color = self->wm->black; xrdp_painter_draw_text(painter, self, 0, 0, self->caption1); } else if (self->type == WND_TYPE_COMBO) /* 7 combo box */ { /* draw gray box */ painter->fg_color = self->wm->grey; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, self->height); /* white background */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 1, 1, self->width - 3, self->height - 3); if (self->parent->focused_control == self) { painter->fg_color = self->wm->dark_blue; xrdp_painter_fill_rect(painter, self, 3, 3, (self->width - 6) - 18, self->height - 5); } /* dark grey top line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, 1); /* dark grey left line */ painter->fg_color = self->wm->dark_grey; xrdp_painter_fill_rect(painter, self, 0, 0, 1, self->height); /* white bottom line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 0, self->height - 1, self->width, 1); /* white right line */ painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, self->width - 1, 0, 1, self->height); /* black left line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, 1, 1, 1, self->height - 3); /* black top line */ painter->fg_color = self->wm->black; xrdp_painter_fill_rect(painter, self, 1, 1, self->width - 3, 1); /* draw text */ if (self->parent->focused_control == self) { painter->fg_color = self->wm->white; } else { painter->fg_color = self->wm->black; } xrdp_painter_draw_text(painter, self, 4, 2, (char *)list_get_item(self->string_list, self->item_index)); /* draw button on right */ x = self->width - 20; y = 2; w = (self->width - x) - 2; h = self->height - 4; /* looks better with a background around */ painter->fg_color = self->wm->grey; xrdp_painter_fill_rect(painter, self, x, y, w, h); if (self->state == BUTTON_STATE_UP) /* 0 */ { xrdp_bitmap_draw_button(self, painter, x + 1, y + 1, w - 1, h - 1, 0); } else { xrdp_bitmap_draw_button(self, painter, x + 1, y + 1, w - 1, h - 1, 1); } /* draw the arrow */ w = w / 2; x = x + (w / 2) + 1; h = (h / 2) + 2; y = y + (h / 2) + 1; painter->fg_color = self->wm->black; for (i = w; i > 0; i = i - 2) { xrdp_painter_fill_rect(painter, self, x, y, i, 1); y++; x = x + 1; } } else if (self->type == WND_TYPE_SPECIAL) /* 8 special */ { if (self->popped_from != 0) { /* change height if there are too many items in the list */ i = xrdp_painter_font_body_height(painter); i = self->popped_from->string_list->count * i; if (i > self->height) { self->height = i; } } painter->fg_color = self->wm->white; xrdp_painter_fill_rect(painter, self, 0, 0, self->width, self->height); /* draw the list items */ if (self->popped_from != 0) { y = 0; for (i = 0; i < self->popped_from->string_list->count; i++) { p = (char *)list_get_item(self->popped_from->string_list, i); h = xrdp_painter_font_body_height(painter); self->item_height = h; if (i == self->item_index) { painter->fg_color = self->wm->blue; xrdp_painter_fill_rect(painter, self, 0, y, self->width, h); painter->fg_color = self->wm->white; } else { painter->fg_color = self->wm->black; } xrdp_painter_draw_text(painter, self, 2, y, p); y = y + h; } } } /* notify */ if (self->notify != 0) { self->notify(self, self, WM_PAINT, (long)painter, 0); /* 3 */ } /* draw any child windows in the area */ for (i = 0; i < self->child_list->count; i++) { b = (struct xrdp_bitmap *)list_get_item(self->child_list, i); if (rect == 0) { xrdp_bitmap_invalidate(b, 0); } else { MAKERECT(r1, b->left, b->top, b->width, b->height); if (rect_intersect(rect, &r1, &r2)) { RECTOFFSET(r2, -(b->left), -(b->top)); xrdp_bitmap_invalidate(b, &r2); } } } xrdp_painter_end_update(painter); xrdp_painter_delete(painter); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_bitmap_def_proc(struct xrdp_bitmap *self, int msg, int param1, int param2) { int n; int i; int shift; int ext; int scan_code; struct xrdp_bitmap *b; struct xrdp_bitmap *focus_out_control; if (self == 0) { return 0; } if (self->wm == 0) { return 0; } if (self->type == WND_TYPE_WND) { if (msg == WM_KEYDOWN) { scan_code = param1 % 128; if (scan_code == 15) /* tab */ { /* move to next tab stop */ shift = self->wm->keys[42] || self->wm->keys[54]; i = -1; if (self->child_list != 0) { i = list_index_of(self->child_list, (long)self->focused_control); if (shift) { i--; if (i < 0) { i = self->child_list->count - 1; } } else { i++; if (i >= self->child_list->count) { i = 0; } } n = self->child_list->count; b = (struct xrdp_bitmap *)list_get_item(self->child_list, i); while (b != self->focused_control && b != 0 && n > 0) { n--; if (b->tab_stop) { focus_out_control = self->focused_control; self->focused_control = b; xrdp_bitmap_invalidate(focus_out_control, 0); xrdp_bitmap_invalidate(b, 0); break; } if (shift) { i--; if (i < 0) { i = self->child_list->count - 1; } } else { i++; if (i >= self->child_list->count) { i = 0; } } b = (struct xrdp_bitmap *)list_get_item(self->child_list, i); } } } else if (scan_code == 28) /* enter */ { if (self->default_button != 0) { if (self->notify != 0) { /* I think this should use def_proc */ self->notify(self, self->default_button, 1, 0, 0); return 0; } } } else if (scan_code == 1) /* esc */ { if (self->esc_button != 0) { if (self->notify != 0) { /* I think this should use def_proc */ self->notify(self, self->esc_button, 1, 0, 0); return 0; } } } } if (self->focused_control != 0) { xrdp_bitmap_def_proc(self->focused_control, msg, param1, param2); } } else if (self->type == WND_TYPE_EDIT) { if (msg == WM_KEYDOWN) { scan_code = param1 % 128; ext = param2 & 0x0100; /* left or up arrow */ if ((scan_code == 75 || scan_code == 72) && (ext || self->wm->num_lock == 0)) { if (self->edit_pos > 0) { self->edit_pos--; xrdp_bitmap_invalidate(self, 0); } } /* right or down arrow */ else if ((scan_code == 77 || scan_code == 80) && (ext || self->wm->num_lock == 0)) { if (self->edit_pos < (int)utf8_char_count(self->caption1)) { self->edit_pos++; xrdp_bitmap_invalidate(self, 0); } } /* backspace */ else if (scan_code == 14) { n = utf8_char_count(self->caption1); if (n > 0) { if (self->edit_pos > 0) { self->edit_pos--; utf8_remove_char_at(self->caption1, self->edit_pos); xrdp_bitmap_invalidate(self, 0); } } } /* delete */ else if (scan_code == 83 && (ext || self->wm->num_lock == 0)) { n = utf8_char_count(self->caption1); if (n > 0) { if (self->edit_pos < n) { utf8_remove_char_at(self->caption1, self->edit_pos); xrdp_bitmap_invalidate(self, 0); } } } /* end */ else if (scan_code == 79 && (ext || self->wm->num_lock == 0)) { n = utf8_char_count(self->caption1); if (self->edit_pos < n) { self->edit_pos = n; xrdp_bitmap_invalidate(self, 0); } } /* home */ else if ((scan_code == 71) && (ext || (self->wm->num_lock == 0))) { if (self->edit_pos > 0) { self->edit_pos = 0; xrdp_bitmap_invalidate(self, 0); } } else { char32_t c = get_char_from_scan_code (param2, scan_code, self->wm->keys, self->wm->caps_lock, self->wm->num_lock, self->wm->scroll_lock, &(self->wm->keymap)); // Add a printing character to the string. If successful, // bump the edit position and re-display the string if (c >= ' ' && utf8_add_char_at(self->caption1, 256, c, self->edit_pos)) { self->edit_pos++; xrdp_bitmap_invalidate(self, 0); } } } } else if (self->type == WND_TYPE_COMBO) { if (msg == WM_KEYDOWN) { scan_code = param1 % 128; ext = param2 & 0x0100; /* left or up arrow */ if (((scan_code == 75) || (scan_code == 72)) && (ext || (self->wm->num_lock == 0))) { if (self->item_index > 0) { self->item_index--; xrdp_bitmap_invalidate(self, 0); if (self->parent->notify != 0) { self->parent->notify(self->parent, self, CB_ITEMCHANGE, 0, 0); } } } /* right or down arrow */ else if ((scan_code == 77 || scan_code == 80) && (ext || self->wm->num_lock == 0)) { if ((self->item_index + 1) < self->string_list->count) { self->item_index++; xrdp_bitmap_invalidate(self, 0); if (self->parent->notify != 0) { self->parent->notify(self->parent, self, CB_ITEMCHANGE, 0, 0); } } } } } else if (self->type == WND_TYPE_SPECIAL) { if (msg == WM_MOUSEMOVE) { if (self->item_height > 0 && self->popped_from != 0) { i = param2; i = i / self->item_height; if (i != self->item_index && i < self->popped_from->string_list->count) { self->item_index = i; xrdp_bitmap_invalidate(self, 0); } } } else if (msg == WM_LBUTTONUP) { if (self->popped_from != 0) { self->popped_from->item_index = self->item_index; xrdp_bitmap_invalidate(self->popped_from, 0); if (self->popped_from->parent->notify != 0) { self->popped_from->parent->notify(self->popped_from->parent, self->popped_from, CB_ITEMCHANGE, 0, 0); } } } } return 0; } /*****************************************************************************/ /* convert the controls coords to screen coords */ int xrdp_bitmap_to_screenx(struct xrdp_bitmap *self, int x) { int i; i = x; while (self != 0) { i = i + self->left; self = self->parent; } return i; } /*****************************************************************************/ /* convert the controls coords to screen coords */ int xrdp_bitmap_to_screeny(struct xrdp_bitmap *self, int y) { int i; i = y; while (self != 0) { i = i + self->top; self = self->parent; } return i; } /*****************************************************************************/ /* convert the screen coords to controls coords */ int xrdp_bitmap_from_screenx(struct xrdp_bitmap *self, int x) { int i; i = x; while (self != 0) { i = i - self->left; self = self->parent; } return i; } /*****************************************************************************/ /* convert the screen coords to controls coords */ int xrdp_bitmap_from_screeny(struct xrdp_bitmap *self, int y) { int i; i = y; while (self != 0) { i = i - self->top; self = self->parent; } return i; } /*****************************************************************************/ int xrdp_bitmap_get_screen_clip(struct xrdp_bitmap *self, struct xrdp_painter *painter, struct xrdp_rect *rect, int *dx, int *dy) { int ldx; int ldy; if (painter->use_clip) { *rect = painter->clip; } else { rect->left = 0; rect->top = 0; rect->right = self->width; rect->bottom = self->height; } ldx = xrdp_bitmap_to_screenx(self, 0); ldy = xrdp_bitmap_to_screeny(self, 0); rect->left += ldx; rect->top += ldy; rect->right += ldx; rect->bottom += ldy; if (dx != 0) { *dx = ldx; } if (dy != 0) { *dy = ldy; } return 0; } xrdp-0.10.1/xrdp/Makefile.am000644 001751 000000 00000004376 14652432047 015660 0ustar00metawheel000000 000000 EXTRA_DIST = \ czech.txt \ rdp-scan-codes.txt \ xrdpwin.c AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_MODULE_PATH=\"${moduledir}\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_builddir) \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/libxrdp \ -I$(top_srcdir)/third_party \ -I$(top_srcdir)/third_party/tomlc99 \ $(IMLIB2_CFLAGS) XRDP_EXTRA_LIBS = if XRDP_RFXCODEC AM_CPPFLAGS += -DXRDP_RFXCODEC AM_CPPFLAGS += -I$(top_srcdir)/librfxcodec/include XRDP_EXTRA_LIBS += $(top_builddir)/librfxcodec/src/.libs/librfxencode.a endif if XRDP_PIXMAN AM_CPPFLAGS += -DXRDP_PIXMAN AM_CPPFLAGS += $(PIXMAN_CFLAGS) XRDP_EXTRA_LIBS += $(PIXMAN_LIBS) endif if XRDP_PAINTER AM_CPPFLAGS += -DXRDP_PAINTER AM_CPPFLAGS += -I$(top_srcdir)/libpainter/include XRDP_EXTRA_LIBS += $(top_builddir)/libpainter/src/.libs/libpainter.a endif sbin_PROGRAMS = \ xrdp xrdp_SOURCES = \ funcs.c \ lang.c \ xrdp.c \ xrdp.h \ xrdp_bitmap.c \ xrdp_bitmap_load.c \ xrdp_bitmap_common.c \ xrdp_cache.c \ xrdp_encoder.c \ xrdp_encoder.h \ xrdp_font.c \ xrdp_listen.c \ xrdp_login_wnd.c \ xrdp_mm.c \ xrdp_painter.c \ xrdp_process.c \ xrdp_region.c \ xrdp_types.h \ xrdp_egfx.c \ xrdp_egfx.h \ xrdp_wm.c \ xrdp_main_utils.c xrdp_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(top_builddir)/third_party/tomlc99/libtoml.la \ $(IMLIB2_LIBS) \ $(XRDP_EXTRA_LIBS) xrdpsysconfdir=$(sysconfdir)/xrdp if MACOS lib_extension = dylib else lib_extension = so endif SUBST_VARS = sed \ -e 's|@lib_extension[@]|$(lib_extension)|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in .in: $(subst_verbose)$(SUBST_VARS) $< > $@ dist_xrdpsysconf_DATA = \ xrdp.ini \ xrdp_keyboard.ini xrdppkgdatadir=$(datadir)/xrdp dist_xrdppkgdata_DATA = \ ad24b.bmp \ ad256.bmp \ xrdp24b.bmp \ xrdp256.bmp \ xrdp_logo.bmp \ xrdp_logo.png \ README.logo \ sans-10.fv1 \ sans-18.fv1 \ cursor0.cur \ cursor1.cur xrdp-0.10.1/xrdp/xrdp_encoder.c000644 001751 000000 00000112627 14652432047 016443 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Encoder */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp_encoder.h" #include "xrdp.h" #include "ms-rdpbcgr.h" #include "thread_calls.h" #include "fifo.h" #include "xrdp_egfx.h" #include "string_calls.h" #ifdef XRDP_RFXCODEC #include "rfxcodec_encode.h" #endif #define DEFAULT_XRDP_GFX_FRAMES_IN_FLIGHT 2 /* limits used for validate env var XRDP_GFX_FRAMES_IN_FLIGHT */ #define MIN_XRDP_GFX_FRAMES_IN_FLIGHT 1 #define MAX_XRDP_GFX_FRAMES_IN_FLIGHT 16 #define DEFAULT_XRDP_GFX_MAX_COMPRESSED_BYTES (3 * 1024 * 1024) /* limits used for validate env var XRDP_GFX_MAX_COMPRESSED_BYTES */ #define MIN_XRDP_GFX_MAX_COMPRESSED_BYTES (64 * 1024) #define MAX_XRDP_GFX_MAX_COMPRESSED_BYTES (256 * 1024 * 1024) #define XRDP_SURCMD_PREFIX_BYTES 256 #define OUT_DATA_BYTES_DEFAULT_SIZE (16 * 1024 * 1024) #ifdef XRDP_RFXCODEC /* * LH3 LL3, HH3 HL3, HL2 LH2, LH1 HH2, HH1 HL1 * https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdprfx/3e9c8af4-7539-4c9d-95de-14b1558b902c */ /* standard quality */ static const unsigned char g_rfx_quantization_values_std[] = { 0x66, 0x66, 0x77, 0x87, 0x98, 0x76, 0x77, 0x88, 0x98, 0x99 }; /* low quality */ static const unsigned char g_rfx_quantization_values_lq[] = { 0x66, 0x66, 0x77, 0x87, 0x98, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA /* TODO: tentative value */ }; /* ultra low quality */ static const unsigned char g_rfx_quantization_values_ulq[] = { 0x66, 0x66, 0x77, 0x87, 0x98, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB /* TODO: tentative value */ }; #endif struct enc_rect { short x1; short y1; short x2; short y2; }; /*****************************************************************************/ static int process_enc_jpg(struct xrdp_encoder *self, XRDP_ENC_DATA *enc); #ifdef XRDP_RFXCODEC static int process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc); static int process_enc_egfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc); #endif static int process_enc_h264(struct xrdp_encoder *self, XRDP_ENC_DATA *enc); /*****************************************************************************/ /* Item destructor for self->fifo_to_proc */ static void xrdp_enc_data_destructor(void *item, void *closure) { XRDP_ENC_DATA *enc = (XRDP_ENC_DATA *)item; if (ENC_IS_BIT_SET(enc->flags, ENC_FLAGS_GFX_BIT)) { g_free(enc->u.gfx.cmd); } else { g_free(enc->u.sc.drects); g_free(enc->u.sc.crects); } g_free(enc); } /* Item destructor for self->fifo_processed */ static void xrdp_enc_data_done_destructor(void *item, void *closure) { XRDP_ENC_DATA_DONE *enc_done = (XRDP_ENC_DATA_DONE *)item; g_free(enc_done->comp_pad_data); g_free(enc_done); } /*****************************************************************************/ struct xrdp_encoder * xrdp_encoder_create(struct xrdp_mm *mm) { LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_encoder_create:"); struct xrdp_encoder *self; struct xrdp_client_info *client_info; char buf[1024]; int pid; client_info = mm->wm->client_info; /* RemoteFX 7.1 requires LAN but GFX does not */ if (client_info->mcs_connection_type != CONNECTION_TYPE_LAN) { if ((mm->egfx_flags & (XRDP_EGFX_H264 | XRDP_EGFX_RFX_PRO)) == 0) { return 0; } } if (client_info->bpp < 24) { return 0; } self = g_new0(struct xrdp_encoder, 1); if (self == NULL) { return NULL; } self->mm = mm; if (client_info->jpeg_codec_id != 0) { LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: starting jpeg codec session"); self->codec_id = client_info->jpeg_codec_id; self->in_codec_mode = 1; self->codec_quality = client_info->jpeg_prop[0]; client_info->capture_code = 0; client_info->capture_format = XRDP_a8b8g8r8; self->process_enc = process_enc_jpg; } #ifdef XRDP_RFXCODEC else if (mm->egfx_flags & XRDP_EGFX_RFX_PRO) { LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: starting gfx rfx pro codec session"); self->in_codec_mode = 1; client_info->capture_code = 4; self->process_enc = process_enc_egfx; self->gfx = 1; self->num_quants = 2; self->quant_idx_y = 0; self->quant_idx_u = 1; self->quant_idx_v = 1; switch (client_info->mcs_connection_type) { case CONNECTION_TYPE_MODEM: case CONNECTION_TYPE_BROADBAND_LOW: case CONNECTION_TYPE_SATELLITE: self->quants = (const char *) g_rfx_quantization_values_ulq; break; case CONNECTION_TYPE_BROADBAND_HIGH: case CONNECTION_TYPE_WAN: self->quants = (const char *) g_rfx_quantization_values_lq; break; case CONNECTION_TYPE_LAN: case CONNECTION_TYPE_AUTODETECT: /* not implemented yet */ default: self->quants = (const char *) g_rfx_quantization_values_std; } } else if (client_info->rfx_codec_id != 0) { LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: starting rfx codec session"); self->codec_id = client_info->rfx_codec_id; self->in_codec_mode = 1; client_info->capture_code = 2; self->process_enc = process_enc_rfx; self->codec_handle_rfx = rfxcodec_encode_create(mm->wm->screen->width, mm->wm->screen->height, RFX_FORMAT_YUV, 0); } #endif else if (client_info->h264_codec_id != 0) { LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: starting h264 codec session"); self->codec_id = client_info->h264_codec_id; self->in_codec_mode = 1; client_info->capture_code = 3; client_info->capture_format = XRDP_nv12; self->process_enc = process_enc_h264; } else { g_free(self); return 0; } LOG_DEVEL(LOG_LEVEL_INFO, "init_xrdp_encoder: initializing encoder codec_id %d", self->codec_id); /* setup required FIFOs */ self->fifo_to_proc = fifo_create(xrdp_enc_data_destructor); self->fifo_processed = fifo_create(xrdp_enc_data_done_destructor); self->mutex = tc_mutex_create(); pid = g_getpid(); /* setup wait objects for signalling */ g_snprintf(buf, 1024, "xrdp_%8.8x_encoder_event_to_proc", pid); self->xrdp_encoder_event_to_proc = g_create_wait_obj(buf); g_snprintf(buf, 1024, "xrdp_%8.8x_encoder_event_processed", pid); self->xrdp_encoder_event_processed = g_create_wait_obj(buf); g_snprintf(buf, 1024, "xrdp_%8.8x_encoder_term", pid); self->xrdp_encoder_term_request = g_create_wait_obj(buf); self->xrdp_encoder_term_done = g_create_wait_obj(buf); if (client_info->gfx) { const char *env_var = g_getenv("XRDP_GFX_FRAMES_IN_FLIGHT"); self->frames_in_flight = DEFAULT_XRDP_GFX_FRAMES_IN_FLIGHT; if (env_var != NULL) { int fif = g_atoix(env_var); if (fif >= MIN_XRDP_GFX_FRAMES_IN_FLIGHT && fif <= MAX_XRDP_GFX_FRAMES_IN_FLIGHT) { self->frames_in_flight = fif; LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: " "XRDP_GFX_FRAMES_IN_FLIGHT set to %d", fif); } else { LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: " "XRDP_GFX_FRAMES_IN_FLIGHT set but invalid %s", env_var); } } env_var = g_getenv("XRDP_GFX_MAX_COMPRESSED_BYTES"); self->max_compressed_bytes = DEFAULT_XRDP_GFX_MAX_COMPRESSED_BYTES; if (env_var != NULL) { int mcb = g_atoix(env_var); if (mcb >= MIN_XRDP_GFX_MAX_COMPRESSED_BYTES && mcb <= MAX_XRDP_GFX_MAX_COMPRESSED_BYTES) { self->max_compressed_bytes = mcb; LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: " "XRDP_GFX_MAX_COMPRESSED_BYTES set to %d", mcb); } else { LOG(LOG_LEVEL_INFO, "xrdp_encoder_create: " "XRDP_GFX_MAX_COMPRESSED_BYTES set but invalid %s", env_var); } } LOG_DEVEL(LOG_LEVEL_INFO, "Using %d max_compressed_bytes for encoder", self->max_compressed_bytes); } else { self->frames_in_flight = client_info->max_unacknowledged_frame_count; self->max_compressed_bytes = client_info->max_fastpath_frag_bytes & ~15; } /* make sure frames_in_flight is at least 1 */ self->frames_in_flight = MAX(self->frames_in_flight, 1); /* create thread to process messages */ tc_thread_create(proc_enc_msg, self); return self; } /*****************************************************************************/ void xrdp_encoder_delete(struct xrdp_encoder *self) { int index; (void)index; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_encoder_delete:"); if (self == 0) { return; } if (self->in_codec_mode == 0) { return; } /* tell worker thread to shut down */ g_set_wait_obj(self->xrdp_encoder_term_request); g_obj_wait(&self->xrdp_encoder_term_done, 1, NULL, 0, 5000); if (!g_is_wait_obj_set(self->xrdp_encoder_term_done)) { LOG(LOG_LEVEL_WARNING, "Encoder failed to shut down cleanly"); } #ifdef XRDP_RFXCODEC for (index = 0; index < 16; index++) { if (self->codec_handle_prfx_gfx[index] != NULL) { rfxcodec_encode_destroy(self->codec_handle_prfx_gfx[index]); } } if (self->codec_handle_rfx != NULL) { rfxcodec_encode_destroy(self->codec_handle_rfx); } #endif #if defined(XRDP_X264) for (index = 0; index < 16; index++) { if (self->codec_handle_h264_gfx[index] != NULL) { rfxcodec_encode_destroy(self->codec_handle_h264_gfx[index]); } } if (self->codec_handle_h264 != NULL) { xrdp_encoder_x264_delete(self->codec_handle_h264); } #endif /* destroy wait objects used for signalling */ g_delete_wait_obj(self->xrdp_encoder_event_to_proc); g_delete_wait_obj(self->xrdp_encoder_event_processed); g_delete_wait_obj(self->xrdp_encoder_term_request); g_delete_wait_obj(self->xrdp_encoder_term_done); /* cleanup fifos */ fifo_delete(self->fifo_to_proc, NULL); fifo_delete(self->fifo_processed, NULL); tc_mutex_delete(self->mutex); g_free(self); } /*****************************************************************************/ /* called from encoder thread */ static int process_enc_jpg(struct xrdp_encoder *self, XRDP_ENC_DATA *enc) { int index; int x; int y; int cx; int cy; int quality; int error; int out_data_bytes; int count; char *out_data; XRDP_ENC_DATA_DONE *enc_done; struct fifo *fifo_processed; tbus mutex; tbus event_processed; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_jpg:"); quality = self->codec_quality; fifo_processed = self->fifo_processed; mutex = self->mutex; event_processed = self->xrdp_encoder_event_processed; count = enc->u.sc.num_crects; for (index = 0; index < count; index++) { x = enc->u.sc.crects[index * 4 + 0]; y = enc->u.sc.crects[index * 4 + 1]; cx = enc->u.sc.crects[index * 4 + 2]; cy = enc->u.sc.crects[index * 4 + 3]; if (cx < 1 || cy < 1) { LOG_DEVEL(LOG_LEVEL_WARNING, "process_enc_jpg: error 1"); continue; } LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_jpg: x %d y %d cx %d cy %d", x, y, cx, cy); out_data_bytes = MAX((cx + 4) * cy * 4, 8192); if ((out_data_bytes < 1) || (out_data_bytes > OUT_DATA_BYTES_DEFAULT_SIZE)) { LOG_DEVEL(LOG_LEVEL_ERROR, "process_enc_jpg: error 2"); return 1; } out_data = (char *) g_malloc(out_data_bytes + XRDP_SURCMD_PREFIX_BYTES + 2, 0); if (out_data == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "process_enc_jpg: error 3"); return 1; } out_data[256] = 0; /* header bytes */ out_data[257] = 0; error = libxrdp_codec_jpeg_compress(self->mm->wm->session, 0, enc->u.sc.data, enc->u.sc.width, enc->u.sc.height, enc->u.sc.width * 4, x, y, cx, cy, quality, out_data + XRDP_SURCMD_PREFIX_BYTES + 2, &out_data_bytes); if (error < 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "process_enc_jpg: jpeg error %d " "bytes %d", error, out_data_bytes); g_free(out_data); return 1; } LOG_DEVEL(LOG_LEVEL_WARNING, "jpeg error %d bytes %d", error, out_data_bytes); enc_done = (XRDP_ENC_DATA_DONE *) g_malloc(sizeof(XRDP_ENC_DATA_DONE), 1); enc_done->comp_bytes = out_data_bytes + 2; enc_done->pad_bytes = 256; enc_done->comp_pad_data = out_data; enc_done->enc = enc; enc_done->last = index == (enc->u.sc.num_crects - 1); enc_done->x = x; enc_done->y = y; enc_done->cx = cx; enc_done->cy = cy; /* done with msg */ /* inform main thread done */ tc_mutex_lock(mutex); fifo_add_item(fifo_processed, enc_done); tc_mutex_unlock(mutex); /* signal completion for main thread */ g_set_wait_obj(event_processed); } return 0; } #ifdef XRDP_RFXCODEC /*****************************************************************************/ /* called from encoder thread */ static int process_enc_rfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc) { int index; int x; int y; int cx; int cy; int out_data_bytes; int count; int tiles_written; int all_tiles_written; int tiles_left; int finished; char *out_data; XRDP_ENC_DATA_DONE *enc_done; struct fifo *fifo_processed; tbus mutex; tbus event_processed; struct rfx_tile *tiles; struct rfx_rect *rfxrects; int alloc_bytes; int encode_flags; int encode_passes; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_rfx:"); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_rfx: num_crects %d num_drects %d", enc->u.sc.num_crects, enc->u.sc.num_drects); fifo_processed = self->fifo_processed; mutex = self->mutex; event_processed = self->xrdp_encoder_event_processed; all_tiles_written = 0; encode_passes = 0; do { tiles_written = 0; tiles_left = enc->u.sc.num_crects - all_tiles_written; out_data = NULL; out_data_bytes = 0; if ((tiles_left > 0) && (enc->u.sc.num_drects > 0)) { alloc_bytes = XRDP_SURCMD_PREFIX_BYTES; alloc_bytes += self->max_compressed_bytes; alloc_bytes += sizeof(struct rfx_tile) * tiles_left + sizeof(struct rfx_rect) * enc->u.sc.num_drects; out_data = g_new(char, alloc_bytes); if (out_data != NULL) { tiles = (struct rfx_tile *) (out_data + XRDP_SURCMD_PREFIX_BYTES + self->max_compressed_bytes); rfxrects = (struct rfx_rect *) (tiles + tiles_left); count = tiles_left; for (index = 0; index < count; index++) { x = enc->u.sc.crects[(index + all_tiles_written) * 4 + 0]; y = enc->u.sc.crects[(index + all_tiles_written) * 4 + 1]; cx = enc->u.sc.crects[(index + all_tiles_written) * 4 + 2]; cy = enc->u.sc.crects[(index + all_tiles_written) * 4 + 3]; tiles[index].x = x; tiles[index].y = y; tiles[index].cx = cx; tiles[index].cy = cy; tiles[index].quant_y = self->quant_idx_y; tiles[index].quant_cb = self->quant_idx_u; tiles[index].quant_cr = self->quant_idx_v; } count = enc->u.sc.num_drects; for (index = 0; index < count; index++) { x = enc->u.sc.drects[index * 4 + 0]; y = enc->u.sc.drects[index * 4 + 1]; cx = enc->u.sc.drects[index * 4 + 2]; cy = enc->u.sc.drects[index * 4 + 3]; rfxrects[index].x = x; rfxrects[index].y = y; rfxrects[index].cx = cx; rfxrects[index].cy = cy; } out_data_bytes = self->max_compressed_bytes; encode_flags = 0; if (((int)enc->flags & KEY_FRAME_REQUESTED) && encode_passes == 0) { encode_flags = RFX_FLAGS_PRO_KEY; } tiles_written = rfxcodec_encode_ex(self->codec_handle_rfx, out_data + XRDP_SURCMD_PREFIX_BYTES, &out_data_bytes, enc->u.sc.data, enc->u.sc.width, enc->u.sc.height, ((enc->u.sc.width + 63) & ~63) * 4, rfxrects, enc->u.sc.num_drects, tiles, enc->u.sc.num_crects, self->quants, self->num_quants, encode_flags); } ++encode_passes; } LOG_DEVEL(LOG_LEVEL_DEBUG, "process_enc_rfx: rfxcodec_encode tiles_written %d", tiles_written); /* only if enc_done->comp_bytes is not zero is something sent to the client but you must always send something back even on error so Xorg can get ack */ enc_done = g_new0(XRDP_ENC_DATA_DONE, 1); if (enc_done == NULL) { return 1; } enc_done->comp_bytes = tiles_written > 0 ? out_data_bytes : 0; enc_done->pad_bytes = XRDP_SURCMD_PREFIX_BYTES; enc_done->comp_pad_data = out_data; enc_done->enc = enc; enc_done->x = enc->u.sc.left; enc_done->y = enc->u.sc.top; enc_done->cx = enc->u.sc.width; enc_done->cy = enc->u.sc.height; enc_done->frame_id = enc->u.sc.frame_id; enc_done->continuation = all_tiles_written > 0; if (tiles_written > 0) { all_tiles_written += tiles_written; } finished = (all_tiles_written == enc->u.sc.num_crects) || (tiles_written < 0); enc_done->last = finished; /* done with msg */ /* inform main thread done */ tc_mutex_lock(mutex); fifo_add_item(fifo_processed, enc_done); tc_mutex_unlock(mutex); } while (!finished); /* signal completion for main thread */ g_set_wait_obj(event_processed); return 0; } #endif /*****************************************************************************/ /* called from encoder thread */ static int process_enc_h264(struct xrdp_encoder *self, XRDP_ENC_DATA *enc) { LOG_DEVEL(LOG_LEVEL_INFO, "process_enc_h264: dummy func"); return 0; } #ifdef XRDP_RFXCODEC /*****************************************************************************/ static int gfx_send_done(struct xrdp_encoder *self, XRDP_ENC_DATA *enc, int comp_bytes, int pad_bytes, char *comp_pad_data, int got_frame_id, int frame_id, int is_last) { XRDP_ENC_DATA_DONE *enc_done; enc_done = g_new0(XRDP_ENC_DATA_DONE, 1); if (enc_done == NULL) { return 1; } ENC_SET_BIT(enc_done->flags, ENC_DONE_FLAGS_GFX_BIT); enc_done->enc = enc; enc_done->last = is_last; enc_done->pad_bytes = pad_bytes; enc_done->comp_bytes = comp_bytes; enc_done->comp_pad_data = comp_pad_data; if (got_frame_id) { ENC_SET_BIT(enc_done->flags, ENC_DONE_FLAGS_FRAME_ID_BIT); enc_done->frame_id = frame_id; } /* inform main thread done */ tc_mutex_lock(self->mutex); fifo_add_item(self->fifo_processed, enc_done); tc_mutex_unlock(self->mutex); /* signal completion for main thread */ g_set_wait_obj(self->xrdp_encoder_event_processed); return 0; } /*****************************************************************************/ static struct stream * gfx_wiretosurface1(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s, XRDP_ENC_DATA *enc) { (void)self; (void)bulk; (void)in_s; (void)enc; return NULL; } /*****************************************************************************/ static struct stream * gfx_wiretosurface2(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s, XRDP_ENC_DATA *enc) { int index; int surface_id; int codec_id; int codec_context_id; int pixel_format; int num_rects_d; int num_rects_c; struct stream *rv; short left; short top; short width; short height; char *bitmap_data; int bitmap_data_length; struct rfx_tile *tiles; struct rfx_rect *rfxrects; int tiles_compressed; int flags; int total_tiles; int tiles_written; int mon_index; if (!s_check_rem(in_s, 15)) { return NULL; } in_uint16_le(in_s, surface_id); in_uint16_le(in_s, codec_id); in_uint32_le(in_s, codec_context_id); in_uint8(in_s, pixel_format); in_uint32_le(in_s, flags); mon_index = (flags >> 28) & 0xF; in_uint16_le(in_s, num_rects_d); if ((num_rects_d < 1) || (num_rects_d > 16 * 1024) || (!s_check_rem(in_s, num_rects_d * 8))) { return NULL; } rfxrects = g_new0(struct rfx_rect, num_rects_d); if (rfxrects == NULL) { return NULL; } for (index = 0; index < num_rects_d; index++) { in_uint16_le(in_s, left); in_uint16_le(in_s, top); in_uint16_le(in_s, width); in_uint16_le(in_s, height); rfxrects[index].x = left; rfxrects[index].y = top; rfxrects[index].cx = width; rfxrects[index].cy = height; } if (!s_check_rem(in_s, 2)) { g_free(rfxrects); return NULL; } in_uint16_le(in_s, num_rects_c); if ((num_rects_c < 1) || (num_rects_c > 16 * 1024) || (!s_check_rem(in_s, num_rects_c * 8))) { g_free(rfxrects); return NULL; } tiles = g_new0(struct rfx_tile, num_rects_c); if (tiles == NULL) { g_free(rfxrects); return NULL; } for (index = 0; index < num_rects_c; index++) { in_uint16_le(in_s, left); in_uint16_le(in_s, top); in_uint16_le(in_s, width); in_uint16_le(in_s, height); tiles[index].x = left; tiles[index].y = top; tiles[index].cx = width; tiles[index].cy = height; tiles[index].quant_y = self->quant_idx_y; tiles[index].quant_cb = self->quant_idx_u; tiles[index].quant_cr = self->quant_idx_v; } if (!s_check_rem(in_s, 8)) { g_free(tiles); g_free(rfxrects); return NULL; } in_uint16_le(in_s, left); in_uint16_le(in_s, top); in_uint16_le(in_s, width); in_uint16_le(in_s, height); if (self->codec_handle_prfx_gfx[mon_index] == NULL) { self->codec_handle_prfx_gfx[mon_index] = rfxcodec_encode_create( width, height, RFX_FORMAT_YUV, RFX_FLAGS_RLGR1 | RFX_FLAGS_PRO1); if (self->codec_handle_prfx_gfx[mon_index] == NULL) { g_free(tiles); g_free(rfxrects); return NULL; } } bitmap_data_length = self->max_compressed_bytes; bitmap_data = g_new(char, bitmap_data_length); if (bitmap_data == NULL) { g_free(tiles); g_free(rfxrects); return NULL; } rv = NULL; tiles_written = 0; total_tiles = num_rects_c; for (;;) { tiles_compressed = rfxcodec_encode(self->codec_handle_prfx_gfx[mon_index], bitmap_data, &bitmap_data_length, enc->u.gfx.data, width, height, ((width + 63) & ~63) * 4, rfxrects, num_rects_d, tiles + tiles_written, total_tiles - tiles_written, self->quants, self->num_quants); if (tiles_compressed < 1) { break; } tiles_written += tiles_compressed; rv = xrdp_egfx_wire_to_surface2(bulk, surface_id, codec_id, codec_context_id, pixel_format, bitmap_data, bitmap_data_length); if (rv == NULL) { break; } LOG_DEVEL(LOG_LEVEL_ERROR, "gfx_wiretosurface2: " "tiles_compressed %d total_tiles %d tiles_written %d", tiles_compressed, total_tiles, tiles_written); if (tiles_written >= total_tiles) { /* ok, done with last tile set */ break; } /* we have another tile set, send this one to main thread */ if (gfx_send_done(self, enc, (int)(rv->end - rv->data), 0, rv->data, 0, 0, 0) != 0) { free_stream(rv); rv = NULL; break; } g_free(rv); /* don't call free_stream() here so s->data is valid */ rv = NULL; bitmap_data_length = self->max_compressed_bytes; } g_free(tiles); g_free(rfxrects); g_free(bitmap_data); return rv; } /*****************************************************************************/ static struct stream * gfx_solidfill(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int surface_id; int pixel; int num_rects; char *ptr8; struct xrdp_egfx_rect *rects; if (!s_check_rem(in_s, 8)) { return NULL; } in_uint16_le(in_s, surface_id); in_uint32_le(in_s, pixel); in_uint16_le(in_s, num_rects); if (!s_check_rem(in_s, num_rects * 8)) { return NULL; } in_uint8p(in_s, ptr8, num_rects * 8); rects = (struct xrdp_egfx_rect *) ptr8; return xrdp_egfx_fill_surface(bulk, surface_id, pixel, num_rects, rects); } /*****************************************************************************/ static struct stream * gfx_surfacetosurface(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int surface_id_src; int surface_id_dst; char *ptr8; int num_pts; struct xrdp_egfx_rect *rects; struct xrdp_egfx_point *pts; if (!s_check_rem(in_s, 14)) { return NULL; } in_uint16_le(in_s, surface_id_src); in_uint16_le(in_s, surface_id_dst); in_uint8p(in_s, ptr8, 8); rects = (struct xrdp_egfx_rect *) ptr8; in_uint16_le(in_s, num_pts); if (!s_check_rem(in_s, num_pts * 4)) { return NULL; } in_uint8p(in_s, ptr8, num_pts * 4); pts = (struct xrdp_egfx_point *) ptr8; return xrdp_egfx_surface_to_surface(bulk, surface_id_src, surface_id_dst, rects, num_pts, pts); } /*****************************************************************************/ static struct stream * gfx_createsurface(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int surface_id; int width; int height; int pixel_format; if (!s_check_rem(in_s, 7)) { return NULL; } in_uint16_le(in_s, surface_id); in_uint16_le(in_s, width); in_uint16_le(in_s, height); in_uint8(in_s, pixel_format); return xrdp_egfx_create_surface(bulk, surface_id, width, height, pixel_format); } /*****************************************************************************/ static struct stream * gfx_deletesurface(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int surface_id; if (!s_check_rem(in_s, 2)) { return NULL; } in_uint16_le(in_s, surface_id); return xrdp_egfx_delete_surface(bulk, surface_id); } /*****************************************************************************/ static struct stream * gfx_startframe(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int frame_id; int time_stamp; if (!s_check_rem(in_s, 8)) { return NULL; } in_uint32_le(in_s, frame_id); in_uint32_le(in_s, time_stamp); return xrdp_egfx_frame_start(bulk, frame_id, time_stamp); } /*****************************************************************************/ static struct stream * gfx_endframe(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s, int *aframe_id) { int frame_id; if (!s_check_rem(in_s, 4)) { return NULL; } in_uint32_le(in_s, frame_id); *aframe_id = frame_id; return xrdp_egfx_frame_end(bulk, frame_id); } /*****************************************************************************/ static struct stream * gfx_resetgraphics(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int width; int height; int monitor_count; int index; struct monitor_info *mi; struct stream *rv; if (!s_check_rem(in_s, 12)) { return NULL; } in_uint32_le(in_s, width); in_uint32_le(in_s, height); in_uint32_le(in_s, monitor_count); if ((monitor_count < 1) || (monitor_count > 16) || !s_check_rem(in_s, monitor_count * 20)) { return NULL; } mi = g_new0(struct monitor_info, monitor_count); if (mi == NULL) { return NULL; } for (index = 0; index < monitor_count; index++) { in_uint32_le(in_s, mi[index].left); in_uint32_le(in_s, mi[index].top); in_uint32_le(in_s, mi[index].right); in_uint32_le(in_s, mi[index].bottom); in_uint32_le(in_s, mi[index].is_primary); } rv = xrdp_egfx_reset_graphics(bulk, width, height, monitor_count, mi); g_free(mi); return rv; } /*****************************************************************************/ static struct stream * gfx_mapsurfacetooutput(struct xrdp_encoder *self, struct xrdp_egfx_bulk *bulk, struct stream *in_s) { int surface_id; int x; int y; if (!s_check_rem(in_s, 10)) { return NULL; } in_uint16_le(in_s, surface_id); in_uint32_le(in_s, x); in_uint32_le(in_s, y); return xrdp_egfx_map_surface(bulk, surface_id, x, y); } /*****************************************************************************/ /* called from encoder thread */ static int process_enc_egfx(struct xrdp_encoder *self, XRDP_ENC_DATA *enc) { struct stream *s; struct stream in_s; struct xrdp_egfx_bulk *bulk; int cmd_id; int cmd_bytes; int frame_id; int got_frame_id; int error; char *holdp; char *holdend; bulk = self->mm->egfx->bulk; g_memset(&in_s, 0, sizeof(in_s)); in_s.data = enc->u.gfx.cmd; in_s.size = enc->u.gfx.cmd_bytes; in_s.p = in_s.data; in_s.end = in_s.data + in_s.size; while (s_check_rem(&in_s, 8)) { s = NULL; frame_id = 0; got_frame_id = 0; holdp = in_s.p; in_uint16_le(&in_s, cmd_id); in_uint8s(&in_s, 2); /* flags */ in_uint32_le(&in_s, cmd_bytes); if ((cmd_bytes < 8) || (cmd_bytes > 32 * 1024)) { return 1; } holdend = in_s.end; in_s.end = holdp + cmd_bytes; switch (cmd_id) { case XR_RDPGFX_CMDID_WIRETOSURFACE_1: /* 0x0001 */ s = gfx_wiretosurface1(self, bulk, &in_s, enc); break; case XR_RDPGFX_CMDID_WIRETOSURFACE_2: /* 0x0002 */ s = gfx_wiretosurface2(self, bulk, &in_s, enc); break; case XR_RDPGFX_CMDID_SOLIDFILL: /* 0x0004 */ s = gfx_solidfill(self, bulk, &in_s); break; case XR_RDPGFX_CMDID_SURFACETOSURFACE: /* 0x0005 */ s = gfx_surfacetosurface(self, bulk, &in_s); break; case XR_RDPGFX_CMDID_CREATESURFACE: /* 0x0009 */ s = gfx_createsurface(self, bulk, &in_s); break; case XR_RDPGFX_CMDID_DELETESURFACE: /* 0x000A */ s = gfx_deletesurface(self, bulk, &in_s); break; case XR_RDPGFX_CMDID_STARTFRAME: /* 0x000B */ s = gfx_startframe(self, bulk, &in_s); break; case XR_RDPGFX_CMDID_ENDFRAME: /* 0x000C */ s = gfx_endframe(self, bulk, &in_s, &frame_id); got_frame_id = 1; break; case XR_RDPGFX_CMDID_RESETGRAPHICS: /* 0x000E */ s = gfx_resetgraphics(self, bulk, &in_s); break; case XR_RDPGFX_CMDID_MAPSURFACETOOUTPUT: /* 0x000F */ s = gfx_mapsurfacetooutput(self, bulk, &in_s); break; default: break; } /* setup for next cmd */ in_s.p = holdp + cmd_bytes; in_s.end = holdend; if (s != NULL) { /* send message to main thread */ error = gfx_send_done(self, enc, (int) (s->end - s->data), 0, s->data, got_frame_id, frame_id, !s_check_rem(&in_s, 8)); if (error != 0) { LOG(LOG_LEVEL_ERROR, "process_enc_egfx: gfx_send_done failed " "error %d", error); free_stream(s); return 1; } g_free(s); /* don't call free_stream() here so s->data is valid */ } } return 0; } #endif /** * Encoder thread main loop *****************************************************************************/ THREAD_RV THREAD_CC proc_enc_msg(void *arg) { XRDP_ENC_DATA *enc; struct fifo *fifo_to_proc; tbus mutex; tbus event_to_proc; tbus term_obj; tbus lterm_obj; int robjs_count; int wobjs_count; int cont; int timeout; tbus robjs[32]; tbus wobjs[32]; struct xrdp_encoder *self; LOG_DEVEL(LOG_LEVEL_INFO, "proc_enc_msg: thread is running"); self = (struct xrdp_encoder *) arg; if (self == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "proc_enc_msg: self nil"); return 0; } fifo_to_proc = self->fifo_to_proc; mutex = self->mutex; event_to_proc = self->xrdp_encoder_event_to_proc; term_obj = g_get_term(); lterm_obj = self->xrdp_encoder_term_request; cont = 1; while (cont) { timeout = -1; robjs_count = 0; wobjs_count = 0; robjs[robjs_count++] = term_obj; robjs[robjs_count++] = lterm_obj; robjs[robjs_count++] = event_to_proc; if (g_obj_wait(robjs, robjs_count, wobjs, wobjs_count, timeout) != 0) { /* error, should not get here */ g_sleep(100); } if (g_is_wait_obj_set(term_obj)) /* global term */ { LOG(LOG_LEVEL_DEBUG, "Received termination signal, stopping the encoder thread"); break; } if (g_is_wait_obj_set(lterm_obj)) /* xrdp_mm term */ { LOG_DEVEL(LOG_LEVEL_DEBUG, "proc_enc_msg: xrdp_mm term"); break; } if (g_is_wait_obj_set(event_to_proc)) { /* clear it right away */ g_reset_wait_obj(event_to_proc); /* get first msg */ tc_mutex_lock(mutex); enc = (XRDP_ENC_DATA *) fifo_remove_item(fifo_to_proc); tc_mutex_unlock(mutex); while (enc != 0) { /* do work */ self->process_enc(self, enc); /* get next msg */ tc_mutex_lock(mutex); enc = (XRDP_ENC_DATA *) fifo_remove_item(fifo_to_proc); tc_mutex_unlock(mutex); } } } /* end while (cont) */ g_set_wait_obj(self->xrdp_encoder_term_done); LOG_DEVEL(LOG_LEVEL_DEBUG, "proc_enc_msg: thread exit"); return 0; } xrdp-0.10.1/xrdp/xrdp256.bmp000644 001751 000000 00000140176 14652432047 015535 0ustar00metawheel000000 000000 BM~~(  333fff`                                                                                                                                                                                                 xrdp-0.10.1/xrdp/README.logo000644 001751 000000 00000000304 14652432047 015426 0ustar00metawheel000000 000000 About xrdp_logo.png / xrdp_logo.bmp These new xrdp logo files were created by processing vector image files by @metalefty. The base images can be found at https://github.com/metalefty/xrdp-logo xrdp-0.10.1/xrdp/xrdp_types.h000644 001751 000000 00000066465 14652432047 016205 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * types */ #ifndef _XRDP_TYPES_H_ #define _XRDP_TYPES_H_ #define DEFAULT_STRING_LEN 255 #define LOG_WINDOW_CHAR_PER_LINE 60 #include "xrdp_rail.h" #include "xrdp_constants.h" #include "fifo.h" #include "guid.h" #include "xrdp_client_info.h" #define MAX_NR_CHANNELS 16 #define MAX_CHANNEL_NAME 16 /* Code values used in 'xrdp_mm->code=' settings */ #define XVNC_SESSION_CODE 0 #define XORG_SESSION_CODE 20 /* To check whether touch events has been implemented on session type 'mm' */ #define XRDP_MM_IMPLEMENTS_TOUCH(mm) ((mm)->code != XVNC_SESSION_CODE) struct source_info; struct list16; /* lib */ struct xrdp_mod { int size; /* size of this struct */ int version; /* internal version */ /* client functions */ int (*mod_start)(struct xrdp_mod *v, int w, int h, int bpp); int (*mod_connect)(struct xrdp_mod *v); int (*mod_event)(struct xrdp_mod *v, int msg, long param1, long param2, long param3, long param4); int (*mod_signal)(struct xrdp_mod *v); int (*mod_end)(struct xrdp_mod *v); int (*mod_set_param)(struct xrdp_mod *v, const char *name, const char *value); int (*mod_session_change)(struct xrdp_mod *v, int, int); int (*mod_get_wait_objs)(struct xrdp_mod *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int (*mod_check_wait_objs)(struct xrdp_mod *v); int (*mod_frame_ack)(struct xrdp_mod *v, int flags, int frame_id); int (*mod_suppress_output)(struct xrdp_mod *v, int suppress, int left, int top, int right, int bottom); int (*mod_server_monitor_resize)(struct xrdp_mod *v, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress); int (*mod_server_monitor_full_invalidate)(struct xrdp_mod *v, int width, int height); int (*mod_server_version_message)(struct xrdp_mod *v); tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod functions above */ /* server functions */ int (*server_begin_update)(struct xrdp_mod *v); int (*server_end_update)(struct xrdp_mod *v); int (*server_fill_rect)(struct xrdp_mod *v, int x, int y, int cx, int cy); int (*server_screen_blt)(struct xrdp_mod *v, int x, int y, int cx, int cy, int srcx, int srcy); int (*server_paint_rect)(struct xrdp_mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy); int (*server_set_pointer)(struct xrdp_mod *v, int x, int y, char *data, char *mask); int (*server_palette)(struct xrdp_mod *v, int *palette); int (*server_msg)(struct xrdp_mod *v, const char *msg, int code); /* This one can be assigned directly into the is_term member of * a struct trans */ int (*server_is_term)(void); int (*server_set_clip)(struct xrdp_mod *v, int x, int y, int cx, int cy); int (*server_reset_clip)(struct xrdp_mod *v); int (*server_set_fgcolor)(struct xrdp_mod *v, int fgcolor); int (*server_set_bgcolor)(struct xrdp_mod *v, int bgcolor); int (*server_set_opcode)(struct xrdp_mod *v, int opcode); int (*server_set_mixmode)(struct xrdp_mod *v, int mixmode); int (*server_set_brush)(struct xrdp_mod *v, int x_origin, int y_origin, int style, char *pattern); int (*server_set_pen)(struct xrdp_mod *v, int style, int width); int (*server_draw_line)(struct xrdp_mod *v, int x1, int y1, int x2, int y2); int (*server_add_char)(struct xrdp_mod *v, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_draw_text)(struct xrdp_mod *v, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int (*client_monitor_resize)(struct xrdp_mod *v, int width, int height, int num_monitors, const struct monitor_info *monitors); int (*server_monitor_resize_done)(struct xrdp_mod *v); int (*server_get_channel_count)(struct xrdp_mod *v); int (*server_query_channel)(struct xrdp_mod *v, int index, char *channel_name, int *channel_flags); int (*server_get_channel_id)(struct xrdp_mod *v, const char *name); int (*server_send_to_channel)(struct xrdp_mod *v, int channel_id, char *data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct xrdp_mod *v); int (*server_chansrv_in_use)(struct xrdp_mod *v); /* off screen bitmaps */ int (*server_create_os_surface)(struct xrdp_mod *v, int rdpindex, int width, int height); int (*server_switch_os_surface)(struct xrdp_mod *v, int rdpindex); int (*server_delete_os_surface)(struct xrdp_mod *v, int rdpindex); int (*server_paint_rect_os)(struct xrdp_mod *mod, int x, int y, int cx, int cy, int rdpindex, int srcx, int srcy); int (*server_set_hints)(struct xrdp_mod *mod, int hints, int mask); /* rail */ int (*server_window_new_update)(struct xrdp_mod *mod, int window_id, struct rail_window_state_order *window_state, int flags); int (*server_window_delete)(struct xrdp_mod *mod, int window_id); int (*server_window_icon)(struct xrdp_mod *mod, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags); int (*server_window_cached_icon)(struct xrdp_mod *mod, int window_id, int cache_entry, int cache_id, int flags); int (*server_notify_new_update)(struct xrdp_mod *mod, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags); int (*server_notify_delete)(struct xrdp_mod *mod, int window_id, int notify_id); int (*server_monitored_desktop)(struct xrdp_mod *mod, struct rail_monitored_desktop_order *mdo, int flags); int (*server_set_pointer_ex)(struct xrdp_mod *v, int x, int y, char *data, char *mask, int bpp); int (*server_add_char_alpha)(struct xrdp_mod *mod, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_create_os_surface_bpp)(struct xrdp_mod *v, int rdpindex, int width, int height, int bpp); int (*server_paint_rect_bpp)(struct xrdp_mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy, int bpp); int (*server_composite)(struct xrdp_mod *v, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat); int (*server_paint_rects)(struct xrdp_mod *v, int num_drects, short *drects, int num_crects, short *crects, char *data, int width, int height, int flags, int frame_id); int (*server_session_info)(struct xrdp_mod *v, const char *data, int data_bytes); int (*server_set_pointer_large)(struct xrdp_mod *v, int x, int y, char *data, char *mask, int bpp, int width, int height); int (*server_paint_rects_ex)(struct xrdp_mod *v, int num_drects, short *drects, int num_crects, short *crects, char *data, int left, int top, int width, int height, int flags, int frame_id, void *shmem_ptr, int shmem_bytes); int (*server_egfx_cmd)(struct xrdp_mod *v, char *cmd, int cmd_bytes, char *data, int data_bytes); tintptr server_dumby[100 - 50]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as int */ tintptr wm; /* struct xrdp_wm* */ tintptr painter; struct source_info *si; }; /** * Transform to apply to loaded images */ enum xrdp_bitmap_load_transform { XBLT_NONE = 0, XBLT_SCALE, XBLT_ZOOM }; /* header for bmp file */ struct xrdp_bmp_header { int size; int image_width; int image_height; short planes; short bit_count; int compression; int image_size; int x_pels_per_meter; int y_pels_per_meter; int clr_used; int clr_important; }; struct xrdp_palette_item { int stamp; int palette[256]; }; struct xrdp_bitmap_item { int stamp; int lru_index; struct xrdp_bitmap *bitmap; }; struct xrdp_lru_item { int next; int prev; }; struct xrdp_os_bitmap_item { int id; struct xrdp_bitmap *bitmap; }; struct xrdp_char_item { int stamp; struct xrdp_font_char font_item; }; struct xrdp_pointer_item { int stamp; int x; /* hotspot */ int y; int pad0; char data[96 * 96 * 4]; char mask[96 * 96 / 8]; int bpp; int width; int height; int pad1; }; struct xrdp_brush_item { int stamp; /* expand this to a structure to handle more complicated brushes for now it's 8x8 1bpp brushes only */ char pattern[8]; }; /* moved to xrdp_constants.h #define XRDP_BITMAP_CACHE_ENTRIES 2048 */ /* difference caches */ struct xrdp_cache { struct xrdp_wm *wm; /* owner */ struct xrdp_session *session; /* palette */ int palette_stamp; struct xrdp_palette_item palette_items[6]; /* bitmap */ int bitmap_stamp; struct xrdp_bitmap_item bitmap_items[XRDP_MAX_BITMAP_CACHE_ID] [XRDP_MAX_BITMAP_CACHE_IDX]; /* lru optimize */ struct xrdp_lru_item bitmap_lrus[XRDP_MAX_BITMAP_CACHE_ID] [XRDP_MAX_BITMAP_CACHE_IDX]; int lru_head[XRDP_MAX_BITMAP_CACHE_ID]; int lru_tail[XRDP_MAX_BITMAP_CACHE_ID]; int lru_reset[XRDP_MAX_BITMAP_CACHE_ID]; /* crc optimize */ struct list16 crc16[XRDP_MAX_BITMAP_CACHE_ID][64 * 1024]; int use_bitmap_comp; int cache1_entries; int cache1_size; int cache2_entries; int cache2_size; int cache3_entries; int cache3_size; int bitmap_cache_persist_enable; int bitmap_cache_version; /* font */ int char_stamp; struct xrdp_char_item char_items[12][256]; /* pointer */ int pointer_stamp; struct xrdp_pointer_item pointer_items[32]; int pointer_cache_entries; int brush_stamp; struct xrdp_brush_item brush_items[64]; struct xrdp_os_bitmap_item os_bitmap_items[2000]; struct list *xrdp_os_del_list; }; /* defined later */ struct xrdp_enc_data; /** * Stages we go through connecting to the session */ enum mm_connect_state { MMCS_CONNECT_TO_SESMAN, MMCS_GATEWAY_LOGIN, MMCS_SESSION_LOGIN, MMCS_CREATE_SESSION, MMCS_CONNECT_TO_SESSION, MMCS_CONNECT_TO_CHANSRV, MMCS_DONE }; enum display_resize_state { WMRZ_ENCODER_DELETE = 0, WMRZ_EGFX_DELETE_SURFACE, WMRZ_EGFX_CONN_CLOSE, WMRZ_EGFX_CONN_CLOSING, WMRZ_EGFX_CONN_CLOSED, WRMZ_EGFX_DELETE, WMRZ_SERVER_MONITOR_RESIZE, WMRZ_SERVER_MONITOR_MESSAGE_PROCESSING, WMRZ_SERVER_MONITOR_MESSAGE_PROCESSED, WMRZ_XRDP_CORE_RESET, WMRZ_XRDP_CORE_RESET_PROCESSING, WMRZ_XRDP_CORE_RESET_PROCESSED, WMRZ_EGFX_INITIALIZE, WMRZ_EGFX_INITALIZING, WMRZ_EGFX_INITIALIZED, WMRZ_ENCODER_CREATE, WMRZ_SERVER_INVALIDATE, WMRZ_COMPLETE, WMRZ_ERROR }; #define XRDP_DISPLAY_RESIZE_STATE_TO_STR(status) \ ((status) == WMRZ_ENCODER_DELETE ? "WMRZ_ENCODER_DELETE" : \ (status) == WMRZ_EGFX_DELETE_SURFACE ? "WMRZ_EGFX_DELETE_SURFACE" : \ (status) == WMRZ_EGFX_CONN_CLOSE ? "WMRZ_EGFX_CONN_CLOSE" : \ (status) == WMRZ_EGFX_CONN_CLOSING ? "WMRZ_EGFX_CONN_CLOSING" : \ (status) == WMRZ_EGFX_CONN_CLOSED ? "WMRZ_EGFX_CONN_CLOSED" : \ (status) == WRMZ_EGFX_DELETE ? "WMRZ_EGFX_DELETE" : \ (status) == WMRZ_SERVER_MONITOR_RESIZE ? "WMRZ_SERVER_MONITOR_RESIZE" : \ (status) == WMRZ_SERVER_MONITOR_MESSAGE_PROCESSING ? \ "WMRZ_SERVER_MONITOR_MESSAGE_PROCESSING" : \ (status) == WMRZ_SERVER_MONITOR_MESSAGE_PROCESSED ? \ "WMRZ_SERVER_MONITOR_MESSAGE_PROCESSED" : \ (status) == WMRZ_XRDP_CORE_RESET ? "WMRZ_XRDP_CORE_RESET" : \ (status) == WMRZ_XRDP_CORE_RESET_PROCESSING ? \ "WMRZ_XRDP_CORE_RESET_PROCESSING" : \ (status) == WMRZ_XRDP_CORE_RESET_PROCESSED ? \ "WMRZ_XRDP_CORE_RESET_PROCESSED" : \ (status) == WMRZ_EGFX_INITIALIZE ? "WMRZ_EGFX_INITIALIZE" : \ (status) == WMRZ_EGFX_INITALIZING ? "WMRZ_EGFX_INITALIZING" : \ (status) == WMRZ_EGFX_INITIALIZED ? "WMRZ_EGFX_INITIALIZED" : \ (status) == WMRZ_ENCODER_CREATE ? "WMRZ_ENCODER_CREATE" : \ (status) == WMRZ_SERVER_INVALIDATE ? "WMRZ_SERVER_INVALIDATE" : \ (status) == WMRZ_COMPLETE ? "WMRZ_COMPLETE" : \ (status) == WMRZ_ERROR ? "WMRZ_ERROR" : \ "unknown" \ ) enum xrdp_egfx_flags { XRDP_EGFX_NONE = 0, XRDP_EGFX_H264 = 1, XRDP_EGFX_RFX_PRO = 2 }; struct xrdp_mm { struct xrdp_wm *wm; /* owner */ enum mm_connect_state connect_state; /* State of connection */ int mmcs_expecting_msg; /* Connect state machine is expecting a message from sesman */ /* Other processes we connect to */ int use_sesman; /* true if this is a sesman session */ int use_gw_login; /* True if we're to login using a gateway */ int use_chansrv; /* true if chansrvport is set in xrdp.ini or using sesman */ struct trans *sesman_trans; /* connection to sesman */ struct trans *chan_trans; /* connection to chansrv */ /* We can't delete transports while we're in a callback for that * transport, as this causes trans.c to reference undefined memory. * These flags mark transports as needing to be deleted when * we are definitely not in a transport callback */ int delete_sesman_trans; struct list *login_names; struct list *login_values; /* mod vars */ long mod_handle; /* returned from g_load_library */ struct xrdp_mod *(*mod_init)(void); int (*mod_exit)(struct xrdp_mod *); struct xrdp_mod *mod; /* module interface */ int display; /* 10 for :10.0, 11 for :11.0, etc */ int uid; /* UID for a successful login, -1 otherwise */ struct guid guid; /* GUID for the session, or all zeros */ int code; /* 0=Xvnc session, 20=xorg driver mode */ struct xrdp_encoder *encoder; int cs2xr_cid_map[256]; int xr2cr_cid_map[256]; int dynamic_monitor_chanid; struct xrdp_egfx *egfx; int egfx_up; enum xrdp_egfx_flags egfx_flags; int gfx_delay_autologin; int mod_uses_wm_screen_for_gfx; /* Resize on-the-fly control */ struct display_control_monitor_layout_data *resize_data; struct list *resize_queue; tbus resize_ready; }; struct xrdp_key_info { int sym; char32_t chr; }; struct xrdp_keymap { struct xrdp_key_info keys_noshift[256]; struct xrdp_key_info keys_shift[256]; struct xrdp_key_info keys_altgr[256]; struct xrdp_key_info keys_shiftaltgr[256]; struct xrdp_key_info keys_capslock[256]; struct xrdp_key_info keys_capslockaltgr[256]; struct xrdp_key_info keys_shiftcapslock[256]; struct xrdp_key_info keys_shiftcapslockaltgr[256]; }; /* the window manager */ /*** * Window manager login mode states * * Use with xrdp_wm_set_login_state() */ enum wm_login_state { /** * Place the window manager in this state to reset it */ WMLS_RESET = 0, /** * In this state, the window manager is waiting for the user to fill * in the login box */ WMLS_USER_PROMPT, /** * Place the window manager in this state to request xrdp connects to * the X server, sesman, chansrv etc */ WMLS_START_CONNECT, /** * In this state, the window manager is making required connections */ WMLS_CONNECT_IN_PROGRESS, /** * Place the window manager in this state to request it finishes. */ WMLS_CLEANUP, /** * In this state, the window manager is inactive */ WMLS_INACTIVE }; struct xrdp_wm { struct xrdp_process *pro_layer; /* owner */ struct xrdp_bitmap *screen; struct xrdp_session *session; struct xrdp_painter *painter; struct xrdp_cache *cache; int palette[256]; struct xrdp_bitmap *login_window; /* generic colors */ int black; int grey; int dark_grey; int blue; int dark_blue; int white; int red; int green; int background; /* dragging info */ int dragging; int draggingx; int draggingy; int draggingcx; int draggingcy; int draggingdx; int draggingdy; int draggingorgx; int draggingorgy; int draggingxorstate; struct xrdp_bitmap *dragging_window; /* the down(clicked) button */ struct xrdp_bitmap *button_down; /* popup for combo box */ struct xrdp_bitmap *popup_wnd; /* focused window */ struct xrdp_bitmap *focused_window; /* pointer */ int current_pointer; int mouse_x; int mouse_y; /* keyboard info */ int keys[256]; /* key states 0 up 1 down*/ int caps_lock; int scroll_lock; int num_lock; /* client info */ struct xrdp_client_info *client_info; /* session log */ struct list *log; struct xrdp_bitmap *log_wnd; enum wm_login_state login_state; tbus login_state_event; struct xrdp_mm *mm; struct xrdp_font *default_font; struct xrdp_keymap keymap; int hide_log_window; int fatal_error_in_log_window; struct xrdp_bitmap *target_surface; /* either screen or os surface */ int current_surface_index; int hints; char pamerrortxt[256]; /* configuration derived from xrdp.ini */ struct xrdp_config *xrdp_config; struct xrdp_region *screen_dirty_region; int last_screen_draw_time; }; /* rdp process */ struct xrdp_process { int status; struct trans *server_trans; /* in tcp server mode */ tbus self_term_event; struct xrdp_listen *lis_layer; /* owner */ struct xrdp_session *session; /* create these when up and running */ struct xrdp_wm *wm; //int app_sck; tbus done_event; int session_id; }; /* rdp listener */ struct xrdp_listen { int status; struct list *trans_list; /* list of struct trans* */ struct list *process_list; struct list *fork_list; tbus pro_done_event; struct xrdp_startup_params *startup_params; }; /* region */ struct xrdp_region { struct xrdp_wm *wm; /* owner */ struct pixman_region16 *reg; }; /* painter */ struct xrdp_painter { int rop; struct xrdp_rect *use_clip; /* nil if not using clip */ struct xrdp_rect clip; int clip_children; int bg_color; int fg_color; int mix_mode; struct xrdp_brush brush; struct xrdp_pen pen; struct xrdp_session *session; struct xrdp_wm *wm; /* owner */ struct xrdp_font *font; void *painter; struct xrdp_region *dirty_region; int begin_end_level; }; /* window or bitmap */ struct xrdp_bitmap { /* 0 = bitmap 1 = window 2 = screen 3 = button 4 = image 5 = edit 6 = label 7 = combo 8 = special */ int type; int width; int height; struct xrdp_wm *wm; /* msg 1 = click 2 = mouse move 3 = paint 100 = modal result */ /* see messages in constants.h */ int (*notify)(struct xrdp_bitmap *wnd, struct xrdp_bitmap *sender, int msg, long param1, long param2); /* for bitmap */ int bpp; int line_size; /* in bytes */ int do_not_free_data; char *data; /* for all but bitmap */ int left; int top; int pointer; int bg_color; int tab_stop; int id; char *caption1; /* for window or screen */ struct xrdp_bitmap *modal_dialog; struct xrdp_bitmap *focused_control; struct xrdp_bitmap *owner; /* window that created us */ struct xrdp_bitmap *parent; /* window contained in */ /* for modal dialog */ struct xrdp_bitmap *default_button; /* button when enter is pressed */ struct xrdp_bitmap *esc_button; /* button when esc is pressed */ /* list of child windows */ struct list *child_list; /* for edit */ int edit_pos; char32_t password_char; /* for button or combo */ int state; /* for button 0 = normal 1 = down */ /* for combo */ struct list *string_list; struct list *data_list; /* for combo or popup */ int item_index; /* for popup */ struct xrdp_bitmap *popped_from; int item_height; /* crc */ int crc32; int crc16; }; #define MAX_FONT_CHARS 0x4e00 #define DEFAULT_FONT_NAME "sans-10.fv1" #define DEFAULT_FONT_PIXEL_SIZE 16 #define DEFAULT_FV1_SELECT "130:sans-18.fv1,0:" DEFAULT_FONT_NAME #define DEFAULT_BUTTON_MARGIN_H 12 #define DEFAULT_BUTTON_MARGIN_W 12 #define DEFAULT_COMBO_MARGIN_H 6 #define DEFAULT_EDIT_MARGIN_H 6 #define DEFAULT_WND_LOGIN_W 425 #define DEFAULT_WND_LOGIN_H 475 #define DEFAULT_WND_HELP_W 340 #define DEFAULT_WND_HELP_H 300 #define DEFAULT_WND_LOG_W 400 #define DEFAULT_WND_LOG_H 400 #define DEFAULT_WND_SPECIAL_H 100 /* font */ struct xrdp_font { struct xrdp_wm *wm; // Font characters, accessed by Unicode codepoint. The first 32 // entries are unused. struct xrdp_font_char chars[MAX_FONT_CHARS]; unsigned int char_count; // # elements in above array struct xrdp_font_char *default_char; // Pointer into above array char name[32]; int size; /** Body height in pixels */ int body_height; int style; }; /* module */ struct xrdp_mod_data { struct list *names; struct list *values; }; struct xrdp_startup_params { /* xrdp_ini is not malloc'd and has at least the same lifetime as main() */ const char *xrdp_ini; char port[1024]; int kill; int no_daemon; int help; int version; int fork; int dump_config; int license; int tcp_send_buffer_bytes; int tcp_recv_buffer_bytes; int tcp_nodelay; int tcp_keepalive; int use_vsock; }; /* * For storing xrdp.ini (and other) configuration settings */ struct xrdp_ls_dimensions { int width; /* window width */ int height; /* window height */ int logo_width; /* logo width (optional) */ int logo_height; /* logo height (optional) */ int logo_x_pos; /* logo x co-ordinate */ int logo_y_pos; /* logo y co-ordinate */ int label_x_pos; /* x pos of labels */ int label_width; /* width of labels */ int input_x_pos; /* x pos of text and combo boxes */ int input_width; /* width of input and combo boxes */ int input_y_pos; /* y pos for for first label and combo box */ int btn_ok_x_pos; /* x pos for OK button */ int btn_ok_y_pos; /* y pos for OK button */ int btn_ok_width; /* width of OK button */ int btn_ok_height; /* height of OK button */ int btn_cancel_x_pos; /* x pos for Cancel button */ int btn_cancel_y_pos; /* y pos for Cancel button */ int btn_cancel_width; /* width of Cancel button */ int btn_cancel_height; /* height of Cancel button */ int default_btn_height; /* Default button height (e.g. OK on login box) */ int log_wnd_width; /* Width of log window */ int log_wnd_height; /* Height of log window */ int edit_height; /* Height of an edit box */ int combo_height; /* Height of a combo box */ int help_wnd_width; /* Width of login help window */ int help_wnd_height; /* Height of login help window */ }; struct xrdp_cfg_globals { int ini_version; /* xrdp.ini file version number */ int use_bitmap_cache; int use_bitmap_compression; int port; int crypt_level; /* low=1, medium=2, high=3 */ int allow_channels; int max_bpp; int fork; int tcp_nodelay; int tcp_keepalive; int tcp_send_buffer_bytes; int tcp_recv_buffer_bytes; char autorun[256]; int hidelogwindow; int require_credentials; int bulk_compression; int new_cursors; int nego_sec_layer; int allow_multimon; int enable_token_login; /* colors */ int grey; int black; int dark_grey; int blue; int dark_blue; int white; int red; int green; int background; /* login screen */ unsigned int default_dpi; /* Default DPI to use if nothing from client */ char fv1_select[256]; /* Selection string for fv1 font */ int ls_top_window_bg_color; /* top level window background color */ int ls_bg_color; /* background color */ char ls_background_image[256]; /* background image file name */ /* transform to apply to background image */ enum xrdp_bitmap_load_transform ls_background_transform; char ls_logo_filename[256]; /* logo filename */ /* transform to apply to logo */ enum xrdp_bitmap_load_transform ls_logo_transform; char ls_title[256]; /* loginscreen window title */ /* Login screen dimensions, unscaled (from config) */ struct xrdp_ls_dimensions ls_unscaled; /* Login screen dimensions, scaled (after font is loaded) */ struct xrdp_ls_dimensions ls_scaled; }; struct xrdp_cfg_logging { }; struct xrdp_cfg_channels { }; struct xrdp_config { struct xrdp_cfg_globals cfg_globals; struct xrdp_cfg_logging cfg_logging; struct xrdp_cfg_channels cfg_channels; }; #endif xrdp-0.10.1/xrdp/xrdp.c000644 001751 000000 00000037045 14652432047 014744 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * main program */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "xrdp.h" #include "log.h" #include "xrdp_configure_options.h" #include "copying_third_party.h" #include "string_calls.h" #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" #endif static struct xrdp_listen *g_listen = 0; /*****************************************************************************/ static void print_license(void) { g_writeln("Third Party Code Additional Copyright Notices and License Terms"); g_writeln("%s", ""); g_writeln("Following third-party code are used in xrdp %s:", PACKAGE_VERSION); g_writeln("%s", ""); g_writeln("%s", copying_third_party); } /*****************************************************************************/ static void print_version(void) { g_writeln("xrdp %s", PACKAGE_VERSION); g_writeln(" A Remote Desktop Protocol Server."); g_writeln(" Copyright (C) 2004-%d Jay Sorg, " "Neutrino Labs, and all contributors.", VERSION_YEAR); g_writeln(" See https://github.com/neutrinolabs/xrdp for more information."); g_writeln("%s", ""); #if defined(XRDP_CONFIGURE_OPTIONS) g_writeln(" Configure options:"); g_writeln("%s", XRDP_CONFIGURE_OPTIONS); #endif g_writeln(" Compiled with %s", get_openssl_version()); } /*****************************************************************************/ static void print_help(void) { g_writeln("Usage: xrdp [options]"); g_writeln(" -k, --kill shut down xrdp"); g_writeln(" -h, --help show help"); g_writeln(" -v, --version show version"); g_writeln(" -n, --nodaemon don't fork into background"); g_writeln(" -p, --port tcp listen port"); g_writeln(" -f, --fork fork on new connection"); g_writeln(" -c, --config specify new path to xrdp.ini"); g_writeln(" --dump-config display config on stdout on startup"); g_writeln(" --license show additional license information"); } /*****************************************************************************/ /* Signal handler for SIGINT and SIGTERM * Note: only signal safe code (eg. setting wait event) should be executed in * this function. For more details see `man signal-safety` */ static void xrdp_shutdown(int sig) { g_set_wait_obj(g_get_term()); } /*****************************************************************************/ /* Signal handler for SIGCHLD * Note: only signal safe code (eg. setting wait event) should be executed in * this function. For more details see `man signal-safety` */ static void xrdp_child(int sig) { g_set_sigchld(1); } /*****************************************************************************/ /** * @brief looks for a case-insensitive match of a string in a list * @param candidate String to match * @param ... NULL-terminated list of strings to compare the candidate with * @return !=0 if the candidate is found in the list */ static int nocase_matches(const char *candidate, ...) { va_list vl; const char *member; int result = 0; va_start(vl, candidate); while ((member = va_arg(vl, const char *)) != NULL) { if (g_strcasecmp(candidate, member) == 0) { result = 1; break; } } va_end(vl); return result; } /*****************************************************************************/ /* No-op signal handler. * Note: only signal safe code (eg. setting wait event) should be executed in * this function. For more details see `man signal-safety` */ static void xrdp_sig_no_op(int sig) { /* no-op */ } /*****************************************************************************/ /** * * @brief Command line argument parser * @param number of command line arguments * @param pointer array of commandline arguments * @param [out] Returned startup parameters * @return 0 on success, n on nth argument is unknown * */ static int xrdp_process_params(int argc, char **argv, struct xrdp_startup_params *startup_params) { int index; const char *option; const char *value; index = 1; while (index < argc) { option = argv[index]; if (index + 1 < argc) { value = argv[index + 1]; } else { value = ""; } if (nocase_matches(option, "-help", "--help", "-h", NULL)) { startup_params->help = 1; } else if (nocase_matches(option, "-kill", "--kill", "-k", NULL)) { startup_params->kill = 1; } else if (nocase_matches(option, "-nodaemon", "--nodaemon", "-n", "-nd", "--nd", "-ns", "--ns", NULL)) { startup_params->no_daemon = 1; } else if (nocase_matches(option, "-v", "--version", NULL)) { startup_params->version = 1; } else if (nocase_matches(option, "-p", "--port", NULL)) { index++; g_strncpy(startup_params->port, value, sizeof(startup_params->port) - 1); if (g_strlen(startup_params->port) < 1) { g_writeln("error processing params, port [%s]", startup_params->port); return 1; } else { g_writeln("--port parameter found, ini override [%s]", startup_params->port); } } else if (nocase_matches(option, "-f", "--fork", NULL)) { startup_params->fork = 1; g_writeln("--fork parameter found, ini override"); } else if (nocase_matches(option, "--dump-config", NULL)) { startup_params->dump_config = 1; } else if (nocase_matches(option, "--license", NULL)) { startup_params->license = 1; } else if (nocase_matches(option, "-c", "--config", NULL)) { index++; startup_params->xrdp_ini = value; } else /* unknown option */ { return index; } index++; } return 0; } /*****************************************************************************/ /* Basic sanity checks before any forking */ static int xrdp_sanity_check(void) { int intval = 1; int host_be; const char *key_file = XRDP_CFG_PATH "/rsakeys.ini"; /* check compiled endian with actual endian */ host_be = !((int)(*(unsigned char *)(&intval))); #if defined(B_ENDIAN) if (!host_be) { g_writeln("Not a big endian machine, edit arch.h"); return 1; } #endif #if defined(L_ENDIAN) if (host_be) { g_writeln("Not a little endian machine, edit arch.h"); return 1; } #endif /* check long, int and void* sizes */ #if SIZEOF_INT != 4 # error unusable int size, must be 4 #endif #if SIZEOF_LONG != SIZEOF_VOID_P # error sizeof(long) must match sizeof(void*) #endif #if SIZEOF_LONG != 4 && SIZEOF_LONG != 8 # error sizeof(long), must be 4 or 8 #endif if (sizeof(tui64) != 8) { g_writeln("unusable tui64 size, must be 8"); return 1; } if (!g_file_exist(key_file)) { g_writeln("File %s is missing, create it using xrdp-keygen", key_file); return 1; } return 0; } /*****************************************************************************/ int main(int argc, char **argv) { int exit_status = 0; enum logReturns error; struct xrdp_startup_params startup_params = {0}; int pid; int fd; int daemon; char text[256]; const char *pid_file = XRDP_PID_PATH "/xrdp.pid"; int errored_argc; #ifdef USE_DEVEL_LOGGING int test; for (test = 0; test < argc; test++) { g_writeln("Argument %i - %s", test, argv[test]); } #endif g_init("xrdp"); ssl_init(); startup_params.xrdp_ini = XRDP_CFG_PATH "/xrdp.ini"; errored_argc = xrdp_process_params(argc, argv, &startup_params); if (errored_argc > 0) { print_version(); g_writeln("%s", ""); print_help(); g_writeln("%s", ""); g_writeln("Unknown option: %s", argv[errored_argc]); g_deinit(); g_exit(1); } if (startup_params.help) { print_version(); g_writeln("%s", ""); print_help(); g_deinit(); g_exit(0); } if (startup_params.version) { print_version(); g_deinit(); g_exit(0); } if (startup_params.license) { print_license(); g_deinit(); g_exit(0); } if (xrdp_sanity_check() != 0) { g_writeln("Fatal error occurred, exiting"); g_deinit(); g_exit(1); } if (startup_params.kill) { g_writeln("stopping xrdp"); /* read the xrdp.pid file */ fd = -1; if (g_file_exist(pid_file)) /* xrdp.pid */ { fd = g_file_open_ro(pid_file); /* xrdp.pid */ } if (fd == -1) { g_writeln("cannot open %s, maybe xrdp is not running", pid_file); } else { g_memset(text, 0, 32); g_file_read(fd, text, 31); pid = g_atoi(text); g_writeln("stopping process id %d", pid); if (pid > 0) { g_sigterm(pid); } g_file_close(fd); } g_deinit(); g_exit(0); } /* starting logging subsystem */ error = log_start(startup_params.xrdp_ini, "xrdp", (startup_params.dump_config) ? LOG_START_DUMP_CONFIG : 0); if (error != LOG_STARTUP_OK) { switch (error) { case LOG_ERROR_MALLOC: g_writeln("error on malloc. cannot start logging. quitting."); break; case LOG_ERROR_FILE_OPEN: g_writeln("error opening log file [%s]. quitting.", getLogFile(text, 255)); break; case LOG_ERROR_NO_CFG: g_writeln("config file %s unreadable or missing", startup_params.xrdp_ini); break; default: g_writeln("log_start error"); break; } g_deinit(); g_exit(1); } if (g_file_exist(pid_file)) /* xrdp.pid */ { LOG(LOG_LEVEL_ALWAYS, "It looks like xrdp is already running."); LOG(LOG_LEVEL_ALWAYS, "If not, delete %s and try again.", pid_file); log_end(); g_deinit(); g_exit(1); } daemon = !startup_params.no_daemon; if (daemon) { /* make sure containing directory exists */ g_create_path(pid_file); /* make sure we can write to pid file */ fd = g_file_open_rw(pid_file); /* xrdp.pid */ if (fd == -1) { LOG(LOG_LEVEL_ALWAYS, "running in daemon mode with no access to pid files, quitting"); log_end(); g_deinit(); g_exit(1); } if (g_file_write(fd, "0", 1) == -1) { LOG(LOG_LEVEL_ALWAYS, "running in daemon mode with no access to pid files, quitting"); log_end(); g_deinit(); g_exit(1); } g_file_close(fd); g_file_delete(pid_file); } if (daemon) { /* if can't listen, exit with failure status */ if (xrdp_listen_test(&startup_params) != 0) { LOG(LOG_LEVEL_ALWAYS, "Failed to start xrdp daemon, " "possibly address already in use."); log_end(); g_deinit(); /* must exit with failure status, or systemd cannot detect xrdp daemon couldn't start properly */ g_exit(1); } /* start of daemonizing code */ pid = g_fork(); if (pid == -1) { LOG(LOG_LEVEL_ALWAYS, "problem forking [%s]", g_get_strerror()); log_end(); g_deinit(); g_exit(1); } if (0 != pid) { /* exit, this is the main process */ log_end(); g_deinit(); g_exit(0); } g_sleep(1000); /* write the pid to file */ pid = g_getpid(); fd = g_file_open_rw(pid_file); /* xrdp.pid */ if (fd == -1) { LOG(LOG_LEVEL_WARNING, "Can't open %s for writing [%s]", pid_file, g_get_strerror()); } else { g_sprintf(text, "%d", pid); g_file_write(fd, text, g_strlen(text)); g_file_close(fd); } g_sleep(1000); g_file_close(0); g_file_close(1); g_file_close(2); if (g_file_open_rw("/dev/null") < 0) { } if (g_file_open_rw("/dev/null") < 0) { } if (g_file_open_rw("/dev/null") < 0) { } /* end of daemonizing code */ } g_set_threadid(tc_get_threadid()); g_listen = xrdp_listen_create(); g_signal_user_interrupt(xrdp_shutdown); /* SIGINT */ g_signal_pipe(xrdp_sig_no_op); /* SIGPIPE */ g_signal_terminate(xrdp_shutdown); /* SIGTERM */ g_signal_child_stop(xrdp_child); /* SIGCHLD */ g_signal_hang_up(xrdp_sig_no_op); /* SIGHUP */ g_set_sync_mutex(tc_mutex_create()); g_set_sync1_mutex(tc_mutex_create()); pid = g_getpid(); LOG(LOG_LEVEL_INFO, "starting xrdp with pid %d", pid); g_snprintf(text, 255, "xrdp_%8.8x_main_term", pid); g_set_term_event(g_create_wait_obj(text)); if (g_get_term() == 0) { LOG(LOG_LEVEL_WARNING, "error creating g_term_event"); } g_snprintf(text, 255, "xrdp_%8.8x_main_sigchld", pid); g_set_sigchld_event(g_create_wait_obj(text)); if (g_get_sigchld() == 0) { LOG(LOG_LEVEL_WARNING, "error creating g_sigchld_event"); } g_snprintf(text, 255, "xrdp_%8.8x_main_sync", pid); g_set_sync_event(g_create_wait_obj(text)); if (g_get_sync_event() == 0) { LOG(LOG_LEVEL_WARNING, "error creating g_sync_event"); } g_listen->startup_params = &startup_params; exit_status = xrdp_listen_main_loop(g_listen); xrdp_listen_delete(g_listen); tc_mutex_delete(g_get_sync_mutex()); g_set_sync_mutex(0); tc_mutex_delete(g_get_sync1_mutex()); g_set_sync1_mutex(0); g_delete_wait_obj(g_get_term()); g_set_term_event(0); g_delete_wait_obj(g_get_sigchld()); g_set_sigchld_event(0); g_delete_wait_obj(g_get_sync_event()); g_set_sync_event(0); /* only main process should delete pid file */ if (daemon && (pid == g_getpid())) { /* delete the xrdp.pid file */ g_file_delete(pid_file); } log_end(); g_deinit(); if (exit_status == 0) { g_exit(0); } else { g_exit(1); } return 0; } xrdp-0.10.1/xrdp/funcs.c000644 001751 000000 00000006333 14652432047 015101 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * simple functions */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" #include "string_calls.h" /*****************************************************************************/ /* returns boolean */ int rect_contains_pt(struct xrdp_rect *in, int x, int y) { if (x < in->left) { return 0; } if (y < in->top) { return 0; } if (x >= in->right) { return 0; } if (y >= in->bottom) { return 0; } return 1; } /*****************************************************************************/ int rect_intersect(struct xrdp_rect *in1, struct xrdp_rect *in2, struct xrdp_rect *out) { int rv; struct xrdp_rect dumby; if (out == 0) { out = &dumby; } *out = *in1; if (in2->left > in1->left) { out->left = in2->left; } if (in2->top > in1->top) { out->top = in2->top; } if (in2->right < in1->right) { out->right = in2->right; } if (in2->bottom < in1->bottom) { out->bottom = in2->bottom; } rv = !ISRECTEMPTY(*out); if (!rv) { g_memset(out, 0, sizeof(struct xrdp_rect)); } return rv; } /*****************************************************************************/ /* returns boolean */ int rect_contained_by(struct xrdp_rect *in1, int left, int top, int right, int bottom) { if (left < in1->left || top < in1->top || right > in1->right || bottom > in1->bottom) { return 0; } else { return 1; } } /*****************************************************************************/ /* adjust the bounds to fit in the bitmap */ /* return false if there is nothing to draw else return true */ int check_bounds(struct xrdp_bitmap *b, int *x, int *y, int *cx, int *cy) { if (*x >= b->width) { return 0; } if (*y >= b->height) { return 0; } if (*x < 0) { *cx += *x; *x = 0; } if (*y < 0) { *cy += *y; *y = 0; } if (*cx <= 0) { return 0; } if (*cy <= 0) { return 0; } if (*x + *cx > b->width) { *cx = b->width - *x; } if (*y + *cy > b->height) { *cy = b->height - *y; } return 1; } /*****************************************************************************/ int set_string(char **in_str, const char *in) { if (in_str == 0) { return 0; } g_free(*in_str); *in_str = g_strdup(in); return 0; } xrdp-0.10.1/xrdp/xrdp_font.c000644 001751 000000 00000030631 14652432047 015764 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * fonts */ /* fv1 files are described in fontutils/README_fv1.txt */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "xrdp.h" #include "log.h" #include "string_calls.h" #if 0 /* not used */ static char w_char[] = { 0x00, 0x00, 0x00, // ........................ 0x00, 0x00, 0x00, // ........................ 0x00, 0x00, 0x00, // ........................ 0x08, 0x20, 0x80, // ....X.....X.....X....... 0x08, 0x50, 0x80, // ....X....X.X....X....... 0x04, 0x51, 0x00, // .....X...X.X...X........ 0x04, 0x51, 0x00, // .....X...X.X...X........ 0x04, 0x51, 0x00, // .....X...X.X...X........ 0x02, 0x8a, 0x00, // ......X.X...X.X......... 0x02, 0x8a, 0x00, // ......X.X...X.X......... 0x02, 0x8a, 0x00, // ......X.X...X.X......... 0x01, 0x04, 0x00, // .......X.....X.......... 0x01, 0x04, 0x00, // .......X.....X.......... 0x00, 0x00, 0x00, // ........................ 0x00, 0x00, 0x00, // ........................ 0x00, 0x00, 0x00, // ........................ }; #endif // First character allocated in the 'struct xrdp_font.chars' array #define FIRST_CHAR ' ' /*****************************************************************************/ /** * Parses the fv1_select configuration value to get the font to use, * based on the DPI of the primary monitor * * @param globals Configuration globals * @param dpi DPI of primary monitor. If not known, a suitable * default should be passed in here. * @param[out] font_name Name of font to use * @param[in] font_name_len Length of font name buffer */ static void get_font_name_from_dpi(const struct xrdp_cfg_globals *globals, unsigned int dpi, char *font_name, int font_name_len) { int bad_selector = 0; font_name[0] = '\0'; const char *fv1_select = globals->fv1_select; if (fv1_select == NULL || fv1_select[0] == '\0') { fv1_select = DEFAULT_FV1_SELECT; } const char *p = fv1_select; while (p != NULL) { /* DPI value must be next in string */ if (!isdigit(*p)) { bad_selector = 1; break; } unsigned int field_dpi = g_atoi(p); if (field_dpi <= dpi) { /* Use this font */ p = g_strchr(p, ':'); if (p == NULL) { bad_selector = 1; } else { ++p; const char *q = g_strchr(p, ','); if (q == NULL) { q = p + g_strlen(p); } if (q - p > (font_name_len - 1)) { q = p + font_name_len - 1; } g_memcpy(font_name, p, q - p); font_name[q - p] = '\0'; } break; } else { p = g_strchr(p, ','); if (p != NULL) { ++p; } } } if (bad_selector) { LOG(LOG_LEVEL_WARNING, "Unable to parse fv1_select configuration"); } if (font_name[0] == '\0') { LOG(LOG_LEVEL_WARNING, "Loading default font " DEFAULT_FONT_NAME); g_snprintf(font_name, font_name_len, DEFAULT_FONT_NAME); } } /*****************************************************************************/ struct xrdp_font * xrdp_font_create(struct xrdp_wm *wm, unsigned int dpi) { struct xrdp_font *self; struct stream *s; int fd; int b; int i; unsigned int char_count; unsigned int datasize; // Size of glyph data on disk int file_size; struct xrdp_font_char *f; const char *file_path; char file_path_buff[256]; int min_descender; char font_name[256]; const struct xrdp_cfg_globals *globals = &wm->xrdp_config->cfg_globals; LOG_DEVEL(LOG_LEVEL_TRACE, "in xrdp_font_create"); if (dpi == 0) { LOG(LOG_LEVEL_WARNING, "No DPI value is available to find login font"); dpi = globals->default_dpi; LOG(LOG_LEVEL_WARNING, "Using the default_dpi of %u", dpi); } get_font_name_from_dpi(globals, dpi, font_name, sizeof(font_name)); if (font_name[0] == '/') { /* User specified absolute path */ file_path = font_name; } else { g_snprintf(file_path_buff, sizeof(file_path_buff), XRDP_SHARE_PATH "/%s", font_name); file_path = file_path_buff; } if (!g_file_exist(file_path)) { /* Try to fall back to the default */ const char *default_file_path = XRDP_SHARE_PATH "/" DEFAULT_FONT_NAME; if (g_file_exist(default_file_path)) { LOG(LOG_LEVEL_WARNING, "xrdp_font_create: font file [%s] does not exist - using [%s]", file_path, default_file_path); file_path = default_file_path; } else { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: Can't load either [%s] or [%s]", file_path, default_file_path); return 0; } } file_size = g_file_get_size(file_path); if (file_size < 1) { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: error reading font from file [%s]", file_path); return 0; } self = (struct xrdp_font *)g_malloc(sizeof(struct xrdp_font), 1); if (self == NULL) { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: " "Can't allocate memory for font"); return self; } self->wm = wm; make_stream(s); init_stream(s, file_size + 1024); fd = g_file_open_ro(file_path); if (fd < 0) { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: Can't open %s - %s", file_path, g_get_strerror()); g_free(self); self = NULL; } else { b = g_file_read(fd, s->data, file_size + 1024); g_file_close(fd); // Got at least a header? if (b < (4 + 32 + 2 + 2 + 2 + 2 + 4)) { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: Font %s is truncated", file_path); g_free(self); self = NULL; } else { s->end = s->data + b; in_uint8s(s, 4); in_uint8a(s, self->name, 32); in_uint16_le(s, self->size); in_uint16_le(s, self->style); in_uint16_le(s, self->body_height); in_sint16_le(s, min_descender); in_uint8s(s, 4); char_count = FIRST_CHAR; while (!s_check_end(s)) { if (!s_check_rem(s, 16)) { LOG(LOG_LEVEL_WARNING, "xrdp_font_create: " "Can't parse header for character U+%X", char_count); break; } if (char_count >= MAX_FONT_CHARS) { LOG(LOG_LEVEL_WARNING, "xrdp_font_create: " "Ignoring characters >= U+%x", MAX_FONT_CHARS); break; } f = self->chars + char_count; in_sint16_le(s, i); f->width = i; in_sint16_le(s, i); f->height = i; in_sint16_le(s, i); /* Move the glyph up so there are no descenders */ f->baseline = i + min_descender; in_sint16_le(s, i); f->offset = i; in_sint16_le(s, i); f->incby = i; in_uint8s(s, 6); datasize = FONT_DATASIZE(f); if (datasize < 0 || datasize > 512) { /* shouldn't happen */ LOG(LOG_LEVEL_ERROR, "xrdp_font_create: " "datasize for U+%x wrong " "width %d, height %d, datasize %d", char_count, f->width, f->height, datasize); break; } if (!s_check_rem(s, datasize)) { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: " "Not enough data for character U+%X", char_count); break; } if (datasize == 0) { /* Allocate a single blank pixel for the glyph, so * that it can be added to the glyph cache if required */ f->width = 1; f->height = 1; /* GOTCHA - we need to allocate more than one byte in * memory for this glyph */ f->data = (char *)g_malloc(FONT_DATASIZE(f), 1); } else { f->data = (char *)g_malloc(datasize, 0); } if (f->data == NULL) { LOG(LOG_LEVEL_ERROR, "xrdp_font_create: " "Allocation error for character U+%X", char_count); break; } in_uint8a(s, f->data, datasize); ++char_count; } self->char_count = char_count; if (char_count <= FIRST_CHAR) { /* We read no characters from the font */ xrdp_font_delete(self); self = NULL; } else { if (self->body_height == 0) { /* Older font made for xrdp v0.9.x. Synthesise this * value from the first glyph */ self->body_height = -self->chars[FIRST_CHAR].baseline + 1; } // Find a default glyph if (char_count > UCS_WHITE_SQUARE) { self->default_char = &self->chars[UCS_WHITE_SQUARE]; } else if (char_count > '?') { self->default_char = &self->chars['?']; } else { self->default_char = &self->chars[FIRST_CHAR]; } } } } free_stream(s); /* self->font_items[0].offset = -4; self->font_items[0].baseline = -16; self->font_items[0].width = 24; self->font_items[0].height = 16; self->font_items[0].data = g_malloc(3 * 16, 0); g_memcpy(self->font_items[0].data, w_char, 3 * 16); */ LOG_DEVEL(LOG_LEVEL_TRACE, "out xrdp_font_create"); return self; } /*****************************************************************************/ /* free the font and all the items */ void xrdp_font_delete(struct xrdp_font *self) { unsigned int i; if (self == 0) { return; } for (i = FIRST_CHAR; i < self->char_count; i++) { g_free(self->chars[i].data); } g_free(self); } /*****************************************************************************/ /* compare the two font items returns 1 if they match */ int xrdp_font_item_compare(struct xrdp_font_char *font1, struct xrdp_font_char *font2) { int datasize; if (font1 == 0) { return 0; } if (font2 == 0) { return 0; } if (font1->offset != font2->offset) { return 0; } if (font1->baseline != font2->baseline) { return 0; } if (font1->width != font2->width) { return 0; } if (font1->height != font2->height) { return 0; } datasize = FONT_DATASIZE(font1); if (g_memcmp(font1->data, font2->data, datasize) == 0) { return 1; } return 0; } xrdp-0.10.1/xrdp/rdp-scan-codes.txt000644 001751 000000 00000012021 14652432047 017151 0ustar00metawheel000000 000000 complete rdp key code listing en-us 4000s in the down flags column is from repeating keys(holding a key down) When holding a key down, the down flags repeat but the up flags only come once at the end. Rdesktop does not do this as of yet. It always sends down and up for each repeat. key rdp code down flags up flags esc 0x01 1 0000 8000 1 0x02 2 0000 8000 2 0x03 3 0000 8000 3 0x04 4 0000 8000 4 0x05 5 0000 8000 5 0x06 6 0000 8000 6 0x07 7 0000 8000 7 0x08 8 0000 8000 8 0x09 9 0000 8000 9 0x0a 10 0000 8000 0 0x0b 11 0000 8000 - 0x0c 12 0000 8000 = 0x0d 13 0000 8000 backspace 0x0e 14 0000 8000 tab 0x0f 15 0000 8000 q 0x10 16 0000 8000 w 0x11 17 0000 8000 e 0x12 18 0000 8000 r 0x13 19 0000 8000 t 0x14 20 0000 8000 y 0x15 21 0000 8000 u 0x16 22 0000 8000 i 0x17 23 0000 8000 o 0x18 24 0000 8000 p 0x19 25 0000 8000 [ 0x1a 26 0000 8000 ] 0x1b 27 0000 8000 enter 0x1c 28 0000 8000 left ctrl 0x1d 29 0000/4000 c000 right ctrl 0x1d 29 0100/4100 c100 a 0x1e 30 0000 8000 s 0x1f 31 0000 8000 d 0x20 32 0000 8000 f 0x21 33 0000 8000 g 0x22 34 0000 8000 h 0x23 35 0000 8000 j 0x24 36 0000 8000 k 0x25 37 0000 8000 l 0x26 38 0000 8000 ; 0x27 39 0000 8000 ' 0x28 40 0000 8000 ` 0x29 41 0000 8000 left shift 0x2a 42 0000/4000 c000 \ 0x2b 43 0000 8000 z 0x2c 44 0000 8000 x 0x2d 45 0000 8000 c 0x2e 46 0000 8000 v 0x2f 47 0000 8000 b 0x30 48 0000 8000 n 0x31 49 0000 8000 m 0x32 50 0000 8000 , 0x33 51 0000 8000 . 0x34 52 0000 8000 / 0x35 53 0000 8000 /(keypad) 0x35 53 0100 8100 right shift 0x36 54 0000/4000 c000 *(keypad) 0x37 55 0000 8000 print scrn 0x37 55 0100 8100 left alt 0x38 56 0000/4000 c000 right alt 0x38 56 0100/4100 c100 space 0x39 57 0000 8000 caps lock 0x3a 58 0000/4000 c000 f1 0x3b 59 0000 8000 f2 0x3c 60 0000 8000 f3 0x3d 61 0000 8000 f4 0x3e 62 0000 8000 f5 0x3f 63 0000 8000 f6 0x40 64 0000 8000 f7 0x41 65 0000 8000 f8 0x42 66 0000 8000 f9 0x43 67 0000 8000 f10 0x44 68 0000 8000 num lock 0x45 69 0000/4000 c000 scroll lock 0x46 70 0000/4000 c000 7(keypad) 0x47 71 0000 8000 home 0x47 71 0100 8100 8(keypad) 0x48 72 0000 8000 up arrow 0x48 72 0100 8100 9(keypad) 0x49 73 0000 8000 pg up 0x49 73 0100 8100 -(keypad) 0x4a 74 0000 8000 4(keypad) 0x4b 75 0000 8000 left arrow 0x4b 75 0100 8100 5(keypad) 0x4c 76 0000 8000 6(keypad) 0x4d 77 0000 8000 right arrow 0x4d 77 0100 8100 +(keypad) 0x4e 78 0000 8000 1(keypad) 0x4f 79 0000 8000 end 0x4f 79 0100 8100 2(keypad) 0x50 80 0000 8000 down arrow 0x50 80 0100 8100 3(keypad) 0x51 81 0000 8000 pg down 0x51 81 0100 8100 0(keypad) 0x52 82 0000 8000 insert 0x52 82 0100 8100 .(keypad) 0x53 83 0000 8000 delete 0x53 83 0100 8100 ? 0x54 84 ? 0x55 85 ? 0x56 86 f11 0x57 87 0000 8000 f12 0x58 88 0000 8000 ? 0x59 89 ? 0x5a 90 left win 0x5b 91 0100 8100 right win 0x5c 92 0100 8100 menu key 0x5d 93 0100 8100 pause break 0x1d 29 0200 8200 0x45 69 0000 8000 This is a special key that sends 2 down and 2 up like this down 001d 0200 down 0045 0000 up 001d 8200 up 0045 8000 xrdp-0.10.1/xrdp/xrdpwin.c000644 001751 000000 00000043041 14652432047 015453 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * main program */ #if defined(HAVE_CONFIG_H) #include #endif #if defined(_WIN32) #include #endif #include "xrdp.h" static struct xrdp_listen *g_listen = 0; static long g_threadid = 0; /* main threadid */ #if defined(_WIN32) static SERVICE_STATUS_HANDLE g_ssh = 0; static SERVICE_STATUS g_service_status; #endif static long g_sync_mutex = 0; static long g_sync1_mutex = 0; static tbus g_term_event = 0; static tbus g_sync_event = 0; /* synchronize stuff */ static int g_sync_command = 0; static long g_sync_result = 0; static long g_sync_param1 = 0; static long g_sync_param2 = 0; static long (*g_sync_func)(long param1, long param2); /*****************************************************************************/ long g_xrdp_sync(long (*sync_func)(long param1, long param2), long sync_param1, long sync_param2) { long sync_result; int sync_command; if (tc_threadid_equal(tc_get_threadid(), g_threadid)) { /* this is the main thread, call the function directly */ sync_result = sync_func(sync_param1, sync_param2); } else { tc_mutex_lock(g_sync1_mutex); tc_mutex_lock(g_sync_mutex); g_sync_param1 = sync_param1; g_sync_param2 = sync_param2; g_sync_func = sync_func; g_sync_command = 100; tc_mutex_unlock(g_sync_mutex); g_set_wait_obj(g_sync_event); do { g_sleep(100); tc_mutex_lock(g_sync_mutex); sync_command = g_sync_command; sync_result = g_sync_result; tc_mutex_unlock(g_sync_mutex); } while (sync_command != 0); tc_mutex_unlock(g_sync1_mutex); } return sync_result; } /*****************************************************************************/ void xrdp_shutdown(int sig) { tbus threadid; threadid = tc_get_threadid(); g_writeln("shutting down"); g_writeln("signal %d threadid %p", sig, threadid); if (!g_is_wait_obj_set(g_term_event)) { g_set_wait_obj(g_term_event); } } /*****************************************************************************/ int g_is_term(void) { return g_is_wait_obj_set(g_term_event); } /*****************************************************************************/ void g_set_term(int in_val) { if (in_val) { g_set_wait_obj(g_term_event); } else { g_reset_wait_obj(g_term_event); } } /*****************************************************************************/ tbus g_get_sync_event(void) { return g_sync_event; } /*****************************************************************************/ void pipe_sig(int sig_num) { /* do nothing */ g_writeln("got XRDP WIN SIGPIPE(%d)", sig_num); } /*****************************************************************************/ void g_process_waiting_function(void) { tc_mutex_lock(g_sync_mutex); if (g_sync_command != 0) { if (g_sync_func != 0) { if (g_sync_command == 100) { g_sync_result = g_sync_func(g_sync_param1, g_sync_param2); } } g_sync_command = 0; } tc_mutex_unlock(g_sync_mutex); } /* win32 service control functions */ #if defined(_WIN32) /*****************************************************************************/ VOID WINAPI MyHandler(DWORD fdwControl) { if (g_ssh == 0) { return; } if (fdwControl == SERVICE_CONTROL_STOP) { g_service_status.dwCurrentState = SERVICE_STOP_PENDING; g_set_term(1); } else if (fdwControl == SERVICE_CONTROL_PAUSE) { /* shouldn't happen */ } else if (fdwControl == SERVICE_CONTROL_CONTINUE) { /* shouldn't happen */ } else if (fdwControl == SERVICE_CONTROL_INTERROGATE) { } else if (fdwControl == SERVICE_CONTROL_SHUTDOWN) { g_service_status.dwCurrentState = SERVICE_STOP_PENDING; g_set_term(1); } SetServiceStatus(g_ssh, &g_service_status); } /*****************************************************************************/ static void log_event(HANDLE han, char *msg) { ReportEvent(han, EVENTLOG_INFORMATION_TYPE, 0, 0, 0, 1, 0, &msg, 0); } /*****************************************************************************/ VOID WINAPI MyServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) { WSADATA w; char text[256]; int pid; //HANDLE event_han; // int fd; // char text[256]; // fd = g_file_open_rw("c:\\temp\\xrdp\\log.txt"); // g_file_write(fd, "hi\r\n", 4); //event_han = RegisterEventSource(0, "xrdp"); //log_event(event_han, "hi xrdp log"); g_threadid = tc_get_threadid(); g_set_current_dir("c:\\temp\\xrdp"); g_listen = 0; WSAStartup(2, &w); g_sync_mutex = tc_mutex_create(); g_sync1_mutex = tc_mutex_create(); pid = g_getpid(); g_snprintf(text, 255, "xrdp_%8.8x_main_term", pid); g_term_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_%8.8x_main_sync", pid); g_sync_event = g_create_wait_obj(text); g_memset(&g_service_status, 0, sizeof(SERVICE_STATUS)); g_service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; g_service_status.dwCurrentState = SERVICE_RUNNING; g_service_status.dwControlsAccepted = SERVICE_CONTROL_INTERROGATE | SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; g_service_status.dwWin32ExitCode = NO_ERROR; g_service_status.dwServiceSpecificExitCode = 0; g_service_status.dwCheckPoint = 0; g_service_status.dwWaitHint = 0; // g_sprintf(text, "calling RegisterServiceCtrlHandler\r\n"); // g_file_write(fd, text, g_strlen(text)); g_ssh = RegisterServiceCtrlHandler("xrdp", MyHandler); if (g_ssh != 0) { // g_sprintf(text, "ok\r\n"); // g_file_write(fd, text, g_strlen(text)); SetServiceStatus(g_ssh, &g_service_status); g_listen = xrdp_listen_create(); xrdp_listen_main_loop(g_listen); g_sleep(100); g_service_status.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(g_ssh, &g_service_status); } else { //g_sprintf(text, "RegisterServiceCtrlHandler failed\r\n"); //g_file_write(fd, text, g_strlen(text)); } xrdp_listen_delete(g_listen); tc_mutex_delete(g_sync_mutex); tc_mutex_delete(g_sync1_mutex); g_destroy_wait_obj(g_term_event); g_destroy_wait_obj(g_sync_event); WSACleanup(); //CloseHandle(event_han); } #endif /*****************************************************************************/ int main(int argc, char **argv) { int test; int host_be; #if defined(_WIN32) WSADATA w; SC_HANDLE sc_man; SC_HANDLE sc_ser; int run_as_service; SERVICE_TABLE_ENTRY te[2]; #else int pid; int fd; int no_daemon; char text[256]; char pid_file[256]; #endif g_init(); ssl_init(); /* check compiled endian with actual endian */ test = 1; host_be = !((int)(*(unsigned char *)(&test))); #if defined(B_ENDIAN) if (!host_be) #endif #if defined(L_ENDIAN) if (host_be) #endif { g_writeln("endian wrong, edit arch.h"); return 0; } /* check long, int and void* sizes */ #if SIZEOF_INT != 4 # error unusable int size, must be 4 #endif #if SIZEOF_LONG != SIZEOF_VOID_P # error sizeof(long) must match sizeof(void*) #endif #if SIZEOF_LONG != 4 && SIZEOF_LONG != 8 # error sizeof(long), must be 4 or 8 #endif if (sizeof(tui64) != 8) { g_writeln("unusable tui64 size, must be 8"); return 0; } #if defined(_WIN32) run_as_service = 1; if (argc == 2) { if (g_strncasecmp(argv[1], "-help", 255) == 0 || g_strncasecmp(argv[1], "--help", 255) == 0 || g_strncasecmp(argv[1], "-h", 255) == 0) { g_writeln("%s", ""); g_writeln("xrdp: A Remote Desktop Protocol server."); g_writeln("Copyright (C) Jay Sorg 2004-2011"); g_writeln("See http://www.xrdp.org for more information."); g_writeln("%s", ""); g_writeln("Usage: xrdp [options]"); g_writeln(" -h: show help"); g_writeln(" -install: install service"); g_writeln(" -remove: remove service"); g_writeln("%s", ""); g_exit(0); } else if (g_strncasecmp(argv[1], "-install", 255) == 0 || g_strncasecmp(argv[1], "--install", 255) == 0 || g_strncasecmp(argv[1], "-i", 255) == 0) { /* open service manager */ sc_man = OpenSCManager(0, 0, GENERIC_WRITE); if (sc_man == 0) { g_writeln("error OpenSCManager, do you have rights?"); g_exit(0); } /* check if service is already installed */ sc_ser = OpenService(sc_man, "xrdp", SERVICE_ALL_ACCESS); if (sc_ser == 0) { /* install service */ CreateService(sc_man, "xrdp", "xrdp", SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, "c:\\temp\\xrdp\\xrdp.exe", 0, 0, 0, 0, 0); } else { g_writeln("error service is already installed"); CloseServiceHandle(sc_ser); CloseServiceHandle(sc_man); g_exit(0); } CloseServiceHandle(sc_man); g_exit(0); } else if (g_strncasecmp(argv[1], "-remove", 255) == 0 || g_strncasecmp(argv[1], "--remove", 255) == 0 || g_strncasecmp(argv[1], "-r", 255) == 0) { /* open service manager */ sc_man = OpenSCManager(0, 0, GENERIC_WRITE); if (sc_man == 0) { g_writeln("error OpenSCManager, do you have rights?"); g_exit(0); } /* check if service is already installed */ sc_ser = OpenService(sc_man, "xrdp", SERVICE_ALL_ACCESS); if (sc_ser == 0) { g_writeln("error service is not installed"); CloseServiceHandle(sc_man); g_exit(0); } DeleteService(sc_ser); CloseServiceHandle(sc_man); g_exit(0); } else { g_writeln("Unknown Parameter"); g_writeln("xrdp -h for help"); g_writeln("%s", ""); g_exit(0); } } else if (argc > 1) { g_writeln("Unknown Parameter"); g_writeln("xrdp -h for help"); g_writeln("%s", ""); g_exit(0); } if (run_as_service) { g_memset(&te, 0, sizeof(te)); te[0].lpServiceName = "xrdp"; te[0].lpServiceProc = MyServiceMain; StartServiceCtrlDispatcher(&te); g_exit(0); } WSAStartup(2, &w); #else /* _WIN32 */ g_snprintf(pid_file, 255, "%s/xrdp.pid", XRDP_PID_PATH); no_daemon = 0; if (argc == 2) { if ((g_strncasecmp(argv[1], "-kill", 255) == 0) || (g_strncasecmp(argv[1], "--kill", 255) == 0) || (g_strncasecmp(argv[1], "-k", 255) == 0)) { g_writeln("stopping xrdp"); /* read the xrdp.pid file */ fd = -1; if (g_file_exist(pid_file)) /* xrdp.pid */ { fd = g_file_open_ro(pid_file); /* xrdp.pid */ } if (fd == -1) { g_writeln("cannot open %s, maybe xrdp is not running", pid_file); } else { g_memset(text, 0, 32); g_file_read(fd, text, 31); pid = g_atoi(text); g_writeln("stopping process id %d", pid); if (pid > 0) { g_sigterm(pid); } g_file_close(fd); } g_exit(0); } else if (g_strncasecmp(argv[1], "-nodaemon", 255) == 0 || g_strncasecmp(argv[1], "--nodaemon", 255) == 0 || g_strncasecmp(argv[1], "-nd", 255) == 0 || g_strncasecmp(argv[1], "--nd", 255) == 0 || g_strncasecmp(argv[1], "-ns", 255) == 0 || g_strncasecmp(argv[1], "--ns", 255) == 0) { no_daemon = 1; } else if (g_strncasecmp(argv[1], "-help", 255) == 0 || g_strncasecmp(argv[1], "--help", 255) == 0 || g_strncasecmp(argv[1], "-h", 255) == 0) { g_writeln("%s", ""); g_writeln("xrdp: A Remote Desktop Protocol server."); g_writeln("Copyright (C) Jay Sorg 2004-2011"); g_writeln("See http://www.xrdp.org for more information."); g_writeln("%s", ""); g_writeln("Usage: xrdp [options]"); g_writeln(" -h: show help"); g_writeln(" -nodaemon: don't fork into background"); g_writeln(" -kill: shut down xrdp"); g_writeln("%s", ""); g_exit(0); } else if ((g_strncasecmp(argv[1], "-v", 255) == 0) || (g_strncasecmp(argv[1], "--version", 255) == 0)) { g_writeln("%s", ""); g_writeln("xrdp: A Remote Desktop Protocol server."); g_writeln("Copyright (C) Jay Sorg 2004-2011"); g_writeln("See http://www.xrdp.org for more information."); g_writeln("Version %s", PACKAGE_VERSION); g_writeln("%s", ""); g_exit(0); } else { g_writeln("Unknown Parameter"); g_writeln("xrdp -h for help"); g_writeln("%s", ""); g_exit(0); } } else if (argc > 1) { g_writeln("Unknown Parameter"); g_writeln("xrdp -h for help"); g_writeln("%s", ""); g_exit(0); } if (g_file_exist(pid_file)) /* xrdp.pid */ { g_writeln("It looks like xrdp is already running."); g_writeln("If not, delete %s and try again.", pid_file); g_exit(0); } if (!no_daemon) { /* make sure we can write to pid file */ fd = g_file_open_rw(pid_file); /* xrdp.pid */ if (fd == -1) { g_writeln("running in daemon mode with no access to pid files, quitting"); g_exit(0); } if (g_file_write(fd, "0", 1) == -1) { g_writeln("running in daemon mode with no access to pid files, quitting"); g_exit(0); } g_file_close(fd); g_file_delete(pid_file); } if (!no_daemon) { /* start of daemonizing code */ pid = g_fork(); if (pid == -1) { g_writeln("problem forking"); g_exit(1); } if (0 != pid) { g_writeln("process %d started ok", pid); /* exit, this is the main process */ g_exit(0); } g_sleep(1000); g_file_close(0); g_file_close(1); g_file_close(2); g_file_open_rw("/dev/null"); g_file_open_rw("/dev/null"); g_file_open_rw("/dev/null"); /* end of daemonizing code */ } if (!no_daemon) { /* write the pid to file */ pid = g_getpid(); fd = g_file_open_rw(pid_file); /* xrdp.pid */ if (fd == -1) { g_writeln("trying to write process id to xrdp.pid"); g_writeln("problem opening xrdp.pid"); g_writeln("maybe no rights"); } else { g_sprintf(text, "%d", pid); g_file_write(fd, text, g_strlen(text)); g_file_close(fd); } } #endif g_threadid = tc_get_threadid(); g_listen = xrdp_listen_create(); g_signal_user_interrupt(xrdp_shutdown); /* SIGINT */ g_signal_pipe(pipe_sig); /* SIGPIPE */ g_signal_terminate(xrdp_shutdown); /* SIGTERM */ g_sync_mutex = tc_mutex_create(); g_sync1_mutex = tc_mutex_create(); pid = g_getpid(); g_snprintf(text, 255, "xrdp_%8.8x_main_term", pid); g_term_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_%8.8x_main_sync", pid); g_sync_event = g_create_wait_obj(text); if (g_term_event == 0) { g_writeln("error creating g_term_event"); } xrdp_listen_main_loop(g_listen); xrdp_listen_delete(g_listen); tc_mutex_delete(g_sync_mutex); tc_mutex_delete(g_sync1_mutex); g_delete_wait_obj(g_term_event); g_delete_wait_obj(g_sync_event); #if defined(_WIN32) /* I don't think it ever gets here */ /* when running in win32 app mode, control c exits right away */ WSACleanup(); #else /* delete the xrdp.pid file */ g_file_delete(pid_file); #endif return 0; } xrdp-0.10.1/xrdp/cursor0.cur000644 001751 000000 00000000506 14652432047 015723 0ustar00metawheel000000 000000  0( @@@@??x0??xrdp-0.10.1/xrdp/xrdp_painter.c000644 001751 000000 00000133540 14652432047 016463 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * painter, gc */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "xrdp.h" #include "string_calls.h" #if defined(XRDP_PAINTER) #include /* libpainter */ #endif #if defined(XRDP_PAINTER) /*****************************************************************************/ static int xrdp_painter_add_dirty_rect(struct xrdp_painter *self, int x, int y, int cx, int cy, struct xrdp_rect *clip_rect) { int x2; int y2; struct xrdp_rect rect; if (clip_rect != 0) { x2 = x + cx; y2 = y + cy; x = MAX(x, clip_rect->left); y = MAX(y, clip_rect->top); x2 = MIN(x2, clip_rect->right); y2 = MIN(y2, clip_rect->bottom); cx = x2 - x; cy = y2 - y; } if (cx < 1 || cy < 1) { return 0; } rect.left = x; rect.top = y; rect.right = x + cx; rect.bottom = y + cy; xrdp_region_add_rect(self->dirty_region, &rect); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_add_dirty_rect: x %d y %d cx %d cy %d", x, y, cx, cy); return 0; } /*****************************************************************************/ static int xrdp_painter_send_dirty(struct xrdp_painter *self) { int cx; int cy; int bpp; int Bpp; int index; int jndex; int error; char *ldata; char *src; char *dst; struct xrdp_rect rect; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_send_dirty:"); bpp = self->wm->screen->bpp; Bpp = (bpp + 7) / 8; if (Bpp == 3) { Bpp = 4; } if (self->session->client_info->gfx) { xrdp_mm_efgx_add_dirty_region_to_planar_list(self->wm->mm, self->dirty_region); } else { jndex = 0; error = xrdp_region_get_rect(self->dirty_region, jndex, &rect); while (error == 0) { cx = rect.right - rect.left; cy = rect.bottom - rect.top; ldata = (char *)g_malloc(cx * cy * Bpp, 0); if (ldata == 0) { return 1; } src = self->wm->screen->data; src += self->wm->screen->line_size * rect.top; src += rect.left * Bpp; dst = ldata; for (index = 0; index < cy; index++) { g_memcpy(dst, src, cx * Bpp); src += self->wm->screen->line_size; dst += cx * Bpp; } LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_send_dirty:" " x %d y %d cx %d cy %d", rect.left, rect.top, cx, cy); libxrdp_send_bitmap(self->session, cx, cy, bpp, ldata, rect.left, rect.top, cx, cy); g_free(ldata); jndex++; error = xrdp_region_get_rect(self->dirty_region, jndex, &rect); } } xrdp_region_delete(self->dirty_region); self->dirty_region = xrdp_region_create(self->wm); return 0; } #endif /*****************************************************************************/ struct xrdp_painter * xrdp_painter_create(struct xrdp_wm *wm, struct xrdp_session *session) { struct xrdp_painter *self; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_create:"); self = (struct xrdp_painter *)g_malloc(sizeof(struct xrdp_painter), 1); self->wm = wm; self->session = session; self->rop = 0xcc; /* copy will use 0xcc */ self->clip_children = 1; if (self->session->client_info->no_orders_supported || self->session->client_info->gfx) { #if defined(XRDP_PAINTER) if (painter_create(&(self->painter)) != PT_ERROR_NONE) { self->painter = 0; LOG_DEVEL(LOG_LEVEL_WARNING, "xrdp_painter_create: painter_create failed"); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_create: painter_create success"); } self->dirty_region = xrdp_region_create(wm); #endif } return self; } /*****************************************************************************/ void xrdp_painter_delete(struct xrdp_painter *self) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_delete:"); if (self == 0) { return; } #if defined(XRDP_PAINTER) painter_delete(self->painter); xrdp_region_delete(self->dirty_region); #endif g_free(self); } /*****************************************************************************/ int wm_painter_set_target(struct xrdp_painter *self) { int surface_index; int index; struct list *del_list; LOG_DEVEL(LOG_LEVEL_DEBUG, "wm_painter_set_target:"); if (self->painter != 0) { return 0; } if (self->wm->target_surface->type == WND_TYPE_SCREEN) { if (self->wm->current_surface_index != 0xffff) { libxrdp_orders_send_switch_os_surface(self->session, 0xffff); self->wm->current_surface_index = 0xffff; } } else if (self->wm->target_surface->type == WND_TYPE_OFFSCREEN) { surface_index = self->wm->target_surface->item_index; if (surface_index != self->wm->current_surface_index) { if (self->wm->target_surface->tab_stop == 0) /* tab_stop is hack */ { del_list = self->wm->cache->xrdp_os_del_list; index = list_index_of(del_list, surface_index); list_remove_item(del_list, index); libxrdp_orders_send_create_os_surface(self->session, surface_index, self->wm->target_surface->width, self->wm->target_surface->height, del_list); self->wm->target_surface->tab_stop = 1; list_clear(del_list); } libxrdp_orders_send_switch_os_surface(self->session, surface_index); self->wm->current_surface_index = surface_index; } } else { LOG(LOG_LEVEL_WARNING, "xrdp_painter_begin_update: bad target_surface"); } return 0; } /*****************************************************************************/ int xrdp_painter_begin_update(struct xrdp_painter *self) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_begin_update:"); if (self == 0) { return 0; } self->begin_end_level++; if (self->painter != 0) { return 0; } libxrdp_orders_init(self->session); wm_painter_set_target(self); return 0; } /*****************************************************************************/ int xrdp_painter_end_update(struct xrdp_painter *self) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_end_update:"); if (self == 0) { return 0; } self->begin_end_level--; if (self->painter != 0) { #if defined(XRDP_PAINTER) if (self->begin_end_level == 0) { xrdp_painter_send_dirty(self); return 0; } #endif } libxrdp_orders_send(self->session); return 0; } /*****************************************************************************/ int xrdp_painter_font_needed(struct xrdp_painter *self) { if (self->font == 0) { self->font = self->wm->default_font; } return 0; } #if 0 /*****************************************************************************/ /* returns boolean, true if there is something to draw */ static int xrdp_painter_clip_adj(struct xrdp_painter *self, int *x, int *y, int *cx, int *cy) { int dx; int dy; if (!self->use_clip) { return 1; } if (self->clip.left > *x) { dx = self->clip.left - *x; } else { dx = 0; } if (self->clip.top > *y) { dy = self->clip.top - *y; } else { dy = 0; } if (*x + *cx > self->clip.right) { *cx = *cx - ((*x + *cx) - self->clip.right); } if (*y + *cy > self->clip.bottom) { *cy = *cy - ((*y + *cy) - self->clip.bottom); } *cx = *cx - dx; *cy = *cy - dy; if (*cx <= 0) { return 0; } if (*cy <= 0) { return 0; } *x = *x + dx; *y = *y + dy; return 1; } #endif /*****************************************************************************/ int xrdp_painter_set_clip(struct xrdp_painter *self, int x, int y, int cx, int cy) { self->use_clip = &self->clip; self->clip.left = x; self->clip.top = y; self->clip.right = x + cx; self->clip.bottom = y + cy; return 0; } /*****************************************************************************/ int xrdp_painter_clr_clip(struct xrdp_painter *self) { self->use_clip = 0; return 0; } #if 0 /*****************************************************************************/ static int xrdp_painter_rop(int rop, int src, int dst) { switch (rop & 0x0f) { case 0x0: return 0; case 0x1: return ~(src | dst); case 0x2: return (~src) & dst; case 0x3: return ~src; case 0x4: return src & (~dst); case 0x5: return ~(dst); case 0x6: return src ^ dst; case 0x7: return ~(src & dst); case 0x8: return src & dst; case 0x9: return ~(src) ^ dst; case 0xa: return dst; case 0xb: return (~src) | dst; case 0xc: return src; case 0xd: return src | (~dst); case 0xe: return src | dst; case 0xf: return ~0; } return dst; } #endif /*****************************************************************************/ int xrdp_painter_text_width(struct xrdp_painter *self, const char *text) { return xrdp_painter_text_width_count(self, text, UINT_MAX); } /*****************************************************************************/ int xrdp_painter_text_width_count(struct xrdp_painter *self, const char *text, unsigned int c32_count) { int rv = 0; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_text_width_count:"); xrdp_painter_font_needed(self); if (self->font != NULL && text != NULL) { unsigned int index; for (index = 0 ; index < c32_count; ++index) { struct xrdp_font_char *font_item; char32_t c32 = utf8_get_next_char(&text, NULL); if (c32 == 0) { break; // Terminator } font_item = XRDP_FONT_GET_CHAR(self->font, c32); rv += font_item->incby; } } return rv; } /*****************************************************************************/ int xrdp_painter_repeated_char_width(struct xrdp_painter *self, char32_t chr, unsigned int repeat_count) { int rv = 0; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_repeated_char_width:"); xrdp_painter_font_needed(self); if (self->font != NULL) { struct xrdp_font_char *font_item = XRDP_FONT_GET_CHAR(self->font, chr); rv = font_item->incby * repeat_count; } return rv; } /*****************************************************************************/ unsigned int xrdp_painter_font_body_height(const struct xrdp_painter *self) { return (self->font == NULL) ? 0 : self->font->body_height; } /*****************************************************************************/ static int xrdp_painter_setup_brush(struct xrdp_painter *self, struct xrdp_brush *out_brush, struct xrdp_brush *in_brush) { int cache_id; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_setup_brush:"); if (self->painter != 0) { return 0; } g_memcpy(out_brush, in_brush, sizeof(struct xrdp_brush)); if (in_brush->style == 3) { if (self->session->client_info->brush_cache_code == 1) { cache_id = xrdp_cache_add_brush(self->wm->cache, in_brush->pattern); g_memset(out_brush->pattern, 0, 8); out_brush->pattern[0] = cache_id; out_brush->style = 0x81; } } return 0; } #if defined(XRDP_PAINTER) /*****************************************************************************/ static int get_pt_format(struct xrdp_painter *self) { switch (self->wm->screen->bpp) { case 8: return PT_FORMAT_r3g3b2; case 15: return PT_FORMAT_a1r5g5b5; case 16: return PT_FORMAT_r5g6b5; } return PT_FORMAT_a8r8g8b8; } /*****************************************************************************/ static int get_rgb_from_rdp_color(struct xrdp_painter *self, int rdp_color) { if (self->wm->screen->bpp < 24) { return rdp_color; } /* well, this is really BGR2RGB */ return XR_RGB2BGR(rdp_color); } #endif /*****************************************************************************/ /* fill in an area of the screen with one color */ int xrdp_painter_fill_rect(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x, int y, int cx, int cy) { struct xrdp_rect clip_rect; struct xrdp_rect draw_rect; struct xrdp_rect rect; struct xrdp_region *region; struct xrdp_brush brush; int k; int dx; int dy; int rop; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_fill_rect:"); if (self == 0) { return 0; } dx = 0; dy = 0; if (self->painter != 0) { #if defined(XRDP_PAINTER) struct painter_bitmap dst_pb; struct xrdp_bitmap *ldst; struct painter_bitmap pat; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_fill_rect: dst->type %d", dst->type); if (dst->type != WND_TYPE_OFFSCREEN) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_fill_rect: using painter"); ldst = self->wm->screen; g_memset(&dst_pb, 0, sizeof(dst_pb)); dst_pb.format = get_pt_format(self); dst_pb.width = ldst->width; dst_pb.stride_bytes = ldst->line_size; dst_pb.height = ldst->height; dst_pb.data = ldst->data; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_fill_rect: ldst->width %d ldst->height %d " "dst->data %p self->fg_color %d", ldst->width, ldst->height, ldst->data, self->fg_color); xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); x += dx; y += dy; rop = self->rop; switch (self->rop) { case 0x5a: rop = PT_ROP_DSx; break; case 0xf0: rop = PT_ROP_S; break; case 0xfb: rop = PT_ROP_D; break; case 0xc0: rop = PT_ROP_DSa; break; } painter_set_rop(self->painter, rop); if (self->mix_mode == 0) { painter_set_pattern_mode(self->painter, PT_PATTERN_MODE_OPAQUE); painter_set_fgcolor(self->painter, get_rgb_from_rdp_color(self, self->fg_color)); k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { painter_set_clip(self->painter, draw_rect.left, draw_rect.top, draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top); painter_fill_rect(self->painter, &dst_pb, x, y, cx, cy); xrdp_painter_add_dirty_rect(self, x, y, cx, cy, &draw_rect); } k++; } } else { painter_set_pattern_mode(self->painter, PT_PATTERN_MODE_OPAQUE); painter_set_fgcolor(self->painter, get_rgb_from_rdp_color(self, self->fg_color)); painter_set_bgcolor(self->painter, get_rgb_from_rdp_color(self, self->bg_color)); painter_set_pattern_origin(self->painter, self->brush.x_origin, self->brush.y_origin); g_memset(&pat, 0, sizeof(pat)); pat.format = PT_FORMAT_c1; pat.width = 8; pat.stride_bytes = 1; pat.height = 8; pat.data = self->brush.pattern; k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { painter_set_clip(self->painter, draw_rect.left, draw_rect.top, draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top); painter_fill_pattern(self->painter, &dst_pb, &pat, x, y, x, y, cx, cy); xrdp_painter_add_dirty_rect(self, x, y, cx, cy, &draw_rect); } k++; } } painter_clear_clip(self->painter); xrdp_region_delete(region); } return 0; #endif } /* todo data */ if (dst->type == WND_TYPE_BITMAP) /* 0 */ { return 0; } xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); } else { xrdp_region_add_rect(region, &clip_rect); } x += dx; y += dy; if (self->mix_mode == 0 && self->rop == 0xcc) { k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { libxrdp_orders_rect(self->session, x, y, cx, cy, self->fg_color, &draw_rect); } k++; } } else if (self->mix_mode == 0 && ((self->rop & 0xf) == 0x0 || /* black */ (self->rop & 0xf) == 0xf || /* white */ (self->rop & 0xf) == 0x5)) /* DSTINVERT */ { k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { libxrdp_orders_dest_blt(self->session, x, y, cx, cy, self->rop, &draw_rect); } k++; } } else { k = 0; rop = self->rop; /* if opcode is in the form 0x00, 0x11, 0x22, ... convert it */ if (((rop & 0xf0) >> 4) == (rop & 0xf)) { switch (rop) { case 0x66: /* xor */ rop = 0x5a; break; case 0xaa: /* noop */ rop = 0xfb; break; case 0xcc: /* copy */ rop = 0xf0; break; case 0x88: /* and */ rop = 0xc0; break; } } xrdp_painter_setup_brush(self, &brush, &self->brush); while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { libxrdp_orders_pat_blt(self->session, x, y, cx, cy, rop, self->bg_color, self->fg_color, &brush, &draw_rect); } k++; } } xrdp_region_delete(region); return 0; } /*****************************************************************************/ static int xrdp_painter_draw_utf32(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x, int y, char32_t utf32[], unsigned int utf32len) { int i; int f; int c; int k; int x1; int y1; int flags; unsigned int index; int total_width; int total_height; int dx; int dy; char *data; struct xrdp_region *region; struct xrdp_rect rect; struct xrdp_rect clip_rect; struct xrdp_rect draw_rect; struct xrdp_font *font; struct xrdp_font_char *font_item; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_draw_text:"); if (self == 0) { return 0; } if (utf32len < 1) { return 0; } /* todo data */ if (dst->type == 0) { return 0; } xrdp_painter_font_needed(self); if (self->font == 0) { return 0; } if (self->painter != 0) { #if defined(XRDP_PAINTER) struct painter_bitmap pat; struct painter_bitmap dst_pb; struct xrdp_bitmap *ldst; if (dst->type != WND_TYPE_OFFSCREEN) { ldst = self->wm->screen; font = self->font; // Calculate total width and height fields total_width = 0; total_height = 0; for (index = 0 ; index < utf32len; ++index) { font_item = XRDP_FONT_GET_CHAR(font, utf32[index]); k = font_item->incby; total_width += k; /* Use the nominal height of the font to work out the * actual height of this glyph */ int glyph_height = font->body_height + font_item->baseline + font_item->height; total_height = MAX(total_height, glyph_height); } xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); xrdp_wm_get_vis_region(self->wm, dst, x, y, total_width, total_height, region, self->clip_children); x += dx; y += dy; g_memset(&dst_pb, 0, sizeof(dst_pb)); dst_pb.format = get_pt_format(self); dst_pb.width = ldst->width; dst_pb.stride_bytes = ldst->line_size; dst_pb.height = ldst->height; dst_pb.data = ldst->data; painter_set_rop(self->painter, PT_ROP_S); painter_set_pattern_origin(self->painter, 0, 0); painter_set_pattern_mode(self->painter, PT_PATTERN_MODE_NORMAL); painter_set_fgcolor(self->painter, get_rgb_from_rdp_color(self, self->fg_color)); k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { painter_set_clip(self->painter, draw_rect.left, draw_rect.top, draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top); for (index = 0 ; index < utf32len; ++index) { font_item = XRDP_FONT_GET_CHAR(font, utf32[index]); g_memset(&pat, 0, sizeof(pat)); pat.format = PT_FORMAT_c1; pat.width = font_item->width; pat.stride_bytes = (font_item->width + 7) / 8; pat.height = font_item->height; pat.data = font_item->data; x1 = x + font_item->offset; y1 = y + (font->body_height + font_item->baseline); painter_fill_pattern(self->painter, &dst_pb, &pat, 0, 0, x1, y1, font_item->width, font_item->height); xrdp_painter_add_dirty_rect(self, x1, y1, font_item->width, font_item->height, &draw_rect); x += font_item->incby; } } k++; } painter_clear_clip(self->painter); xrdp_region_delete(region); } return 0; #endif } font = self->font; f = 0; k = 0; total_width = 0; total_height = 0; index = 0; data = (char *)g_malloc(utf32len * 2, 1); for (index = 0 ; index < utf32len; ++index) { font_item = XRDP_FONT_GET_CHAR(font, utf32[index]); i = xrdp_cache_add_char(self->wm->cache, font_item); f = HIWORD(i); c = LOWORD(i); data[index * 2] = c; data[index * 2 + 1] = k; k = font_item->incby; total_width += k; /* Use the nominal height of the font to work out the * actual height of this glyph */ int glyph_height = font->body_height + font_item->baseline + font_item->height; total_height = MAX(total_height, glyph_height); } xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { xrdp_wm_get_vis_region(self->wm, dst, x, y, total_width, total_height, region, self->clip_children); } else { xrdp_region_add_rect(region, &clip_rect); } x += dx; y += dy; k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { x1 = x; y1 = y + font->body_height; flags = 0x03; /* 0x03 0x73; TEXT2_IMPLICIT_X and something else */ libxrdp_orders_text(self->session, f, flags, 0, self->fg_color, 0, x - 1, y - 1, x + total_width, y + total_height, 0, 0, 0, 0, x1, y1, data, utf32len * 2, &draw_rect); } k++; } xrdp_region_delete(region); g_free(data); return 0; } /*****************************************************************************/ int xrdp_painter_draw_text(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x, int y, const char *text) { int rv = 0; unsigned int c32_count = utf8_char_count(text); if (c32_count > 0) { char32_t *utf32 = (char32_t *)malloc(c32_count * sizeof(char32_t)); if (utf32 == NULL) { rv = 1; } else { unsigned int i = 0; char32_t c32; while ((c32 = utf8_get_next_char(&text, NULL)) != 0) { utf32[i++] = c32; } rv = xrdp_painter_draw_utf32(self, dst, x, y, utf32, c32_count); free (utf32); } } return rv; } /*****************************************************************************/ int xrdp_painter_draw_text2(struct xrdp_painter *self, struct xrdp_bitmap *dst, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len) { struct xrdp_rect clip_rect; struct xrdp_rect draw_rect; struct xrdp_rect rect; struct xrdp_region *region; int k; int dx; int dy; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_painter_draw_text2:"); if (self == 0) { return 0; } if (self->painter != 0) { return 0; } /* todo data */ if (dst->type == WND_TYPE_BITMAP) { return 0; } xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { if (box_right - box_left > 1) { xrdp_wm_get_vis_region(self->wm, dst, box_left, box_top, box_right - box_left, box_bottom - box_top, region, self->clip_children); } else { xrdp_wm_get_vis_region(self->wm, dst, clip_left, clip_top, clip_right - clip_left, clip_bottom - clip_top, region, self->clip_children); } } else { xrdp_region_add_rect(region, &clip_rect); } clip_left += dx; clip_top += dy; clip_right += dx; clip_bottom += dy; box_left += dx; box_top += dy; box_right += dx; box_bottom += dy; x += dx; y += dy; k = 0; while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { libxrdp_orders_text(self->session, font, flags, mixmode, self->fg_color, self->bg_color, clip_left, clip_top, clip_right, clip_bottom, box_left, box_top, box_right, box_bottom, x, y, data, data_len, &draw_rect); } k++; } xrdp_region_delete(region); return 0; } /*****************************************************************************/ int xrdp_painter_draw_char(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x, int y, char32_t chr, unsigned int repeat_count) { int rv = 0; if (repeat_count > 0) { char32_t *utf32 = (char32_t *)malloc(repeat_count * sizeof(char32_t)); if (utf32 == NULL) { rv = 1; } else { unsigned int i = 0; for (i = 0; i < repeat_count; ++i) { utf32[i] = chr; } rv = xrdp_painter_draw_utf32(self, dst, x, y, utf32, repeat_count); free (utf32); } } return rv; } /*****************************************************************************/ int xrdp_painter_copy(struct xrdp_painter *self, struct xrdp_bitmap *src, struct xrdp_bitmap *dst, int x, int y, int cx, int cy, int srcx, int srcy) { struct xrdp_rect clip_rect; struct xrdp_rect draw_rect; struct xrdp_rect rect1; struct xrdp_rect rect2; struct xrdp_region *region; struct xrdp_bitmap *b; int i; int j; int k; int dx; int dy; int palette_id; int bitmap_id; int cache_id; int cache_idx; int dstx; int dsty; int w; int h; int index; struct list *del_list; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_copy:"); if (self == 0 || src == 0 || dst == 0) { return 0; } if (self->painter != 0) { #if defined(XRDP_PAINTER) struct painter_bitmap src_pb; struct painter_bitmap dst_pb; struct xrdp_bitmap *ldst; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_copy: src->type %d dst->type %d", src->type, dst->type); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_copy: self->rop 0x%2.2x", self->rop); if (dst->type != WND_TYPE_OFFSCREEN) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_copy: using painter"); ldst = self->wm->screen; g_memset(&dst_pb, 0, sizeof(dst_pb)); dst_pb.format = get_pt_format(self); dst_pb.width = ldst->width; dst_pb.stride_bytes = ldst->line_size; dst_pb.height = ldst->height; dst_pb.data = ldst->data; g_memset(&src_pb, 0, sizeof(src_pb)); src_pb.format = get_pt_format(self); src_pb.width = src->width; src_pb.stride_bytes = src->line_size; src_pb.height = src->height; src_pb.data = src->data; xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); x += dx; y += dy; k = 0; painter_set_rop(self->painter, self->rop); while (xrdp_region_get_rect(region, k, &rect1) == 0) { if (rect_intersect(&rect1, &clip_rect, &draw_rect)) { painter_set_clip(self->painter, draw_rect.left, draw_rect.top, draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top); LOG_DEVEL(LOG_LEVEL_DEBUG, " x %d y %d cx %d cy %d srcx %d srcy %d", x, y, cx, cy, srcx, srcy); painter_copy(self->painter, &dst_pb, x, y, cx, cy, &src_pb, srcx, srcy); xrdp_painter_add_dirty_rect(self, x, y, cx, cy, &draw_rect); } k++; } painter_clear_clip(self->painter); xrdp_region_delete(region); } return 0; #endif } /* todo data */ if (dst->type == WND_TYPE_BITMAP) { return 0; } if (src->type == WND_TYPE_SCREEN) { xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); } else { xrdp_region_add_rect(region, &clip_rect); } x += dx; y += dy; srcx += dx; srcy += dy; k = 0; while (xrdp_region_get_rect(region, k, &rect1) == 0) { if (rect_intersect(&rect1, &clip_rect, &draw_rect)) { libxrdp_orders_screen_blt(self->session, x, y, cx, cy, srcx, srcy, self->rop, &draw_rect); } k++; } xrdp_region_delete(region); } else if (src->type == WND_TYPE_OFFSCREEN) { LOG(LOG_LEVEL_DEBUG, "xrdp_painter_copy: todo"); xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { LOG(LOG_LEVEL_DEBUG, "off screen to screen"); xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); } else { LOG(LOG_LEVEL_DEBUG, "off screen to off screen"); xrdp_region_add_rect(region, &clip_rect); } x += dx; y += dy; palette_id = 0; cache_id = 255; // todo cache_idx = src->item_index; // todo if (src->tab_stop == 0) { LOG(LOG_LEVEL_WARNING, "xrdp_painter_copy: warning src not created"); del_list = self->wm->cache->xrdp_os_del_list; index = list_index_of(del_list, cache_idx); list_remove_item(del_list, index); libxrdp_orders_send_create_os_surface(self->session, cache_idx, src->width, src->height, del_list); src->tab_stop = 1; list_clear(del_list); } k = 0; while (xrdp_region_get_rect(region, k, &rect1) == 0) { if (rect_intersect(&rect1, &clip_rect, &rect2)) { MAKERECT(rect1, x, y, cx, cy); if (rect_intersect(&rect2, &rect1, &draw_rect)) { libxrdp_orders_mem_blt(self->session, cache_id, palette_id, x, y, cx, cy, self->rop, srcx, srcy, cache_idx, &draw_rect); } } k++; } xrdp_region_delete(region); } else if (src->data != 0) /* todo, the non bitmap cache part is gone, it should be put back */ { xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); } else { xrdp_region_add_rect(region, &clip_rect); } x += dx; y += dy; palette_id = 0; j = srcy; while (j < (srcy + cy)) { i = srcx; while (i < (srcx + cx)) { w = MIN(64, ((srcx + cx) - i)); h = MIN(64, ((srcy + cy) - j)); b = xrdp_bitmap_create(w, h, src->bpp, 0, self->wm); #if 1 xrdp_bitmap_copy_box_with_crc(src, b, i, j, w, h); #else xrdp_bitmap_copy_box(src, b, i, j, w, h); xrdp_bitmap_hash_crc(b); #endif bitmap_id = xrdp_cache_add_bitmap(self->wm->cache, b, self->wm->hints); cache_id = HIWORD(bitmap_id); cache_idx = LOWORD(bitmap_id); dstx = (x + i) - srcx; dsty = (y + j) - srcy; k = 0; while (xrdp_region_get_rect(region, k, &rect1) == 0) { if (rect_intersect(&rect1, &clip_rect, &rect2)) { MAKERECT(rect1, dstx, dsty, w, h); if (rect_intersect(&rect2, &rect1, &draw_rect)) { libxrdp_orders_mem_blt(self->session, cache_id, palette_id, dstx, dsty, w, h, self->rop, 0, 0, cache_idx, &draw_rect); } } k++; } i += 64; } j += 64; } xrdp_region_delete(region); } return 0; } /*****************************************************************************/ int xrdp_painter_composite(struct xrdp_painter *self, struct xrdp_bitmap *src, int srcformat, int srcwidth, int srcrepeat, struct xrdp_bitmap *dst, int *srctransform, int mskflags, struct xrdp_bitmap *msk, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat) { struct xrdp_rect clip_rect; struct xrdp_rect draw_rect; struct xrdp_rect rect1; struct xrdp_rect rect2; struct xrdp_region *region; int k; int dx; int dy; int cache_srcidx; int cache_mskidx; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_composite:"); if (self == 0 || src == 0 || dst == 0) { return 0; } if (self->painter != 0) { return 0; } /* todo data */ if (dst->type == WND_TYPE_BITMAP) { return 0; } if (src->type == WND_TYPE_OFFSCREEN) { xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); xrdp_region_add_rect(region, &clip_rect); dstx += dx; dsty += dy; cache_srcidx = src->item_index; cache_mskidx = -1; if (mskflags & 1) { if (msk != 0) { cache_mskidx = msk->item_index; // todo } } k = 0; while (xrdp_region_get_rect(region, k, &rect1) == 0) { if (rect_intersect(&rect1, &clip_rect, &rect2)) { MAKERECT(rect1, dstx, dsty, width, height); if (rect_intersect(&rect2, &rect1, &draw_rect)) { libxrdp_orders_composite_blt(self->session, cache_srcidx, srcformat, srcwidth, srcrepeat, srctransform, mskflags, cache_mskidx, mskformat, mskwidth, mskrepeat, op, srcx, srcy, mskx, msky, dstx, dsty, width, height, dstformat, &draw_rect); } } k++; } xrdp_region_delete(region); } return 0; } /*****************************************************************************/ int xrdp_painter_line(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x1, int y1, int x2, int y2) { struct xrdp_rect clip_rect; struct xrdp_rect draw_rect; struct xrdp_rect rect; struct xrdp_region *region; int k; int dx; int dy; int rop; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_line:"); if (self == 0) { return 0; } if (self->painter != 0) { #if defined(XRDP_PAINTER) int x; int y; int cx; int cy; struct painter_bitmap dst_pb; struct xrdp_bitmap *ldst; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_line: dst->type %d", dst->type); LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_line: self->rop 0x%2.2x", self->rop); if (dst->type != WND_TYPE_OFFSCREEN) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_painter_line: using painter"); ldst = self->wm->screen; g_memset(&dst_pb, 0, sizeof(dst_pb)); dst_pb.format = get_pt_format(self); dst_pb.width = ldst->width; dst_pb.stride_bytes = ldst->line_size; dst_pb.height = ldst->height; dst_pb.data = ldst->data; xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); x = MIN(x1, x2); y = MIN(y1, y2); cx = g_abs(x1 - x2) + 1; cy = g_abs(y1 - y2) + 1; xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); x1 += dx; y1 += dy; x2 += dx; y2 += dy; k = 0; rop = self->rop; painter_set_rop(self->painter, rop); painter_set_fgcolor(self->painter, self->pen.color); while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { painter_set_clip(self->painter, draw_rect.left, draw_rect.top, draw_rect.right - draw_rect.left, draw_rect.bottom - draw_rect.top); painter_line(self->painter, &dst_pb, x1, y1, x2, y2, self->pen.width, 0); xrdp_painter_add_dirty_rect(self, x, y, cx, cy, &draw_rect); } k++; } painter_clear_clip(self->painter); xrdp_region_delete(region); } return 0; #endif } /* todo data */ if (dst->type == WND_TYPE_BITMAP) { return 0; } xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { xrdp_wm_get_vis_region(self->wm, dst, MIN(x1, x2), MIN(y1, y2), g_abs(x1 - x2) + 1, g_abs(y1 - y2) + 1, region, self->clip_children); } else { xrdp_region_add_rect(region, &clip_rect); } x1 += dx; y1 += dy; x2 += dx; y2 += dy; k = 0; rop = self->rop; if (rop < 0x01 || rop > 0x10) { rop = (rop & 0xf) + 1; } while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { libxrdp_orders_line(self->session, 1, x1, y1, x2, y2, rop, self->bg_color, &self->pen, &draw_rect); } k++; } xrdp_region_delete(region); return 0; } xrdp-0.10.1/xrdp/xrdp_process.c000644 001751 000000 00000022374 14652432047 016501 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * main rdp process */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp.h" static int g_session_id = 0; /*****************************************************************************/ /* always called from xrdp_listen thread */ struct xrdp_process * xrdp_process_create(struct xrdp_listen *owner, tbus done_event) { struct xrdp_process *self; char event_name[256]; int pid; self = (struct xrdp_process *)g_malloc(sizeof(struct xrdp_process), 1); self->lis_layer = owner; self->done_event = done_event; g_session_id++; self->session_id = g_session_id; pid = g_getpid(); g_snprintf(event_name, 255, "xrdp_%8.8x_process_self_term_event_%8.8x", pid, self->session_id); self->self_term_event = g_create_wait_obj(event_name); return self; } /*****************************************************************************/ void xrdp_process_delete(struct xrdp_process *self) { if (self == 0) { return; } g_delete_wait_obj(self->self_term_event); libxrdp_exit(self->session); xrdp_wm_delete(self->wm); trans_delete(self->server_trans); g_free(self); } /*****************************************************************************/ static int xrdp_process_loop(struct xrdp_process *self, struct stream *s) { int rv; rv = 0; if (self->session != 0) { rv = libxrdp_process_data(self->session, s); if ((self->wm == 0) && (self->session->up_and_running) && (rv == 0)) { LOG_DEVEL(LOG_LEVEL_TRACE, "calling xrdp_wm_init and creating wm"); self->wm = xrdp_wm_create(self, self->session->client_info); /* at this point the wm(window manager) is created and wm::login_state is WMLS_RESET and wm::login_state_event is set so xrdp_wm_init should be called by xrdp_wm_check_wait_objs */ } } return rv; } /*****************************************************************************/ /* returns boolean */ /* this is so libxrdp.so can known when to quit looping */ static int xrdp_is_term(void) { return g_is_term(); } /*****************************************************************************/ static int xrdp_process_mod_end(struct xrdp_process *self) { if (self->wm != 0) { if (self->wm->mm != 0) { if (self->wm->mm->mod != 0) { if (self->wm->mm->mod->mod_end != 0) { return self->wm->mm->mod->mod_end(self->wm->mm->mod); } } } } return 0; } /*****************************************************************************/ static int xrdp_process_data_in(struct trans *self) { struct xrdp_process *pro; struct stream *s; int len; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_process_data_in"); pro = (struct xrdp_process *)(self->callback_data); s = pro->server_trans->in_s; switch (pro->server_trans->extra_flags) { case 0: /* early in connection sequence, we're in this mode */ if (xrdp_process_loop(pro, 0) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_process_data_in: " "xrdp_process_loop failed"); return 1; } if (pro->session->up_and_running) { pro->server_trans->header_size = 2; pro->server_trans->extra_flags = 1; init_stream(s, 0); } break; case 1: /* we got 2 bytes */ if (s->p[0] == 3) { pro->server_trans->header_size = 4; pro->server_trans->extra_flags = 2; } else { if (s->p[1] & 0x80) { pro->server_trans->header_size = 3; pro->server_trans->extra_flags = 2; } else { len = (tui8)(s->p[1]); pro->server_trans->header_size = len; pro->server_trans->extra_flags = 3; } } len = (int) (s->end - s->data); if (pro->server_trans->header_size > (unsigned int)len) { /* not enough data read yet */ break; } /* FALLTHROUGH */ case 2: /* we have enough now to get the PDU bytes */ len = libxrdp_get_pdu_bytes(s->p); if (len == -1) { LOG(LOG_LEVEL_ERROR, "xrdp_process_data_in: " "xrdp_process_get_packet_bytes failed"); return 1; } pro->server_trans->header_size = len; pro->server_trans->extra_flags = 3; len = (int) (s->end - s->data); if (pro->server_trans->header_size > (unsigned int)len) { /* not enough data read yet */ break; } /* FALLTHROUGH */ case 3: /* the whole PDU is read in now process */ s->p = s->data; if (xrdp_process_loop(pro, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_process_data_in: " "xrdp_process_loop failed"); return 1; } init_stream(s, 0); pro->server_trans->header_size = 2; pro->server_trans->extra_flags = 1; break; } return 0; } /*****************************************************************************/ int xrdp_process_main_loop(struct xrdp_process *self) { int robjs_count; int wobjs_count; int cont; int timeout = 0; tbus robjs[32]; tbus wobjs[32]; tbus term_obj; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_process_main_loop"); self->status = 1; self->server_trans->extra_flags = 0; self->server_trans->header_size = 0; self->server_trans->no_stream_init_on_data_in = 1; self->server_trans->trans_data_in = xrdp_process_data_in; self->server_trans->callback_data = self; init_stream(self->server_trans->in_s, 8192 * 4); self->session = libxrdp_init((tbus)self, self->server_trans, self->lis_layer->startup_params->xrdp_ini); self->server_trans->si = &(self->session->si); self->server_trans->my_source = XRDP_SOURCE_CLIENT; /* this callback function is in xrdp_wm.c */ self->session->callback = callback; /* this function is just above */ self->session->is_term = xrdp_is_term; if (libxrdp_process_incoming(self->session) == 0) { init_stream(self->server_trans->in_s, 32 * 1024); term_obj = g_get_term(); cont = 1; while (cont) { /* build the wait obj list */ timeout = -1; robjs_count = 0; wobjs_count = 0; robjs[robjs_count++] = term_obj; robjs[robjs_count++] = self->self_term_event; xrdp_wm_get_wait_objs(self->wm, robjs, &robjs_count, wobjs, &wobjs_count, &timeout); trans_get_wait_objs_rw(self->server_trans, robjs, &robjs_count, wobjs, &wobjs_count, &timeout); /* wait */ if (g_obj_wait(robjs, robjs_count, wobjs, wobjs_count, timeout) != 0) { /* error, should not get here */ g_sleep(100); } if (g_is_wait_obj_set(term_obj)) /* term */ { LOG(LOG_LEVEL_DEBUG, "Received termination signal, stopping the client message " "processor thread"); break; } if (g_is_wait_obj_set(self->self_term_event)) { break; } if (xrdp_wm_check_wait_objs(self->wm) != 0) { break; } if (trans_check_wait_objs(self->server_trans) != 0) { break; } } /* send disconnect message if possible */ libxrdp_disconnect(self->session); } else { LOG(LOG_LEVEL_ERROR, "xrdp_process_main_loop: libxrdp_process_incoming failed"); /* this will try to send a disconnect, maybe should check that connection got far enough */ libxrdp_disconnect(self->session); } /* Run end in module */ xrdp_process_mod_end(self); xrdp_wm_delete(self->wm); self->wm = NULL; libxrdp_exit(self->session); self->session = 0; self->status = -1; g_set_wait_obj(self->done_event); return 0; } xrdp-0.10.1/xrdp/xrdp_wm.c000644 001751 000000 00000217127 14652432047 015450 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * simple window manager */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include "xrdp.h" #include "ms-rdpbcgr.h" #include "log.h" #include "string_calls.h" /*****************************************************************************/ static void xrdp_wm_load_channel_config(struct xrdp_wm *self) { struct list *names = list_create(); names->auto_free = 1; struct list *values = list_create(); values->auto_free = 1; if (file_by_name_read_section(self->session->xrdp_ini, "Channels", names, values) == 0) { int chan_id; int chan_count = libxrdp_get_channel_count(self->session); const char *disabled_str = NULL; for (chan_id = 0 ; chan_id < chan_count ; ++chan_id) { char chan_name[16]; if (libxrdp_query_channel(self->session, chan_id, chan_name, NULL) == 0) { int disabled = 1; /* Channels disabled if not found */ int index; for (index = 0; index < names->count; index++) { const char *q = (const char *)list_get_item(names, index); const char *r = (const char *)list_get_item(values, index); if (g_strcasecmp(q, chan_name) == 0) { disabled = !g_text2bool(r); break; } } disabled_str = (disabled) ? "disabled" : "enabled"; LOG(LOG_LEVEL_DEBUG, "xrdp_wm_load_channel_config: " "channel %s channel id %d is %s", chan_name, chan_id, disabled_str); libxrdp_disable_channel(self->session, chan_id, disabled); } } } list_delete(names); list_delete(values); } /*****************************************************************************/ struct xrdp_wm * xrdp_wm_create(struct xrdp_process *owner, struct xrdp_client_info *client_info) { struct xrdp_wm *self = (struct xrdp_wm *)NULL; char event_name[256]; int pid = 0; /* initialize (zero out) local variables: */ g_memset(event_name, 0, sizeof(char) * 256); self = (struct xrdp_wm *)g_malloc(sizeof(struct xrdp_wm), 1); self->client_info = client_info; self->screen = xrdp_bitmap_create(client_info->display_sizes.session_width, client_info->display_sizes.session_height, client_info->bpp, WND_TYPE_SCREEN, self); self->screen->wm = self; self->pro_layer = owner; self->session = owner->session; pid = g_getpid(); g_snprintf(event_name, 255, "xrdp_%8.8x_wm_login_state_event_%8.8x", pid, owner->session_id); LOG(LOG_LEVEL_DEBUG, "%s", event_name); self->login_state_event = g_create_wait_obj(event_name); self->painter = xrdp_painter_create(self, self->session); self->cache = xrdp_cache_create(self, self->session, self->client_info); self->log = list_create(); self->log->auto_free = 1; self->mm = xrdp_mm_create(self); /* this will use built in keymap or load from file */ get_keymaps(self->session->client_info->keylayout, &(self->keymap)); xrdp_wm_set_login_state(self, WMLS_RESET); self->target_surface = self->screen; self->current_surface_index = 0xffff; /* screen */ /* to store configuration from xrdp.ini */ self->xrdp_config = g_new0(struct xrdp_config, 1); /* Load the channel config so libxrdp can check whether drdynvc is enabled or not */ xrdp_wm_load_channel_config(self); // Start drdynvc if available. if (libxrdp_drdynvc_start(self->session) == 0) { // drdynvc is started. callback() will // be notified when capabilities are received. } else if (self->client_info->gfx) { LOG(LOG_LEVEL_WARNING, "Disabling GFX as '" DRDYNVC_SVC_CHANNEL_NAME "' isn't available"); self->client_info->gfx = 0; } return self; } /*****************************************************************************/ void xrdp_wm_delete(struct xrdp_wm *self) { if (self == 0) { return; } xrdp_region_delete(self->screen_dirty_region); xrdp_mm_delete(self->mm); xrdp_cache_delete(self->cache); xrdp_painter_delete(self->painter); xrdp_bitmap_delete(self->screen); /* free the log */ list_delete(self->log); /* free default font */ xrdp_font_delete(self->default_font); g_delete_wait_obj(self->login_state_event); if (self->xrdp_config) { g_free(self->xrdp_config); } /* free self */ g_free(self); } /*****************************************************************************/ int xrdp_wm_send_palette(struct xrdp_wm *self) { return libxrdp_send_palette(self->session, self->palette); } /*****************************************************************************/ int xrdp_wm_send_bell(struct xrdp_wm *self) { return libxrdp_send_bell(self->session); } /*****************************************************************************/ int xrdp_wm_send_bitmap(struct xrdp_wm *self, struct xrdp_bitmap *bitmap, int x, int y, int cx, int cy) { return libxrdp_send_bitmap(self->session, bitmap->width, bitmap->height, bitmap->bpp, bitmap->data, x, y, cx, cy); } /*****************************************************************************/ int xrdp_wm_set_focused(struct xrdp_wm *self, struct xrdp_bitmap *wnd) { struct xrdp_bitmap *focus_out_control; struct xrdp_bitmap *focus_in_control; if (self == 0) { return 0; } if (self->focused_window == wnd) { return 0; } focus_out_control = 0; focus_in_control = 0; if (self->focused_window != 0) { xrdp_bitmap_set_focus(self->focused_window, 0); focus_out_control = self->focused_window->focused_control; } self->focused_window = wnd; if (self->focused_window != 0) { xrdp_bitmap_set_focus(self->focused_window, 1); focus_in_control = self->focused_window->focused_control; } xrdp_bitmap_invalidate(focus_out_control, 0); xrdp_bitmap_invalidate(focus_in_control, 0); return 0; } /******************************************************************************/ static int xrdp_wm_get_pixel(char *data, int x, int y, int width, int bpp) { int start; int shift; if (bpp == 1) { width = (width + 7) / 8; start = (y * width) + x / 8; shift = x % 8; return (data[start] & (0x80 >> shift)) != 0; } else if (bpp == 4) { width = (width + 1) / 2; start = y * width + x / 2; shift = x % 2; if (shift == 0) { return (data[start] & 0xf0) >> 4; } else { return data[start] & 0x0f; } } return 0; } /*****************************************************************************/ int xrdp_wm_pointer(struct xrdp_wm *self, char *data, char *mask, int x, int y, int bpp, int width, int height) { int bytes; struct xrdp_pointer_item *pointer_item; if (bpp == 0) { bpp = 24; } bytes = ((bpp + 7) / 8) * width * height; pointer_item = g_new0(struct xrdp_pointer_item, 1); pointer_item->x = x; pointer_item->y = y; pointer_item->bpp = bpp; pointer_item->width = width; pointer_item->height = height; g_memcpy(pointer_item->data, data, bytes); g_memcpy(pointer_item->mask, mask, width * height / 8); self->screen->pointer = xrdp_cache_add_pointer(self->cache, pointer_item); g_free(pointer_item); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_wm_load_pointer(struct xrdp_wm *self, char *file_name, char *data, char *mask, int *x, int *y) { int fd; int len; int bpp; int w; int h; int i; int j; int pixel; int palette[16]; struct stream *fs; if (!g_file_exist(file_name)) { LOG(LOG_LEVEL_ERROR, "xrdp_wm_load_pointer: error pointer file [%s] does not exist", file_name); return 1; } make_stream(fs); init_stream(fs, 8192); fd = g_file_open_ro(file_name); if (fd < 0) { LOG(LOG_LEVEL_ERROR, "xrdp_wm_load_pointer: error loading pointer from file [%s]", file_name); xstream_free(fs); return 1; } len = g_file_read(fd, fs->data, 8192); g_file_close(fd); if (len <= 0) { LOG(LOG_LEVEL_ERROR, "xrdp_wm_load_pointer: read error from file [%s]", file_name); xstream_free(fs); return 1; } fs->end = fs->data + len; in_uint8s(fs, 6); in_uint8(fs, w); in_uint8(fs, h); in_uint8s(fs, 2); in_uint16_le(fs, *x); in_uint16_le(fs, *y); in_uint8s(fs, 22); in_uint8(fs, bpp); in_uint8s(fs, 25); if (w == 32 && h == 32) { if (bpp == 1) { for (i = 0; i < 2; i++) { in_uint32_le(fs, pixel); palette[i] = pixel; } for (i = 0; i < 32; i++) { for (j = 0; j < 32; j++) { pixel = palette[xrdp_wm_get_pixel(fs->p, j, i, 32, 1)]; *data = pixel; data++; *data = pixel >> 8; data++; *data = pixel >> 16; data++; } } in_uint8s(fs, 128); } else if (bpp == 4) { for (i = 0; i < 16; i++) { in_uint32_le(fs, pixel); palette[i] = pixel; } for (i = 0; i < 32; i++) { for (j = 0; j < 32; j++) { pixel = palette[xrdp_wm_get_pixel(fs->p, j, i, 32, 1)]; *data = pixel; data++; *data = pixel >> 8; data++; *data = pixel >> 16; data++; } } in_uint8s(fs, 512); } g_memcpy(mask, fs->p, 128); /* mask */ } free_stream(fs); return 0; } /*****************************************************************************/ int xrdp_wm_send_pointer(struct xrdp_wm *self, int cache_idx, char *data, char *mask, int x, int y, int bpp, int width, int height) { return libxrdp_send_pointer(self->session, cache_idx, data, mask, x, y, bpp, width, height); } /*****************************************************************************/ int xrdp_wm_set_pointer(struct xrdp_wm *self, int cache_idx) { return libxrdp_set_pointer(self->session, cache_idx); } /*****************************************************************************/ /* convert hex string to int */ unsigned int xrdp_wm_htoi (const char *ptr) { unsigned int value = 0; char ch = *ptr; while (ch == ' ' || ch == '\t') { ch = *(++ptr); } for (;;) { if (ch >= '0' && ch <= '9') { value = (value << 4) + (ch - '0'); } else if (ch >= 'A' && ch <= 'F') { value = (value << 4) + (ch - 'A' + 10); } else if (ch >= 'a' && ch <= 'f') { value = (value << 4) + (ch - 'a' + 10); } else { return value; } ch = *(++ptr); } } /*****************************************************************************/ int xrdp_wm_load_static_colors_plus(struct xrdp_wm *self, char *autorun_name) { int bindex; int gindex; int rindex; int fd; int index; char *val; struct list *names; struct list *values; if (autorun_name != 0) { autorun_name[0] = 0; } /* initialize with defaults */ self->black = HCOLOR(self->screen->bpp, 0x000000); self->grey = HCOLOR(self->screen->bpp, 0xc0c0c0); self->dark_grey = HCOLOR(self->screen->bpp, 0x808080); self->blue = HCOLOR(self->screen->bpp, 0x0000ff); self->dark_blue = HCOLOR(self->screen->bpp, 0x00007f); self->white = HCOLOR(self->screen->bpp, 0xffffff); self->red = HCOLOR(self->screen->bpp, 0xff0000); self->green = HCOLOR(self->screen->bpp, 0x00ff00); self->background = HCOLOR(self->screen->bpp, 0x000000); /* now load them from the globals in xrdp.ini if defined */ fd = g_file_open_ro(self->session->xrdp_ini); if (fd >= 0) { names = list_create(); names->auto_free = 1; values = list_create(); values->auto_free = 1; if (file_read_section(fd, "globals", names, values) == 0) { for (index = 0; index < names->count; index++) { val = (char *)list_get_item(names, index); if (val != 0) { if (g_strcasecmp(val, "black") == 0) { val = (char *)list_get_item(values, index); self->black = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "grey") == 0) { val = (char *)list_get_item(values, index); self->grey = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "dark_grey") == 0) { val = (char *)list_get_item(values, index); self->dark_grey = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "blue") == 0) { val = (char *)list_get_item(values, index); self->blue = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "dark_blue") == 0) { val = (char *)list_get_item(values, index); self->dark_blue = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "white") == 0) { val = (char *)list_get_item(values, index); self->white = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "red") == 0) { val = (char *)list_get_item(values, index); self->red = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "green") == 0) { val = (char *)list_get_item(values, index); self->green = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "background") == 0) { val = (char *)list_get_item(values, index); self->background = HCOLOR(self->screen->bpp, xrdp_wm_htoi(val)); } else if (g_strcasecmp(val, "autorun") == 0) { val = (char *)list_get_item(values, index); if (autorun_name != 0) { g_strncpy(autorun_name, val, 255); } } else if (g_strcasecmp(val, "hidelogwindow") == 0) { val = (char *)list_get_item(values, index); self->hide_log_window = g_text2bool(val); } else if (g_strcasecmp(val, "pamerrortxt") == 0) { val = (char *)list_get_item(values, index); g_strncpy(self->pamerrortxt, val, 255); } } } } list_delete(names); list_delete(values); g_file_close(fd); } else { LOG(LOG_LEVEL_WARNING, "xrdp_wm_load_static_colors: Could not read xrdp.ini file %s", self->session->xrdp_ini); } if (self->screen->bpp == 8) { /* rgb332 */ for (bindex = 0; bindex < 4; bindex++) { for (gindex = 0; gindex < 8; gindex++) { for (rindex = 0; rindex < 8; rindex++) { self->palette[(bindex << 6) | (gindex << 3) | rindex] = (((rindex << 5) | (rindex << 2) | (rindex >> 1)) << 16) | (((gindex << 5) | (gindex << 2) | (gindex >> 1)) << 8) | ((bindex << 6) | (bindex << 4) | (bindex << 2) | (bindex)); } } } xrdp_wm_send_palette(self); } return 0; } /*****************************************************************************/ /* returns error */ int xrdp_wm_load_static_pointers(struct xrdp_wm *self) { struct xrdp_pointer_item pointer_item; char file_path[256]; LOG_DEVEL(LOG_LEVEL_TRACE, "sending cursor"); g_snprintf(file_path, 255, "%s/cursor1.cur", XRDP_SHARE_PATH); g_memset(&pointer_item, 0, sizeof(pointer_item)); xrdp_wm_load_pointer(self, file_path, pointer_item.data, pointer_item.mask, &pointer_item.x, &pointer_item.y); xrdp_cache_add_pointer_static(self->cache, &pointer_item, 1); LOG_DEVEL(LOG_LEVEL_TRACE, "sending cursor"); g_snprintf(file_path, 255, "%s/cursor0.cur", XRDP_SHARE_PATH); g_memset(&pointer_item, 0, sizeof(pointer_item)); xrdp_wm_load_pointer(self, file_path, pointer_item.data, pointer_item.mask, &pointer_item.x, &pointer_item.y); xrdp_cache_add_pointer_static(self->cache, &pointer_item, 0); return 0; } /*****************************************************************************/ int xrdp_wm_init(struct xrdp_wm *self) { int fd; int index; const char *q; const char *r; char param[256]; char default_section_name[256]; char section_name[256]; char autorun_name[256]; int dpi; LOG(LOG_LEVEL_DEBUG, "in xrdp_wm_init: "); load_xrdp_config(self->xrdp_config, self->session->xrdp_ini, self->screen->bpp); /* Remove a font loaded on the previous config */ xrdp_font_delete(self->default_font); self->painter->font = NULL; /* May be set to the default_font */ /* Load the font */ dpi = xrdp_login_wnd_get_monitor_dpi(self); self->default_font = xrdp_font_create(self, dpi); /* Scale the login screen values */ xrdp_login_wnd_scale_config_values(self); xrdp_wm_load_static_colors_plus(self, autorun_name); xrdp_wm_load_static_pointers(self); self->screen->bg_color = self->xrdp_config->cfg_globals.ls_top_window_bg_color; if (self->session->client_info->rdp_autologin) { /* * NOTE: this should eventually be accessed from self->xrdp_config */ fd = g_file_open_ro(self->session->xrdp_ini); if (fd != -1) { struct list *names = list_create(); names->auto_free = 1; struct list *values = list_create(); values->auto_free = 1; /* pick up the first section name except for 'globals', 'Logging', 'channels' * in xrdp.ini and use it as default section name */ file_read_sections(fd, names); default_section_name[0] = '\0'; for (index = 0; index < names->count; index++) { q = (const char *)list_get_item(names, index); if ((g_strncasecmp("globals", q, 8) != 0) && (g_strncasecmp("Logging", q, 8) != 0) && (g_strncasecmp("LoggingPerLogger", q, 17) != 0) && (g_strncasecmp("channels", q, 9) != 0)) { g_strncpy(default_section_name, q, 255); break; } } /* look for module name to be loaded */ if (autorun_name[0] != 0) { /* if autorun is configured in xrdp.ini, we enforce that module to be loaded */ g_strncpy(section_name, autorun_name, 255); } else if (self->session->client_info->domain[0] != '\0' && self->session->client_info->domain[0] != '_') { /* domain names that starts with '_' are reserved for IP/DNS to * simplify for the user in a proxy setup */ /* we use the domain name as the module name to be loaded */ g_strncpy(section_name, self->session->client_info->domain, 255); } else { /* if no domain is given, and autorun is not specified in xrdp.ini * use default_section_name as section_name */ g_strncpy(section_name, default_section_name, 255); } list_clear(names); /* if given section name doesn't match any sections configured * in xrdp.ini, fallback to default_section_name */ if (file_read_section(fd, section_name, names, values) != 0) { LOG(LOG_LEVEL_INFO, "Module \"%s\" specified by %s from %s " "is not configured. Using \"%s\" instead.", section_name, self->session->client_info->username, self->session->client_info->client_description, default_section_name); list_clear(names); list_clear(values); g_strncpy(section_name, default_section_name, 255); } /* look for the required module in xrdp.ini, fetch its parameters */ if (file_read_section(fd, section_name, names, values) == 0) { for (index = 0; index < names->count; index++) { q = (const char *)list_get_item(names, index); r = (const char *)list_get_item(values, index); if (g_strncasecmp("password", q, 255) == 0) { /* if the password has been asked for by the module, use what the client says. if the password has been manually set in the config, use that instead of what the client says. */ if (g_strncmp("ask", r, 3) == 0) { r = self->session->client_info->password; } } else if (g_strncasecmp("username", q, 255) == 0) { /* if the username has been asked for by the module, use what the client says. if the username has been manually set in the config, use that instead of what the client says. */ if (g_strncmp("ask", r, 3) == 0) { r = self->session->client_info->username; } } else if (g_strncasecmp("ip", q, 255) == 0) { /* if the ip has been asked for by the module, use what the client says (target ip should be in 'domain' field, when starting with "_") if the ip has been manually set in the config, use that instead of what the client says. */ if (g_strncmp("ask", r, 3) == 0) { if (self->session->client_info->domain[0] == '_') { g_strncpy(param, &self->session->client_info->domain[1], 255); r = param; } } } else if (g_strncasecmp("port", q, 255) == 0) { if (g_strncmp("ask3389", r, 7) == 0) { r = "3389"; /* use default */ } } list_add_strdup(self->mm->login_names, q); list_add_strdup(self->mm->login_values, r); } if (self->session->client_info->gfx && !self->mm->egfx_up) { /* gfx session but have not recieved caps advertise yet, set flag so we will connect to backend later */ self->mm->gfx_delay_autologin = 1; } else { /* * Skip the login box and go straight to the connection phase */ xrdp_wm_set_login_state(self, WMLS_START_CONNECT); } } else { /* Hopefully, we never reach here. */ LOG(LOG_LEVEL_WARNING, "Control should never reach %s:%d", __FILE__, __LINE__); } list_delete(names); list_delete(values); g_file_close(fd); } else { LOG(LOG_LEVEL_WARNING, "xrdp_wm_init: Could not read xrdp.ini file %s", self->session->xrdp_ini); } } else { LOG(LOG_LEVEL_DEBUG, " xrdp_wm_init: no autologin / auto run detected, draw login window"); xrdp_login_wnd_create(self); /* clear screen */ xrdp_bitmap_invalidate(self->screen, 0); xrdp_wm_set_focused(self, self->login_window); xrdp_wm_set_login_state(self, WMLS_USER_PROMPT); } LOG(LOG_LEVEL_DEBUG, "out xrdp_wm_init: "); return 0; } /*****************************************************************************/ /* returns the number for rects visible for an area relative to a drawable */ /* putting the rects in region */ int xrdp_wm_get_vis_region(struct xrdp_wm *self, struct xrdp_bitmap *bitmap, int x, int y, int cx, int cy, struct xrdp_region *region, int clip_children) { int i; struct xrdp_bitmap *p; struct xrdp_rect a; struct xrdp_rect b; /* area we are drawing */ MAKERECT(a, bitmap->left + x, bitmap->top + y, cx, cy); p = bitmap->parent; while (p != 0) { RECTOFFSET(a, p->left, p->top); p = p->parent; } a.left = MAX(self->screen->left, a.left); a.top = MAX(self->screen->top, a.top); a.right = MIN(self->screen->left + self->screen->width, a.right); a.bottom = MIN(self->screen->top + self->screen->height, a.bottom); xrdp_region_add_rect(region, &a); if (clip_children) { /* loop through all windows in z order */ for (i = 0; i < self->screen->child_list->count; i++) { p = (struct xrdp_bitmap *)list_get_item(self->screen->child_list, i); if (p == bitmap || p == bitmap->parent) { return 0; } MAKERECT(b, p->left, p->top, p->width, p->height); xrdp_region_subtract_rect(region, &b); } } return 0; } /*****************************************************************************/ /* return the window at x, y on the screen */ static struct xrdp_bitmap * xrdp_wm_at_pos(struct xrdp_bitmap *wnd, int x, int y, struct xrdp_bitmap **wnd1) { int i; struct xrdp_bitmap *p; struct xrdp_bitmap *q; /* loop through all windows in z order */ for (i = 0; i < wnd->child_list->count; i++) { p = (struct xrdp_bitmap *)list_get_item(wnd->child_list, i); if (x >= p->left && y >= p->top && x < p->left + p->width && y < p->top + p->height) { if (wnd1 != 0) { *wnd1 = p; } q = xrdp_wm_at_pos(p, x - p->left, y - p->top, 0); if (q == 0) { return p; } else { return q; } } } return 0; } /*****************************************************************************/ static int xrdp_wm_xor_pat(struct xrdp_wm *self, int x, int y, int cx, int cy) { self->painter->clip_children = 0; self->painter->rop = 0x5a; xrdp_painter_begin_update(self->painter); self->painter->use_clip = 0; self->painter->mix_mode = 1; self->painter->brush.pattern[0] = 0xaa; self->painter->brush.pattern[1] = 0x55; self->painter->brush.pattern[2] = 0xaa; self->painter->brush.pattern[3] = 0x55; self->painter->brush.pattern[4] = 0xaa; self->painter->brush.pattern[5] = 0x55; self->painter->brush.pattern[6] = 0xaa; self->painter->brush.pattern[7] = 0x55; self->painter->brush.x_origin = 0; self->painter->brush.y_origin = 0; self->painter->brush.style = 3; self->painter->bg_color = self->black; self->painter->fg_color = self->white; /* top */ xrdp_painter_fill_rect(self->painter, self->screen, x, y, cx, 5); /* bottom */ xrdp_painter_fill_rect(self->painter, self->screen, x, y + (cy - 5), cx, 5); /* left */ xrdp_painter_fill_rect(self->painter, self->screen, x, y + 5, 5, cy - 10); /* right */ xrdp_painter_fill_rect(self->painter, self->screen, x + (cx - 5), y + 5, 5, cy - 10); xrdp_painter_end_update(self->painter); self->painter->rop = 0xcc; self->painter->clip_children = 1; self->painter->mix_mode = 0; return 0; } /*****************************************************************************/ /* return true if rect is totally exposed going in reverse z order */ /* from wnd up */ static int xrdp_wm_is_rect_vis(struct xrdp_wm *self, struct xrdp_bitmap *wnd, struct xrdp_rect *rect) { struct xrdp_rect wnd_rect; struct xrdp_bitmap *b; int i;; /* if rect is part off screen */ if (rect->left < 0) { return 0; } if (rect->top < 0) { return 0; } if (rect->right >= self->screen->width) { return 0; } if (rect->bottom >= self->screen->height) { return 0; } i = list_index_of(self->screen->child_list, (long)wnd); i--; while (i >= 0) { b = (struct xrdp_bitmap *)list_get_item(self->screen->child_list, i); MAKERECT(wnd_rect, b->left, b->top, b->width, b->height); if (rect_intersect(rect, &wnd_rect, 0)) { return 0; } i--; } return 1; } /*****************************************************************************/ static int xrdp_wm_move_window(struct xrdp_wm *self, struct xrdp_bitmap *wnd, int dx, int dy) { struct xrdp_rect rect1; struct xrdp_rect rect2; struct xrdp_region *r; int i; MAKERECT(rect1, wnd->left, wnd->top, wnd->width, wnd->height); self->painter->clip_children = 0; if (xrdp_wm_is_rect_vis(self, wnd, &rect1)) { rect2 = rect1; RECTOFFSET(rect2, dx, dy); if (xrdp_wm_is_rect_vis(self, wnd, &rect2)) { xrdp_painter_begin_update(self->painter); xrdp_painter_copy(self->painter, self->screen, self->screen, wnd->left + dx, wnd->top + dy, wnd->width, wnd->height, wnd->left, wnd->top); xrdp_painter_end_update(self->painter); wnd->left += dx; wnd->top += dy; r = xrdp_region_create(self); xrdp_region_add_rect(r, &rect1); xrdp_region_subtract_rect(r, &rect2); i = 0; while (xrdp_region_get_rect(r, i, &rect1) == 0) { xrdp_bitmap_invalidate(self->screen, &rect1); i++; } xrdp_region_delete(r); self->painter->clip_children = 1; return 0; } } self->painter->clip_children = 1; wnd->left += dx; wnd->top += dy; xrdp_bitmap_invalidate(self->screen, &rect1); xrdp_bitmap_invalidate(wnd, 0); return 0; } /*****************************************************************************/ static int xrdp_wm_undraw_dragging_box(struct xrdp_wm *self, int do_begin_end) { int boxx; int boxy; if (self == 0) { return 0; } if (self->dragging) { if (self->draggingxorstate) { if (do_begin_end) { xrdp_painter_begin_update(self->painter); } boxx = self->draggingx - self->draggingdx; boxy = self->draggingy - self->draggingdy; xrdp_wm_xor_pat(self, boxx, boxy, self->draggingcx, self->draggingcy); self->draggingxorstate = 0; if (do_begin_end) { xrdp_painter_end_update(self->painter); } } } return 0; } /*****************************************************************************/ static int xrdp_wm_draw_dragging_box(struct xrdp_wm *self, int do_begin_end) { int boxx; int boxy; if (self == 0) { return 0; } if (self->dragging) { if (!self->draggingxorstate) { if (do_begin_end) { xrdp_painter_begin_update(self->painter); } boxx = self->draggingx - self->draggingdx; boxy = self->draggingy - self->draggingdy; xrdp_wm_xor_pat(self, boxx, boxy, self->draggingcx, self->draggingcy); self->draggingxorstate = 1; if (do_begin_end) { xrdp_painter_end_update(self->painter); } } } return 0; } /*****************************************************************************/ int xrdp_wm_mouse_move(struct xrdp_wm *self, int x, int y) { struct xrdp_bitmap *b; if (self == 0) { return 0; } if (x < 0) { x = 0; } if (y < 0) { y = 0; } if (x >= self->screen->width) { x = self->screen->width; } if (y >= self->screen->height) { y = self->screen->height; } self->mouse_x = x; self->mouse_y = y; if (self->dragging) { xrdp_painter_begin_update(self->painter); xrdp_wm_undraw_dragging_box(self, 0); self->draggingx = x; self->draggingy = y; xrdp_wm_draw_dragging_box(self, 0); xrdp_painter_end_update(self->painter); return 0; } b = xrdp_wm_at_pos(self->screen, x, y, 0); if (b == 0) /* if b is null, the movement must be over the screen */ { if (self->screen->pointer != self->current_pointer) { xrdp_wm_set_pointer(self, self->screen->pointer); self->current_pointer = self->screen->pointer; } if (self->mm->mod != 0) /* if screen is mod controlled */ { if (self->mm->mod->mod_event != 0) { self->mm->mod->mod_event(self->mm->mod, WM_MOUSEMOVE, x, y, 0, 0); } } } if (self->button_down != 0) { if (b == self->button_down && self->button_down->state == 0) { self->button_down->state = 1; xrdp_bitmap_invalidate(self->button_down, 0); } else if (b != self->button_down) { self->button_down->state = 0; xrdp_bitmap_invalidate(self->button_down, 0); } } if (b != 0) { if (!self->dragging) { if (b->pointer != self->current_pointer) { xrdp_wm_set_pointer(self, b->pointer); self->current_pointer = b->pointer; } xrdp_bitmap_def_proc(b, WM_MOUSEMOVE, xrdp_bitmap_from_screenx(b, x), xrdp_bitmap_from_screeny(b, y)); if (self->button_down == 0) { if (b->notify != 0) { b->notify(b->owner, b, 2, x, y); } } } } return 0; } /*****************************************************************************/ static int xrdp_wm_clear_popup(struct xrdp_wm *self) { int i; struct xrdp_rect rect; //struct xrdp_bitmap* b; //b = 0; if (self->popup_wnd != 0) { //b = self->popup_wnd->popped_from; i = list_index_of(self->screen->child_list, (long)self->popup_wnd); list_remove_item(self->screen->child_list, i); MAKERECT(rect, self->popup_wnd->left, self->popup_wnd->top, self->popup_wnd->width, self->popup_wnd->height); xrdp_bitmap_invalidate(self->screen, &rect); xrdp_bitmap_delete(self->popup_wnd); } //xrdp_wm_set_focused(self, b->parent); return 0; } /*****************************************************************************/ int xrdp_wm_mouse_touch(struct xrdp_wm *self, int gesture, int param) { LOG(LOG_LEVEL_DEBUG, "mouse touch event gesture %d param %d", gesture, param); switch (gesture) { case TOUCH_TWO_FINGERS_UP: case TOUCH_TWO_FINGERS_DOWN: self->mm->mod->mod_event(self->mm->mod, WM_TOUCH_VSCROLL, self->mouse_x, self->mouse_y, param, 0); break; case TOUCH_TWO_FINGERS_RIGHT: case TOUCH_TWO_FINGERS_LEFT: self->mm->mod->mod_event(self->mm->mod, WM_TOUCH_HSCROLL, self->mouse_x, self->mouse_y, param, 0); break; } return 0; } /*****************************************************************************/ int xrdp_wm_mouse_click(struct xrdp_wm *self, int x, int y, int but, int down) { struct xrdp_bitmap *control; struct xrdp_bitmap *focus_out_control; struct xrdp_bitmap *wnd; int newx; int newy; int oldx; int oldy; if (self == 0) { return 0; } if (x < 0) { x = 0; } if (y < 0) { y = 0; } if (x >= self->screen->width) { x = self->screen->width; } if (y >= self->screen->height) { y = self->screen->height; } if (self->dragging && but == 1 && !down && self->dragging_window != 0) { /* if done dragging */ self->draggingx = x; self->draggingy = y; newx = self->draggingx - self->draggingdx; newy = self->draggingy - self->draggingdy; oldx = self->dragging_window->left; oldy = self->dragging_window->top; /* draw xor box one more time */ if (self->draggingxorstate) { xrdp_wm_xor_pat(self, newx, newy, self->draggingcx, self->draggingcy); } self->draggingxorstate = 0; /* move screen to new location */ xrdp_wm_move_window(self, self->dragging_window, newx - oldx, newy - oldy); self->dragging_window = 0; self->dragging = 0; } wnd = 0; control = xrdp_wm_at_pos(self->screen, x, y, &wnd); if (control == 0) { if (self->mm->mod != 0) /* if screen is mod controlled */ { if (self->mm->mod->mod_event != 0) { if (down) { self->mm->mod->mod_event(self->mm->mod, WM_MOUSEMOVE, x, y, 0, 0); } if (but == 1 && down) { self->mm->mod->mod_event(self->mm->mod, WM_LBUTTONDOWN, x, y, 0, 0); } else if (but == 1 && !down) { self->mm->mod->mod_event(self->mm->mod, WM_LBUTTONUP, x, y, 0, 0); } if (but == 2 && down) { self->mm->mod->mod_event(self->mm->mod, WM_RBUTTONDOWN, x, y, 0, 0); } else if (but == 2 && !down) { self->mm->mod->mod_event(self->mm->mod, WM_RBUTTONUP, x, y, 0, 0); } if (but == 3 && down) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON3DOWN, x, y, 0, 0); } else if (but == 3 && !down) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON3UP, x, y, 0, 0); } if (but == 8 && down) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON8DOWN, x, y, 0, 0); } else if (but == 8 && !down) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON8UP, x, y, 0, 0); } if (but == 9 && down) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON9DOWN, x, y, 0, 0); } else if (but == 9 && !down) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON9UP, x, y, 0, 0); } /* vertical scroll */ if (but == 4) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON4DOWN, self->mouse_x, self->mouse_y, 0, 0); self->mm->mod->mod_event(self->mm->mod, WM_BUTTON4UP, self->mouse_x, self->mouse_y, 0, 0); } if (but == 5) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON5DOWN, self->mouse_x, self->mouse_y, 0, 0); self->mm->mod->mod_event(self->mm->mod, WM_BUTTON5UP, self->mouse_x, self->mouse_y, 0, 0); } /* horizontal scroll */ if (but == 6) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON6DOWN, self->mouse_x, self->mouse_y, 0, 0); self->mm->mod->mod_event(self->mm->mod, WM_BUTTON6UP, self->mouse_x, self->mouse_y, 0, 0); } if (but == 7) { self->mm->mod->mod_event(self->mm->mod, WM_BUTTON7DOWN, self->mouse_x, self->mouse_y, 0, 0); self->mm->mod->mod_event(self->mm->mod, WM_BUTTON7UP, self->mouse_x, self->mouse_y, 0, 0); } } } } if (self->popup_wnd != 0) { if (self->popup_wnd == control && !down) { xrdp_bitmap_def_proc(self->popup_wnd, WM_LBUTTONUP, x, y); xrdp_wm_clear_popup(self); self->button_down = 0; return 0; } else if (self->popup_wnd != control && down) { xrdp_wm_clear_popup(self); self->button_down = 0; return 0; } } if (control != 0) { if (wnd != 0) { if (wnd->modal_dialog != 0) /* if window has a modal dialog */ { return 0; } if (control == wnd) { } else if (control->tab_stop) { focus_out_control = wnd->focused_control; wnd->focused_control = control; xrdp_bitmap_invalidate(focus_out_control, 0); xrdp_bitmap_invalidate(control, 0); } } if ((control->type == WND_TYPE_BUTTON || control->type == WND_TYPE_COMBO) && but == 1 && !down && self->button_down == control) { /* if clicking up on a button that was clicked down */ self->button_down = 0; control->state = 0; xrdp_bitmap_invalidate(control, 0); if (control->parent != 0) { if (control->parent->notify != 0) { /* control can be invalid after this */ control->parent->notify(control->owner, control, 1, x, y); } } } else if ((control->type == WND_TYPE_BUTTON || control->type == WND_TYPE_COMBO) && but == 1 && down) { /* if clicking down on a button or combo */ self->button_down = control; control->state = 1; xrdp_bitmap_invalidate(control, 0); if (control->type == WND_TYPE_COMBO) { xrdp_wm_pu(self, control); } } else if (but == 1 && down) { if (self->popup_wnd == 0) { xrdp_wm_set_focused(self, wnd); if (control->type == WND_TYPE_WND && y < (control->top + 21)) { /* if dragging */ if (self->dragging) /* rarely happens */ { newx = self->draggingx - self->draggingdx; newy = self->draggingy - self->draggingdy; if (self->draggingxorstate) { xrdp_wm_xor_pat(self, newx, newy, self->draggingcx, self->draggingcy); } self->draggingxorstate = 0; } self->dragging = 1; self->dragging_window = control; self->draggingorgx = control->left; self->draggingorgy = control->top; self->draggingx = x; self->draggingy = y; self->draggingdx = x - control->left; self->draggingdy = y - control->top; self->draggingcx = control->width; self->draggingcy = control->height; } } } } else { xrdp_wm_set_focused(self, 0); } /* no matter what, mouse is up, reset button_down */ if (but == 1 && !down && self->button_down != 0) { self->button_down = 0; } return 0; } /*****************************************************************************/ int xrdp_wm_key(struct xrdp_wm *self, int device_flags, int scan_code) { int msg; struct xrdp_key_info *ki; /*g_printf("count %d\n", self->key_down_list->count);*/ scan_code = scan_code % 128; if (self->popup_wnd != 0) { xrdp_wm_clear_popup(self); return 0; } // workaround odd shift behavior // see https://github.com/neutrinolabs/xrdp/issues/397 if (scan_code == 42 && device_flags == (KBD_FLAG_UP | KBD_FLAG_EXT)) { return 0; } if (device_flags & KBD_FLAG_UP) /* 0x8000 */ { self->keys[scan_code] = 0; msg = WM_KEYUP; } else /* key down */ { self->keys[scan_code] = 1 | device_flags; msg = WM_KEYDOWN; switch (scan_code) { case 58: self->caps_lock = !self->caps_lock; break; /* caps lock */ case 69: self->num_lock = !self->num_lock; break; /* num lock */ case 70: self->scroll_lock = !self->scroll_lock; break; /* scroll lock */ } } if (self->mm->mod != 0) { if (self->mm->mod->mod_event != 0) { ki = get_key_info_from_scan_code (device_flags, scan_code, self->keys, self->caps_lock, self->num_lock, self->scroll_lock, &(self->keymap)); if (ki != 0) { self->mm->mod->mod_event(self->mm->mod, msg, ki->chr, ki->sym, scan_code, device_flags); } } } else if (self->focused_window != 0) { xrdp_bitmap_def_proc(self->focused_window, msg, scan_code, device_flags); } return 0; } /*****************************************************************************/ /* happens when client gets focus and sends key modifier info */ int xrdp_wm_key_sync(struct xrdp_wm *self, int device_flags, int key_flags) { self->num_lock = 0; self->scroll_lock = 0; self->caps_lock = 0; if (key_flags & 1) { self->scroll_lock = 1; } if (key_flags & 2) { self->num_lock = 1; } if (key_flags & 4) { self->caps_lock = 1; } if (self->mm->mod != 0) { if (self->mm->mod->mod_event != 0) { self->mm->mod->mod_event(self->mm->mod, WM_KEYBRD_SYNC, key_flags, device_flags, key_flags, device_flags); } } return 0; } /*****************************************************************************/ static int xrdp_wm_key_unicode(struct xrdp_wm *self, int device_flags, char32_t unicode) { int index; for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++) { if (unicode == self->keymap.keys_noshift[index].chr) { xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); return 0; } } for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++) { if (unicode == self->keymap.keys_shift[index].chr) { if (device_flags & KBD_FLAG_UP) { xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); xrdp_wm_key(self, KBD_FLAG_UP, XR_RDP_SCAN_LSHIFT); } else { xrdp_wm_key(self, KBD_FLAG_DOWN, XR_RDP_SCAN_LSHIFT); xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); } return 0; } } for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++) { if (unicode == self->keymap.keys_altgr[index].chr) { if (device_flags & KBD_FLAG_UP) { xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT, XR_RDP_SCAN_ALT); } else { xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT, XR_RDP_SCAN_ALT); xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); } return 0; } } for (index = XR_MIN_KEY_CODE; index < XR_MAX_KEY_CODE; index++) { if (unicode == self->keymap.keys_shiftaltgr[index].chr) { if (device_flags & KBD_FLAG_UP) { xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); xrdp_wm_key(self, KBD_FLAG_UP | KBD_FLAG_EXT, XR_RDP_SCAN_ALT); xrdp_wm_key(self, KBD_FLAG_UP, XR_RDP_SCAN_LSHIFT); } else { xrdp_wm_key(self, KBD_FLAG_DOWN, XR_RDP_SCAN_LSHIFT); xrdp_wm_key(self, KBD_FLAG_DOWN | KBD_FLAG_EXT, XR_RDP_SCAN_ALT); xrdp_wm_key(self, device_flags, index - XR_MIN_KEY_CODE); } return 0; } } return 0; } /*****************************************************************************/ int xrdp_wm_pu(struct xrdp_wm *self, struct xrdp_bitmap *control) { int x; int y; if (self == 0) { return 0; } if (control == 0) { return 0; } self->popup_wnd = xrdp_bitmap_create(control->width, DEFAULT_WND_SPECIAL_H, self->screen->bpp, WND_TYPE_SPECIAL, self); self->popup_wnd->popped_from = control; self->popup_wnd->parent = self->screen; self->popup_wnd->owner = self->screen; x = xrdp_bitmap_to_screenx(control, 0); y = xrdp_bitmap_to_screeny(control, 0); self->popup_wnd->left = x; self->popup_wnd->top = y + control->height; self->popup_wnd->item_index = control->item_index; list_insert_item(self->screen->child_list, 0, (long)self->popup_wnd); xrdp_bitmap_invalidate(self->popup_wnd, 0); return 0; } /*****************************************************************************/ static int xrdp_wm_process_input_mouse(struct xrdp_wm *self, int device_flags, int x, int y) { LOG_DEVEL(LOG_LEVEL_TRACE, "mouse event flags %4.4x x %d y %d", device_flags, x, y); if (device_flags & PTRFLAGS_MOVE) { xrdp_wm_mouse_move(self, x, y); } if (device_flags & PTRFLAGS_BUTTON1) { if (device_flags & PTRFLAGS_DOWN) { xrdp_wm_mouse_click(self, x, y, 1, 1); } else { xrdp_wm_mouse_click(self, x, y, 1, 0); } } if (device_flags & PTRFLAGS_BUTTON2) { if (device_flags & PTRFLAGS_DOWN) { xrdp_wm_mouse_click(self, x, y, 2, 1); } else { xrdp_wm_mouse_click(self, x, y, 2, 0); } } if (device_flags & PTRFLAGS_BUTTON3) { if (device_flags & PTRFLAGS_DOWN) { xrdp_wm_mouse_click(self, x, y, 3, 1); } else { xrdp_wm_mouse_click(self, x, y, 3, 0); } } /* vertical mouse wheel */ if (device_flags & PTRFLAGS_WHEEL) { int delta = 0; if (device_flags & PTRFLAGS_WHEEL_NEGATIVE) { /** * [MS-RDPBCGR] 2.2.8.1.1.3.1.1.3 Mouse Event (TS_POINTER_EVENT) * In negative scrolling, rotation distance is negative and the delta * is represented by the lowest byte. * Examples: * device_flags = 0x020a, positive vertical scrolling, distance 10 * device_flags = 0x03f6, negative vertical scrolling, distance -10 * * The negative number is represented by complement. */ delta = (device_flags & WheelRotationMask) | ~WheelRotationMask; if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm)) { // Use nature scrolling, up direction is negative. xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_UP, delta); } else { xrdp_wm_mouse_click(self, 0, 0, 5, 0); } } else { delta = device_flags & WheelRotationMask; if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm)) { xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_DOWN, delta); } else { xrdp_wm_mouse_click(self, 0, 0, 4, 0); } } } /* horizontal mouse wheel */ /** * As mstsc does MOUSE not MOUSEX for horizontal scrolling, * PTRFLAGS_HWHEEL must be handled here. */ if (device_flags & PTRFLAGS_HWHEEL) { int delta = 0; if (device_flags & PTRFLAGS_WHEEL_NEGATIVE) { /** * [MS-RDPBCGR] 2.2.8.1.1.3.1.1.3 Mouse Event (TS_POINTER_EVENT) * In negative scrolling, rotation distance is negative and the delta * is represented by the lowest byte. * Examples: * device_flags = 0x040a, positive horizontal scrolling, distance 10 * device_flags = 0x05f6, negative horizontal scrolling, distance -10 * * The negative number is represented by complement. */ delta = (device_flags & WheelRotationMask) | ~WheelRotationMask; if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm)) { // Use nature scrolling, right direction is negative. xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_RIGHT, delta); } else { xrdp_wm_mouse_click(self, 0, 0, 6, 0); } } else { delta = device_flags & WheelRotationMask; if (delta != 0 && XRDP_MM_IMPLEMENTS_TOUCH(self->mm)) { xrdp_wm_mouse_touch(self, TOUCH_TWO_FINGERS_LEFT, delta); } else { xrdp_wm_mouse_click(self, 0, 0, 7, 0); } } } return 0; } /*****************************************************************************/ static int xrdp_wm_process_input_mousex(struct xrdp_wm *self, int device_flags, int x, int y) { if (device_flags & PTRXFLAGS_DOWN) { if (device_flags & PTRXFLAGS_BUTTON1) { xrdp_wm_mouse_click(self, x, y, 8, 1); } else if (device_flags & PTRXFLAGS_BUTTON2) { xrdp_wm_mouse_click(self, x, y, 9, 1); } } else { if (device_flags & PTRXFLAGS_BUTTON1) { xrdp_wm_mouse_click(self, x, y, 8, 0); } else if (device_flags & PTRXFLAGS_BUTTON2) { xrdp_wm_mouse_click(self, x, y, 9, 0); } } return 0; } /******************************************************************************/ /* param1 = MAKELONG(channel_id, flags) param2 = size param3 = pointer to data param4 = total size */ static int xrdp_wm_process_channel_data(struct xrdp_wm *self, tbus param1, tbus param2, tbus param3, tbus param4) { int rv; rv = 1; if (self->mm->mod != 0) { if (self->mm->use_chansrv) { rv = xrdp_mm_process_channel_data(self->mm, param1, param2, param3, param4); } else { if (self->mm->mod->mod_event != 0) { rv = self->mm->mod->mod_event(self->mm->mod, WM_CHANNEL_DATA, param1, param2, param3, param4); } } } return rv; } /******************************************************************************/ /* this is the callbacks coming from libxrdp.so */ int callback(intptr_t id, int msg, intptr_t param1, intptr_t param2, intptr_t param3, intptr_t param4) { int rv; struct xrdp_wm *wm; struct xrdp_rect rect; if (id == 0) /* "id" should be "struct xrdp_process*" as long */ { return 0; } wm = ((struct xrdp_process *)id)->wm; if (wm == 0) { return 0; } rv = 0; switch (msg) { case RDP_INPUT_SYNCHRONIZE: rv = xrdp_wm_key_sync(wm, param3, param1); break; case RDP_INPUT_SCANCODE: rv = xrdp_wm_key(wm, param3, param1); break; case RDP_INPUT_UNICODE: rv = xrdp_wm_key_unicode(wm, param3, param1); break; case RDP_INPUT_MOUSE: rv = xrdp_wm_process_input_mouse(wm, param3, param1, param2); break; case RDP_INPUT_MOUSEX: rv = xrdp_wm_process_input_mousex(wm, param3, param1, param2); break; case 0x4444: /* invalidate, this is not from RDP_DATA_PDU_INPUT */ /* like the rest, it's from RDP_PDU_DATA with code 33 */ /* it's the rdp client asking for a screen update */ MAKERECT(rect, param1, param2, param3, param4); rv = xrdp_bitmap_invalidate(wm->screen, &rect); break; case 0x5555: /* called from xrdp_channel.c, channel data has come in, pass it to module if there is one */ rv = xrdp_wm_process_channel_data(wm, param1, param2, param3, param4); break; case 0x5556: rv = xrdp_mm_check_chan(wm->mm); break; case 0x5557: LOG(LOG_LEVEL_TRACE, "callback: frame ack %p", (void *) param1); xrdp_mm_frame_ack(wm->mm, param1); break; case 0x5558: xrdp_mm_drdynvc_up(wm->mm); break; case 0x5559: xrdp_mm_suppress_output(wm->mm, param1, LOWORD(param2), HIWORD(param2), LOWORD(param3), HIWORD(param3)); case 0x555a: // "yeah, up_and_running" xrdp_mm_up_and_running(wm->mm); break; } return rv; } /******************************************************************************/ /* returns error */ /* this gets called when there is nothing on any socket */ static int xrdp_wm_login_state_changed(struct xrdp_wm *self) { if (self == 0) { return 0; } LOG(LOG_LEVEL_DEBUG, "Login state has changed to %s", xrdp_wm_login_state_to_str(self->login_state)); if (self->login_state == WMLS_RESET) { list_clear(self->log); xrdp_wm_delete_all_children(self); self->dragging = 0; if (self->fatal_error_in_log_window) { /* We've got here after OK is pressed in the log * window, so the user has read the message(s) in it */ g_set_wait_obj(self->pro_layer->self_term_event); } else { /* this is the initial state of the login window */ xrdp_wm_set_login_state(self, WMLS_USER_PROMPT); xrdp_wm_init(self); } } else if (self->login_state == WMLS_START_CONNECT) { xrdp_wm_delete_all_children(self); self->dragging = 0; xrdp_wm_set_login_state(self, WMLS_CONNECT_IN_PROGRESS); /* This calls back to xrdp_wm_mod_connect_done() when the * connect is finished*/ xrdp_mm_connect(self->mm); } else if (self->login_state == WMLS_CLEANUP) { xrdp_wm_delete_all_children(self); self->dragging = 0; xrdp_wm_set_login_state(self, WMLS_INACTIVE); } return 0; } /******************************************************************************/ /* this gets called when the module manager finishes a connect * which was initiated by xrdp_mm_connect() */ void xrdp_wm_mod_connect_done(struct xrdp_wm *self, int status) { LOG(LOG_LEVEL_DEBUG, "status from xrdp_mm_connect() : %d", status); if (status == 0) { xrdp_wm_set_login_state(self, WMLS_CLEANUP); self->dragging = 0; } else { xrdp_wm_set_login_state(self, WMLS_INACTIVE); xrdp_wm_show_log(self); } } /*****************************************************************************/ /* this is the log windows notify function */ static int xrdp_wm_log_wnd_notify(struct xrdp_bitmap *wnd, struct xrdp_bitmap *sender, int msg, long param1, long param2) { struct xrdp_painter *painter; struct xrdp_wm *wm; struct xrdp_rect rect; int index; char *text; if (wnd == 0) { return 0; } if (sender == 0) { return 0; } if (wnd->owner == 0) { return 0; } wm = wnd->wm; if (msg == 1) /* click */ { if (sender->id == 1) /* ok button */ { /* close the log window */ MAKERECT(rect, wnd->left, wnd->top, wnd->width, wnd->height); xrdp_bitmap_delete(wnd); xrdp_bitmap_invalidate(wm->screen, &rect); /* if module is gone, reset the session when ok is clicked */ if (wm->mm->mod_handle == 0) { /* make sure autologin is off */ wm->session->client_info->rdp_autologin = 0; xrdp_wm_set_login_state(wm, WMLS_RESET); /* reset session */ } } } else if (msg == WM_PAINT) /* 3 */ { painter = (struct xrdp_painter *)param1; if (painter != 0) { unsigned int row_height = xrdp_painter_font_body_height(painter); painter->fg_color = wnd->wm->black; for (index = 0; index < wnd->wm->log->count; index++) { text = (char *)list_get_item(wnd->wm->log, index); xrdp_painter_draw_text(painter, wnd, 10, (index + 2) * row_height, text); } } } return 0; } static void add_string_to_logwindow(const char *msg, struct list *log) { const char *new_part_message; const char *current_pointer = msg; int len_done = 0; do { new_part_message = g_strndup(current_pointer, LOG_WINDOW_CHAR_PER_LINE); list_add_item(log, (tintptr) new_part_message); len_done += g_strlen(new_part_message); current_pointer += g_strlen(new_part_message); } while ((len_done < g_strlen(msg)) && (len_done < DEFAULT_STRING_LEN)); } /*****************************************************************************/ int xrdp_wm_show_log(struct xrdp_wm *self) { struct xrdp_bitmap *but; int w; int h; int xoffset; int yoffset; uint32_t index; int primary_x_offset; int primary_y_offset; if (self->hide_log_window) { /* make sure autologin is off */ self->session->client_info->rdp_autologin = 0; xrdp_wm_set_login_state(self, WMLS_RESET); /* reset session */ return 0; } if (self->log_wnd == 0) { w = self->xrdp_config->cfg_globals.ls_scaled.log_wnd_width; h = self->xrdp_config->cfg_globals.ls_scaled.log_wnd_height; xoffset = 10; yoffset = 10; if (self->screen->width < w) { w = self->screen->width - 4; xoffset = 2; } if (self->screen->height < h) { h = self->screen->height - 4; yoffset = 2; } primary_x_offset = 0; primary_y_offset = 0; /* multimon scenario, draw log window on primary monitor */ if (self->client_info->display_sizes.monitorCount > 1) { for (index = 0; index < self->client_info->display_sizes.monitorCount; index++) { if (self->client_info->display_sizes.minfo_wm[index].is_primary) { primary_x_offset = self->client_info->display_sizes.minfo_wm[index].left; primary_y_offset = self->client_info->display_sizes.minfo_wm[index].top; break; } } } /* log window */ self->log_wnd = xrdp_bitmap_create(w, h, self->screen->bpp, WND_TYPE_WND, self); list_add_item(self->screen->child_list, (long)self->log_wnd); self->log_wnd->parent = self->screen; self->log_wnd->owner = self->screen; self->log_wnd->bg_color = self->grey; self->log_wnd->left = primary_x_offset + xoffset; self->log_wnd->top = primary_y_offset + yoffset; set_string(&(self->log_wnd->caption1), "Connection Log"); /* ok button */ const char *ok_string = "OK"; const int ok_height = self->xrdp_config->cfg_globals.ls_scaled.default_btn_height; const int ok_width = xrdp_painter_text_width(self->painter, ok_string) + DEFAULT_BUTTON_MARGIN_W; but = xrdp_bitmap_create(ok_width, ok_height, self->screen->bpp, WND_TYPE_BUTTON, self); list_insert_item(self->log_wnd->child_list, 0, (long)but); but->parent = self->log_wnd; but->owner = self->log_wnd; but->left = (w - ok_width) - xoffset; but->top = (h - ok_height) - yoffset; but->id = 1; but->tab_stop = 1; set_string(&but->caption1, "OK"); self->log_wnd->focused_control = but; /* set notify function */ self->log_wnd->notify = xrdp_wm_log_wnd_notify; } xrdp_wm_set_focused(self, self->log_wnd); xrdp_bitmap_invalidate(self->log_wnd, 0); return 0; } /*****************************************************************************/ int xrdp_wm_log_msg(struct xrdp_wm *self, enum logLevels loglevel, const char *fmt, ...) { va_list ap; char msg[256]; va_start(ap, fmt); vsnprintf(msg, sizeof(msg), fmt, ap); va_end(ap); LOG(loglevel, "xrdp_wm_log_msg: %s", msg); add_string_to_logwindow(msg, self->log); return 0; } /*****************************************************************************/ int xrdp_wm_get_wait_objs(struct xrdp_wm *self, tbus *robjs, int *rc, tbus *wobjs, int *wc, int *timeout) { int i; if (self == 0) { return 0; } i = *rc; robjs[i++] = self->login_state_event; *rc = i; return xrdp_mm_get_wait_objs(self->mm, robjs, rc, wobjs, wc, timeout); } /******************************************************************************/ int xrdp_wm_check_wait_objs(struct xrdp_wm *self) { int rv; if (self == 0) { return 0; } rv = 0; if (g_is_wait_obj_set(self->login_state_event)) { g_reset_wait_obj(self->login_state_event); xrdp_wm_login_state_changed(self); } if (rv == 0) { rv = xrdp_mm_check_wait_objs(self->mm); } return rv; } /*****************************************************************************/ const char * xrdp_wm_login_state_to_str(enum wm_login_state login_state) { const char *result = "unknown"; /* Use a switch for this, as some compilers will warn about missing states */ switch (login_state) { case WMLS_RESET: result = "WMLS_RESET"; break; case WMLS_USER_PROMPT: result = "WMLS_USER_PROMPT"; break; case WMLS_START_CONNECT: result = "WMLS_START_CONNECT"; break; case WMLS_CONNECT_IN_PROGRESS: result = "WMLS_CONNECT_IN_PROGRESS"; break; case WMLS_CLEANUP: result = "WMLS_CLEANUP"; break; case WMLS_INACTIVE: result = "WMLS_INACTIVE"; } return result; } /*****************************************************************************/ int xrdp_wm_set_login_state(struct xrdp_wm *self, enum wm_login_state login_state) { LOG(LOG_LEVEL_DEBUG, "Login state change request %s -> %s", xrdp_wm_login_state_to_str(self->login_state), xrdp_wm_login_state_to_str(login_state)); self->login_state = login_state; g_set_wait_obj(self->login_state_event); return 0; } int xrdp_wm_can_resize(struct xrdp_wm *self) { if (self->login_state != WMLS_CLEANUP && self->login_state != WMLS_INACTIVE) { LOG(LOG_LEVEL_INFO, "Not allowing resize. Login in progress."); LOG_DEVEL(LOG_LEVEL_INFO, "State is %s", xrdp_wm_login_state_to_str(self->login_state)); return 0; } return 1; } xrdp-0.10.1/xrdp/xrdp_egfx.h000644 001751 000000 00000022774 14652432047 015765 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2019 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * MS-RDPEGFX */ /** * * @file xrdp_egfx.h * @brief Stream function headers for the EGFX extension to the MSRDP protocol. * @author Jay Sorg, Christopher Pitstick * */ #ifndef _XRDP_EGFX_H #define _XRDP_EGFX_H #include "xrdp.h" #define XR_RDPGFX_CAPVERSION_8 0x00080004 #define XR_RDPGFX_CAPVERSION_81 0x00080105 #define XR_RDPGFX_CAPVERSION_10 0x000A0002 #define XR_RDPGFX_CAPVERSION_101 0x000A0100 #define XR_RDPGFX_CAPVERSION_102 0x000A0200 #define XR_RDPGFX_CAPVERSION_103 0x000A0301 #define XR_RDPGFX_CAPVERSION_104 0x000A0400 #define XR_RDPGFX_CAPVERSION_105 0x000A0502 #define XR_RDPGFX_CAPVERSION_106 0x000A0600 #define XR_RDPGFX_CAPVERSION_107 0x000A0701 #define XR_PIXEL_FORMAT_XRGB_8888 0x20 #define XR_PIXEL_FORMAT_ARGB_8888 0x21 #define XR_RDPGFX_CAPS_FLAG_THINCLIENT 0x00000001 #define XR_RDPGFX_CAPS_FLAG_SMALL_CACHE 0x00000002 #define XR_RDPGFX_CAPS_FLAG_AVC420_ENABLED 0x00000010 #define XR_RDPGFX_CAPS_FLAG_AVC_DISABLED 0x00000020 #define XR_RDPGFX_CAPS_FLAG_AVC_THINCLIENT 0x00000040 #define XR_RDPGFX_CMDID_WIRETOSURFACE_1 0x0001 #define XR_RDPGFX_CMDID_WIRETOSURFACE_2 0x0002 #define XR_RDPGFX_CMDID_DELETEENCODINGCONTEXT 0x0003 #define XR_RDPGFX_CMDID_SOLIDFILL 0x0004 #define XR_RDPGFX_CMDID_SURFACETOSURFACE 0x0005 #define XR_RDPGFX_CMDID_SURFACETOCACHE 0x0006 #define XR_RDPGFX_CMDID_CACHETOSURFACE 0x0007 #define XR_RDPGFX_CMDID_EVICTCACHEENTRY 0x0008 #define XR_RDPGFX_CMDID_CREATESURFACE 0x0009 #define XR_RDPGFX_CMDID_DELETESURFACE 0x000A #define XR_RDPGFX_CMDID_STARTFRAME 0x000B #define XR_RDPGFX_CMDID_ENDFRAME 0x000C #define XR_RDPGFX_CMDID_FRAMEACKNOWLEDGE 0x000D #define XR_RDPGFX_CMDID_RESETGRAPHICS 0x000E #define XR_RDPGFX_CMDID_MAPSURFACETOOUTPUT 0x000F #define XR_RDPGFX_CMDID_CACHEIMPORTOFFER 0x0010 #define XR_RDPGFX_CMDID_CACHEIMPORTREPLY 0x0011 #define XR_RDPGFX_CMDID_CAPSADVERTISE 0x0012 #define XR_RDPGFX_CMDID_CAPSCONFIRM 0x0013 #define XR_RDPGFX_CMDID_MAPSURFACETOWINDOW 0x0015 #define XR_RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE 0x0016 #define XR_RDPGFX_CMDID_MAPSURFACETOSCALEDOUTPUT 0x0017 #define XR_RDPGFX_CMDID_MAPSURFACETOSCALEDWINDOW 0x0018 #define XR_QUEUE_DEPTH_UNAVAILABLE 0x00000000 #define XR_SUSPEND_FRAME_ACKNOWLEDGEMENT 0xFFFFFFFF /* The bitmap data encapsulated in the bitmapData field is uncompressed. Pixels in the uncompressed data are ordered from left to right and then top to bottom. */ #define XR_RDPGFX_CODECID_UNCOMPRESSED 0x0000 /* The bitmap data encapsulated in the bitmapData field is compressed using the RemoteFX Codec ([MS-RDPRFX] sections 2.2.1 and 3.1.8). Note that the TS_RFX_RECT ([MS-RDPRFX] section 2.2.2.1.6) structures encapsulated in the bitmapData field MUST all be relative to the top-left corner of the rectangle defined by the destRect field. */ #define XR_RDPGFX_CODECID_CAVIDEO 0x0003 /* The bitmap data encapsulated in the bitmapData field is compressed using the ClearCodec Codec (sections 2.2.4.1 and 3.3.8.1). */ #define XR_RDPGFX_CODECID_CLEARCODEC 0x0008 /* The bitmap data encapsulated in the bitmapData field is compressed using the Planar Codec ([MS-RDPEGDI] sections 2.2.2.5.1 and 3.1.9). */ #define XR_RDPGFX_CODECID_PLANAR 0x000A /* The bitmap data encapsulated in the bitmapData field is compressed using the MPEG-4 AVC/H.264 Codec in YUV420p mode (section 2.2.4.4). */ #define XR_RDPGFX_CODECID_AVC420 0x000B /* The bitmap data encapsulated in the bitmapData field is compressed using the Alpha Codec (section 2.2.4.3). */ #define XR_RDPGFX_CODECID_ALPHA 0x000C /* The bitmap data encapsulated in the bitmapData field is compressed using the MPEG-4 AVC/H.264 Codec in YUV444 mode (section 2.2.4.5). */ #define XR_RDPGFX_CODECID_AVC444 0x000E /* The bitmap data encapsulated in the bitmapData field is compressed using the MPEG-4 AVC/H.264 Codec in YUV444v2 mode (section 2.2.4.6). */ #define XR_RDPGFX_CODECID_AVC444V2 0x000F struct xrdp_egfx_rect { short x1; short y1; short x2; short y2; }; struct xrdp_egfx_point { short x; short y; }; struct xrdp_egfx { struct xrdp_session *session; int channel_id; int surface_id; int frame_id; struct stream *s; void *user; struct xrdp_egfx_bulk *bulk; int (*caps_advertise)(void *user, int num_caps, int *version, int *flags); int (*frame_ack)(void *user, uint32_t queue_depth, int frame_id, int frames_decoded); }; struct xrdp_egfx_bulk { int id; }; int xrdp_egfx_send_data(struct xrdp_egfx *egfx, const char *data, int bytes); int xrdp_egfx_send_s(struct xrdp_egfx *egfx, struct stream *s); int xrdp_egfx_create(struct xrdp_mm *mm, struct xrdp_egfx **egfx); int xrdp_egfx_shutdown_delete_surface(struct xrdp_egfx *egfx); int xrdp_egfx_shutdown_close_connection(struct xrdp_egfx *egfx); int xrdp_egfx_shutdown_delete(struct xrdp_egfx *egfx); int xrdp_egfx_shutdown_full(struct xrdp_egfx *egfx); struct stream * xrdp_egfx_create_surface(struct xrdp_egfx_bulk *bulk, int surface_id, int width, int height, int pixel_format); int xrdp_egfx_send_create_surface(struct xrdp_egfx *egfx, int surface_id, int width, int height, int pixel_format); struct stream * xrdp_egfx_delete_surface(struct xrdp_egfx_bulk *bulk, int surface_id); int xrdp_egfx_send_delete_surface(struct xrdp_egfx *egfx, int surface_id); struct stream * xrdp_egfx_map_surface(struct xrdp_egfx_bulk *bulk, int surface_id, int x, int y); int xrdp_egfx_send_map_surface(struct xrdp_egfx *egfx, int surface_id, int x, int y); struct stream * xrdp_egfx_fill_surface(struct xrdp_egfx_bulk *bulk, int surface_id, int fill_color, int num_rects, const struct xrdp_egfx_rect *rects); int xrdp_egfx_send_fill_surface(struct xrdp_egfx *egfx, int surface_id, int fill_color, int num_rects, const struct xrdp_egfx_rect *rects); struct stream * xrdp_egfx_surface_to_surface(struct xrdp_egfx_bulk *bulk, int src_surface_id, int dst_surface_id, const struct xrdp_egfx_rect *src_rect, int num_dst_points, const struct xrdp_egfx_point *dst_points); int xrdp_egfx_send_surface_to_surface(struct xrdp_egfx *egfx, int src_surface_id, int dst_surface_id, const struct xrdp_egfx_rect *src_rect, int num_dst_points, const struct xrdp_egfx_point *dst_points); struct stream * xrdp_egfx_frame_start(struct xrdp_egfx_bulk *bulk, int frame_id, int timestamp); int xrdp_egfx_send_frame_start(struct xrdp_egfx *egfx, int frame_id, int timestamp); struct stream * xrdp_egfx_frame_end(struct xrdp_egfx_bulk *bulk, int frame_id); int xrdp_egfx_send_frame_end(struct xrdp_egfx *egfx, int frame_id); struct stream * xrdp_egfx_capsconfirm(struct xrdp_egfx_bulk *bulk, int version, int flags); int xrdp_egfx_send_capsconfirm(struct xrdp_egfx *egfx, int version, int flags); struct stream * xrdp_egfx_wire_to_surface1(struct xrdp_egfx_bulk *bulk, int surface_id, int codec_id, int pixel_format, struct xrdp_egfx_rect *dest_rect, void *bitmap_data, int bitmap_data_length); int xrdp_egfx_send_wire_to_surface1(struct xrdp_egfx *egfx, int surface_id, int codec_id, int pixel_format, struct xrdp_egfx_rect *dest_rect, void *bitmap_data, int bitmap_data_length); struct stream * xrdp_egfx_wire_to_surface2(struct xrdp_egfx_bulk *bulk, int surface_id, int codec_id, int codec_context_id, int pixel_format, void *bitmap_data, int bitmap_data_length); int xrdp_egfx_send_wire_to_surface2(struct xrdp_egfx *egfx, int surface_id, int codec_id, int codec_context_id, int pixel_format, void *bitmap_data, int bitmap_data_length); /* * NB: mi below must be such that the (top,left) co-ordinate of * the primary monitor is (0.0) */ struct stream * xrdp_egfx_reset_graphics(struct xrdp_egfx_bulk *bulk, int width, int height, int monitor_count, struct monitor_info *mi); int xrdp_egfx_send_reset_graphics(struct xrdp_egfx *egfx, int width, int height, int monitor_count, struct monitor_info *mi); #endif xrdp-0.10.1/xrdp/Makefile.in000644 001751 000000 00000074274 14652432075 015676 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @XRDP_RFXCODEC_TRUE@am__append_1 = -DXRDP_RFXCODEC \ @XRDP_RFXCODEC_TRUE@ -I$(top_srcdir)/librfxcodec/include @XRDP_RFXCODEC_TRUE@am__append_2 = $(top_builddir)/librfxcodec/src/.libs/librfxencode.a @XRDP_PIXMAN_TRUE@am__append_3 = -DXRDP_PIXMAN $(PIXMAN_CFLAGS) @XRDP_PIXMAN_TRUE@am__append_4 = $(PIXMAN_LIBS) @XRDP_PAINTER_TRUE@am__append_5 = -DXRDP_PAINTER \ @XRDP_PAINTER_TRUE@ -I$(top_srcdir)/libpainter/include @XRDP_PAINTER_TRUE@am__append_6 = $(top_builddir)/libpainter/src/.libs/libpainter.a sbin_PROGRAMS = xrdp$(EXEEXT) subdir = xrdp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_xrdppkgdata_DATA) \ $(dist_xrdpsysconf_DATA) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(xrdppkgdatadir)" \ "$(DESTDIR)$(xrdpsysconfdir)" PROGRAMS = $(sbin_PROGRAMS) am_xrdp_OBJECTS = funcs.$(OBJEXT) lang.$(OBJEXT) xrdp.$(OBJEXT) \ xrdp_bitmap.$(OBJEXT) xrdp_bitmap_load.$(OBJEXT) \ xrdp_bitmap_common.$(OBJEXT) xrdp_cache.$(OBJEXT) \ xrdp_encoder.$(OBJEXT) xrdp_font.$(OBJEXT) \ xrdp_listen.$(OBJEXT) xrdp_login_wnd.$(OBJEXT) \ xrdp_mm.$(OBJEXT) xrdp_painter.$(OBJEXT) \ xrdp_process.$(OBJEXT) xrdp_region.$(OBJEXT) \ xrdp_egfx.$(OBJEXT) xrdp_wm.$(OBJEXT) \ xrdp_main_utils.$(OBJEXT) xrdp_OBJECTS = $(am_xrdp_OBJECTS) am__DEPENDENCIES_1 = @XRDP_PIXMAN_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am__DEPENDENCIES_3 = $(am__append_2) $(am__DEPENDENCIES_2) \ $(am__append_6) xrdp_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(top_builddir)/third_party/tomlc99/libtoml.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/funcs.Po ./$(DEPDIR)/lang.Po \ ./$(DEPDIR)/xrdp.Po ./$(DEPDIR)/xrdp_bitmap.Po \ ./$(DEPDIR)/xrdp_bitmap_common.Po \ ./$(DEPDIR)/xrdp_bitmap_load.Po ./$(DEPDIR)/xrdp_cache.Po \ ./$(DEPDIR)/xrdp_egfx.Po ./$(DEPDIR)/xrdp_encoder.Po \ ./$(DEPDIR)/xrdp_font.Po ./$(DEPDIR)/xrdp_listen.Po \ ./$(DEPDIR)/xrdp_login_wnd.Po ./$(DEPDIR)/xrdp_main_utils.Po \ ./$(DEPDIR)/xrdp_mm.Po ./$(DEPDIR)/xrdp_painter.Po \ ./$(DEPDIR)/xrdp_process.Po ./$(DEPDIR)/xrdp_region.Po \ ./$(DEPDIR)/xrdp_wm.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_SOURCES) DIST_SOURCES = $(xrdp_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } DATA = $(dist_xrdppkgdata_DATA) $(dist_xrdpsysconf_DATA) 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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ czech.txt \ rdp-scan-codes.txt \ xrdpwin.c AM_CPPFLAGS = -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_MODULE_PATH=\"${moduledir}\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" -I$(top_builddir) \ -I$(top_srcdir)/common -I$(top_srcdir)/libipm \ -I$(top_srcdir)/libxrdp -I$(top_srcdir)/third_party \ -I$(top_srcdir)/third_party/tomlc99 $(IMLIB2_CFLAGS) \ $(am__append_1) $(am__append_3) $(am__append_5) XRDP_EXTRA_LIBS = $(am__append_2) $(am__append_4) $(am__append_6) xrdp_SOURCES = \ funcs.c \ lang.c \ xrdp.c \ xrdp.h \ xrdp_bitmap.c \ xrdp_bitmap_load.c \ xrdp_bitmap_common.c \ xrdp_cache.c \ xrdp_encoder.c \ xrdp_encoder.h \ xrdp_font.c \ xrdp_listen.c \ xrdp_login_wnd.c \ xrdp_mm.c \ xrdp_painter.c \ xrdp_process.c \ xrdp_region.c \ xrdp_types.h \ xrdp_egfx.c \ xrdp_egfx.h \ xrdp_wm.c \ xrdp_main_utils.c xrdp_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(top_builddir)/third_party/tomlc99/libtoml.la \ $(IMLIB2_LIBS) \ $(XRDP_EXTRA_LIBS) xrdpsysconfdir = $(sysconfdir)/xrdp @MACOS_FALSE@lib_extension = so @MACOS_TRUE@lib_extension = dylib SUBST_VARS = sed \ -e 's|@lib_extension[@]|$(lib_extension)|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in dist_xrdpsysconf_DATA = \ xrdp.ini \ xrdp_keyboard.ini xrdppkgdatadir = $(datadir)/xrdp dist_xrdppkgdata_DATA = \ ad24b.bmp \ ad256.bmp \ xrdp24b.bmp \ xrdp256.bmp \ xrdp_logo.bmp \ xrdp_logo.png \ README.logo \ sans-10.fv1 \ sans-18.fv1 \ cursor0.cur \ cursor1.cur all: all-am .SUFFIXES: .SUFFIXES: .in .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign xrdp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign xrdp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || 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)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && $(am__rm_f) $$files clean-sbinPROGRAMS: $(am__rm_f) $(sbin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(sbin_PROGRAMS:$(EXEEXT)=) xrdp$(EXEEXT): $(xrdp_OBJECTS) $(xrdp_DEPENDENCIES) $(EXTRA_xrdp_DEPENDENCIES) @rm -f xrdp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_OBJECTS) $(xrdp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/funcs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lang.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_bitmap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_bitmap_common.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_bitmap_load.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_cache.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_egfx.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_encoder.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_font.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_listen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_login_wnd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_main_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_mm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_painter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_process.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_region.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_wm.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_xrdppkgdataDATA: $(dist_xrdppkgdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_xrdppkgdata_DATA)'; test -n "$(xrdppkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xrdppkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xrdppkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xrdppkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xrdppkgdatadir)" || exit $$?; \ done uninstall-dist_xrdppkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xrdppkgdata_DATA)'; test -n "$(xrdppkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xrdppkgdatadir)'; $(am__uninstall_files_from_dir) install-dist_xrdpsysconfDATA: $(dist_xrdpsysconf_DATA) @$(NORMAL_INSTALL) @list='$(dist_xrdpsysconf_DATA)'; test -n "$(xrdpsysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xrdpsysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xrdpsysconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xrdpsysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xrdpsysconfdir)" || exit $$?; \ done uninstall-dist_xrdpsysconfDATA: @$(NORMAL_UNINSTALL) @list='$(dist_xrdpsysconf_DATA)'; test -n "$(xrdpsysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xrdpsysconfdir)'; $(am__uninstall_files_from_dir) 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(xrdppkgdatadir)" "$(DESTDIR)$(xrdpsysconfdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/funcs.Po -rm -f ./$(DEPDIR)/lang.Po -rm -f ./$(DEPDIR)/xrdp.Po -rm -f ./$(DEPDIR)/xrdp_bitmap.Po -rm -f ./$(DEPDIR)/xrdp_bitmap_common.Po -rm -f ./$(DEPDIR)/xrdp_bitmap_load.Po -rm -f ./$(DEPDIR)/xrdp_cache.Po -rm -f ./$(DEPDIR)/xrdp_egfx.Po -rm -f ./$(DEPDIR)/xrdp_encoder.Po -rm -f ./$(DEPDIR)/xrdp_font.Po -rm -f ./$(DEPDIR)/xrdp_listen.Po -rm -f ./$(DEPDIR)/xrdp_login_wnd.Po -rm -f ./$(DEPDIR)/xrdp_main_utils.Po -rm -f ./$(DEPDIR)/xrdp_mm.Po -rm -f ./$(DEPDIR)/xrdp_painter.Po -rm -f ./$(DEPDIR)/xrdp_process.Po -rm -f ./$(DEPDIR)/xrdp_region.Po -rm -f ./$(DEPDIR)/xrdp_wm.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_xrdppkgdataDATA \ install-dist_xrdpsysconfDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS 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 ./$(DEPDIR)/funcs.Po -rm -f ./$(DEPDIR)/lang.Po -rm -f ./$(DEPDIR)/xrdp.Po -rm -f ./$(DEPDIR)/xrdp_bitmap.Po -rm -f ./$(DEPDIR)/xrdp_bitmap_common.Po -rm -f ./$(DEPDIR)/xrdp_bitmap_load.Po -rm -f ./$(DEPDIR)/xrdp_cache.Po -rm -f ./$(DEPDIR)/xrdp_egfx.Po -rm -f ./$(DEPDIR)/xrdp_encoder.Po -rm -f ./$(DEPDIR)/xrdp_font.Po -rm -f ./$(DEPDIR)/xrdp_listen.Po -rm -f ./$(DEPDIR)/xrdp_login_wnd.Po -rm -f ./$(DEPDIR)/xrdp_main_utils.Po -rm -f ./$(DEPDIR)/xrdp_mm.Po -rm -f ./$(DEPDIR)/xrdp_painter.Po -rm -f ./$(DEPDIR)/xrdp_process.Po -rm -f ./$(DEPDIR)/xrdp_region.Po -rm -f ./$(DEPDIR)/xrdp_wm.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_xrdppkgdataDATA \ uninstall-dist_xrdpsysconfDATA uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_xrdppkgdataDATA \ install-dist_xrdpsysconfDATA 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-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_xrdppkgdataDATA uninstall-dist_xrdpsysconfDATA \ uninstall-sbinPROGRAMS .PRECIOUS: Makefile .in: $(subst_verbose)$(SUBST_VARS) $< > $@ # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/ulalaca/UlalacaMessages.hpp000644 001751 000000 00000006236 14652432052 020005 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/05/06. // #ifndef XRDP_ULALACAMESSAGES_HPP #define XRDP_ULALACAMESSAGES_HPP #include #define FIXME_MARK_AS_PACKED_STRUCT __attribute__ ((packed)) struct Rect { short x; short y; short width; short height; } __attribute__ ((packed)); namespace projector { enum MessageType: uint16_t { IN_SCREEN_UPDATE_EVENT = 0x0101, IN_SCREEN_COMMIT_UPDATE = 0x0102, OUT_SCREEN_UPDATE_REQUEST = 0x0201, OUT_KEYBOARD_EVENT = 0x0311, OUT_MOUSE_MOVE_EVENT = 0x0321, OUT_MOUSE_BUTTON_EVENT = 0x0322, OUT_MOUSE_WHEEL_EVENT = 0x0323 }; struct MessageHeader { uint16_t messageType; uint64_t id; uint64_t replyTo; uint64_t timestamp; uint64_t length; } FIXME_MARK_AS_PACKED_STRUCT; /** * incoming message */ struct ScreenUpdateEvent { uint8_t type; Rect rect; } FIXME_MARK_AS_PACKED_STRUCT; struct ScreenCommitUpdate { Rect screenRect; uint64_t bitmapLength; } FIXME_MARK_AS_PACKED_STRUCT; struct ScreenUpdateRequest { static const uint8_t TYPE_ENTIRE_SCREEN = 0; static const uint8_t TYPE_PARTIAL = 1; uint8_t type; Rect rect; }; struct KeyboardEvent { static const uint8_t TYPE_NOOP = 0; static const uint8_t TYPE_KEYUP = 1; static const uint8_t TYPE_KEYDOWN = 2; /** * force releases pressed keys */ static const uint8_t TYPE_RESET = 4; static const uint16_t FLAG_IGNORE_TIMESTAMP_QUEUE = 0b00000001; static const uint16_t FLAG_EMIT_EVENT_USING_KARABINER = 0b00010000; uint8_t type; uint32_t keyCode; uint16_t flags; } FIXME_MARK_AS_PACKED_STRUCT; struct MouseMoveEvent { static const uint16_t FLAG_IGNORE_TIMESTAMP_QUEUE = 0b0001; static const uint16_t FLAG_EMIT_EVENT_USING_KARABINER = 0b00010000; uint16_t x; uint16_t y; uint16_t flags; } FIXME_MARK_AS_PACKED_STRUCT; struct MouseButtonEvent { static const uint8_t TYPE_NOOP = 0; static const uint8_t TYPE_MOUSEUP = 1; static const uint8_t TYPE_MOUSEDOWN = 2; static const uint8_t BUTTON_LEFT = 0; static const uint8_t BUTTON_RIGHT = 1; static const uint8_t BUTTON_MIDDLE = 2; static const uint16_t FLAG_IGNORE_TIMESTAMP_QUEUE = 0b0001; static const uint16_t FLAG_EMIT_EVENT_USING_KARABINER = 0b00010000; // ... uint8_t type; uint8_t button; uint16_t flags; } FIXME_MARK_AS_PACKED_STRUCT; struct MouseWheelEvent { static const uint16_t FLAG_IGNORE_TIMESTAMP_QUEUE = 0b0001; static const uint16_t FLAG_EMIT_EVENT_USING_KARABINER = 0b00010000; int32_t deltaX; int32_t deltaY; uint16_t flags; } FIXME_MARK_AS_PACKED_STRUCT; } #endif //XRDP_ULALACAMESSAGES_HPP xrdp-0.10.1/ulalaca/XrdpTransport.hpp000644 001751 000000 00000002441 14652432052 017577 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/04/30. // #ifndef ULALACA_XRDPTRANSPORT_HPP #define ULALACA_XRDPTRANSPORT_HPP #include #include extern "C" { #include "trans.h" }; #include "XrdpStream.hpp" class XrdpTransport { public: using Transport = trans; using TransportDeleter = std::function; using TransportBus = tbus; template using List = std::vector; XrdpTransport(int mode, int inSize, int outSize); std::unique_ptr> getWaitObjs(); int forceReadS(XrdpStream &inStream, size_t size); int forceWriteS(XrdpStream &outStream); int forceRead(size_t size); int forceWrite(); int writeCopy(); int writeCopyS(XrdpStream &outStream); int connect(std::string server, std::string port, int timeout); int listenAddress(std::string port, std::string address); XrdpStream &getInStream(); XrdpStream &getOutStream(size_t size); int setTLSMode(std::string key, std::string cert, long sslProtocols, std::string tlsCiphers); int shutdownTLSMode(); int tcpForceReadS(XrdpStream &inStream, size_t size); private: std::unique_ptr _transport; }; #endif //ULALACA_XRDPTRANSPORT_HPP xrdp-0.10.1/ulalaca/UnixSocket.cpp000644 001751 000000 00000005505 14652432052 017040 0ustar00metawheel000000 000000 // // Created by cheesekun on 2/28/22. // #include #include #include #include #include #include #include #include #include #include "UnixSocket.hpp" ssize_t UnixSocketBase::read(void *buffer, size_t size) { return ::read(descriptor(), buffer, size); } ssize_t UnixSocketBase::write(const void *buffer, size_t size) { return ::write(descriptor(), buffer, size); } void UnixSocketBase::close() { ::close(descriptor()); } UnixSocketConnection::UnixSocketConnection(FD descriptor, sockaddr_un clientAddress) : _descriptor(descriptor), _clientAddress(clientAddress) { } FD UnixSocketConnection::descriptor() { return _descriptor; } UnixSocket::UnixSocket(const std::string path): _path(path), _descriptor(createSocket()) { } void UnixSocket::bind() { if (std::filesystem::exists(_path)) { if (!std::filesystem::is_socket(_path)) { // TODO: file exists, but not socket throw std::runtime_error(""); } std::filesystem::remove(_path); } sockaddr_un address = {}; address.sun_family = AF_UNIX; std::strncpy(address.sun_path, _path.c_str(), _path.size()); int retval = ::bind(_descriptor, (sockaddr *) &address, sizeof(address)); if (retval == -1) { throw SystemCallException(errno, "bind"); } } void UnixSocket::listen() { int retval = ::listen(_descriptor, 0); if (retval == -1) { throw SystemCallException(errno, "listen"); } } UnixSocketConnection UnixSocket::accept() { socklen_t addressLength = 0; sockaddr_un clientAddress = {}; FD client = ::accept(_descriptor, (sockaddr *) &clientAddress, &addressLength); if (client == -1) { throw SystemCallException(errno, "accept"); } // assert(addressLength == sizeof(clientAddress)); return UnixSocketConnection(client, clientAddress); } void UnixSocket::connect() { sockaddr_un address = {}; address.sun_family = AF_UNIX; std::strncpy(address.sun_path, _path.c_str(), _path.size()); address.sun_len = _path.size(); int retval = ::connect(_descriptor, (sockaddr *) &address, sizeof(address)); if (retval < 0) { throw SystemCallException(errno, "connect"); } } FD UnixSocket::descriptor() { return _descriptor; } FD UnixSocket::createSocket() { FD descriptor = socket(AF_UNIX, SOCK_STREAM, 0); if (descriptor < 0) { throw SystemCallException(errno, "socket"); } // size_t recvBufferSize = 256000; // setsockopt(descriptor, SOL_SOCKET, SO_RCVBUF, &recvBufferSize, sizeof(recvBufferSize)); // size_t sendBufferSize = 256000; // setsockopt(descriptor, SOL_SOCKET, SO_SNDBUF, &sendBufferSize, sizeof(sendBufferSize)); return descriptor; } xrdp-0.10.1/ulalaca/XrdpTransport.cpp000644 001751 000000 00000000630 14652432052 017570 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/04/30. // #if defined(HAVE_CONFIG_H) #include #endif #include "XrdpTransport.hpp" static void XrdpTransportDeleter(XrdpTransport::Transport *transport) { trans_delete(transport); } XrdpTransport::XrdpTransport(int mode, int inSize, int outSize): _transport { trans_create(mode, inSize, outSize), XrdpTransportDeleter } { } xrdp-0.10.1/ulalaca/UnixSocket.hpp000644 001751 000000 00000005055 14652432052 017045 0ustar00metawheel000000 000000 // // Created by cheesekun on 2/28/22. // #ifndef ULALACA_UNIXSOCKET_HPP #define ULALACA_UNIXSOCKET_HPP #include #include #include #include "SystemCallException.hpp" using FD = int; class UnixSocketBase { public: /** * 파일 디스크립터를 반환합니다. * * @note 임의로 닫지 마십시오. */ virtual FD descriptor() = 0; /** * 소켓으로부터 데이터를 읽습니다. * * @param buffer 입력 버퍼 * @param size 읽고자 하는 데이터의 크기 * * @return 버퍼에 실제로 읽힌 데이터의 크기를 반환합니다. * 플랫폼에 따라 오류가 발생하면 음수 값이 반환될 수 있습니다. */ ssize_t read(void *buffer, size_t size); /** * 소켓에 데이터를 씁니다. * * @param buffer 출력 버퍼 * @param size 쓰고자 하는 데이터의 크기 * * @return 소켓에 실제로 쓰여진 데이터의 크기를 반환합니다. * 플랫폼에 따라 오류가 발생하면 음수 값이 반환될 수 있습니다. */ ssize_t write(const void *buffer, size_t size); /** * 소켓을 닫습니다. */ void close(); }; class UnixSocketConnection: public UnixSocketBase { public: explicit UnixSocketConnection(FD descriptor, sockaddr_un clientAddress); FD descriptor() override; private: FD _descriptor; sockaddr_un _clientAddress; }; class UnixSocket: public UnixSocketBase { public: explicit UnixSocket(const std::string path); /** * bind(2)를 호출합니다. * * @see man 2 bind * @throws SystemCallException * bind()의 리턴 값이 -1일 시 errno를 담은 예외를 던집니다. */ void bind(); /** * listen(2)를 호출합니다. * * @see man 2 listen * @throws SystemCallException * listen()의 리턴 값이 -1일 시 errno를 담은 예외를 던집니다. */ void listen(); /** * accept(2)를 호출합니다. * * @see man 2 accept * @return (File Descriptor, sockaddr_un)의 pair를 반환합니다. * @throws SystemCallException * accept()의 리턴 값이 -1일 시 errno를 담은 예외를 던집니다. */ UnixSocketConnection accept(); /** * connect(2)를 호출합니다. */ void connect(); FD descriptor() override; static FD createSocket(); private: std::string _path; FD _descriptor; }; #endif //ULALACA_UNIXSOCKET_HPP xrdp-0.10.1/ulalaca/README.md000644 001751 000000 00000003211 14652432052 015507 0ustar00metawheel000000 000000 # 麗 -ulalaca- ![sosumi](https://user-images.githubusercontent.com/964412/166627076-616c1252-aede-4f33-9084-9a483caa5a8c.png) this xrdp module requires [ulalaca-sessionprojector](https://github.com/unstabler/ulalaca) # TODO / BUGS - NOT SUITABLE FOR PRODUCTION USE YET # INSTALLATION 1. fetch xrdp source code ```shell $ git clone https://github.com/neutrinolabs/xrdp.git xrdp $ cd xrdp $ git checkout devel ``` 2. add ulalaca-xrdp as submodule ```shell $ git submodule add https://github.com/unstabler/ulalaca-xrdp ulalaca ``` 3. apply patch ```shell $ patch -p1 < ulalaca/xrdp-automake.patch $ patch -p1 < ulalaca/xrdp-encoder-force-use-bgra.patch # + fix hard-coded socket path $ vi ulalaca/ulalaca.cpp ``` ```diff _this->_socket = std::make_unique( - "/Users/unstabler/ulalaca-projector.socket" + "..." ); _this->_socket->connect(); ``` 4. build & install ```shell $ ./bootstrap $ ./configure --enable-pixman PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:/usr/local/opt/libjpeg-turbo/lib/pkgconf $ make -j8 $ make install ``` 5. edit /etc/xrdp/xrdp.ini ```diff ; Section name to use for automatic login if the client sends username ; and password. If empty, the domain name sent by the client is used. ; If empty and no domain name is given, the first suitable section in ; this file will be used. autorun= allow_channels=true allow_multimon=true bitmap_cache=true -bitmap_compression=true +bitmap_compression=false -bulk_compression=true +bulk_compression=false #hidelogwindow=true max_bpp=32 new_cursors=true ; ... +[Ulalaca] +name=Ulalaca +lib=libulalaca.dylib ``` xrdp-0.10.1/ulalaca/XrdpStream.cpp000644 001751 000000 00000001117 14652432052 017030 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/04/30. // #if defined(HAVE_CONFIG_H) #include #endif #include "ulalaca.hpp" static inline XrdpStream::Stream *createXrdpStreamInternal(size_t size) { XrdpStream::Stream *stream; make_stream(stream); init_stream(stream, size); return stream; } static void XrdpStreamDeleter(XrdpStream::Stream *stream) { free_stream(stream); } XrdpStream::XrdpStream(size_t size): _stream { createXrdpStreamInternal(size), XrdpStreamDeleter } { } XrdpStream::operator Stream const *() const { return _stream.get(); } xrdp-0.10.1/ulalaca/Makefile.in000644 001751 000000 00000060733 14652432075 016316 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = ulalaca ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libulalaca_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libulalaca_la_OBJECTS = UnixSocket.lo SocketStream.lo \ SystemCallException.lo XrdpTransport.lo XrdpStream.lo \ ProjectionThread.lo KeycodeMap.lo ulalaca.lo libulalaca_la_OBJECTS = $(am_libulalaca_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/KeycodeMap.Plo \ ./$(DEPDIR)/ProjectionThread.Plo ./$(DEPDIR)/SocketStream.Plo \ ./$(DEPDIR)/SystemCallException.Plo ./$(DEPDIR)/UnixSocket.Plo \ ./$(DEPDIR)/XrdpStream.Plo ./$(DEPDIR)/XrdpTransport.Plo \ ./$(DEPDIR)/ulalaca.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(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 = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libulalaca_la_SOURCES) DIST_SOURCES = $(libulalaca_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common AM_CXXFLAGS = \ --std=c++17 module_LTLIBRARIES = \ libulalaca.la libulalaca_la_SOURCES = \ UnixSocket.cpp \ UnixSocket.hpp \ SocketStream.cpp \ SocketStream.hpp \ SystemCallException.cpp \ SystemCallException.hpp \ XrdpEvent.hpp \ XrdpTransport.hpp \ XrdpTransport.cpp \ XrdpStream.hpp \ XrdpStream.cpp \ UlalacaMessages.hpp \ ProjectionThread.hpp \ ProjectionThread.cpp \ KeycodeMap.cpp \ ulalaca.cpp \ ulalaca.hpp libulalaca_la_LIBADD = \ $(top_builddir)/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ulalaca/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign ulalaca/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libulalaca.la: $(libulalaca_la_OBJECTS) $(libulalaca_la_DEPENDENCIES) $(EXTRA_libulalaca_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) -rpath $(moduledir) $(libulalaca_la_OBJECTS) $(libulalaca_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KeycodeMap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProjectionThread.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SocketStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SystemCallException.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UnixSocket.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrdpStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XrdpTransport.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulalaca.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/KeycodeMap.Plo -rm -f ./$(DEPDIR)/ProjectionThread.Plo -rm -f ./$(DEPDIR)/SocketStream.Plo -rm -f ./$(DEPDIR)/SystemCallException.Plo -rm -f ./$(DEPDIR)/UnixSocket.Plo -rm -f ./$(DEPDIR)/XrdpStream.Plo -rm -f ./$(DEPDIR)/XrdpTransport.Plo -rm -f ./$(DEPDIR)/ulalaca.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/KeycodeMap.Plo -rm -f ./$(DEPDIR)/ProjectionThread.Plo -rm -f ./$(DEPDIR)/SocketStream.Plo -rm -f ./$(DEPDIR)/SystemCallException.Plo -rm -f ./$(DEPDIR)/UnixSocket.Plo -rm -f ./$(DEPDIR)/XrdpStream.Plo -rm -f ./$(DEPDIR)/XrdpTransport.Plo -rm -f ./$(DEPDIR)/ulalaca.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/ulalaca/XrdpEvent.hpp000644 001751 000000 00000001620 14652432052 016662 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/04/30. // #ifndef ULALACA_XRDPEVENT_HPP #define ULALACA_XRDPEVENT_HPP struct XrdpEvent { public: enum Type { KEY_DOWN = 15, KEY_UP = 16, KEY_SYNCHRONIZE_LOCK = 17, MOUSE_MOVE = 100, MOUSE_BUTTON_LEFT_UP = 101, MOUSE_BUTTON_LEFT_DOWN = 102, MOUSE_BUTTON_RIGHT_UP = 103, MOUSE_BUTTON_RIGHT_DOWN = 104, MOUSE_BUTTON_MIDDLE_UP = 105, MOUSE_BUTTON_MIDDLE_DOWN = 106, MOUSE_WHEEL_UP = 107, MOUSE_UNKNOWN_1 = 108, MOUSE_WHEEL_DOWN = 109, MOUSE_UNKNOWN_2 = 110, INVALIDATE_REQUEST = 200, CHANNEL_EVENT = 0x5555 }; bool isKeyEvent() const; bool isMouseEvent() const; Type type; long param1; long param2; long param3; long param4; }; #endif //ULALACA_XRDPEVENT_HPP xrdp-0.10.1/ulalaca/XrdpStream.hpp000644 001751 000000 00000001144 14652432052 017035 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/04/30. // #ifndef ULALACA_XRDPSTREAM_HPP #define ULALACA_XRDPSTREAM_HPP #include #include extern "C" { #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" }; class XrdpStream { public: using Stream = stream; using StreamDeleter = std::function; XrdpStream(size_t size); explicit operator Stream const *() const; template XrdpStream &operator<< (T value); private: std::unique_ptr _stream; }; #endif //ULALACA_XRDPSTREAM_HPP xrdp-0.10.1/ulalaca/ProjectionThread.cpp000644 001751 000000 00000017365 14652432052 020217 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/05/06. // #if defined(HAVE_CONFIG_H) #include #endif extern "C" { #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #include "guid.h" #include "xrdp_client_info.h" }; #include "ProjectionThread.hpp" #include "KeycodeMap.hpp" ProjectionThread::ProjectionThread( XrdpUlalaca &xrdpUlalaca, UnixSocket &socket ): _xrdpUlalaca(xrdpUlalaca), _socket(socket), _isTerminated(false) { } void ProjectionThread::start() { _projectorThread = std::thread(&ProjectionThread::mainLoop, this); _ioThread = std::thread(&ProjectionThread::ioLoop, this); } void ProjectionThread::stop() { _isTerminated = true; } void ProjectionThread::handleEvent(XrdpEvent &event) { using namespace projector; if (event.isKeyEvent()) { auto keycode = event.param3; auto cgKeycode = rdpKeycodeToCGKeycode(keycode); auto eventType = event.type == XrdpEvent::KEY_DOWN ? KeyboardEvent::TYPE_KEYDOWN : KeyboardEvent::TYPE_KEYUP; if (cgKeycode == -1) { return; } writeMessage(MessageType::OUT_KEYBOARD_EVENT, KeyboardEvent { eventType, (uint32_t) cgKeycode, 0 }); } else if (event.type == XrdpEvent::KEY_SYNCHRONIZE_LOCK) { auto lockStatus = event.param1; } if (event.isMouseEvent()) { switch (event.type) { case XrdpEvent::MOUSE_MOVE: { uint16_t posX = event.param1; uint16_t posY = event.param2; writeMessage(MessageType::OUT_MOUSE_MOVE_EVENT, MouseMoveEvent { posX, posY, 0 }); return; } case XrdpEvent::MOUSE_BUTTON_LEFT_DOWN: { writeMessage(MessageType::OUT_MOUSE_BUTTON_EVENT, MouseButtonEvent { MouseButtonEvent::TYPE_MOUSEDOWN, MouseButtonEvent::BUTTON_LEFT, 0 }); return; } case XrdpEvent::MOUSE_BUTTON_LEFT_UP: { writeMessage(MessageType::OUT_MOUSE_BUTTON_EVENT, MouseButtonEvent { MouseButtonEvent::TYPE_MOUSEUP, MouseButtonEvent::BUTTON_LEFT, 0 }); return; } case XrdpEvent::MOUSE_BUTTON_RIGHT_DOWN: { writeMessage(MessageType::OUT_MOUSE_BUTTON_EVENT, MouseButtonEvent { MouseButtonEvent::TYPE_MOUSEDOWN, MouseButtonEvent::BUTTON_RIGHT, 0 }); return; } case XrdpEvent::MOUSE_BUTTON_RIGHT_UP: { writeMessage(MessageType::OUT_MOUSE_BUTTON_EVENT, MouseButtonEvent { MouseButtonEvent::TYPE_MOUSEUP, MouseButtonEvent::BUTTON_RIGHT, 0 }); return; } case XrdpEvent::MOUSE_WHEEL_DOWN: { LOG(LOG_LEVEL_DEBUG, "TODO: WHEEL_DOWN (%d)", (int) event.param1); /* writeMessage(MessageType::OUT_MOUSE_WHEEL_EVENT, MouseWheelEvent { MouseButtonEvent::, MouseButtonEvent::BUTTON_RIGHT, 0 }); */ return; } default: break; } } if (event.type == XrdpEvent::INVALIDATE_REQUEST) { uint16_t x1 = HIWORD(event.param1); uint16_t y1 = LOWORD(event.param1); uint16_t x2 = HIWORD(event.param2); uint16_t y2 = LOWORD(event.param2); // TODO: redraw(rect)? } if (event.type == XrdpEvent::CHANNEL_EVENT) { uint16_t channelId = LOWORD(event.param1); uint16_t flags = HIWORD(event.param1); auto size = (int) event.param2; auto data = (char *) event.param3; auto total_size = (int) event.param4; } } void ProjectionThread::mainLoop() { while (!_isTerminated) { auto header = nextHeader(); switch (header->messageType) { case projector::IN_SCREEN_UPDATE_EVENT: { auto updateEvent = read(header->length); LOG(LOG_LEVEL_DEBUG, "mainLoop(): adding dirty rect"); _xrdpUlalaca.addDirtyRect(updateEvent->rect); continue; } case projector::IN_SCREEN_COMMIT_UPDATE: { auto commitUpdate = read(header->length); auto bitmap = read(commitUpdate->bitmapLength); LOG(LOG_LEVEL_DEBUG, "mainLoop(): commiting update"); _xrdpUlalaca.commitUpdate( bitmap.get(), commitUpdate->screenRect.width, commitUpdate->screenRect.height ); continue; } default: { // ignore read(header->length); } } } } void ProjectionThread::ioLoop() { const size_t MAX_READ_SIZE = 8192; size_t readBytes = 0; std::unique_ptr _currentReadTask; while (!_isTerminated) { if (_writeTasks.empty() && _readTasks.empty()) { using namespace std::chrono_literals; std::this_thread::sleep_for(1ms); } if (!_writeTasks.empty()) { std::scoped_lock scopedWriteTasksLock(_writeTasksLock); auto writeTask = std::move(_writeTasks.front()); _writeTasks.pop(); if (_socket.write(writeTask.second.get(), writeTask.first) < 0) { throw std::runtime_error("failed to perform write()"); } } if (!_readTasks.empty()) { auto &readTask = _readTasks.front(); auto &contentLength = readTask.first; auto &promise = readTask.second; if (_currentReadTask == nullptr) { readBytes = 0; _currentReadTask = std::unique_ptr( new uint8_t[readTask.first] ); } int bytes = std::min( (size_t) MAX_READ_SIZE, contentLength - readBytes ); size_t retval = _socket.read(_currentReadTask.get() + readBytes, bytes); if (retval < 0) { throw std::runtime_error("failed to perform read()"); } readBytes += retval; if (readBytes >= contentLength) { promise.set_value(std::move(_currentReadTask)); { std::scoped_lock scopedReadTasksLock(_readTasksLock); _readTasks.pop(); } _currentReadTask = nullptr; readBytes = 0; } } } } std::unique_ptr ProjectionThread::nextHeader() { return std::move(read(sizeof(projector::MessageHeader))); } void ProjectionThread::write(const void *pointer, size_t size) { assert(pointer != nullptr); assert(size > 0); std::scoped_lock scopedWriteTasksLock(_writeTasksLock); std::unique_ptr data( (uint8_t *) malloc(size), free ); std::memcpy(data.get(), pointer, size); _writeTasks.emplace(size, std::move(data)); }xrdp-0.10.1/ulalaca/Makefile.am000644 001751 000000 00000001331 14652432052 016265 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common AM_CXXFLAGS = \ --std=c++17 module_LTLIBRARIES = \ libulalaca.la libulalaca_la_SOURCES = \ UnixSocket.cpp \ UnixSocket.hpp \ SocketStream.cpp \ SocketStream.hpp \ SystemCallException.cpp \ SystemCallException.hpp \ XrdpEvent.hpp \ XrdpTransport.hpp \ XrdpTransport.cpp \ XrdpStream.hpp \ XrdpStream.cpp \ UlalacaMessages.hpp \ ProjectionThread.hpp \ ProjectionThread.cpp \ KeycodeMap.cpp \ ulalaca.cpp \ ulalaca.hpp libulalaca_la_LIBADD = \ $(top_builddir)/common/libcommon.la xrdp-0.10.1/ulalaca/SocketStream.cpp000644 001751 000000 00000002270 14652432052 017344 0ustar00metawheel000000 000000 // // Created by cheesekun on 2/28/22. // #include "SocketStream.hpp" InputSocketStream::InputSocketStream(UnixSocketBase &socketLike): _socket(socketLike), _buffer() { } int InputSocketStream::underflow() { if (this->gptr() == this->egptr()) { auto read = _socket.read(_buffer, MAX_BUFFER_SIZE); if (read <= 0) { // 더 이상 읽을 수 있는 데이터가 없음 return traits_type::eof(); } this->setg( _buffer, _buffer, _buffer + read ); } // TODO: assert(this->gptr() != this->egptr()); return traits_type::to_int_type(*this->gptr()); } OutputSocketStream::OutputSocketStream(UnixSocketBase &socketLike): _socket(socketLike), _buffer() { this->setp(_buffer, _buffer + MAX_BUFFER_SIZE); } void OutputSocketStream::flush() { ptrdiff_t distance = this->pptr() - _buffer; auto written = _socket.write(_buffer, distance); this->setp(_buffer, _buffer + MAX_BUFFER_SIZE); } int OutputSocketStream::overflow(int character) { if (this->pptr() == this->epptr()) { this->flush(); } return traits_type::to_int_type(character); } xrdp-0.10.1/ulalaca/SystemCallException.hpp000644 001751 000000 00000001176 14652432052 020710 0ustar00metawheel000000 000000 // // Created by cheesekun on 2/28/22. // #ifndef ULALACA_SYSTEMCALLEXCEPTION_HPP #define ULALACA_SYSTEMCALLEXCEPTION_HPP #include #include class SystemCallException: public std::exception { public: explicit SystemCallException( int _errno, std::string funcName ); ~SystemCallException() override = default; int getErrno() const; const std::string &getMessage() const; const char* what() const noexcept override; private: int _errno; std::string _message; std::string _funcName; std::string _what; }; #endif //ULALACA_SYSTEMCALLEXCEPTION_HPP xrdp-0.10.1/ulalaca/ulalaca.hpp000644 001751 000000 00000025650 14652432052 016356 0ustar00metawheel000000 000000 #ifndef ULALACA_HPP #define ULALACA_HPP #include #include #include #include extern "C" { #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #include "guid.h" #include "xrdp_client_info.h" }; #include "XrdpEvent.hpp" #include "XrdpTransport.hpp" #include "XrdpStream.hpp" #include "UnixSocket.hpp" #include "UlalacaMessages.hpp" class ProjectionThread; extern "C" { struct XrdpUlalaca { int size; /* size of this struct */ int version; /* internal version */ /* client functions */ int (*mod_start)(XrdpUlalaca *v, int w, int h, int bpp); int (*mod_connect)(XrdpUlalaca *v); int (*mod_event)(XrdpUlalaca *v, int msg, long param1, long param2, long param3, long param4); int (*mod_signal)(XrdpUlalaca *v); int (*mod_end)(XrdpUlalaca *v); int (*mod_set_param)(XrdpUlalaca *v, const char *name, const char *value); int (*mod_session_change)(XrdpUlalaca *v, int, int); int (*mod_get_wait_objs)(XrdpUlalaca *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int (*mod_check_wait_objs)(XrdpUlalaca *v); int (*mod_frame_ack)(XrdpUlalaca *v, int flags, int frame_id); int (*mod_suppress_output)(XrdpUlalaca *v, int suppress, int left, int top, int right, int bottom); int (*mod_server_monitor_resize)(XrdpUlalaca *v, int width, int height); int (*mod_server_monitor_full_invalidate)(XrdpUlalaca *v, int width, int height); int (*mod_server_version_message)(XrdpUlalaca *v); tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod functions above */ /* server functions */ int (*server_begin_update)(XrdpUlalaca *v) = nullptr; int (*server_end_update)(XrdpUlalaca *v) = nullptr; int (*server_fill_rect)(XrdpUlalaca *v, int x, int y, int cx, int cy) = nullptr; int (*server_screen_blt)(XrdpUlalaca *v, int x, int y, int cx, int cy, int srcx, int srcy) = nullptr; int (*server_paint_rect)(XrdpUlalaca *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy) = nullptr; int (*server_set_cursor)(XrdpUlalaca *v, int x, int y, char *data, char *mask) = nullptr; int (*server_palette)(XrdpUlalaca *v, int *palette) = nullptr; int (*server_msg)(XrdpUlalaca *v, const char *msg, int code) = nullptr; int (*server_is_term)(XrdpUlalaca *v) = nullptr; int (*server_set_clip)(XrdpUlalaca *v, int x, int y, int cx, int cy) = nullptr; int (*server_reset_clip)(XrdpUlalaca *v) = nullptr; int (*server_set_fgcolor)(XrdpUlalaca *v, int fgcolor) = nullptr; int (*server_set_bgcolor)(XrdpUlalaca *v, int bgcolor) = nullptr; int (*server_set_opcode)(XrdpUlalaca *v, int opcode) = nullptr; int (*server_set_mixmode)(XrdpUlalaca *v, int mixmode) = nullptr; int (*server_set_brush)(XrdpUlalaca *v, int x_origin, int y_origin, int style, char *pattern) = nullptr; int (*server_set_pen)(XrdpUlalaca *v, int style, int width) = nullptr; int (*server_draw_line)(XrdpUlalaca *v, int x1, int y1, int x2, int y2) = nullptr; int (*server_add_char)(XrdpUlalaca *v, int font, int character, int offset, int baseline, int width, int height, char *data) = nullptr; int (*server_draw_text)(XrdpUlalaca *v, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len) = nullptr; int (*server_reset)(XrdpUlalaca *v, int width, int height, int bpp) = nullptr; int (*server_get_channel_count)(XrdpUlalaca *v) = nullptr; int (*server_query_channel)(XrdpUlalaca *v, int index, char *channel_name, int *channel_flags) = nullptr; int (*server_get_channel_id)(XrdpUlalaca *v, const char *name) = nullptr; int (*server_send_to_channel)(XrdpUlalaca *v, int channel_id, char *data, int data_len, int total_data_len, int flags) = nullptr; int (*server_bell_trigger)(XrdpUlalaca *v) = nullptr; int (*server_chansrv_in_use)(XrdpUlalaca *v) = nullptr; /* off screen bitmaps */ int (*server_create_os_surface)(XrdpUlalaca *v, int rdpindex, int width, int height) = nullptr; int (*server_switch_os_surface)(XrdpUlalaca *v, int rdpindex) = nullptr; int (*server_delete_os_surface)(XrdpUlalaca *v, int rdpindex) = nullptr; int (*server_paint_rect_os)(XrdpUlalaca *mod, int x, int y, int cx, int cy, int rdpindex, int srcx, int srcy) = nullptr; int (*server_set_hints)(XrdpUlalaca *mod, int hints, int mask) = nullptr; /* rail */ int (*server_window_new_update)(XrdpUlalaca *mod, int window_id, struct rail_window_state_order *window_state, int flags) = nullptr; int (*server_window_delete)(XrdpUlalaca *mod, int window_id) = nullptr; int (*server_window_icon)(XrdpUlalaca *mod, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags) = nullptr; int (*server_window_cached_icon)(XrdpUlalaca *mod, int window_id, int cache_entry, int cache_id, int flags) = nullptr; int (*server_notify_new_update)(XrdpUlalaca *mod, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags) = nullptr; int (*server_notify_delete)(XrdpUlalaca *mod, int window_id, int notify_id) = nullptr; int (*server_monitored_desktop)(XrdpUlalaca *mod, struct rail_monitored_desktop_order *mdo, int flags) = nullptr; int (*server_set_pointer_ex)(XrdpUlalaca *mod, int x, int y, char *data, char *mask, int bpp) = nullptr; int (*server_add_char_alpha)(XrdpUlalaca *mod, int font, int character, int offset, int baseline, int width, int height, char *data) = nullptr; int (*server_create_os_surface_bpp)(XrdpUlalaca *v, int rdpindex, int width, int height, int bpp) = nullptr; int (*server_paint_rect_bpp)(XrdpUlalaca *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy, int bpp) = nullptr; int (*server_composite)(XrdpUlalaca *v, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat) = nullptr; int (*server_paint_rects)(XrdpUlalaca *v, int num_drects, short *drects, int num_crects, short *crects, char *data, int width, int height, int flags, int frame_id) = nullptr; int (*server_session_info)(XrdpUlalaca *v, const char *data, int data_bytes) = nullptr; tintptr server_dumby[100 - 46]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as int */ tintptr wm; /* struct xrdp_wm* */ tintptr painter; struct source_info *si; public: static const int RECT_SIZE_BYPASS_CREATE = 0; constexpr static const int ULALACA_VERSION = 1; constexpr static const int NO_ERROR = 0; explicit XrdpUlalaca(); static int lib_mod_start(XrdpUlalaca *_this, int width, int height, int bpp); static int lib_mod_connect(XrdpUlalaca *_this); static int lib_mod_event(XrdpUlalaca *_this, int type, long arg1, long arg2, long arg3, long arg4); static int lib_mod_signal(XrdpUlalaca *_this); static int lib_mod_end(XrdpUlalaca *_this); static int lib_mod_set_param(XrdpUlalaca *_this, const char *name, const char *value); static int lib_mod_session_change(XrdpUlalaca *_this, int, int); static int lib_mod_get_wait_objs(XrdpUlalaca *_this, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); static int lib_mod_check_wait_objs(XrdpUlalaca *_this); static int lib_mod_frame_ack(XrdpUlalaca *_this, int flags, int frame_id); static int lib_mod_suppress_output(XrdpUlalaca *_this, int suppress, int left, int top, int right, int bottom); static int lib_mod_server_monitor_resize(XrdpUlalaca *_this, int width, int height); static int lib_mod_server_monitor_full_invalidate(XrdpUlalaca *_this, int width, int height); static int lib_mod_server_version_message(XrdpUlalaca *_this); /* session-broker related */ /** @deprecated */ inline std::string getSessionSocketPath(std::string &username); /* paint related */ inline int decideCopyRectSize() const; inline std::unique_ptr> createCopyRects(std::vector &dirtyRects, int rectSize) const; void addDirtyRect(Rect &rect); void commitUpdate(const uint8_t *image, int32_t width, int32_t height); void calculateSessionSize(); /* utility methods / lib_server_* wrappers */ void serverMessage(const char *message, int code); private: int _error = 0; Rect _sessionSize; std::vector _screenLayouts; int _bpp; std::atomic_int64_t _frameId = 0; std::atomic_int64_t _ackFrameId = 0; std::string _username; std::string _password; std::string _ip; std::string _port; int _keyLayout; int _delayMs; guid _guid; int _encodingsMask; xrdp_client_info _clientInfo; std::unique_ptr _socket; std::unique_ptr _projectionThread; std::mutex _commitUpdateLock; std::vector _dirtyRects; }; }; #endifxrdp-0.10.1/ulalaca/KeycodeMap.cpp000644 001751 000000 00000003520 14652432052 016760 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/05/07. // #include "KeycodeMap.hpp" #include static const int16_t RDP_CGKEYCODE_MAP[] = { -1, kVK_Escape, kVK_ANSI_1, kVK_ANSI_2, kVK_ANSI_3, kVK_ANSI_4, kVK_ANSI_5, kVK_ANSI_6, kVK_ANSI_7, kVK_ANSI_8, kVK_ANSI_9, kVK_ANSI_0, kVK_ANSI_Minus, kVK_ANSI_Equal, kVK_Delete, // 14 kVK_Tab, // 15 kVK_ANSI_Q, kVK_ANSI_W, kVK_ANSI_E, kVK_ANSI_R, kVK_ANSI_T, kVK_ANSI_Y, kVK_ANSI_U, kVK_ANSI_I, kVK_ANSI_O, kVK_ANSI_P, kVK_ANSI_LeftBracket, kVK_ANSI_RightBracket, // 27 kVK_Return, // 28 kVK_Control, // 29 kVK_ANSI_A, kVK_ANSI_S, kVK_ANSI_D, kVK_ANSI_F, kVK_ANSI_G, kVK_ANSI_H, kVK_ANSI_J, kVK_ANSI_K, kVK_ANSI_L, kVK_ANSI_Semicolon, kVK_ANSI_Quote, // 40 kVK_ANSI_Grave, kVK_Shift, // 42 kVK_ANSI_Backslash, kVK_ANSI_Z, // 44 kVK_ANSI_X, kVK_ANSI_C, kVK_ANSI_V, kVK_ANSI_B, kVK_ANSI_N, kVK_ANSI_M, kVK_ANSI_Comma, kVK_ANSI_Period, kVK_ANSI_Slash, kVK_RightShift, // 54 -1, kVK_Option, // 56 kVK_Space, // 57 -1, kVK_F1, kVK_F2, // 60 kVK_F3, // 61 kVK_F4, kVK_F5, kVK_F6, kVK_F7, kVK_F8, kVK_F9, kVK_F10, kVK_F11, kVK_F12, // 70 kVK_Home, // 71 kVK_UpArrow, kVK_PageUp, -1, kVK_LeftArrow, -1, kVK_RightArrow, -1, kVK_End, kVK_DownArrow, // 80 kVK_PageDown, -1, // FIXME: INSERT KEY kVK_ForwardDelete, -1, -1, -1, -1, -1, -1, -1, // 90 kVK_Command }; int16_t rdpKeycodeToCGKeycode(uint16_t keycode) { if (keycode <= 91) { return RDP_CGKEYCODE_MAP[keycode]; } return -1; }xrdp-0.10.1/ulalaca/ProjectionThread.hpp000644 001751 000000 00000004045 14652432052 020213 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/05/06. // #ifndef ULALACA_PROJECTIONTHREAD_HPP #define ULALACA_PROJECTIONTHREAD_HPP #include #include #include #include #include "UnixSocket.hpp" #include "UlalacaMessages.hpp" #include "ulalaca.hpp" using MallocFreeDeleter = std::function; class ProjectionThread { public: explicit ProjectionThread( XrdpUlalaca &xrdpUlalaca, UnixSocket &socket ); void start(); void stop(); void handleEvent(XrdpEvent &event); private: void mainLoop(); void ioLoop(); std::unique_ptr nextHeader(); template std::unique_ptr read(size_t size) { assert(size != 0); auto promise = std::promise>(); { std::scoped_lock scopedReadTasksLock(_readTasksLock); _readTasks.emplace(size, promise); } auto pointer = promise.get_future().get(); return std::move(std::unique_ptr( reinterpret_cast(pointer.release()), free )); } void write(const void *pointer, size_t size); template void writeMessage(projector::MessageType messageType, T message) { auto header = projector::MessageHeader { (uint16_t) messageType, 0, 0, 0, sizeof(T) }; write(&header, sizeof(header)); write(&message, sizeof(T)); } XrdpUlalaca &_xrdpUlalaca; UnixSocket &_socket; bool _isTerminated; std::thread _projectorThread; std::thread _ioThread; std::mutex _writeTasksLock; std::mutex _readTasksLock; std::queue>> _writeTasks; std::queue> &>> _readTasks; }; #endif //ULALACA_PROJECTIONTHREAD_HPP xrdp-0.10.1/ulalaca/SocketStream.hpp000644 001751 000000 00000001515 14652432052 017352 0ustar00metawheel000000 000000 // // Created by cheesekun on 2/28/22. // #ifndef ULALACA_SOCKETSTREAM_HPP #define ULALACA_SOCKETSTREAM_HPP #include #include "UnixSocket.hpp" class InputSocketStream: public std::basic_streambuf> { public: explicit InputSocketStream(UnixSocketBase &socketLike); protected: static const size_t MAX_BUFFER_SIZE = 8192; int underflow() override; uint8_t _buffer[MAX_BUFFER_SIZE]; UnixSocketBase &_socket; }; class OutputSocketStream: public std::streambuf { public: explicit OutputSocketStream(UnixSocketBase &socketLike); void flush(); protected: static const size_t MAX_BUFFER_SIZE = 8192; int overflow(int character) override; char _buffer[MAX_BUFFER_SIZE]; UnixSocketBase &_socket; }; #endif //ULALACA_SOCKETSTREAM_HPP xrdp-0.10.1/ulalaca/ulalaca.cpp000644 001751 000000 00000023640 14652432052 016346 0ustar00metawheel000000 000000 // // Created by Gyuhwan Park on 2022/04/28. // #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include "ulalaca.hpp" #include "SocketStream.hpp" #include "ProjectionThread.hpp" bool XrdpEvent::isKeyEvent() const { return type == KEY_DOWN || type == KEY_UP; } bool XrdpEvent::isMouseEvent() const { return type >= MOUSE_MOVE && type <= MOUSE_UNKNOWN_2; } XrdpUlalaca::XrdpUlalaca(): size(sizeof(XrdpUlalaca)), version(ULALACA_VERSION), mod_start(&lib_mod_start), mod_connect(&lib_mod_connect), mod_event(&lib_mod_event), mod_signal(&lib_mod_signal), mod_end(&lib_mod_end), mod_set_param(&lib_mod_set_param), mod_session_change(&lib_mod_session_change), mod_get_wait_objs(&lib_mod_get_wait_objs), mod_check_wait_objs(&lib_mod_check_wait_objs), mod_frame_ack(&lib_mod_frame_ack), mod_suppress_output(&lib_mod_suppress_output), mod_server_monitor_resize(&lib_mod_server_monitor_resize), mod_server_monitor_full_invalidate(&lib_mod_server_monitor_full_invalidate), mod_server_version_message(&lib_mod_server_version_message), si(nullptr), _sessionSize { 0, 0, 640, 480 }, _bpp(0), _encodingsMask(0), _keyLayout(0), _delayMs(0) { } int XrdpUlalaca::lib_mod_event(XrdpUlalaca *_this, int type, long arg1, long arg2, long arg3, long arg4) { LOG(LOG_LEVEL_DEBUG, "lib_mod_event() called: %d", type); XrdpEvent event { (XrdpEvent::Type) type, arg1, arg2, arg3, arg4 }; if (_this->_projectionThread != nullptr) { _this->_projectionThread->handleEvent(event); } return 0; } int XrdpUlalaca::lib_mod_start(XrdpUlalaca *_this, int width, int height, int bpp) { constexpr const unsigned int BACKGROUND_COLOR = 0xb97e51; _this->_screenLayouts.clear(); _this->_screenLayouts.emplace_back(Rect { 0, 0, (short) width, (short) height }); _this->calculateSessionSize(); _this->server_begin_update(_this); _this->server_set_fgcolor(_this, (int) BACKGROUND_COLOR); _this->server_fill_rect(_this, 0, 0, width, height); _this->server_end_update(_this); _this->_bpp = bpp; // _this->updateBpp(bpp); return 0; } int XrdpUlalaca::lib_mod_set_param(XrdpUlalaca *_this, const char *_name, const char *_value) { std::string name(_name); std::string value(_value); if (name == "username") { _this->_username = value; } else if (name == "password") { _this->_password = value; } else if (name == "ip") { _this->_ip = value; } else if (name == "port") { _this->_port = value; } else if (name == "keylayout") { _this->_keyLayout = std::stoi(value); } else if (name == "delay_ms") { _this->_delayMs = std::stoi(value); } else if (name == "guid") { auto *_guid = reinterpret_cast(_value); _this->_guid = *_guid; } else if (name == "disabled_encodings_mask") { _this->_encodingsMask = ~std::stoi(value); } else if (name == "client_info") { auto *clientInfo = reinterpret_cast(_value); _this->_clientInfo = *clientInfo; } return 0; } int XrdpUlalaca::lib_mod_connect(XrdpUlalaca *_this) { _this->serverMessage("establishing connection to SessionProjector", 0); try { _this->_socket = std::make_unique( _this->getSessionSocketPath(_this->_username) ); _this->_socket->connect(); } catch (SystemCallException &e) { _this->serverMessage(e.what(), 0); return 1; } _this->_password.clear(); _this->_projectionThread = std::make_unique( *_this, *(_this->_socket) ); _this->_projectionThread->start(); _this->serverMessage("welcome to the fantasy zone, get ready!", 0); return 0; } int XrdpUlalaca::lib_mod_signal(XrdpUlalaca *_this) { LOG(LOG_LEVEL_INFO, "lib_mod_signal() called"); return 0; } int XrdpUlalaca::lib_mod_end(XrdpUlalaca *_this) { LOG(LOG_LEVEL_INFO, "lib_mod_end() called"); return 0; } int XrdpUlalaca::lib_mod_session_change(XrdpUlalaca *_this, int, int) { return 0; } int XrdpUlalaca::lib_mod_get_wait_objs(XrdpUlalaca *_this, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout) { LOG(LOG_LEVEL_INFO, "lib_mod_get_wait_objs() called"); return 0; } int XrdpUlalaca::lib_mod_check_wait_objs(XrdpUlalaca *_this) { LOG(LOG_LEVEL_INFO, "lib_mod_check_wait_objs() called"); return 0; } int XrdpUlalaca::lib_mod_frame_ack(XrdpUlalaca *_this, int flags, int frame_id) { LOG(LOG_LEVEL_INFO, "lib_mod_frame_ack() called: %d", frame_id); _this->_ackFrameId = frame_id; return 0; } int XrdpUlalaca::lib_mod_suppress_output(XrdpUlalaca *_this, int suppress, int left, int top, int right, int bottom) { LOG(LOG_LEVEL_INFO, "lib_mod_suppress_output() called"); return 0; } int XrdpUlalaca::lib_mod_server_monitor_resize(XrdpUlalaca *_this, int width, int height) { return 0; } int XrdpUlalaca::lib_mod_server_monitor_full_invalidate(XrdpUlalaca *_this, int width, int height) { return 0; } int XrdpUlalaca::lib_mod_server_version_message(XrdpUlalaca *_this) { return 0; } std::string XrdpUlalaca::getSessionSocketPath(std::string &username) { std::stringstream sstream; sstream << "/Users/" << username << "/.ulalaca_projector.sock"; return sstream.str(); } int XrdpUlalaca::decideCopyRectSize() const { bool isRFXCodec = _clientInfo.rfx_codec_id != 0; bool isJPEGCodec = _clientInfo.jpeg_codec_id != 0; bool isH264Codec = _clientInfo.h264_codec_id != 0; if (isRFXCodec || isJPEGCodec) { return 64; } if (isH264Codec) { // return 256; return RECT_SIZE_BYPASS_CREATE; } return RECT_SIZE_BYPASS_CREATE; } std::unique_ptr> XrdpUlalaca::createCopyRects(std::vector &dirtyRects, int rectSize) const { auto blocks = std::make_unique>(); if (rectSize == RECT_SIZE_BYPASS_CREATE) { std::copy(dirtyRects.begin(), dirtyRects.end(), std::back_insert_iterator(*blocks)); return std::move(blocks); } for (auto &dirtyRect : dirtyRects) { if (_sessionSize.width <= dirtyRect.x || _sessionSize.height <= dirtyRect.y) { continue; } auto width = std::min(dirtyRect.width, (short) (_sessionSize.width - dirtyRect.x)); auto height = std::min(dirtyRect.height, (short) (_sessionSize.height - dirtyRect.y)); auto baseX = dirtyRect.x - (dirtyRect.x % rectSize); auto baseY = dirtyRect.y - (dirtyRect.y % rectSize); auto blockCountX = ((width + dirtyRect.x % rectSize) + (rectSize - 1)) / rectSize; auto blockCountY = ((height + dirtyRect.y % rectSize) + (rectSize - 1)) / rectSize; for (int j = 0; j < blockCountY; j++) { for (int i = 0; i < blockCountX; i++) { short x = baseX + (rectSize * i); short y = baseY + (rectSize * j); blocks->push_back(Rect {x, y, (short) rectSize, (short) rectSize }); } } } return std::move(blocks); } void XrdpUlalaca::addDirtyRect(Rect &rect) { _dirtyRects.push_back(rect); } void XrdpUlalaca::commitUpdate(const uint8_t *image, int32_t width, int32_t height) { LOG(LOG_LEVEL_TRACE, "painting: %d, %d", width, height); std::scoped_lock scopedCommitLock(_commitUpdateLock); if ((_frameId - _ackFrameId) > 4) { _dirtyRects.clear(); return; } if (_frameId > 0 && _dirtyRects.empty()) { return; } server_begin_update(this); Rect screenRect = {0, 0, (short) width, (short) height}; auto copyRectSize = decideCopyRectSize(); if (_frameId > 0) { auto copyRects = createCopyRects(_dirtyRects, copyRectSize); server_paint_rects( this, _dirtyRects.size(), reinterpret_cast(_dirtyRects.data()), copyRects->size(), reinterpret_cast(copyRects->data()), (char *) image, width, height, 0, (_frameId++ % INT32_MAX) ); } else { // paint entire screen auto dirtyRects = std::vector{screenRect}; auto copyRects = createCopyRects(dirtyRects, copyRectSize); server_paint_rects( this, dirtyRects.size(), reinterpret_cast(dirtyRects.data()), copyRects->size(), reinterpret_cast(copyRects->data()), (char *) image, width, height, 0, (_frameId++ % INT32_MAX) ); } _dirtyRects.clear(); server_end_update(this); } void XrdpUlalaca::calculateSessionSize() { // TODO: calculate session size to support multiple display environments if (_screenLayouts.empty()) { _sessionSize = Rect { 0, 0, 640, 480 }; return; } _sessionSize = _screenLayouts.front(); } void XrdpUlalaca::serverMessage(const char *message, int code) { this->server_msg(this, message, code); LOG(LOG_LEVEL_INFO, "%s", message); } tintptr EXPORT_CC mod_init(void) { auto *ulalaca = (XrdpUlalaca *) g_malloc(sizeof(XrdpUlalaca), 1); new (ulalaca) XrdpUlalaca(); return (tintptr) ulalaca; } int EXPORT_CC mod_exit(tintptr handle) { auto *ulalaca = (XrdpUlalaca *) handle; LOG(LOG_LEVEL_TRACE, "Ulalaca: mod_exit()"); if (ulalaca == nullptr) { LOG(LOG_LEVEL_WARNING, "Ulalaca: mod_exit(): handle is nullptr"); return 0; } // trans_delete(ulalaca->trans); // call destructor manually ulalaca->~XrdpUlalaca(); g_free(ulalaca); // TODO: cleanup return 0; } xrdp-0.10.1/ulalaca/SystemCallException.cpp000644 001751 000000 00000001252 14652432052 020676 0ustar00metawheel000000 000000 // // Created by cheesekun on 2/28/22. // #include #include #include "SystemCallException.hpp" SystemCallException::SystemCallException(int _errno, std::string funcName): _errno(_errno), _message(strerror(errno)), _funcName(funcName), _what() { std::stringstream sstream; sstream << _funcName << "(): " << _message << " (" << _errno << ")"; _what = sstream.str(); } int SystemCallException::getErrno() const { return _errno; } const std::string &SystemCallException::getMessage() const { return _message; } const char *SystemCallException::what() const noexcept { return _what.c_str(); }xrdp-0.10.1/libipm/eicp.c000644 001751 000000 00000020766 14652432047 015210 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/eicp.c * @brief EICP definitions * @author Matt Burt */ #if defined(HAVE_CONFIG_H) #include #endif #include "eicp.h" #include "libipm.h" #include "guid.h" #include "os_calls.h" #include "trans.h" /*****************************************************************************/ static const char * msgno_to_str(unsigned short n) { return (n == E_EICP_SYS_LOGIN_REQUEST) ? "EICP_SYS_LOGIN_REQUEST" : (n == E_EICP_SYS_LOGIN_RESPONSE) ? "EICP_SYS_LOGIN_RESPONSE" : (n == E_EICP_LOGOUT_REQUEST) ? "EICP_LOGOUT_REQUEST" : (n == E_EICP_CREATE_SESSION_REQUEST) ? "EICP_CREATE_SESSION_REQUEST" : NULL; } /*****************************************************************************/ const char * eicp_msgno_to_str(enum eicp_msg_code n, char *buff, unsigned int buff_size) { const char *str = msgno_to_str((unsigned short)n); if (str == NULL) { g_snprintf(buff, buff_size, "[code #%d]", (int)n); } else { g_snprintf(buff, buff_size, "%s", str); } return buff; } /*****************************************************************************/ int eicp_init_trans(struct trans *trans) { return libipm_init_trans(trans, LIBIPM_FAC_EICP, msgno_to_str); } /*****************************************************************************/ struct trans * eicp_init_trans_from_fd(int fd, int trans_type, int (*term_func)(void)) { struct trans *result; if ((result = trans_create(TRANS_MODE_UNIX, 128, 128)) == NULL) { LOG(LOG_LEVEL_ERROR, "Can't create ECP transport [%s]", g_get_strerror()); } else { result->sck = fd; result->type1 = trans_type; result->status = TRANS_STATUS_UP; result->is_term = term_func; // Make sure child processes don't inherit our FD (void)g_file_set_cloexec(result->sck, 1); if (eicp_init_trans(result) != 0) { LOG(LOG_LEVEL_ERROR, "eicp_init_trans() call failed"); trans_delete(result); result = NULL; } } return result; } /*****************************************************************************/ int eicp_msg_in_check_available(struct trans *trans, int *available) { return libipm_msg_in_check_available(trans, available); } /*****************************************************************************/ int eicp_msg_in_wait_available(struct trans *trans) { return libipm_msg_in_wait_available(trans); } /*****************************************************************************/ enum eicp_msg_code eicp_msg_in_get_msgno(const struct trans *trans) { return (enum eicp_msg_code)libipm_msg_in_get_msgno(trans); } /*****************************************************************************/ void eicp_msg_in_reset(struct trans *trans) { libipm_msg_in_reset(trans); } /*****************************************************************************/ int eicp_send_sys_login_request(struct trans *trans, const char *username, const char *password, const char *ip_addr, int scp_fd) { int rv; rv = libipm_msg_out_simple_send( trans, (int)E_EICP_SYS_LOGIN_REQUEST, "sssh", username, password, ip_addr, scp_fd); /* Wipe the output buffer to remove the password */ libipm_msg_out_erase(trans); return rv; } /*****************************************************************************/ int eicp_get_sys_login_request(struct trans *trans, const char **username, const char **password, const char **ip_addr, int *scp_fd) { /* Make sure the buffer is cleared after processing this message */ libipm_set_flags(trans, LIBIPM_E_MSG_IN_ERASE_AFTER_USE); return libipm_msg_in_parse( trans, "sssh", username, password, ip_addr, scp_fd); } /*****************************************************************************/ int eicp_send_sys_login_response(struct trans *trans, int is_logged_in, uid_t uid, int scp_fd) { int rv; if (is_logged_in) { rv = libipm_msg_out_simple_send( trans, (int)E_EICP_SYS_LOGIN_RESPONSE, "bih", 1, uid, scp_fd); } else { rv = libipm_msg_out_simple_send( trans, (int)E_EICP_SYS_LOGIN_RESPONSE, "b", 0); } return rv; } /*****************************************************************************/ int eicp_get_sys_login_response(struct trans *trans, int *is_logged_in, uid_t *uid, int *scp_fd) { int rv; if ((rv = libipm_msg_in_parse(trans, "b", is_logged_in)) == 0) { if (*is_logged_in) { int32_t i_uid; rv = libipm_msg_in_parse( trans, "ih", &i_uid, scp_fd); if (rv == 0) { *uid = (uid_t)i_uid; } } else { *uid = (uid_t) -1; *scp_fd = -1; } } return rv; } /*****************************************************************************/ int eicp_send_logout_request(struct trans *trans) { return libipm_msg_out_simple_send(trans, (int)E_EICP_LOGOUT_REQUEST, NULL); } /*****************************************************************************/ int eicp_send_create_session_request(struct trans *trans, int scp_fd, unsigned int display, enum scp_session_type type, unsigned short width, unsigned short height, unsigned char bpp, const char *shell, const char *directory) { return libipm_msg_out_simple_send( trans, (int)E_EICP_CREATE_SESSION_REQUEST, "huyqqyss", scp_fd, display, type, width, height, bpp, shell, directory); } /*****************************************************************************/ int eicp_get_create_session_request(struct trans *trans, int *scp_fd, unsigned int *display, enum scp_session_type *type, unsigned short *width, unsigned short *height, unsigned char *bpp, const char **shell, const char **directory) { /* Intermediate values */ uint32_t i_display; uint8_t i_type; uint16_t i_width; uint16_t i_height; uint8_t i_bpp; int rv = libipm_msg_in_parse( trans, "huyqqyss", scp_fd, &i_display, &i_type, &i_width, &i_height, &i_bpp, shell, directory); if (rv == 0) { *display = i_display; *type = (enum scp_session_type)i_type; *width = i_width; *height = i_height; /* bpp is fixed for Xorg session types */ *bpp = (*type == SCP_SESSION_TYPE_XORG) ? 24 : i_bpp; } return rv; } xrdp-0.10.1/libipm/ercp.c000644 001751 000000 00000014060 14652432047 015207 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/ercp.c * @brief ERCP definitions * @author Matt Burt */ #if defined(HAVE_CONFIG_H) #include #endif #include "ercp.h" #include "libipm.h" #include "guid.h" #include "os_calls.h" #include "trans.h" /*****************************************************************************/ static const char * msgno_to_str(unsigned short n) { return (n == E_ERCP_SESSION_ANNOUNCE_EVENT) ? "ERCP_SESSION_ANNOUNCE_EVENT" : (n == E_ERCP_SESSION_FINISHED_EVENT) ? "ERCP_SESSION_FINISHED_EVENT" : NULL; } /*****************************************************************************/ const char * ercp_msgno_to_str(enum ercp_msg_code n, char *buff, unsigned int buff_size) { const char *str = msgno_to_str((unsigned short)n); if (str == NULL) { g_snprintf(buff, buff_size, "[code #%d]", (int)n); } else { g_snprintf(buff, buff_size, "%s", str); } return buff; } /*****************************************************************************/ int ercp_init_trans(struct trans *trans) { return libipm_init_trans(trans, LIBIPM_FAC_ERCP, msgno_to_str); } /*****************************************************************************/ void ercp_trans_from_eicp_trans(struct trans *trans, ttrans_data_in callback_func, void *callback_data) { libipm_change_facility(trans, LIBIPM_FAC_EICP, LIBIPM_FAC_ERCP); trans->trans_data_in = callback_func; trans->callback_data = callback_data; } /*****************************************************************************/ int ercp_msg_in_check_available(struct trans *trans, int *available) { return libipm_msg_in_check_available(trans, available); } /*****************************************************************************/ int ercp_msg_in_wait_available(struct trans *trans) { return libipm_msg_in_wait_available(trans); } /*****************************************************************************/ enum ercp_msg_code ercp_msg_in_get_msgno(const struct trans *trans) { return (enum ercp_msg_code)libipm_msg_in_get_msgno(trans); } /*****************************************************************************/ void ercp_msg_in_reset(struct trans *trans) { libipm_msg_in_reset(trans); } /*****************************************************************************/ int ercp_send_session_announce_event(struct trans *trans, unsigned int display, uid_t uid, enum scp_session_type type, unsigned short start_width, unsigned short start_height, unsigned char bpp, const struct guid *guid, const char *start_ip_addr, time_t start_time) { struct libipm_fsb guid_descriptor = { (void *)guid, sizeof(*guid) }; return libipm_msg_out_simple_send( trans, (int)E_ERCP_SESSION_ANNOUNCE_EVENT, "uiyqqyBsx", display, uid, type, start_width, start_height, bpp, &guid_descriptor, start_ip_addr, start_time); } /*****************************************************************************/ int ercp_get_session_announce_event(struct trans *trans, unsigned int *display, uid_t *uid, enum scp_session_type *type, unsigned short *start_width, unsigned short *start_height, unsigned char *bpp, struct guid *guid, const char **start_ip_addr, time_t *start_time) { /* Intermediate values */ uint32_t i_display; int32_t i_uid; uint8_t i_type; uint16_t i_width; uint16_t i_height; uint8_t i_bpp; int64_t i_start_time; const struct libipm_fsb guid_descriptor = { (void *)guid, sizeof(*guid) }; int rv = libipm_msg_in_parse( trans, "uiyqqyBsx", &i_display, &i_uid, &i_type, &i_width, &i_height, &i_bpp, &guid_descriptor, start_ip_addr, &i_start_time); if (rv == 0) { if (display != NULL) { *display = i_display; } *uid = (uid_t)i_uid; *type = (enum scp_session_type)i_type; *start_width = i_width; *start_height = i_height; *bpp = i_bpp; *start_time = (time_t)i_start_time; } return rv; } /*****************************************************************************/ int ercp_send_session_finished_event(struct trans *trans) { return libipm_msg_out_simple_send( trans, (int)E_ERCP_SESSION_FINISHED_EVENT, NULL); } /*****************************************************************************/ int ercp_send_session_reconnect_event(struct trans *trans) { return libipm_msg_out_simple_send( trans, (int)E_ERCP_SESSION_RECONNECT_EVENT, NULL); } xrdp-0.10.1/libipm/libipm.c000644 001751 000000 00000015257 14652432047 015543 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file libipm/libipm.c * @brief Inter-Process Messaging building and parsing definitions */ #if defined(HAVE_CONFIG_H) #include #endif #include "libipm.h" #include "libipm_private.h" #include "libipm_facilities.h" #include "trans.h" #include "log.h" #include "os_calls.h" const char *libipm_valid_type_chars = "ybnqiuxtsdhogB"; /*****************************************************************************/ void libipm_msg_in_close_file_descriptors(struct trans *self) { struct libipm_priv *priv = (struct libipm_priv *)self->extra_data; if (priv != NULL) { unsigned int i; for (i = priv->in_fd_index ; i < priv->in_fd_count; ++i) { g_file_close(priv->in_fds[i]); } priv->in_fd_count = 0; priv->in_fd_index = 0; } } /**************************************************************************//** * Send function for a struct trans initialised with libipm_init_trans() * * @param self Transport to send on * @param data pointer to data to send * @param len Length of data to send * @return As for write(2) */ static int libipm_trans_send_proc(struct trans *self, const char *data, int len) { int rv; struct libipm_priv *priv = (struct libipm_priv *)self->extra_data; if (priv != NULL && data == self->out_s->data) { /* We're sending the message header. Send any file descriptors * as ancillary data */ rv = g_sck_send_fd_set(self->sck, data, len, priv->out_fds, priv->out_fd_count); } else { rv = g_sck_send(self->sck, data, len, 0); } return rv; } /**************************************************************************//** * Receive function for a struct trans initialised with libipm_init_trans() * * @param self Transport to receive on * @param data pointer to receive data buffer * @param len Length of data to read * @return As for read(2) */ static int libipm_trans_recv_proc(struct trans *self, char *data, int len) { int rv; struct libipm_priv *priv = (struct libipm_priv *)self->extra_data; if (priv != NULL && data == self->in_s->data) { /* We're receiving the message header */ unsigned int fdcount; /* Check there are no live file descriptors in the input * buffer from a previous message. This shouldn't happen, but * if by some chance it does, we could leak file descriptors */ if (priv->in_fd_count > 0) { LOG(LOG_LEVEL_WARNING, "Unconsumed file descriptors detected"); libipm_msg_in_close_file_descriptors(self); } rv = g_sck_recv_fd_set(self->sck, data, len, priv->in_fds, MAX_FD_PER_MSG, &fdcount); if (fdcount > MAX_FD_PER_MSG) { LOG(LOG_LEVEL_WARNING, "%d file descriptors were discarded on recvmsg()", fdcount - MAX_FD_PER_MSG); fdcount = MAX_FD_PER_MSG; } priv->in_fd_count = fdcount; } else { rv = g_sck_recv(self->sck, data, len, 0); } return rv; } /**************************************************************************//** * Destructor for a struct trans initialised with libipm_init_trans() * * @param trans Transport to destroy */ static void libipm_trans_destructor(struct trans *trans) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; libipm_msg_in_close_file_descriptors(trans); if (priv != NULL) { if ((priv->flags & LIBIPM_E_MSG_IN_ERASE_AFTER_USE) != 0 && trans->in_s->data != NULL) { g_memset(trans->in_s->data, '\0', trans->in_s->end - trans->in_s->data); } g_free(priv); trans->extra_data = NULL; trans->extra_destructor = NULL; } } /*****************************************************************************/ enum libipm_status libipm_init_trans(struct trans *trans, enum libipm_facility facility, const char *(*msgno_to_str)(unsigned short msgno)) { struct libipm_priv *priv; enum libipm_status rv; if (trans->extra_data != NULL || trans->extra_destructor != NULL) { LOG(LOG_LEVEL_ERROR, "%s() called with sub-classed transport", __func__); rv = E_LI_PROGRAM_ERROR; } else if ((priv = g_new0(struct libipm_priv, 1)) == 0) { LOG(LOG_LEVEL_ERROR, "%s() out of memory", __func__); rv = E_LI_NO_MEMORY; } else { priv->facility = facility; priv->msgno_to_str = msgno_to_str; trans->trans_send = libipm_trans_send_proc; trans->trans_recv = libipm_trans_recv_proc; trans->extra_data = priv; trans->extra_destructor = libipm_trans_destructor; g_sck_set_non_blocking(trans->sck); libipm_msg_in_reset(trans); rv = E_LI_SUCCESS; } return rv; } /*****************************************************************************/ void libipm_set_flags(struct trans *trans, unsigned int flags) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv != NULL) { priv->flags |= flags; } } /*****************************************************************************/ void libipm_clear_flags(struct trans *trans, unsigned int flags) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv != NULL) { priv->flags &= ~flags; } } /*****************************************************************************/ void libipm_change_facility(struct trans *trans, enum libipm_facility old_facility, enum libipm_facility new_facility) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv != NULL) { if (priv->facility != old_facility) { LOG(LOG_LEVEL_WARNING, "Not changing libipm facility - bad value"); } else { priv->facility = new_facility; } } } xrdp-0.10.1/libipm/libipm_recv.c000644 001751 000000 00000045571 14652432047 016564 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file libipm/libipm.c * @brief Inter-Process Messaging building and parsing definitions */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include "libipm.h" #include "libipm_private.h" #include "libipm_facilities.h" #include "trans.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" /**************************************************************************//** * Checks the message header in the input stream, and gets the size */ static enum libipm_status validate_msg_header(struct trans *trans, int *size) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; enum libipm_status rv = E_LI_BAD_HEADER; int version; int facility; int reserved; in_uint16_le(trans->in_s, version); in_uint16_le(trans->in_s, *size); in_uint16_le(trans->in_s, facility); in_uint16_le(trans->in_s, priv->in_msgno); in_uint32_le(trans->in_s, reserved); if (version != LIBIPM_VERSION) { LOG(LOG_LEVEL_ERROR, "Unexpected version number %d from IPM", version); } else if (*size < HEADER_SIZE || *size > LIBIPM_MAX_MSG_SIZE) { LOG(LOG_LEVEL_ERROR, "Invalid message length %d from IPM", *size); } else if (facility != priv->facility) { LOG(LOG_LEVEL_ERROR, "Invalid facility %d from IPM - expected %d", facility, priv->facility); } else if (reserved != 0) { LOG(LOG_LEVEL_ERROR, "Invalid reserved field %d from IPM", reserved); } else { rv = E_LI_SUCCESS; } return rv; } /*****************************************************************************/ enum libipm_status libipm_msg_in_check_available(struct trans *trans, int *available) { enum libipm_status rv = E_LI_SUCCESS; *available = 0; if (trans == NULL || trans->extra_data == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "Failed devel check"); rv = E_LI_PROGRAM_ERROR; } else if (trans->status != TRANS_STATUS_UP) { rv = E_LI_PROGRAM_ERROR; /* Caller should have checked this */ } else { unsigned int len = trans->in_s->end - trans->in_s->data; /* Data read so far */ if (len == trans->header_size) { if (trans->extra_flags == 0) { /* We've read the header so far - validate it */ int size; rv = validate_msg_header(trans, &size); if (rv == 0) { /* Header is OK */ trans->extra_flags = 1; trans->header_size = size; *available = (size == HEADER_SIZE); } } else { *available = 1; } } } return rv; } /*****************************************************************************/ enum libipm_status libipm_msg_in_wait_available(struct trans *trans) { tbus wobj[1]; int ocnt = 0; enum libipm_status rv = E_LI_SUCCESS; if (trans == NULL || trans->extra_data == NULL || trans->status != TRANS_STATUS_UP) { LOG_DEVEL(LOG_LEVEL_ERROR, "Failed devel check"); rv = E_LI_PROGRAM_ERROR; } else if (trans_get_wait_objs(trans, wobj, &ocnt) != 0) { LOG(LOG_LEVEL_ERROR, "Can't get wait object for libipm transport"); rv = E_LI_TRANSPORT_ERROR; } else { int gotmsg = 0; /* Prevent trans_check_wait_objs() actioning any callcacks * when the message is complete */ ttrans_data_in saved_trans_data_in = trans->trans_data_in; trans->trans_data_in = NULL; while (rv == E_LI_SUCCESS && !gotmsg) { if (g_obj_wait(wobj, ocnt, NULL, 0, -1) != 0) { LOG(LOG_LEVEL_ERROR, "Error waiting on libipm transport"); rv = E_LI_TRANSPORT_ERROR; } else if (trans_check_wait_objs(trans) != 0) { LOG(LOG_LEVEL_ERROR, "Error reading libipm transport"); rv = E_LI_TRANSPORT_ERROR; } else { /* This call logs errors already */ rv = libipm_msg_in_check_available(trans, &gotmsg); } } /* Restore transport callback operation */ trans->trans_data_in = saved_trans_data_in; } return rv; } /*****************************************************************************/ unsigned short libipm_msg_in_get_msgno(const struct trans *trans) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; return (priv == NULL) ? 0 : priv->in_msgno; } /*****************************************************************************/ char libipm_msg_in_peek_type(struct trans *trans) { int result; if (s_check_rem(trans->in_s, 1)) { char c; in_uint8_peek(trans->in_s, c); if (g_strchr(libipm_valid_type_chars, c) != NULL) { result = c; /* Only return valid characters */ } else { result = '?'; } } else { result = '\0'; } return result; } /**************************************************************************//** * Log an input parsing error * * @param trans libipm transport * @param format printf-like format descriptor */ printflike(2, 3) static void log_parse_error(struct trans *trans, const char *format, ...) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; const char *msgno_str = NULL; char msgno_str_buff[32]; char buff[256]; unsigned int len; /* Find a string for the message number */ if (priv->msgno_to_str != NULL) { msgno_str = priv->msgno_to_str(priv->in_msgno); } if (msgno_str == NULL) { g_snprintf(msgno_str_buff, sizeof(msgno_str_buff), "[code #%d]", priv->in_msgno); msgno_str = msgno_str_buff; } len = g_snprintf(buff, sizeof(buff), "Error parsing ipm message for %s, parameter %d :", msgno_str, priv->in_param_count); if (len < sizeof(buff)) { va_list ap; va_start(ap, format); vsnprintf(&buff[len], sizeof(buff) - len, format, ap); va_end(ap); } LOG(LOG_LEVEL_ERROR, "%s", buff); } /* Common format string for overflow reporting */ static const char * not_enough_input_msg = "Input buffer overflow for '%c'"; /**************************************************************************//** * Extract a bool from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to pointer to receive the value * @return != 0 for error * * The value must be a 0 or 1 on-the-wire, or an error is returned. */ static enum libipm_status extract_bool_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; int b; if (!s_check_rem(s, 1)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { in_uint8(s, b); if (b < 0 || b > 1) { log_parse_error(trans, "Boolean has value other than 0/1"); rv = E_LI_BAD_VALUE; } else { int *tmp = va_arg(*argptr, int *); *tmp = b; } } return rv; } /**************************************************************************//** * Extract an octet from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to receive the value * @return != 0 for error */ static enum libipm_status extract_int8_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; if (!s_check_rem(s, 1)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { unsigned char *tmp = va_arg(*argptr, unsigned char *); in_uint8(s, *tmp); } return rv; } /**************************************************************************//** * Extract a 16-bit integer from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to receive the value * @return != 0 for error */ static enum libipm_status extract_int16_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; if (!s_check_rem(s, 2)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { uint16_t *tmp = va_arg(*argptr, uint16_t *); /* * C99 7.18.1.1 requires int16_t (if present) to be a two's * complement representation, so this line is valid for both * int16_t and uint16_t */ in_uint16_le(s, *tmp); } return rv; } /**************************************************************************//** * Extract a 32-bit integer from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to receive the value * @return != 0 for error */ static enum libipm_status extract_int32_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; if (!s_check_rem(s, 4)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { uint32_t *tmp = va_arg(*argptr, uint32_t *); /* * C99 7.18.1.1 requires int32_t (if present) to be a two's * complement representation, so this line is valid for both * int32_t and uint32_t */ in_uint32_le(s, *tmp); } return rv; } /**************************************************************************//** * Extract a 64-bit integer from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to receive the value * @return != 0 for error */ static enum libipm_status extract_int64_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; if (!s_check_rem(s, 8)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { uint64_t *tmp = va_arg(*argptr, uint64_t *); /* * C99 7.18.1.1 requires int64_t (if present) to be a two's * complement representation, so this line is valid for both * int64_t and uint64_t */ in_uint64_le(s, *tmp); } return rv; } /**************************************************************************//** * Extract a char * pointer from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to receive the value * @return != 0 for error */ static enum libipm_status extract_char_ptr_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; /* Look for a string terminator in the rest of the input stream */ char *termptr = g_strnchr(s->p, '\0', s->end - s->p); if (termptr == NULL) { log_parse_error(trans, "Unterminated string value"); rv = E_LI_BAD_VALUE; } else { char **tmp = va_arg(*argptr, char **); *tmp = s->p; s->p = termptr + 1; } return rv; } /**************************************************************************//** * Extract a file descriptor from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to receive the value * @return != 0 for error */ static enum libipm_status extract_fd_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; /* File descriptor available? */ if (priv->in_fd_index >= priv->in_fd_count) { log_parse_error(trans, "No file descriptors available"); rv = E_LI_TOO_MANY_FDS; } else { int *tmp = va_arg(*argptr, int *); *tmp = priv->in_fds[priv->in_fd_index++]; } return rv; } /**************************************************************************//** * Extract a fixed size block from the input stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to block descriptor * @return != 0 for error */ static enum libipm_status extract_fsb_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; const struct libipm_fsb *fsb = va_arg(*argptr, const struct libipm_fsb *); if (fsb == NULL || fsb->data == NULL) { log_parse_error(trans, "Malformed descriptor for '%c'", c); rv = E_LI_PROGRAM_ERROR; } else if (!s_check_rem(s, 2)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { unsigned int len; in_uint16_le(s, len); if (len != fsb->datalen) { log_parse_error(trans, "Type '%c'. Expected %u bytes, but got %u", c, fsb->datalen, len); rv = E_LI_BAD_VALUE; } else if (!s_check_rem(s, len)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { in_uint8a(s, fsb->data, len); rv = E_LI_SUCCESS; } } return rv; } /**************************************************************************//** * Local function to pull data from the input stream * * @param trans libipm transport * @param format type-system compatible string * @param argptr Pointers to variables to receive extracted data * @pre - trans->priv has been checked to be non-NULL * @return != 0 for error */ static enum libipm_status libipm_msg_in_parsev(struct trans *trans, const char *format, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->in_s; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; const char *cp; if (format != NULL) { for (cp = format; rv == 0 && *cp != '\0' ; ++cp) { char c = *cp; char actual_c; ++priv->in_param_count; /* Count the parameter */ /* Check the type of the input is supported */ if (g_strchr(libipm_valid_type_chars, c) == NULL) { log_parse_error(trans, "Type code '%c' is not supported", c); rv = E_LI_UNSUPPORTED_TYPE; break; } /* Check the type of the input matches the stream */ if (!s_check_rem(s, 1)) { log_parse_error(trans, not_enough_input_msg, c); rv = E_LI_BUFFER_OVERFLOW; break; } in_uint8(s, actual_c); if (c != actual_c) { log_parse_error(trans, "Expected '%c', got '%c'", c, actual_c); rv = E_LI_UNEXPECTED_TYPE; break; } switch (c) { case 'y': rv = extract_int8_type(c, trans, argptr); break; case 'b': rv = extract_bool_type(c, trans, argptr); break; case 'n': case 'q': rv = extract_int16_type(c, trans, argptr); break; case 'i': case 'u': rv = extract_int32_type(c, trans, argptr); break; case 'x': case 't': rv = extract_int64_type(c, trans, argptr); break; case 's': rv = extract_char_ptr_type(c, trans, argptr); break; case 'h': rv = extract_fd_type(c, trans, argptr); break; case 'B': rv = extract_fsb_type(c, trans, argptr); break; default: log_parse_error(trans, "Reserved type code '%c' " "is unimplemented", c); rv = E_LI_UNIMPLEMENTED_TYPE; break; } } } return rv; } /*****************************************************************************/ enum libipm_status libipm_msg_in_parse(struct trans *trans, const char *format, ...) { enum libipm_status rv; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "uninitialised transport"); rv = E_LI_PROGRAM_ERROR; } else { va_list argptr; va_start(argptr, format); rv = libipm_msg_in_parsev(trans, format, &argptr); va_end(argptr); } return rv; } /*****************************************************************************/ void libipm_msg_in_reset(struct trans *trans) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "uninitialised transport"); } else { if ((priv->flags & LIBIPM_E_MSG_IN_ERASE_AFTER_USE) != 0) { struct stream *s = trans->in_s; g_memset(s->data, '\0', s->end - s->data); priv->flags &= ~LIBIPM_E_MSG_IN_ERASE_AFTER_USE; } priv->in_msgno = 0; priv->in_param_count = 0; libipm_msg_in_close_file_descriptors(trans); } trans->extra_flags = 0; trans->header_size = HEADER_SIZE; trans->no_stream_init_on_data_in = 1; init_stream(trans->in_s, LIBIPM_MAX_MSG_SIZE); } xrdp-0.10.1/libipm/scp.h000644 001751 000000 00000032462 14652432047 015056 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/scp.h * @brief scp declarations * @author Simone Fedele/ Matt Burt * * Functions in this file use the following naming conventions:- * * E_SCP_{msg}_REQUEST is sent by scp_send_{msg}_request() * E_SCP_{msg}_REQUEST is parsed by scp_get_{msg}_request() * E_SCP_{msg}_RESPONSE is sent by scp_send_{msg}_response() * E_SCP_{msg}_RESPONSE is parsed by scp_get_{msg}_response() */ #ifndef SCP_H #define SCP_H #include "arch.h" struct guid; struct trans; #include "scp_application_types.h" /* Message codes */ enum scp_msg_code { E_SCP_SET_PEERNAME_REQUEST = 1, // No E_SCP_SET_PEERNAME_RESPONSE E_SCP_SYS_LOGIN_REQUEST, E_SCP_UDS_LOGIN_REQUEST, E_SCP_LOGIN_RESPONSE, /* Shared between login request types */ E_SCP_LOGOUT_REQUEST, // No S_SCP_LOGOUT_RESPONSE E_SCP_CREATE_SESSION_REQUEST, E_SCP_CREATE_SESSION_RESPONSE, E_SCP_LIST_SESSIONS_REQUEST, E_SCP_LIST_SESSIONS_RESPONSE, E_SCP_CLOSE_CONNECTION_REQUEST // No E_SCP_CLOSE_CONNECTION_RESPONSE }; /* Common facilities */ /** * Convert a message code to a string for output * @param n Message code * @param buff to contain string * @param buff_size length of buff * @return buff is returned for convenience. */ const char * scp_msgno_to_str(enum scp_msg_code n, char *buff, unsigned int buff_size); /* Connection management facilities */ /** * Maps a port definition to a UNIX domain socket path * @param port Port definition (e.g. from sesman.ini). Can be "" or NULL * @param buff Buffer for result * @param bufflen Length of buff * * @return Number of chars needed for result, excluding the '\0' */ int scp_port_to_unix_domain_path(const char *port, char *buff, unsigned int bufflen); /** * Maps a port definition to a displayable string * @param port Port definition (e.g. from sesman.ini). Can be "" or NULL * @param buff Buffer for result * @param bufflen Length of buff * * @return Number of chars needed for result, excluding the '\0' * * This differs from scp_port_to_unix_domain_path() in that the result is * for displaying to the user (i.e. in a status message), rather than for * connecting to. For log messages, use the result of * scp_port_to_unix_domain_path() */ int scp_port_to_display_string(const char *port, char *buff, unsigned int bufflen); /** * Connect to an SCP server * * @param port Port definition (e.g. from sesman.ini) * @param peername Name of this program or object (e.g. "xrdp-sesadmin") * @param term_func Function to poll during connection for program * termination, or NULL for none. * @return Initialised SCP transport * * The returned transport has the is_term member set to term_func. */ struct trans * scp_connect(const char *port, const char *peername, int (*term_func)(void)); /** * Converts a standard trans connected to an SCP endpoint to an SCP transport * * If you are running on a client, you may wish to use * scp_send_set_peername_request() after the connect to inform the * server who you are. * * @param trans connected endpoint * @return != 0 for error */ int scp_init_trans(struct trans *trans); /** * Creates an SCP transport from a file descriptor * * If you are running on a client, you may wish to use * scp_send_set_peername_request() after the connect to inform the * server who you are. * * @param fd file descriptor * @param trans_type TRANS_TYPE_SERVER or TRANS_TYPE_CLIENT * @param term_func Function to poll during connection for program * termination, or NULL for none. * @return SCP transport, or NULL */ struct trans * scp_init_trans_from_fd(int fd, int trans_type, int (*term_func)(void)); /** * Checks an SCP transport to see if a complete message is * available for parsing * * @param trans SCP transport * @param[out] available != 0 if a complete message is available * @return != 0 for error */ int scp_msg_in_check_available(struct trans *trans, int *available); /** * Waits on a single transport for an SCP message to be available for * parsing * * @param trans libipm transport * @return != 0 for error * * While the call is active, data-in callbacks for the transport are * disabled. * * Only use this call if you have nothing to do until a message * arrives on the transport. If you have other transports to service, use * scp_msg_in_check_available() */ int scp_msg_in_wait_available(struct trans *trans); /** * Gets the SCP message number of an incoming message * * @param trans SCP transport * @return message in the buffer * * The results of calling this routine before scp_msg_in_check_available() * states a message is available are undefined. */ enum scp_msg_code scp_msg_in_get_msgno(const struct trans *trans); /** * Resets an SCP message buffer ready to receive the next message * * @param trans libipm transport */ void scp_msg_in_reset(struct trans *trans); /* -------------------- Setup messages-------------------- */ /** * Send an E_SCP_SET_PEERNAME_REQUEST (SCP client) * * @param trans SCP transport * @param peername Peername * @return != 0 for error * * Server does not send a response * * This message is sent automatically by scp_connect(), but it can * be sent at any time. */ int scp_send_set_peername_request(struct trans *trans, const char *peername); /** * Parse an incoming E_SCP_SET_PEERNAME_REQUEST message (SCP server) * * @param trans SCP transport * @param[out] peername peername * @return != 0 for error */ int scp_get_set_peername_request(struct trans *trans, const char **peername); /* -------------------- Login messages-------------------- */ /** * Send an E_SCP_UDS_LOGIN_REQUEST (SCP client) * * User is logged in using their socket details * * @param trans SCP transport * @return != 0 for error * * Server replies with E_SCP_LOGIN_RESPONSE */ int scp_send_uds_login_request(struct trans *trans); /** * Send an E_SCP_SYS_LOGIN_REQUEST (SCP client) * * User is logged in using explicit credentials * * @param trans SCP transport * @param username Username * @param password Password * @param ip_addr IP address for the client (or "" if not known) * @return != 0 for error * * Server replies with E_SCP_LOGIN_RESPONSE */ int scp_send_sys_login_request(struct trans *trans, const char *username, const char *password, const char *ip_addr); /** * Parse an incoming E_SCP_SYS_LOGIN_REQUEST message (SCP server) * * @param trans SCP transport * @param[out] username Username * @param[out] password Password * @param[out] ip_addr IP address for the client. May be "" * @return != 0 for error */ int scp_get_sys_login_request(struct trans *trans, const char **username, const char **password, const char **ip_addr); /** * Send an E_SCP_LOGIN_RESPONSE (SCP server) * * @param trans SCP transport * @param login_result What happened to the login * @param server_closed If login fails, whether server has closed connection. * If not, a retry can be made. * @param uid UID for a successful login * @return != 0 for error */ int scp_send_login_response(struct trans *trans, enum scp_login_status login_result, int server_closed, int uid); /** * Parses an incoming E_SCP_LOGIN_RESPONSE (SCP client) * * @param trans SCP transport * @param[out] login_result 0 for success, PAM error code otherwise * @param[out] server_closed If login fails, whether server has closed * connection. If not a retry can be made. * @param[out] uid UID for a successful login * * server_closed and uid can be passed NULL if the caller isn't interested. * * @return != 0 for error */ int scp_get_login_response(struct trans *trans, enum scp_login_status *login_result, int *server_closed, int *uid); /** * Send an E_SCP_LOGOUT_REQUEST (SCP client) * * @param trans SCP transport * @return != 0 for error * * Logs the user out (if they are logged in), so that another * login request can be sent, maybe with a different user. * * A reply is not sent */ int scp_send_logout_request(struct trans *trans); /* -------------------- Session messages-------------------- */ /** * Send an E_SCP_CREATE_SESSION_REQUEST (SCP client) * * @param trans SCP transport * @param type Session type * @param width Initial session width * @param height Initial session height * @param bpp Session bits-per-pixel (ignored for Xorg sessions) * @param shell User program to run. May be "" * @param directory Directory to run the program in. May be "" * @return != 0 for error * * Server replies with E_SCP_CREATE_SESSION_RESPONSE */ int scp_send_create_session_request(struct trans *trans, enum scp_session_type type, unsigned short width, unsigned short height, unsigned char bpp, const char *shell, const char *directory); /** * Parse an incoming E_SCP_CREATE_SESSION_REQUEST (SCP server) * * @param trans SCP transport * @param[out] type Session type * @param[out] width Initial session width * @param[out] height Initial session height * @param[out] bpp Session bits-per-pixel (ignored for Xorg sessions) * @param[out] shell User program to run. May be "" * @param[out] directory Directory to run the program in. May be "" * @return != 0 for error * * Returned string pointers are valid until scp_msg_in_reset() is * called for the transport */ int scp_get_create_session_request(struct trans *trans, enum scp_session_type *type, unsigned short *width, unsigned short *height, unsigned char *bpp, const char **shell, const char **directory); /** * Send an E_SCP_CREATE_SESSION_RESPONSE (SCP server) * * @param trans SCP transport * @param status Status of creation request * @param display Should be zero if create session failed. * @param guid Guid for session. Should be all zeros if create session failed * * @return != 0 for error */ int scp_send_create_session_response(struct trans *trans, enum scp_screate_status status, int display, const struct guid *guid); /** * Parse an incoming E_SCP_CREATE_SESSION_RESPONSE (SCP client) * * @param trans SCP transport * @param[out] status Status of creation request * @param[out] display Should be zero if create session failed. * @param[out] guid Guid for session. Should be all zeros if create session * failed * * @return != 0 for error */ int scp_get_create_session_response(struct trans *trans, enum scp_screate_status *status, int *display, struct guid *guid); /** * Send an E_LIST_SESSIONS_REQUEST (SCP client) * * @param trans SCP transport * @return != 0 for error * * Server replies with one or more E_SCP_LIST_SESSIONS_RESPONSE */ int scp_send_list_sessions_request(struct trans *trans); /** * Send an E_LIST_SESSIONS_RESPONSE (SCP server) * * @param trans SCP transport * @param status Status of request * @param info Session to send if status == E_SCL_LS_SESSION_INFO * @return != 0 for error */ int scp_send_list_sessions_response( struct trans *trans, enum scp_list_sessions_status status, const struct scp_session_info *info); /** * Parse an incoming E_LIST_SESSIONS_RESPONSE (SCP client) * * @param trans SCP transport * @param[out] status Status of request * @param[out] info Session if status == E_SCL_LS_SESSION_INFO * @return != 0 for error * * The session info is returned as a dynamically allocated structure. * After use the structure (and its members) can be de-allocated with * a single call to g_free() * * The info structures can be added to a 'struct list' with auto_free set. * When the list is de-allocated, all the structures will be de-allocated too. */ int scp_get_list_sessions_response( struct trans *trans, enum scp_list_sessions_status *status, struct scp_session_info **info); /** * Send an E_CLOSE_CONNECTION_REQUEST (SCP client) * * @param trans SCP transport * @return != 0 for error * * Server closes the connection quietly. */ int scp_send_close_connection_request(struct trans *trans); #endif /* SCP_H */ xrdp-0.10.1/libipm/scp_application_types.h000644 001751 000000 00000010061 14652432047 020654 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/scp_application_types.h * @brief scp type declarations intended for use in the application * @author Simone Fedele/ Matt Burt */ #ifndef SCP_APPLICATION_TYPES_H #define SCP_APPLICATION_TYPES_H #include /** * Select the desktop application session type */ enum scp_session_type { SCP_SESSION_TYPE_XVNC = 0, ///< Session used Xvnc SCP_SESSION_TYPE_XORG ///< Session used Xorg + xorgxrdp }; #define SCP_SESSION_TYPE_TO_STR(t) \ ((t) == SCP_SESSION_TYPE_XVNC ? "Xvnc" : \ (t) == SCP_SESSION_TYPE_XORG ? "Xorg" : \ "unknown" \ ) /** * @brief Information to display about a particular sesman session */ struct scp_session_info { int sid; ///< Session ID unsigned int display; ///< Display number enum scp_session_type type; ///< Session type unsigned short width; ///< Initial session width unsigned short height; ///< Initial session height unsigned char bpp; ///< Session bits-per-pixel time_t start_time; ///< When session was created uid_t uid; ///< Username for session char *start_ip_addr; ///< IP address of starting client }; /** * Status of a login request */ enum scp_login_status { E_SCP_LOGIN_OK = 0, ///< The connection is now loggned in E_SCP_LOGIN_ALREADY_LOGGED_IN, //< A user is currently logged in E_SCP_LOGIN_NO_MEMORY, ///< Memory allocation failure /** * User couldn't be authenticated, or user doesn't exist */ E_SCP_LOGIN_NOT_AUTHENTICATED, E_SCP_LOGIN_NOT_AUTHORIZED, ///< User is authenticated, but not authorized E_SCP_LOGIN_GENERAL_ERROR ///< An unspecific error has occurred }; /** * Convert an scp_login_status code to a readable string for output * @param n Message code * @param buff to contain string * @param buff_size length of buff * @return buff is returned for convenience. */ const char * scp_login_status_to_str(enum scp_login_status n, char *buff, unsigned int buff_size); /** * Status of a session creation request */ enum scp_screate_status { E_SCP_SCREATE_OK = 0, ///< Session created E_SCP_SCREATE_NO_MEMORY, ///< Memory allocation failure E_SCP_SCREATE_NOT_LOGGED_IN, ///< Connection is not logged in E_SCP_SCREATE_MAX_REACHED, ///< Max number of sessions already reached E_SCP_SCREATE_NO_DISPLAY, ///< No X server display number is available E_SCP_SCREATE_X_SERVER_FAIL, ///< X server could not be started E_SCP_SCREATE_GENERAL_ERROR ///< An unspecific error has occurred }; /** * Convert an scp_session creation code to a readable string for output * @param n Message code * @param buff to contain string * @param buff_size length of buff * @return buff is returned for convenience. */ const char * scp_screate_status_to_str(enum scp_screate_status n, char *buff, unsigned int buff_size); /** * Status of an list sessions message */ enum scp_list_sessions_status { /** * This message contains a valid session, and other messages * will be sent */ E_SCP_LS_SESSION_INFO = 0, /** * This message indicates the end of a list of sessions. No session * is contained in the message */ E_SCP_LS_END_OF_LIST, /** * Client hasn't logged in yet */ E_SCP_LS_NOT_LOGGED_IN = 100, /** * A client-side error occurred allocating memory for the session */ E_SCP_LS_NO_MEMORY }; #endif /* SCP_APPLICATION_TYPES_H */ xrdp-0.10.1/libipm/libipm_send.c000644 001751 000000 00000042122 14652432047 016543 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file libipm/libipm.c * @brief Inter-Process Messaging building and parsing definitions */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include "libipm.h" #include "libipm_private.h" #include "libipm_facilities.h" #include "trans.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" /**************************************************************************//** * Log an output appending error * * @param trans libipm transport * @param format printf-like format descriptor */ printflike(2, 3) static void log_append_error(struct trans *trans, const char *format, ...) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; const char *msgno_str = NULL; char msgno_str_buff[32]; char buff[256]; unsigned int len; /* Find a string for the message number */ if (priv->msgno_to_str != NULL) { msgno_str = priv->msgno_to_str(priv->out_msgno); } if (msgno_str == NULL) { g_snprintf(msgno_str_buff, sizeof(msgno_str_buff), "[code #%d]", priv->out_msgno); msgno_str = msgno_str_buff; } len = g_snprintf(buff, sizeof(buff), "Error creating ipm message for %s, parameter %d :", msgno_str, priv->out_param_count); if (len < sizeof(buff)) { va_list ap; va_start(ap, format); vsnprintf(&buff[len], sizeof(buff) - len, format, ap); va_end(ap); } LOG(LOG_LEVEL_ERROR, "%s", buff); } /* Common format string for overflow reporting */ static const char * not_enough_output_msg = "Not enough space in output buffer for '%c'"; /* Common format string for bad value reporting */ static const char * bad_value_msg = "Type '%c' has unsupported value '%d'"; /**************************************************************************//** * Add a bool to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack (promoted to int) * @return != 0 for error * * The boolean value must be a 0 or a 1. */ static enum libipm_status append_bool_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; if (!s_check_rem_out(s, 1 + 1)) { log_append_error(trans, not_enough_output_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { int tmp = va_arg(*argptr, int); if (tmp < 0 || tmp > 1) { log_append_error(trans, bad_value_msg, c, tmp); rv = E_LI_BAD_VALUE; } else { out_uint8(s, c); out_uint8(s, tmp); } } return rv; } /**************************************************************************//** * Add an octet to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack (promoted to int) * @return != 0 for error */ static enum libipm_status append_int8_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; if (!s_check_rem_out(s, 1 + 1)) { log_append_error(trans, not_enough_output_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { int tmp = va_arg(*argptr, int); if (tmp < 0 || tmp > 255) { log_append_error(trans, bad_value_msg, c, tmp); rv = E_LI_BAD_VALUE; } else { out_uint8(s, c); out_uint8(s, tmp); } } return rv; } /**************************************************************************//** * Add an 16-bit integer to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack (promoted to int) * @return != 0 for error */ static enum libipm_status append_int16_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; if (!s_check_rem_out(s, 1 + 2)) { log_append_error(trans, not_enough_output_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { int tmp = va_arg(*argptr, int); if ((c == 'n' && (tmp < -0x8000 || tmp > 0x7fff)) || (c == 'q' && (tmp < 0 || tmp > 0xffff))) { log_append_error(trans, bad_value_msg, c, tmp); rv = E_LI_BAD_VALUE; } else { out_uint8(s, c); out_uint16_le(s, tmp); } } return rv; } /**************************************************************************//** * Add a 32-bit integer to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack * @return != 0 for error */ static enum libipm_status append_int32_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; if (!s_check_rem_out(s, 1 + 4)) { log_append_error(trans, not_enough_output_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { /* If int is bigger than 4 bytes, the argument will be * promoted to 'int' rather than 'int32_t'/'uint32_t', * and we will need to check the specified value is in range. */ #if SIZEOF_INT > 4 int tmp = va_arg(*argptr, int); if ((c == 'i' && (tmp < -0x80000000 || tmp > 0x7fffffff)) || (c == 'u' && (tmp < 0 || tmp > 0xffffffff))) { log_append_error(trans, bad_value_msg, c, tmp); rv = E_LI_BAD_VALUE; } else { out_uint8(s, c); out_uint32_le(s, tmp); } #else uint32_t tmp = va_arg(*argptr, uint32_t); out_uint8(s, c); out_uint32_le(s, tmp); #endif } return rv; } /**************************************************************************//** * Add a 64-bit integer to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack * @return != 0 for error */ static enum libipm_status append_int64_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; if (!s_check_rem_out(s, 1 + 8)) { log_append_error(trans, not_enough_output_msg, c); rv = E_LI_BUFFER_OVERFLOW; } else { uint64_t tmp = va_arg(*argptr, uint64_t); out_uint8(s, c); out_uint64_le(s, tmp); } return rv; } /**************************************************************************//** * Add a terminated string to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack (promoted to int) * @return != 0 for error * * NULL pointers are not allowed for the string. */ static enum libipm_status append_char_ptr_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; const char *str = va_arg(*argptr, const char *); if (str == NULL) { log_append_error(trans, "String cannot be NULL"); rv = E_LI_PROGRAM_ERROR; } else { unsigned int len = g_strlen(str); if ((len > (LIBIPM_MAX_MSG_SIZE - HEADER_SIZE - 1)) || (!s_check_rem_out(s, 1 + 1 + len))) { log_append_error(trans, "Not enough space in output buffer for " "'%c'[len=%u]", c, len); rv = E_LI_BUFFER_OVERFLOW; } else { out_uint8(s, c); out_uint8p(s, str, len + 1); } } return rv; } /**************************************************************************//** * Add a file descriptor to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr Pointer to value in argument stack (promoted to int) * @return != 0 for error */ static enum libipm_status append_fd_type(char c, va_list *argptr, struct trans *trans) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; int fd = va_arg(*argptr, int); if (fd < 0) { log_append_error(trans, "File descriptor cannot be < 0"); rv = E_LI_PROGRAM_ERROR; } else if (!s_check_rem_out(s, 1)) { log_append_error(trans, "Not enough space in output buffer for '%c'", c); rv = E_LI_BUFFER_OVERFLOW; } else if (priv->out_fd_count >= MAX_FD_PER_MSG) { log_append_error(trans, "Too many file descriptors for '%c'", c); rv = E_LI_TOO_MANY_FDS; } else { out_uint8(s, c); priv->out_fds[priv->out_fd_count++] = fd; } return rv; } /**************************************************************************//** * Append a fixed size block to the output stream * * @param c Type letter which triggered the call * @param trans libipm transport * @param argptr argptr to pointer to block descriptor * @return != 0 for error */ static enum libipm_status append_fsb_type(char c, struct trans *trans, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct stream *s = trans->out_s; const struct libipm_fsb *fsb = va_arg(*argptr, const struct libipm_fsb *); if (fsb == NULL || fsb->data == NULL) { log_append_error(trans, "Malformed descriptor for '%c'", c); rv = E_LI_PROGRAM_ERROR; } else { unsigned int len = fsb->datalen; if ((len > (LIBIPM_MAX_MSG_SIZE - HEADER_SIZE - 2)) || (!s_check_rem_out(s, 1 + 2 + len))) { log_append_error(trans, "Not enough space in output buffer" " for '%c'[len=%u]", c, len); rv = E_LI_BUFFER_OVERFLOW; } else { out_uint8(s, c); out_uint16_le(s, len); out_uint8a(s, fsb->data, len); } } return rv; } /**************************************************************************//** * Local function to append data to the output stream * * @param trans libipm transport * @param format type-system compatible string * @param argptr Variables containing data to append * @pre - trans->priv has been checked to be non-NULL * @return != 0 for error */ static enum libipm_status libipm_msg_out_appendv(struct trans *trans, const char *format, va_list *argptr) { enum libipm_status rv = E_LI_SUCCESS; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; const char *cp; if (format != NULL) { for (cp = format; rv == 0 && *cp != '\0' ; ++cp) { char c = *cp; ++priv->out_param_count; /* Count the parameter */ if (g_strchr(libipm_valid_type_chars, c) == NULL) { log_append_error(trans, "Type code '%c' is not supported", c); rv = E_LI_UNSUPPORTED_TYPE; break; } switch (c) { case 'y': rv = append_int8_type(c, trans, argptr); break; case 'b': rv = append_bool_type(c, trans, argptr); break; case 'n': case 'q': rv = append_int16_type(c, trans, argptr); break; case 'i': case 'u': rv = append_int32_type(c, trans, argptr); break; case 'x': case 't': rv = append_int64_type(c, trans, argptr); break; case 's': rv = append_char_ptr_type(c, trans, argptr); break; case 'h': rv = append_fd_type(c, argptr, trans); break; case 'B': rv = append_fsb_type(c, trans, argptr); break; default: log_append_error(trans, "Reserved type code '%c' " "is unimplemented", c); rv = E_LI_UNIMPLEMENTED_TYPE; break; } } } return rv; } /**************************************************************************//** * Prepare the transport to build an output message * @param trans libipm trans * @param msgno Number of message * @return != 0 for error */ static void init_output_buffer(struct trans *trans, unsigned short msgno) { struct stream *s = trans->out_s; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; init_stream(s, LIBIPM_MAX_MSG_SIZE); /* Leave space for header */ s_push_layer(s, iso_hdr, HEADER_SIZE); priv->out_msgno = msgno; priv->out_param_count = 0; priv->out_fd_count = 0; } /*****************************************************************************/ enum libipm_status libipm_msg_out_init(struct trans *trans, unsigned short msgno, const char *format, ...) { enum libipm_status rv; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "uninitialised transport"); rv = E_LI_PROGRAM_ERROR; } else { va_list argptr; init_output_buffer(trans, msgno); va_start(argptr, format); rv = libipm_msg_out_appendv(trans, format, &argptr); va_end(argptr); } return rv; } /*****************************************************************************/ enum libipm_status libipm_msg_out_append(struct trans *trans, const char *format, ...) { enum libipm_status rv; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "uninitialised transport"); rv = E_LI_PROGRAM_ERROR; } else { va_list argptr; va_start(argptr, format); rv = libipm_msg_out_appendv(trans, format, &argptr); va_end(argptr); } return rv; } /*****************************************************************************/ void libipm_msg_out_mark_end(struct trans *trans) { struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "uninitialised transport"); } else { struct stream *s = trans->out_s; s_mark_end(s); s_pop_layer(s, iso_hdr); /* Write the message header */ out_uint16_le(s, LIBIPM_VERSION); out_uint16_le(s, s->end - s->data); out_uint16_le(s, priv->facility); out_uint16_le(s, priv->out_msgno); out_uint32_le(s, 0); /* Reserved */ /* Move the output pointer back to the end so another * append works, and so libipm_msg_out_erase() knows * exactly what to do */ s->p = s->end; } } /*****************************************************************************/ enum libipm_status libipm_msg_out_simple_send(struct trans *trans, unsigned short msgno, const char *format, ...) { enum libipm_status rv; struct libipm_priv *priv = (struct libipm_priv *)trans->extra_data; if (priv == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "uninitialised transport"); rv = E_LI_PROGRAM_ERROR; } else { va_list argptr; va_start(argptr, format); init_output_buffer(trans, msgno); rv = libipm_msg_out_appendv(trans, format, &argptr); if (rv == E_LI_SUCCESS) { libipm_msg_out_mark_end(trans); if (trans_force_write(trans) != 0) { rv = E_LI_TRANSPORT_ERROR; } } va_end(argptr); } return rv; } /*****************************************************************************/ void libipm_msg_out_erase(struct trans *trans) { struct stream *s = trans->out_s; if (s->size > 0 && s->data != 0) { g_memset(s->data, '\0', s->p - s->data); } } xrdp-0.10.1/libipm/Makefile.am000644 001751 000000 00000000657 14652432047 016155 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libipm.la libipm_la_SOURCES = \ libipm.h \ libipm.c \ libipm_send.c \ libipm_recv.c \ libipm_facilities.h \ libipm_private.h \ eicp.h \ eicp.c \ ercp.h \ ercp.c \ scp.h \ scp.c \ scp_application_types.h \ scp_application_types.c libipm_la_LIBADD = \ $(top_builddir)/common/libcommon.la xrdp-0.10.1/libipm/libipm.h000644 001751 000000 00000027105 14652432047 015543 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file libipm/libipm.h * @brief Inter-Process Messaging building and parsing - public declarations * * The functions in this file are inspired by the D-Bus type system * (see https://dbus.freedesktop.org/doc/dbus-specification.html), * and the sd-bus library API. */ #if !defined(LIBIPM_H) #define LIBIPM_H #include "arch.h" #include "libipm_facilities.h" struct trans; /** * Fixed-size block descriptor for sending blocks of data using libipm * * Use with the type code 'B' * * See the descriptions of libipm_msg_out_append() and libipm_msg_in_parse() * for instructions on how to use this type. */ struct libipm_fsb { void *data; unsigned int datalen; }; /** * Status code for library calls * * These are mainly intended so that the test suite can check the expected * codepath has been followed. * * Wrappers around libipm may assume success is 0, and anything else * is an error. */ enum libipm_status { E_LI_SUCCESS = 0, E_LI_PROGRAM_ERROR, /***< Programming error */ E_LI_NO_MEMORY, /***< Memory allocation failure */ E_LI_UNSUPPORTED_TYPE, /***< Specified type code is unsupported */ E_LI_UNIMPLEMENTED_TYPE, /***< Specified type code is unimplemented */ E_LI_UNEXPECTED_TYPE, /***< Encountered unexpected type on input */ E_LI_BUFFER_OVERFLOW, /***< End of buffer reached unexpectedly */ E_LI_TOO_MANY_FDS, /***< Too many file descriptors encountered */ E_LI_BAD_VALUE, /***< Specified (or incoming) value is out of range */ E_LI_BAD_HEADER, /***< Bad incoming message header */ E_LI_TRANSPORT_ERROR /***< Error detected at the transport level */ }; /* Flags values for libipm_[set/clear]_flags() */ /** * Input buffer contains sensitive information and must be * erased by libipm_msg_in_reset(). The flag is one-shot, and * is cleared after use. * * There is no corresponding flag for the output buffer - * use libipm_msg_out_erase() explicitly */ #define LIBIPM_E_MSG_IN_ERASE_AFTER_USE (1u<<0) /** * Prepare a standard 'struct trans' for use with libipm * * @param trans libipm transport * @param facility Facility number from libipm_facilities.h * @param msgno_to_str Function to turn a message number into a string * @return != 0 for error. * * The msgno_to_str() function is used for error logging. If the routine * is not specified, or the routine returns NULL, a numeric code is * logged instead. */ enum libipm_status libipm_init_trans(struct trans *trans, enum libipm_facility facility, const char *(*msgno_to_str)(unsigned short msgno)); /** * Set the flag(s) specified for the transport * @param trans libipm transport * @param flags flags to set. Multiple flags should be or'd together. */ void libipm_set_flags(struct trans *trans, unsigned int flags); /** * Clear the flag(s) specified for the transport * @param trans libipm transport * @param flags flags to clear. Multiple flags should be or'd together. */ void libipm_clear_flags(struct trans *trans, unsigned int flags); /** * Change the facility number for the transport * @param trans libipm transport * @param old_facility old transport facility * @param new_facility new transport facility * * This call is required if a libipm transport changes a facility number. * This can be used to implement switches from one functional server state to * another. * * The caller must be aware of the previous facility to change the facility. * In the event of a mismatch, a message is logged and no action is taken. */ void libipm_change_facility(struct trans *trans, enum libipm_facility old_facility, enum libipm_facility new_facility); /** * Initialise an output message * * @param trans libipm transport * @param msgno message number * @param format a description of any arguments to add to the buffer, or * NULL if no arguments are to be added at this time. * * See libipm_msg_out_append() for details of the format string. The format * string is followed immediately by the arguments it describes */ enum libipm_status libipm_msg_out_init(struct trans *trans, unsigned short msgno, const char *format, ...); /** * Append more arguments to an output message * * @param trans libipm transport * @param format a description of any arguments to add to the buffer. * @param != 0 if an error occurs * * The format string is followed immediately by the arguments it * describes. The format string may contain these characters (from the * D-Bus type system):- * * Char | C Type | Description * ---- |------ | ----------- * y |uint8_t | Unsigned 8-bit integer * b |int | Boolean value (see below) * n |int16_t | Signed (two's complement) 16-bit integer * q |uint16_t | Unsigned 16-bit integer * i |int32_t | Signed (two's complement) 32-bit integer * u |uint32_t | Unsigned 32-bit integer * x |int64_t | Signed (two's complement) 64-bit integer * t |uint64_t | Unsigned 64-bit integer * s |char * | NULL-terminated string * h |int | File descriptor * d | - | (reserved) * o | - | (reserved) * g | - | (reserved) * * For the 'b' type, only values 0 and 1 are allowed. Other values * generate an error. * * The 'h' type can only be used where the underlying transport is a * UNIX domain socket. * * The following additions to the D-Bus type system are also supported:- * * Char |C Type | Description * -----|------ | ----------- * B |const struct libipm_fsb * | Fixed-size block pointer * * For the 'B' type, pass in the address of a descriptor containing the * address and size of the object. The object is copied to the output * stream, along with its length. */ enum libipm_status libipm_msg_out_append(struct trans *trans, const char *format, ...); /** * Marks a message as complete and ready for transmission * * @param trans libipm transport */ void libipm_msg_out_mark_end(struct trans *trans); /** * Convenience sending function * * Constructs a simple message and sends it immediately using * libipm_msg_out_init() / libipm_msg_out_mark_end() and * trans_force_write() * * @param trans libipm transport * @param msgno message number * @param format a description of any arguments to add to the buffer, or * NULL if no arguments are to be added at this time. * * See libipm_msg_out_append() for details of the format string. The format * string is followed immediately by the arguments it describes */ enum libipm_status libipm_msg_out_simple_send(struct trans *trans, unsigned short msgno, const char *format, ...); /** * Erase (rather than just ignore) the contents of an output buffer * * Use after sending a message containing data which should not be * kept in memory (e.g. passwords)` * @param trans libipm transport */ void libipm_msg_out_erase(struct trans *trans); /** * Checks a transport to see if a complete libipm message is * available for parsing * * @param trans libipm transport * @param[out] available != 0 if a complete message is available * @return != 0 for error * * When 'available' becomes set, the buffer is guaranteed to * be in a parseable state. * * The results of calling this function after starting to parse a message * and before calling libipm_msg_in_reset() are undefined. */ enum libipm_status libipm_msg_in_check_available(struct trans *trans, int *available); /** * Waits on a single transport for a libipm message to be available for * parsing * * @param trans libipm transport * @return != 0 for error * * While the call is active, data-in callbacks for the transport are * disabled. * * The results of calling this function after starting to parse a message * and before calling libipm_msg_in_reset() are undefined. * * Only use this call if you have nothing to do until a message * arrives on the transport. If you have other transports to service, use * libipm_msg_in_check_available() */ enum libipm_status libipm_msg_in_wait_available(struct trans *trans); /** * Get the message number for a message in the input buffer. * * @param trans libipm transport * @return message number in the buffer * * The results of calling this routine after a call to * libipm_msg_in_reset() and before a successful call to * libipm_msg_in_check_available() (or libipm_msg_wait_available()) * are undefined. */ unsigned short libipm_msg_in_get_msgno(const struct trans *trans); /** * Returns a letter corresponding to the next available type in the * input stream. * * @param trans libipm transport * @return letter of the type, '\0' for end of message, or '?' for * an unrecognised type */ char libipm_msg_in_peek_type(struct trans *trans); /** * Reads arguments from an input message * * @param trans libipm transport * @param format a description of the arguments to read from the buffer. * @param != 0 if an error occurs * * The format string is followed immediately by the arguments it * describes. The format string may contain these characters (from the * D-Bus type system):- * * Char | C Type | Description * ---- | ------ | ----------- * y | uint8_t * | Unsigned 8-bit integer * b | int * | Boolean value (0 or 1 only) * n | int16_t * | Signed (two's complement) 16-bit integer * q | uint16_t * | Unsigned 16-bit integer * i | int32_t * | Signed (two's complement) 32-bit integer * u | uint32_t * | Unsigned 32-bit integer * x | int64_t * | Signed (two's complement) 64-bit integer * t | uint64_t * | Unsigned 64-bit integer * s | char ** | NULL-terminated string * h | int * | File descriptor * d | - | (reserved) * o | - | (reserved) * g | - | (reserved) * * The following additions to the D-Bus type system are also supported:- * * Char | C Type | Description * -----| ------ | ----------- * B | const struct libipm_fsb * | Fixed-size block pointer * * For the 's' type, a pointer into the string in the input buffer is * returned. This pointer will only be valid until the next call to * libipm_msg_in_reset() * * The 'h' type can only be used where the underlying transport is a * UNIX domain socket. * * For the 'B' type, pass in the address of an initialised descriptor * containing the address and size of the object to copy the data * to. The size in the descriptor must match the size of the object * on-the-wire. Unlike 's', the data is copied out of the input buffer. * */ enum libipm_status libipm_msg_in_parse(struct trans *trans, const char *format, ...); /** * Resets a message buffer ready to receive the next message * * If the LIBIPM_E_MSG_IN_ERASE_AFTER_USE flag is set for the transport, * the entire buffer is erased, and the flag is cleared * * Any file descriptors received from the other end but not parsed * by the application are closed. * * @param trans libipm transport */ void libipm_msg_in_reset(struct trans *trans); #endif /* LIBIPM_H */ xrdp-0.10.1/libipm/ercp.h000644 001751 000000 00000015325 14652432047 015221 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/ercp.h * @brief ERCP declarations * @author Matt Burt * * Functions in this file use the following naming conventions:- * * E_ERCP_{msg}_REQUEST is sent by ercp_send_{msg}_request() * E_ERCP_{msg}_REQUEST is parsed by ercp_get_{msg}_request() * E_ERCP_{msg}_RESPONSE is sent by ercp_send_{msg}_response() * E_ERCP_{msg}_RESPONSE is parsed by ercp_get_{msg}_response() * E_ERCP_{msg}_EVENT is sent by ercp_send_{msg}_event() * E_ERCP_{msg}_EVENT is parsed by ercp_get_{msg}_event() */ #ifndef ERCP_H #define ERCP_H #include "arch.h" #include "scp_application_types.h" #include "trans.h" struct guid; /* Message codes */ enum ercp_msg_code { E_ERCP_SESSION_ANNOUNCE_EVENT, E_ERCP_SESSION_FINISHED_EVENT, E_ERCP_SESSION_RECONNECT_EVENT }; /* Common facilities */ /** * Convert a message code to a string for output * @param n Message code * @param buff to contain string * @param buff_size length of buff * @return buff is returned for convenience. */ const char * ercp_msgno_to_str(enum ercp_msg_code n, char *buff, unsigned int buff_size); /* Connection management facilities */ /** * Converts a standard trans connected to an ERCP endpoint to an ERCP transport * * @param trans connected endpoint * @return != 0 for error */ int ercp_init_trans(struct trans *trans); /** * Converts an EICP transport to an ERCP transport. * * This is done following successful transmission or receipt of an * E_EICP_CREATE_SESSION_REQUEST. * * @param trans connected endpoint * @param callback_func New callback function for ERCP messages. * @param callback_data New argument for callback function */ void ercp_trans_from_eicp_trans(struct trans *trans, ttrans_data_in callback_func, void *callback_data); /** * Checks an ERCP transport to see if a complete message is * available for parsing * * @param trans ERCP transport * @param[out] available != 0 if a complete message is available * @return != 0 for error */ int ercp_msg_in_check_available(struct trans *trans, int *available); /** * Waits on a single transport for an ERCP message to be available for * parsing * * @param trans libipm transport * @return != 0 for error * * While the call is active, data-in callbacks for the transport are * disabled. * * Only use this call if you have nothing to do until a message * arrives on the transport. If you have other transports to service, use * ercp_msg_in_check_available() */ int ercp_msg_in_wait_available(struct trans *trans); /** * Gets the ERCP message number of an incoming message * * @param trans ERCP transport * @return message in the buffer * * The results of calling this routine before ercp_msg_in_check_available() * states a message is available are undefined. */ enum ercp_msg_code ercp_msg_in_get_msgno(const struct trans *trans); /** * Resets an ERCP message buffer ready to receive the next message * * @param trans libipm transport */ void ercp_msg_in_reset(struct trans *trans); /* -------------------- Session event messages-------------------- */ /** * Send an E_ERCP_SESSION_ANNOUNCE_EVENT * * Direction : sesexec -> sesman * * This event contains all the information known about a session * * @param trans EICP transport * @param display Display used by session * @param uid UID of user logged in to session * @param type Session type * @param start_width Starting width of seenio * @param start_height Starting height of session * @param bpp Bits-per-pixel for session * @param guid Session GUID * @param start_ip_addr Starting IP address of client * @param start_time Session start time * @return != 0 for error */ int ercp_send_session_announce_event(struct trans *trans, unsigned int display, uid_t uid, enum scp_session_type type, unsigned short start_width, unsigned short start_height, unsigned char bpp, const struct guid *guid, const char *start_ip_addr, time_t start_time); /** * Parse an incoming E_ERCP_SESSION_ANNOUNCE_EVENT * * This event contains all the information known about a session * * @param trans EICP transport * @param[out] display Display used by session. * Pointer can be NULL if this is already known. * @param[out] uid UID of user logged in to session * @param[out] type Session type * @param[out] start_width Starting width of seenio * @param[out] start_height Starting height of session * @param[out] bpp Bits-per-pixel for session * @param[out] guid Session GUID * @param[out] start_ip_addr Starting IP address of client * @param[out] start_time Session start time * @return != 0 for error */ int ercp_get_session_announce_event(struct trans *trans, unsigned int *display, uid_t *uid, enum scp_session_type *type, unsigned short *start_width, unsigned short *start_height, unsigned char *bpp, struct guid *guid, const char **start_ip_addr, time_t *start_time); /** * Send an E_ERCP_SESSION_FINISHED_EVENT * * Direction : sesexec -> sesman * * This event simply states the attached session has finished and can be * removed from any data structures held by sesman * * @param trans EICP transport * @return != 0 for error */ int ercp_send_session_finished_event(struct trans *trans); /** * Send an E_ERCP_SESSION_RECONNECT_EVENT * * Direction : sesman -> sesexec * * This event tells sesexec that a reconnection is about to occur, and * sesexec should run the reconnect script. * * @param trans EICP transport * @return != 0 for error */ int ercp_send_session_reconnect_event(struct trans *trans); #endif /* ERCP_H */ xrdp-0.10.1/libipm/eicp.h000644 001751 000000 00000022301 14652432047 015200 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/eicp.h * @brief EICP declarations * @author Matt Burt * * Functions in this file use the following naming conventions:- * * E_EICP_{msg}_REQUEST is sent by eicp_send_{msg}_request() * E_EICP_{msg}_REQUEST is parsed by eicp_get_{msg}_request() * E_EICP_{msg}_RESPONSE is sent by eicp_send_{msg}_response() * E_EICP_{msg}_RESPONSE is parsed by eicp_get_{msg}_response() */ #ifndef EICP_H #define EICP_H #include "arch.h" #include "scp_application_types.h" struct trans; struct guid; /* Message codes */ enum eicp_msg_code { E_EICP_SYS_LOGIN_REQUEST, E_EICP_SYS_LOGIN_RESPONSE, E_EICP_LOGOUT_REQUEST, // No E_EICP_LOGOUT_RESPONSE E_EICP_CREATE_SESSION_REQUEST // No E_EICP_CREATE_SESSION_RESPONSE }; /* Common facilities */ /** * Convert a message code to a string for output * @param n Message code * @param buff to contain string * @param buff_size length of buff * @return buff is returned for convenience. */ const char * eicp_msgno_to_str(enum eicp_msg_code n, char *buff, unsigned int buff_size); /* Connection management facilities */ /** * Converts a standard trans connected to an EICP endpoint to an EICP transport * * @param trans connected endpoint * @return != 0 for error */ int eicp_init_trans(struct trans *trans); /** * Creates an EICP transport from a file descriptor * * @param fd file descriptor * @param trans_type TRANS_TYPE_SERVER or TRANS_TYPE_CLIENT * @param term_func Function to poll during connection for program * termination, or NULL for none. * @return SCP transport, or NULL */ struct trans * eicp_init_trans_from_fd(int fd, int trans_type, int (*term_func)(void)); /** * Checks an EICP transport to see if a complete message is * available for parsing * * @param trans EICP transport * @param[out] available != 0 if a complete message is available * @return != 0 for error */ int eicp_msg_in_check_available(struct trans *trans, int *available); /** * Waits on a single transport for an EICP message to be available for * parsing * * @param trans libipm transport * @return != 0 for error * * While the call is active, data-in callbacks for the transport are * disabled. * * Only use this call if you have nothing to do until a message * arrives on the transport. If you have other transports to service, use * eicp_msg_in_check_available() */ int eicp_msg_in_wait_available(struct trans *trans); /** * Gets the EICP message number of an incoming message * * @param trans EICP transport * @return message in the buffer * * The results of calling this routine before eicp_msg_in_check_available() * states a message is available are undefined. */ enum eicp_msg_code eicp_msg_in_get_msgno(const struct trans *trans); /** * Resets an EICP message buffer ready to receive the next message * * @param trans libipm transport */ void eicp_msg_in_reset(struct trans *trans); /* -------------------- Connect messages-------------------- */ /** * Send an E_EICP_SYS_LOGIN_REQUEST * * @param trans EICP transport * @param username Username * @param password Password * @param ip_addr IP address for the client (or "" if not known) * @param scp_fd SCP file descriptor from sesman client * @return != 0 for error * * sesexec replies (eventually) with E_EICP_SYS_LOGIN_RESPONSE * * Once this message has been sent, sesman can close its own SCP transport * down, as sesexec is responsible for client communication. When sesexec * responds, sesman can recreate the SCP transport if necessary. * * While E_EICP_SYS_LOGIN_REQUEST is being processed, sesman must assume * sesexec will be unresponsive to other EICP messages (although a * SIGTERM should be effective). */ int eicp_send_sys_login_request(struct trans *trans, const char *username, const char *password, const char *ip_addr, int scp_fd); /** * Parse an incoming E_EICP_SYS_LOGIN_REQUEST message (sesexec) * * @param trans EICP transport * @param[out] username Username * @param[out] password Password * @param[out] ip_addr IP address for the client (or "" if not known) * @param [out] scp_fd SCP file descriptor from sesman client * @return != 0 for error */ int eicp_get_sys_login_request(struct trans *trans, const char **username, const char **password, const char **ip_addr, int *scp_fd); /** * Send an E_EICP_SYS_LOGIN_RESPONSE (sesexec) * * @param trans EICP transport * @param is_logged_in true if the SCP client is logged in * @param uid UID of connected user * @param scp_fd File descriptor of sesman client * @return != 0 for error * * The uid and scp_fd are ignored unless is_logged_in is true. * * If is_logged_in is false, it is assumed that sesexec has properly * closed the connection to the SCP client. */ int eicp_send_sys_login_response(struct trans *trans, int is_logged_in, uid_t uid, int scp_fd); /** * Parses an incoming E_EICP_SYS_LOGIN_RESPONSE (sesexec) * * @param trans EICP transport * @param[out] is_logged_in true if the SCP client is logged in * @param[out] uid UID of connected user * @param[out] scp_fd File descriptor of sesman client * @return != 0 for error * * The uid and client_fd are returned as (uid_t)-1 and -1 respectively * unless is_logged_in is true */ int eicp_get_sys_login_response(struct trans *trans, int *is_logged_in, uid_t *uid, int *scp_fd); /** * Send an E_EICP_LOGOUT_REQUEST (sesexec) * * @param trans EICP transport * @return != 0 for error * * The sesexec process will exit normally */ int eicp_send_logout_request(struct trans *trans); /* -------------------- Session messages-------------------- */ /** * Send an E_EICP_CREATE_SESSION_REQUEST (sesman) * * @param trans EICP transport * @param scp_fd SCP file descriptor from sesman client * @param display X display number to use * @param type Session type * @param width Initial session width * @param height Initial session height * @param bpp Session bits-per-pixel (ignored for Xorg sessions) * @param shell User program to run. May be "" * @param directory Directory to run the program in. May be "" * @return != 0 for error * * The UID for the session comes from one of two places:- * - The UID for a sys login request is used if one has successfully * been executed. * - If no sys login request is used, the UID is taken from the scp_fd * * Following a successful request, the session creation can be * considered to be underway. The result of this operation is * conveyed back to the caller as an ERCP event. The caller must use * ercp_trans_from_eicp_trans() on 'trans' to convert the transport to * an ERCP transport to receive this (and other) session run-time events. */ int eicp_send_create_session_request(struct trans *trans, int scp_fd, unsigned int display, enum scp_session_type type, unsigned short width, unsigned short height, unsigned char bpp, const char *shell, const char *directory); /** * Parse an incoming E_EICP_CREATE_SESSION_REQUEST (sesexec) * * @param trans EICP transport * @param[out] scp_fd SCP file descriptor from sesman client * @param[out] display X display number to use * @param[out] type Session type * @param[out] width Initial session width * @param[out] height Initial session height * @param[out] bpp Session bits-per-pixel (ignored for Xorg sessions) * @param[out] shell User program to run. May be "" * @param[out] directory Directory to run the program in. May be "" * @return != 0 for error * * Returned string pointers are valid until scp_msg_in_reset() is * called for the transport */ int eicp_get_create_session_request(struct trans *trans, int *scp_fd, unsigned int *display, enum scp_session_type *type, unsigned short *width, unsigned short *height, unsigned char *bpp, const char **shell, const char **directory); #endif /* EICP_H */ xrdp-0.10.1/libipm/libipm_facilities.h000644 001751 000000 00000002250 14652432047 017731 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file libipm/libipm_facilities.h * @brief Facilities numbers for facilities built on top of libipm */ #if !defined(LIBIPM__FACILITIES_H) #define LIBIPM__FACILITIES_H /** * Facilities layered on top of libipm (16 bits) */ enum libipm_facility { LIBIPM_FAC_SCP = 1, /**< SCP - Sesman Control Protocol */ LIBIPM_FAC_EICP, /**< EICP - Executive Initialization Control Protocol */ LIBIPM_FAC_ERCP, /**< ERCP - Executive Run-time Control Protocol */ LIBIPM_FAC_TEST = 65535 /**< Used for unit testing */ }; #endif /* LIBIPM_FACILITIES_H */ xrdp-0.10.1/libipm/scp_application_types.c000644 001751 000000 00000005323 14652432047 020654 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/scp_application_types.c * @brief Support routines for types in scp_application_types.h * @author Matt Burt */ #if defined(HAVE_CONFIG_H) #include #endif #include "scp_application_types.h" #include "os_calls.h" /*****************************************************************************/ const char * scp_login_status_to_str(enum scp_login_status n, char *buff, unsigned int buff_size) { const char *str = (n == E_SCP_LOGIN_OK) ? "OK" : (n == E_SCP_LOGIN_ALREADY_LOGGED_IN) ? "A user is already logged in" : (n == E_SCP_LOGIN_NO_MEMORY) ? "No memory for login" : (n == E_SCP_LOGIN_NOT_AUTHENTICATED) ? "User does not exist, or could not be authenticated" : (n == E_SCP_LOGIN_NOT_AUTHORIZED) ? "User is not authorized" : (n == E_SCP_LOGIN_GENERAL_ERROR) ? "General login error" : /* Default */ NULL; if (str == NULL) { g_snprintf(buff, buff_size, "[login error code #%d]", (int)n); } else { g_snprintf(buff, buff_size, "%s", str); } return buff; } /*****************************************************************************/ const char * scp_screate_status_to_str(enum scp_screate_status n, char *buff, unsigned int buff_size) { const char *str = (n == E_SCP_SCREATE_OK) ? "OK" : (n == E_SCP_SCREATE_NO_MEMORY) ? "No memory for session" : (n == E_SCP_SCREATE_NOT_LOGGED_IN) ? "Connection is not logged in" : (n == E_SCP_SCREATE_MAX_REACHED) ? "Max session limit reached" : (n == E_SCP_SCREATE_NO_DISPLAY) ? "No X displays are available" : (n == E_SCP_SCREATE_X_SERVER_FAIL) ? "X server could not be started" : (n == E_SCP_SCREATE_GENERAL_ERROR) ? "General session creation error" : /* Default */ NULL; if (str == NULL) { g_snprintf(buff, buff_size, "[session creation error code #%d]", (int)n); } else { g_snprintf(buff, buff_size, "%s", str); } return buff; } xrdp-0.10.1/libipm/Makefile.in000644 001751 000000 00000055743 14652432075 016175 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = libipm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libipm_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libipm_la_OBJECTS = libipm.lo libipm_send.lo libipm_recv.lo eicp.lo \ ercp.lo scp.lo scp_application_types.lo libipm_la_OBJECTS = $(am_libipm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/eicp.Plo ./$(DEPDIR)/ercp.Plo \ ./$(DEPDIR)/libipm.Plo ./$(DEPDIR)/libipm_recv.Plo \ ./$(DEPDIR)/libipm_send.Plo ./$(DEPDIR)/scp.Plo \ ./$(DEPDIR)/scp_application_types.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libipm_la_SOURCES) DIST_SOURCES = $(libipm_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libipm.la libipm_la_SOURCES = \ libipm.h \ libipm.c \ libipm_send.c \ libipm_recv.c \ libipm_facilities.h \ libipm_private.h \ eicp.h \ eicp.c \ ercp.h \ ercp.c \ scp.h \ scp.c \ scp_application_types.h \ scp_application_types.c libipm_la_LIBADD = \ $(top_builddir)/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libipm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libipm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libipm.la: $(libipm_la_OBJECTS) $(libipm_la_DEPENDENCIES) $(EXTRA_libipm_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libipm_la_OBJECTS) $(libipm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eicp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ercp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libipm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libipm_recv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libipm_send.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_application_types.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/eicp.Plo -rm -f ./$(DEPDIR)/ercp.Plo -rm -f ./$(DEPDIR)/libipm.Plo -rm -f ./$(DEPDIR)/libipm_recv.Plo -rm -f ./$(DEPDIR)/libipm_send.Plo -rm -f ./$(DEPDIR)/scp.Plo -rm -f ./$(DEPDIR)/scp_application_types.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/eicp.Plo -rm -f ./$(DEPDIR)/ercp.Plo -rm -f ./$(DEPDIR)/libipm.Plo -rm -f ./$(DEPDIR)/libipm_recv.Plo -rm -f ./$(DEPDIR)/libipm_send.Plo -rm -f ./$(DEPDIR)/scp.Plo -rm -f ./$(DEPDIR)/scp_application_types.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libipm/scp.c000644 001751 000000 00000043475 14652432047 015057 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file libipm/scp.c * @brief scp definitions * @author Simone Fedele/ Matt Burt */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "scp.h" #include "libipm.h" #include "guid.h" #include "trans.h" #include "os_calls.h" #include "string_calls.h" #include "xrdp_sockets.h" /*****************************************************************************/ static const char * msgno_to_str(unsigned short n) { return (n == E_SCP_SET_PEERNAME_REQUEST) ? "SCP_SET_PEERNAME_REQUEST" : (n == E_SCP_SYS_LOGIN_REQUEST) ? "SCP_SYS_LOGIN_REQUEST" : (n == E_SCP_UDS_LOGIN_REQUEST) ? "SCP_UDS_LOGIN_REQUEST" : (n == E_SCP_LOGIN_RESPONSE) ? "SCP_LOGIN_RESPONSE" : (n == E_SCP_LOGOUT_REQUEST) ? "SCP_LOGOUT_REQUEST" : (n == E_SCP_CREATE_SESSION_REQUEST) ? "SCP_CREATE_SESSION_REQUEST" : (n == E_SCP_CREATE_SESSION_RESPONSE) ? "SCP_CREATE_SESSION_RESPONSE" : (n == E_SCP_LIST_SESSIONS_REQUEST) ? "SCP_LIST_SESSIONS_REQUEST" : (n == E_SCP_LIST_SESSIONS_RESPONSE) ? "SCP_LIST_SESSIONS_RESPONSE" : (n == E_SCP_CLOSE_CONNECTION_REQUEST) ? "SCP_CLOSE_CONNECTION_REQUEST" : NULL; } /*****************************************************************************/ const char * scp_msgno_to_str(enum scp_msg_code n, char *buff, unsigned int buff_size) { const char *str = msgno_to_str((unsigned short)n); if (str == NULL) { g_snprintf(buff, buff_size, "[code #%d]", (int)n); } else { g_snprintf(buff, buff_size, "%s", str); } return buff; } /*****************************************************************************/ /** * Helper function returning 1 if the passed-in string is an integer >= 0 */ static int is_positive_int(const char *s) { for ( ; *s != '\0' ; ++s) { if (!isdigit(*s)) { return 0; } } return 1; } /*****************************************************************************/ int scp_port_to_unix_domain_path(const char *port, char *buff, unsigned int bufflen) { /* GOTCHA: Changes to this logic should be mirrored in * scp_port_to_display_string() */ int result; /* Make sure we can safely de-reference 'port' */ if (port == NULL) { port = ""; } if (port[0] == '/') { result = g_snprintf(buff, bufflen, "%s", port); } else { const char *sep; if ((sep = g_strrchr(port, '/')) != NULL && sep != port) { /* We allow the user to specify an absolute path, but not * a relative one with embedded '/' characters */ LOG(LOG_LEVEL_WARNING, "Ignoring path elements of '%s'", port); port = sep + 1; } if (port[0] == '\0') { port = SCP_LISTEN_PORT_BASE_STR; } else if (is_positive_int(port)) { /* Version v0.9.x and earlier of xrdp used a TCP port * number. If we come across this, we'll ignore it for * compatibility with old config files */ LOG(LOG_LEVEL_WARNING, "Ignoring obsolete SCP port value '%s'", port); port = SCP_LISTEN_PORT_BASE_STR; } result = g_snprintf(buff, bufflen, XRDP_SOCKET_ROOT_PATH "/%s", port); } return result; } /*****************************************************************************/ int scp_port_to_display_string(const char *port, char *buff, unsigned int bufflen) { /* Make sure we can safely de-reference 'port' */ if (port == NULL) { port = ""; } /* Ignore any directories for the display */ const char *sep; if ((sep = g_strrchr(port, '/')) != NULL) { port = sep + 1; } /* Check for a default */ if (port[0] == '\0' || g_strcmp(port, "3350") == 0) { port = SCP_LISTEN_PORT_BASE_STR; } return g_snprintf(buff, bufflen, "%s", port); } /*****************************************************************************/ struct trans * scp_connect(const char *port, const char *peername, int (*term_func)(void)) { char sock_path[256]; struct trans *t; (void)scp_port_to_unix_domain_path(port, sock_path, sizeof(sock_path)); if ((t = trans_create(TRANS_MODE_UNIX, 128, 128)) != NULL) { t->is_term = term_func; if (trans_connect(t, NULL, sock_path, 3000) != 0) { trans_delete(t); t = NULL; } else if (scp_init_trans(t) != 0) { trans_delete(t); t = NULL; } else if (scp_send_set_peername_request(t, peername) != 0) { trans_delete(t); t = NULL; } } return t; } /*****************************************************************************/ int scp_init_trans(struct trans *trans) { return libipm_init_trans(trans, LIBIPM_FAC_SCP, msgno_to_str); } /*****************************************************************************/ struct trans * scp_init_trans_from_fd(int fd, int trans_type, int (*term_func)(void)) { struct trans *result; if ((result = trans_create(TRANS_MODE_UNIX, 128, 128)) == NULL) { LOG(LOG_LEVEL_ERROR, "Can't create SCP transport [%s]", g_get_strerror()); } else { result->sck = fd; result->type1 = trans_type; result->status = TRANS_STATUS_UP; result->is_term = term_func; // Make sure child processes don't inherit our FD (void)g_file_set_cloexec(result->sck, 1); if (scp_init_trans(result) != 0) { LOG(LOG_LEVEL_ERROR, "scp_init_trans() call failed"); trans_delete(result); result = NULL; } } return result; } /*****************************************************************************/ int scp_msg_in_check_available(struct trans *trans, int *available) { return libipm_msg_in_check_available(trans, available); } /*****************************************************************************/ int scp_msg_in_wait_available(struct trans *trans) { return libipm_msg_in_wait_available(trans); } /*****************************************************************************/ enum scp_msg_code scp_msg_in_get_msgno(const struct trans *trans) { return (enum scp_msg_code)libipm_msg_in_get_msgno(trans); } /*****************************************************************************/ void scp_msg_in_reset(struct trans *trans) { libipm_msg_in_reset(trans); } /*****************************************************************************/ int scp_send_set_peername_request(struct trans *trans, const char *peername) { return libipm_msg_out_simple_send( trans, (int)E_SCP_SET_PEERNAME_REQUEST, "s", peername); } /*****************************************************************************/ int scp_get_set_peername_request(struct trans *trans, const char **peername) { return libipm_msg_in_parse( trans, "s", peername); } /*****************************************************************************/ int scp_send_uds_login_request(struct trans *trans) { return libipm_msg_out_simple_send(trans, (int)E_SCP_UDS_LOGIN_REQUEST, NULL); } /*****************************************************************************/ int scp_send_sys_login_request(struct trans *trans, const char *username, const char *password, const char *ip_addr) { int rv; rv = libipm_msg_out_simple_send( trans, (int)E_SCP_SYS_LOGIN_REQUEST, "sss", username, password, ip_addr); /* Wipe the output buffer to remove the password */ libipm_msg_out_erase(trans); return rv; } /*****************************************************************************/ int scp_get_sys_login_request(struct trans *trans, const char **username, const char **password, const char **ip_addr) { /* Make sure the buffer is cleared after processing this message */ libipm_set_flags(trans, LIBIPM_E_MSG_IN_ERASE_AFTER_USE); return libipm_msg_in_parse( trans, "sss", username, password, ip_addr); } /*****************************************************************************/ int scp_send_login_response(struct trans *trans, enum scp_login_status login_result, int server_closed, int uid) { return libipm_msg_out_simple_send( trans, (int)E_SCP_LOGIN_RESPONSE, "ibi", login_result, (server_closed != 0), /* Convert to 0/1 */ uid); } /*****************************************************************************/ int scp_get_login_response(struct trans *trans, enum scp_login_status *login_result, int *server_closed, int *uid) { int32_t i_login_result = 0; int32_t i_uid = 0; int dummy; /* User can pass in NULL for server_closed if they're trying an * login method like UDS for which all fails are fatal. Likewise * they may be uninterested in the uid */ if (server_closed == NULL) { server_closed = &dummy; } if (uid == NULL) { uid = &dummy; } int rv = libipm_msg_in_parse(trans, "ibi", &i_login_result, server_closed, &i_uid); if (rv == 0) { *login_result = (enum scp_login_status)i_login_result; *uid = i_uid; } return rv; } /*****************************************************************************/ int scp_send_logout_request(struct trans *trans) { return libipm_msg_out_simple_send( trans, (int)E_SCP_LOGOUT_REQUEST, NULL); } /*****************************************************************************/ int scp_send_create_session_request(struct trans *trans, enum scp_session_type type, unsigned short width, unsigned short height, unsigned char bpp, const char *shell, const char *directory) { return libipm_msg_out_simple_send( trans, (int)E_SCP_CREATE_SESSION_REQUEST, "yqqyss", type, width, height, bpp, shell, directory); } /*****************************************************************************/ int scp_get_create_session_request(struct trans *trans, enum scp_session_type *type, unsigned short *width, unsigned short *height, unsigned char *bpp, const char **shell, const char **directory) { /* Intermediate values */ uint8_t i_type; uint16_t i_width; uint16_t i_height; uint8_t i_bpp; int rv = libipm_msg_in_parse( trans, "yqqyss", &i_type, &i_width, &i_height, &i_bpp, shell, directory); if (rv == 0) { *type = (enum scp_session_type)i_type; *width = i_width; *height = i_height; /* bpp is fixed for Xorg session types */ *bpp = (*type == SCP_SESSION_TYPE_XORG) ? 24 : i_bpp; } return rv; } /*****************************************************************************/ int scp_send_create_session_response(struct trans *trans, enum scp_screate_status status, int display, const struct guid *guid) { struct libipm_fsb guid_descriptor = { (void *)guid, sizeof(*guid) }; return libipm_msg_out_simple_send( trans, (int)E_SCP_CREATE_SESSION_RESPONSE, "iiB", status, display, &guid_descriptor); } /*****************************************************************************/ int scp_get_create_session_response(struct trans *trans, enum scp_screate_status *status, int *display, struct guid *guid) { /* Intermediate values */ int32_t i_status; int32_t i_display; const struct libipm_fsb guid_descriptor = { (void *)guid, sizeof(*guid) }; int rv = libipm_msg_in_parse( trans, "iiB", &i_status, &i_display, &guid_descriptor); if (rv == 0) { *status = (enum scp_screate_status)i_status; *display = i_display; } return rv; } /*****************************************************************************/ int scp_send_list_sessions_request(struct trans *trans) { return libipm_msg_out_simple_send( trans, (int)E_SCP_LIST_SESSIONS_REQUEST, NULL); } /*****************************************************************************/ int scp_send_list_sessions_response( struct trans *trans, enum scp_list_sessions_status status, const struct scp_session_info *info) { int rv; if (status != E_SCP_LS_SESSION_INFO) { rv = libipm_msg_out_simple_send( trans, (int)E_SCP_LIST_SESSIONS_RESPONSE, "i", status); } else { rv = libipm_msg_out_simple_send( trans, (int)E_SCP_LIST_SESSIONS_RESPONSE, "iiuyqqyxis", status, info->sid, info->display, info->type, info->width, info->height, info->bpp, info->start_time, info->uid, info->start_ip_addr); } return rv; } /*****************************************************************************/ int scp_get_list_sessions_response( struct trans *trans, enum scp_list_sessions_status *status, struct scp_session_info **info) { int32_t i_status; int rv; if (info == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "Bad pointer in %s", __func__); rv = 1; } else if ((rv = libipm_msg_in_parse(trans, "i", &i_status)) == 0) { *status = (enum scp_list_sessions_status)i_status; struct scp_session_info *p = NULL; if (*status == E_SCP_LS_SESSION_INFO) { int32_t i_sid; uint32_t i_display; uint8_t i_type; uint16_t i_width; uint16_t i_height; uint8_t i_bpp; int64_t i_start_time; int32_t i_uid; char *i_start_ip_addr; rv = libipm_msg_in_parse( trans, "iuyqqyxis", &i_sid, &i_display, &i_type, &i_width, &i_height, &i_bpp, &i_start_time, &i_uid, &i_start_ip_addr); if (rv == 0) { /* Allocate a block of memory large enough for the * structure result, and the strings it contains */ unsigned int len = sizeof(struct scp_session_info) + g_strlen(i_start_ip_addr) + 1; if ((p = (struct scp_session_info *)g_malloc(len, 1)) == NULL) { *status = E_SCP_LS_NO_MEMORY; } else { /* Set up the string pointers in the block to point * into the memory allocated after the block */ p->start_ip_addr = (char *)p + sizeof(struct scp_session_info); /* Copy the data over */ p->sid = i_sid; p->display = i_display; p->type = (enum scp_session_type)i_type; p->width = i_width; p->height = i_height; p->bpp = i_bpp; p->start_time = i_start_time; p->uid = i_uid; g_strcpy(p->start_ip_addr, i_start_ip_addr); } } } *info = p; } return rv; } /*****************************************************************************/ int scp_send_close_connection_request(struct trans *trans) { return libipm_msg_out_simple_send( trans, (int)E_SCP_CLOSE_CONNECTION_REQUEST, NULL); } xrdp-0.10.1/libipm/libipm_private.h000644 001751 000000 00000004424 14652432047 017274 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file libipm/libipm_private.h * @brief Inter-Process Messaging building and parsing - private declarations */ #if !defined(LIBIPM_PRIVATE_H) #define LIBIPM_PRIVATE_H #include "libipm_facilities.h" enum { /** * Max size of a libipm message */ LIBIPM_MAX_MSG_SIZE = 8192, /** * Version of libipm wire protocol */ LIBIPM_VERSION = 2, /** * Size of libipm header */ HEADER_SIZE = 12, /** * Max number of file descriptors in a message */ MAX_FD_PER_MSG = 8 }; /** * Private class data stored in the trans 'extra_data' field */ struct libipm_priv { enum libipm_facility facility; unsigned int flags; const char *(*msgno_to_str)(unsigned short msgno); unsigned short out_msgno; unsigned short out_param_count; unsigned short out_fd_count; int out_fds[MAX_FD_PER_MSG]; unsigned short in_msgno; unsigned short in_param_count; /** Pointer to next fd to be consumed by the app */ unsigned short in_fd_index; /** Number of fds in the incoming message */ unsigned short in_fd_count; int in_fds[MAX_FD_PER_MSG]; }; /** * Valid type-system characters * * Contains a list of all the types accepted by libipm_msg_out_append() and * libipm_msg_in_parse() */ extern const char *libipm_valid_type_chars; /** * Close input file descriptors for an input message * * If file descriptors are read from the other end, but not passed to the * application, they must be closed to prevent file descriptor leaks * * @param self Transport to close file descriptors for */ void libipm_msg_in_close_file_descriptors(struct trans *self); #endif /* LIBIPM__PRIVATE_H */ xrdp-0.10.1/librfxcodec/ltmain.sh000644 001751 000000 00001212353 14652432066 016751 0ustar00metawheel000000 000000 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.7 package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # 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. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. 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. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution 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_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --no-warnings equivalent to '-Wnone' --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 more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$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. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. 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) version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/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 } # 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 } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # 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 ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 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 $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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 yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # 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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs 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 () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$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 () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # 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_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # 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 yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # 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. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # 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_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # 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_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; 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 func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && 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 yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && 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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_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 build PIC objects only -prefer-non-pic try to build 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 -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler 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-dir 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 -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 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 '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # 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 $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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 func_append 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 -* | *.la | *.lo ) ;; *) # 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_append_quoted args "$file" done if $opt_dry_run; then # 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 else 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 fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 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" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" 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 "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_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_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_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 -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi 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=: if $isdir; 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. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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 "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -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 "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "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_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) 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" && func_append 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 yes = "$build_old_libs"; 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=: 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 "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_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 "$file$stripped_ext" | $SED "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_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_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 install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; 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 "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $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 case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac 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 func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append 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" "${nlist}I"' # 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "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 "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # 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. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd 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 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac 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_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi 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 () { $debug_cmd 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` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result 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 "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $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 | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # 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 where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $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. 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 file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_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 \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; 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" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${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\ " } # 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 #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #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 /* path handling portability macros */ #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 */ #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 (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ 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_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); 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_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 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; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); 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]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); 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 = (size_t) (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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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) { lt_debugprintf (__FILE__, __LINE__, "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 { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "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 (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t 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) { size_t orig_value_len = strlen (orig_value); size_t 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; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (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 #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (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 case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd 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 # what 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 that 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 bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false 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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && 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_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_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 bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append 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 "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append 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 none = "$pic_object" && test none = "$non_pic_object"; 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 none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 ;; os2dllname) os2dllname=$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 rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append 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 ;; -bindir) prev=bindir 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-export-symbols = "X$arg"; 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" if test -z "$func_stripname_result"; 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 func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # 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 "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm 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|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append 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 ;; -os2dllname) prev=os2dllname 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_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append 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_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_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_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append 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 none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" 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_arg pretty "$arg" arg=$func_quote_arg_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 yes = "$export_dynamic" && 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 \"\$$shlibpath_var\" \| \$SED \'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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # 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_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; 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 "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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=false 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; 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=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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 "$inherited_linker_flags" | $SED '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 "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; 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. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi 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 dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && 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 func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append 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 dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; 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_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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:"*) ;; *) func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append 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 yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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* | *os2*) 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 cannot # 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 no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; 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 "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result 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 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append 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 link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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 "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 func_append 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 no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|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 ;; 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" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; 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) # correct to gnu/linux during the next big refactor 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 0 -ne "$loop"; 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. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 "*) ;; *) func_append 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 "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # 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 yes = "$build_libtool_need_lc"; then func_append 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` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi 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 "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append 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. func_append 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 yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append 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 \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append 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. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; 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 ;; esac ;; 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 " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED '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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append 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 relink = "$opt_mode" || 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 func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$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 func_append 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 func_dll_def_p "$export_symbols" || { # 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 ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || 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 cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs 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 : != "$skipped_export"; 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && 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 func_append 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 "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && 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 func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && 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 func_basename "$output" output_la=$func_basename_result # 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" 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 -z "$objlist" || 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 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$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~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { 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 } 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_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; 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 ${skipped_export-false} && { 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 "$include_expsyms" | $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 func_append 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 } 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 yes = "$module" && 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 func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs 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 test yes = "$build_libtool_libs" || { 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 } if test -n "$pic_flag" || test default != "$pic_mode"; 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" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && 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 " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED '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=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # 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 } 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 func_append 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 func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; 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 "$link_command" | $SED '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 $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # 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" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED '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 $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # 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_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result 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 case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; 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 func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append 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 func_append 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" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result 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 elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" 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 -z "$oldobjs"; 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 yes = "$build_old_libs" && 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_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; 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 func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append 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" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append 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" func_append newdlprefiles " ${lt_sysroot:+=}$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 func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; 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 $rmforce; 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 func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; 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 func_append 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 func_append 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 func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # 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 } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_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 # where 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: xrdp-0.10.1/librfxcodec/install-sh000755 001751 000000 00000036115 14652432071 017130 0ustar00metawheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2024-06-19.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. Report bugs to . GNU Automake home page: . General help using GNU software: ." 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 (GNU Automake) $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-writable /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 incompatibility 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: xrdp-0.10.1/librfxcodec/config_ac-h.in000644 001751 000000 00000003643 14652432071 017611 0ustar00metawheel000000 000000 /* config_ac-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 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 /* Use x86_64 SIMD instructions */ #undef RFX_USE_ACCEL_AMD64 /* Use x86 SIMD instructions */ #undef RFX_USE_ACCEL_X86 /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if 'const' does not conform to ANSI C. */ #undef const xrdp-0.10.1/librfxcodec/src/000755 001751 000000 00000000000 14652432104 015702 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/aclocal.m4000644 001751 000000 00000141630 14652432070 016762 0ustar00metawheel000000 000000 # generated automatically by aclocal 1.17 -*- Autoconf -*- # Copyright (C) 1996-2024 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.72],, [m4_warning([this file was generated for autoconf 2.72. 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-2024 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.17' 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.17], [], [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.17])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-2024 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_COND_IF -*- Autoconf -*- # Copyright (C) 2008-2024 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_COND_IF # _AM_COND_ELSE # _AM_COND_ENDIF # -------------- # These macros are only used for tracing. m4_define([_AM_COND_IF]) m4_define([_AM_COND_ELSE]) m4_define([_AM_COND_ENDIF]) # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE]) # --------------------------------------- # If the shell condition COND is true, execute IF-TRUE, otherwise execute # IF-FALSE. Allow automake to learn about conditional instantiating macros # (the AC_CONFIG_FOOS). AC_DEFUN([AM_COND_IF], [m4_ifndef([_AM_COND_VALUE_$1], [m4_fatal([$0: no such condition "$1"])])dnl _AM_COND_IF([$1])dnl if test -z "$$1_TRUE"; then : m4_n([$2])[]dnl m4_ifval([$3], [_AM_COND_ELSE([$1])dnl else $3 ])dnl _AM_COND_ENDIF([$1])dnl fi[]dnl ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2024 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])]) # Copyright (C) 1999-2024 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2024 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2024 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 AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) 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-2024 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-2024 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2024 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_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2024 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-2024 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])]) # Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2022-2024 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_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2024 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2024 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_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[]*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) 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-2024 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 # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 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 ]) 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]) 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 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) # Copyright (C) 2001-2024 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-2024 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-2024 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 x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif 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 x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif 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 # Copyright (C) 2022-2024 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_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) m4_include([m4/ax_append_compile_flags.m4]) m4_include([m4/ax_append_flag.m4]) m4_include([m4/ax_cflags_warn_all.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_require_defined.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/nasm.m4]) m4_include([m4/pkg.m4]) xrdp-0.10.1/librfxcodec/Makefile.in000644 001751 000000 00000070644 14652432071 017176 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.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 = config_ac.h CONFIG_CLEAN_FILES = rfxcodec.pc rfxcodec-uninstalled.pc CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config_ac-h.in # 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config_ac-h.in \ $(srcdir)/rfxcodec-uninstalled.pc.in $(srcdir)/rfxcodec.pc.in \ compile config.guess config.sub install-sh ltmain.sh 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 -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = -9 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 -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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 pkgconfig_DATA = rfxcodec.pc EXTRA_DIST = bootstrap readme.txt SUBDIRS = \ include \ src \ tests all: config_ac.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile 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): config_ac.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config_ac-h.in $(top_builddir)/config.status $(AM_V_at)rm -f stamp-h1 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config_ac.h $(srcdir)/config_ac-h.in: $(am__configure_deps) $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) $(AM_V_at)rm -f stamp-h1 $(AM_V_at)touch $@ distclean-hdr: -rm -f config_ac.h stamp-h1 rfxcodec.pc: $(top_builddir)/config.status $(srcdir)/rfxcodec.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ rfxcodec-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/rfxcodec-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -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 -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 -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-recursive all-am: Makefile $(DATA) config_ac.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool 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-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pkgconfigDATA .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/rfxcodec-uninstalled.pc.in000644 001751 000000 00000000337 14652432052 022166 0ustar00metawheel000000 000000 Name: rfxcodec Description: Fast jpeg2000 codec compatible with MS RDP servers and xrdp Version: @PACKAGE_VERSION@ Cflags: -I${pc_top_builddir}/${pcfiledir}/include Libs: ${pc_top_builddir}/${pcfiledir}/src/librfxencode.la xrdp-0.10.1/librfxcodec/config.guess000755 001751 000000 00000126014 14652432071 017442 0ustar00metawheel000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # 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 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 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -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 1992-2018 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 # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 set_cc_for_build() { : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { 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" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" 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 } # 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 ; 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 case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # 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 tuples: *-*-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=`(uname -p 2>/dev/null || \ "/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 ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-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) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) 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 # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; 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/[-_].*//' | cut -d. -f1,2` ;; 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}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$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 ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 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`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" case `isainfo -b` in 32) echo i386-pc-solaris2"$UNAME_REL" ;; 64) echo x86_64-pc-solaris2"$UNAME_REL" ;; esac 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) 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 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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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:4.4BSD:*) 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 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 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:*:*) 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 ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-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-$LIBC`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 "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) 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-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) 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 | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" 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-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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.*:*) 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 configure 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 ;; x86_64:Haiku:*:*) echo x86_64-unknown-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 ;; SX-ACE:SUPER-UX:*:*) echo sxace-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 set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-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. # shellcheck disable=SC2154 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 ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xrdp-0.10.1/librfxcodec/readme.txt000644 001751 000000 00000000324 14652432052 017112 0ustar00metawheel000000 000000 This is a fast jpeg2000 codec compatible with MS RDP servers and xrdp. Assembly code in critial parts to maximize speed. Use this to push git remote set-url origin git@github.com:neutrinolabs/librfxcodec.git xrdp-0.10.1/librfxcodec/Makefile.am000644 001751 000000 00000000202 14652432052 017143 0ustar00metawheel000000 000000 ACLOCAL_AMFLAGS = -I m4 pkgconfig_DATA = rfxcodec.pc EXTRA_DIST = bootstrap readme.txt SUBDIRS = \ include \ src \ tests xrdp-0.10.1/librfxcodec/bootstrap000755 001751 000000 00000000661 14652432052 017063 0ustar00metawheel000000 000000 #!/bin/sh command -v autoconf if ! test $? -eq 0 then echo "error, install autoconf" exit 1 fi command -v automake if ! test $? -eq 0 then echo "error, install automake" exit 1 fi command -v libtool || command -v libtoolize if ! test $? -eq 0 then echo "error, install libtool" exit 1 fi command -v pkg-config if ! test $? -eq 0 then echo "error, install pkg-config" exit 1 fi touch configure.ac autoreconf -fvi xrdp-0.10.1/librfxcodec/compile000755 001751 000000 00000016705 14652432071 016505 0ustar00metawheel000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook '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: xrdp-0.10.1/librfxcodec/config.sub000755 001751 000000 00000105526 14652432071 017112 0ustar00metawheel000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-05-24' # 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 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 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # 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 or ALIAS Canonicalize a configuration name. Options: -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 1992-2018 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 # Split fields of configuration type IFS="-" read -r field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers 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 | microblaze* \ | sim | cisco | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; 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 ;; cegcc) basic_machine=arm-unknown os=cegcc ;; cray) basic_machine=j90-cray os=unicos ;; craynv) basic_machine=craynv-cray os=unicosmp ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; 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 ;; hp300bsd) basic_machine=m68k-hp os=bsd ;; hp300hpux) basic_machine=m68k-hp os=hpux ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; vsta) basic_machine=i386-unknown os=vsta ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-pc os=msys ;; mvs) basic_machine=i370-ibm os=mvs ;; nacl) basic_machine=le32-unknown os=nacl ;; 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 ;; necv70) basic_machine=v70-nec os=sysv ;; 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 ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; pw32) basic_machine=i586-unknown os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=rdos ;; rdos32) basic_machine=i386-pc os=rdos ;; rom68k) basic_machine=m68k-rom68k os=coff ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sps7) basic_machine=m68k-bull os=sysv2 ;; stratus) basic_machine=i860-stratus os=sysv4 ;; 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 ;; 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 ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; 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 ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; 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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper | csky \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | 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 \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=${os:-none} ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; m9s12z | m68hcs12z | hcs12z | s12z) basic_machine=s12z-unknown os=${os:-none} ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=${os:-none} ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | 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-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | powerpcspe-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | 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-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | 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. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; abacus) basic_machine=abacus-unknown ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; amiga | amiga-*) basic_machine=m68k-unknown ;; asmjs) basic_machine=asmjs-unknown ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; bluegene*) basic_machine=powerpc-ibm os=cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=${os:-unicos} ;; 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 ;; cr16 | cr16-*) basic_machine=cr16-unknown os=${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=${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 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=${os:-bosx} ;; dpx2*) basic_machine=m68k-bull os=sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; encore | umax | mmax) basic_machine=ns32k-encore ;; elxsi) basic_machine=elxsi-elxsi os=${os:-bsd} ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=hiuxwe2 ;; hp300-*) basic_machine=m68k-hp ;; 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 ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; 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 ;; j90 | j90-cray) basic_machine=j90-cray os=${os:-unicos} ;; iris | iris4d) basic_machine=mips-sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; microblaze*) basic_machine=microblaze-xilinx ;; 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 ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; news-3600 | risc-news) basic_machine=mips-sony os=newsos ;; next | m*-next) basic_machine=m68k-next case $os in nextstep* ) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=hiuxwe2 ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) 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) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; 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 ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=${os:-elf} ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=vxworks ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; tile*) basic_machine=$basic_machine-unknown os=linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; w65*) basic_machine=w65-wdc os=none ;; w89k-*) basic_machine=hppa1.1-winbond os=proelf ;; x64) basic_machine=x86_64-pc ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; none) basic_machine=none-none os=${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 ;; 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 ;; 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. auroraux) os=auroraux ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; 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 ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; none) ;; *-eabi) ;; *) 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 ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; hexagon-*) os=elf ;; tic54x-*) os=coff ;; tic55x-*) os=coff ;; tic6x-*) 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 ;; 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 ;; pru-*) os=elf ;; *-be) os=beos ;; *-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 ;; *-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 ;; *-wrs) os=vxworks ;; *) 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 ;; clix*) vendor=intergraph ;; 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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xrdp-0.10.1/librfxcodec/configure000755 001751 000000 00001643062 14652432071 017041 0ustar00metawheel000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for rfxcodec 0.1.6. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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="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 case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac 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 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) 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 case e in #( e) 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 ;; esac 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: xrdp-devel@googlegroups.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac 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_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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # 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 ' t clear :clear 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} 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='rfxcodec' PACKAGE_TARNAME='rfxcodec' PACKAGE_VERSION='0.1.6' PACKAGE_STRING='rfxcodec 0.1.6' PACKAGE_BUGREPORT='xrdp-devel@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS DEVEL_DEBUG_FALSE DEVEL_DEBUG_TRUE WITH_SIMD_X86_FALSE WITH_SIMD_X86_TRUE WITH_SIMD_AMD64_FALSE WITH_SIMD_AMD64_TRUE NAFLAGS NASM pkgconfigdir LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__xargs_n am__rm_f_notfound 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_pkgconfigdir with_simd enable_devel_all enable_devel_debug ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH' # 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 rfxcodec 0.1.6 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/rfxcodec] --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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of rfxcodec 0.1.6:";; 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-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-devel-all --enable-devel-debug Build library with support for getting better backtraces [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-pkgconfigdir pkg-config installation directory ['${libdir}/pkgconfig'] --without-simd Omit SIMD extensions. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. 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 rfxcodec configure 0.1.6 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext 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>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_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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 rfxcodec $as_me 0.1.6, which was generated by GNU Autoconf 2.72. 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 C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub ltmain.sh compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # 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 case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac 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 config_ac.h:config_ac-h.in" am__api_version='1.17' # 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 case e in #( e) 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 ;; esac 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 sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&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 $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # 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 test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi 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 case e in #( e) 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 ;; esac 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; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi 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='rfxcodec' VERSION='0.1.6' 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 AM_DEFAULT_VERBOSITY=0 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}gcc" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&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_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="gcc" 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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}cc" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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 if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" 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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="$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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}clang" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&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_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="clang" 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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { 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 $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # 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 -version; 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 case e in #( e) ac_file='' ;; esac 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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac 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 case e in #( e) { { 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; } ;; esac 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"); if (!f) return 1; 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.o conftest.obj 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 case e in #( e) 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 case e in #( e) 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; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac 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_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac 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=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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else case e in #( e) ac_cv_c_const=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then printf "%s\n" "#define const /**/" >>confdefs.h fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify 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' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } 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 yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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 ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 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 ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; 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_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # 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_FILECMD="${ac_tool_prefix}file" 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 ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&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_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; 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_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # 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_FILECMD="file" 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 ;; esac fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" 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 FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" 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 ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&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_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" 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 ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 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* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" 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 ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&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_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" 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 ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="$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 ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="$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 ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { 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_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_RANLIB="${ac_tool_prefix}ranlib" 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 ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&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_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { 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_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_RANLIB="ranlib" 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 ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # 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 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #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. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" 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 ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&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_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" 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 ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" 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 ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&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_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" 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 ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" 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 ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&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_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" 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 ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" 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 ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&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_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" 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 ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" 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 ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&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_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" 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 ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" 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 ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&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_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" 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 ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) 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" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } 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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; 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 else case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; 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 else case e in #( e) enable_static=yes ;; esac fi # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; 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 else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi with_aix_soname=$lt_cv_with_aix_soname ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.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 func_cc_basename $compiler cc_basename=$func_cc_basename_result # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$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);}' # 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 # 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 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* 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* ## 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_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-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_prog_compiler_pic='-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 lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; 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_prog_compiler_pic='-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_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; 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). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-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_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # 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'. exclude_expsyms='_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. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$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 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 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 ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$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. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='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 tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ld_shlibs=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 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** 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 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$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. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 hardcode_direct=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 hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$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. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$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. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=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. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$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" module_expsym_cmds="$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" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='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 "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $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='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='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' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='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 hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=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 yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT 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. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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`' 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 # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[23].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } 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 striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check whether --with-pkgconfigdir was given. if test ${with_pkgconfigdir+y} then : withval=$with_pkgconfigdir; else case e in #( e) with_pkgconfigdir='${libdir}/pkgconfig' ;; esac fi pkgconfigdir=$with_pkgconfigdir 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 printf %s "checking CFLAGS for maximum warnings... " >&6; } if test ${ac_cv_cflags_warn_all+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_cflags_warn_all="no, unknown" ac_save_CFLAGS="$CFLAGS" for ac_arg in "-warn all % -warn all" "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS="$ac_save_CFLAGS" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 printf "%s\n" "$ac_cv_cflags_warn_all" >&6; } case ".$ac_cv_cflags_warn_all" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$ac_cv_cflags_warn_all"; } >&5 (: CFLAGS already contains $ac_cv_cflags_warn_all) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $ac_cv_cflags_warn_all" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$ac_cv_cflags_warn_all { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi ;; esac 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 for flag in -Wwrite-strings; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done for flag in -Wmissing-prototypes; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done # SIMD is optional # Check whether --with-simd was given. if test ${with_simd+y} then : withval=$with_simd; fi if test "x${with_simd}" != "xno"; then # Check if we're on a supported CPU { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we have SIMD optimisations for cpu type" >&5 printf %s "checking if we have SIMD optimisations for cpu type... " >&6; } case "$host_cpu" in x86_64 | amd64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (x86_64)" >&5 printf "%s\n" "yes (x86_64)" >&6; } for ac_prog in nasm nasmw yasm 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_NASM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NASM"; then ac_cv_prog_NASM="$NASM" # 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_NASM="$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 ;; esac fi NASM=$ac_cv_prog_NASM if test -n "$NASM"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NASM" >&5 printf "%s\n" "$NASM" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$NASM" && break done test -z "$NASM" && as_fn_error $? "no nasm (Netwide Assembler) found" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for object file format of host system" >&5 printf %s "checking for object file format of host system... " >&6; } case "$host_os" in cygwin* | mingw* | pw32* | interix*) case "$host_cpu" in x86_64) objfmt='Win64-COFF' ;; *) objfmt='Win32-COFF' ;; esac ;; msdosdjgpp* | go32*) objfmt='COFF' ;; os2-emx*) # not tested objfmt='MSOMF' # obj ;; linux*coff* | linux*oldld*) objfmt='COFF' # ??? ;; linux*aout*) objfmt='a.out' ;; linux*) case "$host_cpu" in x86_64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac ;; kfreebsd* | freebsd* | netbsd* | openbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then objfmt='BSD-a.out' else case "$host_cpu" in x86_64 | amd64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac fi ;; solaris* | sunos* | sysv* | sco*) case "$host_cpu" in x86_64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac ;; darwin* | rhapsody* | nextstep* | openstep* | macos*) case "$host_cpu" in x86_64) objfmt='Mach-O64' ;; *) objfmt='Mach-O' ;; esac ;; *) objfmt='ELF ?' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $objfmt" >&5 printf "%s\n" "$objfmt" >&6; } if test "$objfmt" = 'ELF ?'; then objfmt='ELF' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unexpected host system. assumed that the format is $objfmt." >&5 printf "%s\n" "$as_me: WARNING: unexpected host system. assumed that the format is $objfmt." >&2;} fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for object file format specifier (NAFLAGS) " >&5 printf %s "checking for object file format specifier (NAFLAGS) ... " >&6; } case "$objfmt" in MSOMF) NAFLAGS='-fobj -DOBJ32';; Win32-COFF) NAFLAGS='-fwin32 -DWIN32';; Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';; COFF) NAFLAGS='-fcoff -DCOFF';; a.out) NAFLAGS='-faout -DAOUT';; BSD-a.out) NAFLAGS='-faoutb -DAOUT';; ELF) NAFLAGS='-felf -DELF';; ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';; RDF) NAFLAGS='-frdf -DRDF';; Mach-O) NAFLAGS='-fmacho -DMACHO';; Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NAFLAGS" >&5 printf "%s\n" "$NAFLAGS" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler ($NASM $NAFLAGS) works" >&5 printf %s "checking whether the assembler ($NASM $NAFLAGS) works... " >&6; } cat > conftest.asm <&5 (eval $try_nasm) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest-nasm.o; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else echo "configure: failed program was:" >&5 cat conftest.asm >&5 rm -rf conftest* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "installation or configuration problem: assembler cannot create object files." "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts assembler output" >&5 printf %s "checking whether the linker accepts assembler output... " >&6; } nasm_save_LIBS="$LIBS" LIBS="conftest-nasm.o $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif void nasmfunc(void); int main (void) { nasmfunc(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : nasm_link_ok=yes else case e in #( e) nasm_link_ok=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$nasm_save_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $nasm_link_ok" >&5 printf "%s\n" "$nasm_link_ok" >&6; } if test "x$nasm_link_ok" = "xno"; then as_fn_error $? "configuration problem: maybe object file format mismatch." "$LINENO" 5 fi simd_arch=x86_64 printf "%s\n" "#define RFX_USE_ACCEL_AMD64 1" >>confdefs.h ;; i*86 | x86 | ia32) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (i386)" >&5 printf "%s\n" "yes (i386)" >&6; } for ac_prog in nasm nasmw yasm 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_NASM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NASM"; then ac_cv_prog_NASM="$NASM" # 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_NASM="$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 ;; esac fi NASM=$ac_cv_prog_NASM if test -n "$NASM"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NASM" >&5 printf "%s\n" "$NASM" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$NASM" && break done test -z "$NASM" && as_fn_error $? "no nasm (Netwide Assembler) found" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for object file format of host system" >&5 printf %s "checking for object file format of host system... " >&6; } case "$host_os" in cygwin* | mingw* | pw32* | interix*) case "$host_cpu" in x86_64) objfmt='Win64-COFF' ;; *) objfmt='Win32-COFF' ;; esac ;; msdosdjgpp* | go32*) objfmt='COFF' ;; os2-emx*) # not tested objfmt='MSOMF' # obj ;; linux*coff* | linux*oldld*) objfmt='COFF' # ??? ;; linux*aout*) objfmt='a.out' ;; linux*) case "$host_cpu" in x86_64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac ;; kfreebsd* | freebsd* | netbsd* | openbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then objfmt='BSD-a.out' else case "$host_cpu" in x86_64 | amd64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac fi ;; solaris* | sunos* | sysv* | sco*) case "$host_cpu" in x86_64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac ;; darwin* | rhapsody* | nextstep* | openstep* | macos*) case "$host_cpu" in x86_64) objfmt='Mach-O64' ;; *) objfmt='Mach-O' ;; esac ;; *) objfmt='ELF ?' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $objfmt" >&5 printf "%s\n" "$objfmt" >&6; } if test "$objfmt" = 'ELF ?'; then objfmt='ELF' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unexpected host system. assumed that the format is $objfmt." >&5 printf "%s\n" "$as_me: WARNING: unexpected host system. assumed that the format is $objfmt." >&2;} fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for object file format specifier (NAFLAGS) " >&5 printf %s "checking for object file format specifier (NAFLAGS) ... " >&6; } case "$objfmt" in MSOMF) NAFLAGS='-fobj -DOBJ32';; Win32-COFF) NAFLAGS='-fwin32 -DWIN32';; Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';; COFF) NAFLAGS='-fcoff -DCOFF';; a.out) NAFLAGS='-faout -DAOUT';; BSD-a.out) NAFLAGS='-faoutb -DAOUT';; ELF) NAFLAGS='-felf -DELF';; ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';; RDF) NAFLAGS='-frdf -DRDF';; Mach-O) NAFLAGS='-fmacho -DMACHO';; Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NAFLAGS" >&5 printf "%s\n" "$NAFLAGS" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler ($NASM $NAFLAGS) works" >&5 printf %s "checking whether the assembler ($NASM $NAFLAGS) works... " >&6; } cat > conftest.asm <&5 (eval $try_nasm) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest-nasm.o; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else echo "configure: failed program was:" >&5 cat conftest.asm >&5 rm -rf conftest* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "installation or configuration problem: assembler cannot create object files." "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts assembler output" >&5 printf %s "checking whether the linker accepts assembler output... " >&6; } nasm_save_LIBS="$LIBS" LIBS="conftest-nasm.o $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif void nasmfunc(void); int main (void) { nasmfunc(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : nasm_link_ok=yes else case e in #( e) nasm_link_ok=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$nasm_save_LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $nasm_link_ok" >&5 printf "%s\n" "$nasm_link_ok" >&6; } if test "x$nasm_link_ok" = "xno"; then as_fn_error $? "configuration problem: maybe object file format mismatch." "$LINENO" 5 fi simd_arch=i386 printf "%s\n" "#define RFX_USE_ACCEL_X86 1" >>confdefs.h ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (\"$host_cpu\")" >&5 printf "%s\n" "no (\"$host_cpu\")" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: SIMD support not available for this CPU. Performance will suffer." >&5 printf "%s\n" "$as_me: WARNING: SIMD support not available for this CPU. Performance will suffer." >&2;} ;; esac fi if test x$simd_arch = xx86_64; then WITH_SIMD_AMD64_TRUE= WITH_SIMD_AMD64_FALSE='#' else WITH_SIMD_AMD64_TRUE='#' WITH_SIMD_AMD64_FALSE= fi if test x$simd_arch = xi386; then WITH_SIMD_X86_TRUE= WITH_SIMD_X86_FALSE='#' else WITH_SIMD_X86_TRUE='#' WITH_SIMD_X86_FALSE= fi # parent project will propagate these options to us when building # Check whether --enable-devel_all was given. if test ${enable_devel_all+y} then : enableval=$enable_devel_all; devel_all=$enableval else case e in #( e) devel_all=no ;; esac fi # Check whether --enable-devel_debug was given. if test ${enable_devel_debug+y} then : enableval=$enable_devel_debug; devel_debug=$enableval else case e in #( e) devel_debug=$devel_all ;; esac fi if test x$devel_debug = xyes ; then DEVEL_DEBUG_TRUE= DEVEL_DEBUG_FALSE='#' else DEVEL_DEBUG_TRUE='#' DEVEL_DEBUG_FALSE= fi # pass debug option to the assembler if specified if test -z "$DEVEL_DEBUG_TRUE"; then : for flag in -DDEBUG; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${NAFLAGS+y} then : case " $NAFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : NAFLAGS already contains \$flag"; } >&5 (: NAFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append NAFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : NAFLAGS=\"\$NAFLAGS\""; } >&5 (: NAFLAGS="$NAFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) NAFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : NAFLAGS=\"\$NAFLAGS\""; } >&5 (: NAFLAGS="$NAFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done fi ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/amd64/Makefile src/x86/Makefile src/sse2/Makefile tests/Makefile rfxcodec.pc rfxcodec-uninstalled.pc" 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; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SIMD_AMD64_TRUE}" && test -z "${WITH_SIMD_AMD64_FALSE}"; then as_fn_error $? "conditional \"WITH_SIMD_AMD64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SIMD_X86_TRUE}" && test -z "${WITH_SIMD_X86_FALSE}"; then as_fn_error $? "conditional \"WITH_SIMD_X86\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEVEL_DEBUG_TRUE}" && test -z "${DEVEL_DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEVEL_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 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 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 case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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 rfxcodec $as_me 0.1.6, which was generated by GNU Autoconf 2.72. 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" config_commands="$ac_config_commands" _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 Configuration commands: $config_commands 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="\\ rfxcodec config.status 0.1.6 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # 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' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _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 "config_ac.h") CONFIG_HEADERS="$CONFIG_HEADERS config_ac.h:config_ac-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/amd64/Makefile") CONFIG_FILES="$CONFIG_FILES src/amd64/Makefile" ;; "src/x86/Makefile") CONFIG_FILES="$CONFIG_FILES src/x86/Makefile" ;; "src/sse2/Makefile") CONFIG_FILES="$CONFIG_FILES src/sse2/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "rfxcodec.pc") CONFIG_FILES="$CONFIG_FILES rfxcodec.pc" ;; "rfxcodec-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES rfxcodec-uninstalled.pc" ;; *) 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 test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` 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 :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`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 ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { 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 $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # 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 library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # 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. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # 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 '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 xrdp-0.10.1/librfxcodec/configure.ac000644 001751 000000 00000004330 14652432052 017403 0ustar00metawheel000000 000000 # Process this file with autoconf to produce a configure script AC_PREREQ(2.69) AC_INIT([rfxcodec], [0.1.6], [xrdp-devel@googlegroups.com]) AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in) AM_INIT_AUTOMAKE([1.6 foreign]) AC_CONFIG_MACRO_DIR([m4]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC AC_C_CONST LT_INIT PKG_INSTALLDIR AX_CFLAGS_WARN_ALL AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes], ,[-Werror]) # SIMD is optional AC_ARG_WITH([simd], AS_HELP_STRING([--without-simd],[Omit SIMD extensions.])) if test "x${with_simd}" != "xno"; then # Check if we're on a supported CPU AC_MSG_CHECKING([if we have SIMD optimisations for cpu type]) case "$host_cpu" in x86_64 | amd64) AC_MSG_RESULT([yes (x86_64)]) AC_PROG_NASM simd_arch=x86_64 AC_DEFINE([RFX_USE_ACCEL_AMD64], [1], [Use x86_64 SIMD instructions]) ;; i*86 | x86 | ia32) AC_MSG_RESULT([yes (i386)]) AC_PROG_NASM simd_arch=i386 AC_DEFINE([RFX_USE_ACCEL_X86], [1], [Use x86 SIMD instructions]) ;; *) AC_MSG_RESULT([no ("$host_cpu")]) AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.]) ;; esac fi AM_CONDITIONAL(WITH_SIMD_AMD64, [test x$simd_arch = xx86_64]) AM_CONDITIONAL(WITH_SIMD_X86, [test x$simd_arch = xi386]) # parent project will propagate these options to us when building AC_ARG_ENABLE(devel_all, AS_HELP_STRING([--enable-devel-all]), [devel_all=$enableval], [devel_all=no]) AC_ARG_ENABLE(devel_debug, AS_HELP_STRING([--enable-devel-debug], [Build library with support for getting better backtraces [default=no]]), [devel_debug=$enableval], [devel_debug=$devel_all]) AM_CONDITIONAL(DEVEL_DEBUG, [test x$devel_debug = xyes ]) # pass debug option to the assembler if specified AM_COND_IF([DEVEL_DEBUG], [AX_APPEND_COMPILE_FLAGS([-DDEBUG], [NAFLAGS])]) AC_CONFIG_FILES([Makefile include/Makefile src/Makefile src/amd64/Makefile src/x86/Makefile src/sse2/Makefile tests/Makefile rfxcodec.pc rfxcodec-uninstalled.pc ]) AC_OUTPUT xrdp-0.10.1/librfxcodec/include/000755 001751 000000 00000000000 14652432104 016536 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/rfxcodec.pc.in000644 001751 000000 00000000374 14652432052 017647 0ustar00metawheel000000 000000 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: rfxcodec Description: Fast jpeg2000 codec compatible with MS RDP servers and xrdp Version: @PACKAGE_VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lrfxencode xrdp-0.10.1/librfxcodec/missing000755 001751 000000 00000017060 14652432071 016521 0ustar00metawheel000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. scriptversion=2024-06-07.14; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells # Copyright (C) 1996-2024 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 autogen autoheader autom4te automake autoreconf bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Report bugs to . GNU Automake home page: . General help using GNU software: ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing (GNU Automake) $scriptversion" 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|autoreconf) 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'" autoheader_deps="'acconfig.h'" automake_deps="'Makefile.am'" aclocal_deps="'acinclude.m4'" case $normalized_program in aclocal*) echo "You should only need it if you modified $aclocal_deps or" echo "$configure_deps." ;; autoconf*) echo "You should only need it if you modified $configure_deps." ;; autogen*) echo "You should only need it if you modified a '.def' or '.tpl' file." echo "You may want to install the GNU AutoGen package:" echo "<$gnu_software_URL/autogen/>" ;; autoheader*) echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." ;; automake*) echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." ;; autoreconf*) echo "You should only need it if you modified $aclocal_deps or" echo "$automake_deps or $autoheader_deps or $automake_deps or" echo "$configure_deps." ;; 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/>" ;; 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/>" ;; 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>" ;; 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/>" ;; perl*) echo "You should only need it to run GNU Autoconf, GNU Automake, " echo " assorted other tools, or if you modified a Perl source file." echo "You may want to install the Perl 5 language interpreter:" echo "<$perl_URL>" ;; *) 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 program_details "$normalized_program" } 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: xrdp-0.10.1/librfxcodec/m4/000755 001751 000000 00000000000 14652432104 015433 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/depcomp000755 001751 000000 00000056217 14652432071 016506 0ustar00metawheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "depcomp (GNU Automake) $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interference from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. ## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: xrdp-0.10.1/librfxcodec/tests/000755 001751 000000 00000000000 14652432105 016256 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/tests/readme.txt000644 001751 000000 00000000262 14652432052 020255 0ustar00metawheel000000 000000 profiling the test build with -pg run make clean make PROFIL=-pg run tests/rfxcodectest --speed --count 10000 gprof -b tests/rfxcodectest > profile.txt look at profile.txt xrdp-0.10.1/librfxcodec/tests/rfxencode.c000644 001751 000000 00000017317 14652432052 020411 0ustar00metawheel000000 000000 /** * RFX codec encoder test * * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include #define MAX_OUT_DATA_BYTES (1024 * 1024) #define MAX_BMP_DATA_BYTES (10 * 1024 * 1024) static char g_in_filename[256] = ""; static char g_out_filename[256] = ""; static int g_count = 1; static int g_no_accel = 0; static int g_use_rlgr1 = 0; struct bmp_magic { char magic[2]; }; struct bmp_hdr { unsigned int size; unsigned short reserved1; unsigned short reserved2; unsigned int offset; }; struct dib_hdr { unsigned int hdr_size; int width; int height; unsigned short nplanes; unsigned short bpp; unsigned int compress_type; unsigned int image_size; int hres; int vres; unsigned int ncolors; unsigned int nimpcolors; }; static int read_bitmap(char *file_name, int *width, int *height, int *bpp, char *bmp_data) { int i; int j; int e; int fd; int file_stride_bytes; int pixel; struct bmp_magic bm; struct bmp_hdr bh; struct dib_hdr dh; unsigned char *src8; int *src32; int *dst32; fd = open(file_name, O_RDONLY); if (fd == -1) { return 1; } if (read(fd, &bm, sizeof(bm)) != sizeof(bm)) { close(fd); return 1; } if (read(fd, &bh, sizeof(bh)) != sizeof(bh)) { close(fd); return 1; } if (read(fd, &dh, sizeof(dh)) != sizeof(dh)) { close(fd); return 1; } if (dh.bpp != 24 && dh.bpp != 32) { printf("error, only support 24 and 32 bpp\n"); close(fd); return 1; } *width = dh.width; *height = dh.height; *bpp = dh.bpp; file_stride_bytes = dh.width * ((dh.bpp + 7) / 8); e = (4 - file_stride_bytes) & 3; src8 = (unsigned char *) malloc(file_stride_bytes * 4); for (j = 0; j < dh.height; j++) { dst32 = (int *) (bmp_data + (dh.width * dh.height * 4) - ((j + 1) * dh.width * 4)); if (read(fd, src8, file_stride_bytes + e) != file_stride_bytes + e) { free(src8); close(fd); return 1; } if (dh.bpp == 32) { src32 = (int *) src8; for (i = 0; i < dh.width; i++) { pixel = src32[i]; dst32[i] = pixel; } } else if (dh.bpp == 24) { for (i = 0; i < dh.width; i++) { pixel = src8[i * 3 + 0] << 0; pixel |= src8[i * 3 + 1] << 8; pixel |= src8[i * 3 + 2] << 16; dst32[i] = pixel; } } } free(src8); close(fd); return 0; } static int out_params(void) { printf("rfxencode: a RemoteFX encoder testing program.\n"); printf(" -i bmp file\n"); printf(" -o rfx file\n"); printf(" -c times to loop\n"); printf(" -n no accel\n"); printf(" -1 use rlgr1\n"); return 0; } static int process(void) { char *out_data; char *bmp_data; int out_fd; int out_bytes = 0; int error; int index; int index_x; int index_y; void *han; int num_tiles; int num_tiles_x; int num_tiles_y; int flags; int width; int height; int bpp; struct rfx_rect region; struct rfx_tile *tiles; struct rfx_tile *tile; out_data = (char *) malloc(MAX_OUT_DATA_BYTES); bmp_data = (char *) malloc(MAX_BMP_DATA_BYTES); memset(bmp_data, 0xff, MAX_BMP_DATA_BYTES); if (read_bitmap(g_in_filename, &width, &height, &bpp, bmp_data) != 0) { printf("read bitmap failed\n"); free(bmp_data); free(out_data); return 1; } printf("process: got bitmap width %d height %d bpp %d\n", width, height, bpp); flags = 0; if (g_no_accel) { flags |= RFX_FLAGS_NOACCEL; } if (g_use_rlgr1) { flags |= RFX_FLAGS_RLGR1; } han = rfxcodec_encode_create(1920, 1080, RFX_FORMAT_BGRA, flags); region.x = 0; region.y = 0; region.cx = width; region.cy = height; num_tiles_x = (width + 63) / 64; num_tiles_y = (height + 63) / 64; num_tiles = num_tiles_x * num_tiles_y; tiles = (struct rfx_tile *) calloc(num_tiles, sizeof(struct rfx_tile)); if (tiles == NULL) { free(bmp_data); free(out_data); return 1; } for (index_y = 0; index_y < num_tiles_y; index_y++) { for (index_x = 0; index_x < num_tiles_x; index_x++) { tile = tiles + (index_y * num_tiles_x + index_x); tile->x = index_x * 64; tile->y = index_y * 64; tile->cx = 64; tile->cy = 64; } } if (han != NULL) { error = 0; for (index = 0; index < g_count; index++) { out_bytes = 1024 * 1024; error = rfxcodec_encode(han, out_data, &out_bytes, bmp_data, width, height, width * 4, ®ion, 1, tiles, num_tiles, NULL, 0); if (error < num_tiles) { break; } } printf("error %d out_bytes %d num_tiles %d\n", error, out_bytes, num_tiles); if (g_out_filename[0] != 0) { out_fd = open(g_out_filename, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (out_fd == -1) { printf("failed to open %s\n", g_out_filename); free(bmp_data); free(out_data); free(tiles); return 1; } if (write(out_fd, out_data, out_bytes) != out_bytes) { printf("write failed\n"); free(bmp_data); free(out_data); free(tiles); close(out_fd); return 1; } close(out_fd); } } rfxcodec_encode_destroy(han); free(bmp_data); free(out_data); free(tiles); return 0; } int main(int argc, char **argv) { int index; if (argc < 2) { out_params(); return 0; } for (index = 1; index < argc; index++) { if (strcmp(argv[index], "-i") == 0) { index++; strcpy(g_in_filename, argv[index]); } else if (strcmp(argv[index], "-o") == 0) { index++; strcpy(g_out_filename, argv[index]); } else if (strcmp(argv[index], "-c") == 0) { index++; g_count = atoi(argv[index]); } else if (strcmp(argv[index], "-n") == 0) { g_no_accel = 1; } else if (strcmp(argv[index], "-1") == 0) { g_use_rlgr1 = 1; } else { out_params(); return 0; } } process(); return 0; } xrdp-0.10.1/librfxcodec/tests/Makefile.am000644 001751 000000 00000000637 14652432052 020321 0ustar00metawheel000000 000000 EXTRA_DIST = readme.txt AM_CPPFLAGS = \ -I$(top_srcdir)/include check_PROGRAMS = rfxcodectest rfxencode test_dwt_rem rfxcodectest_SOURCES = rfxcodectest.c rfxencode_SOURCES = rfxencode.c test_dwt_rem_SOURCES = test_dwt_rem.c rfxcodectest_LDADD = \ $(top_builddir)/src/librfxencode.la rfxencode_LDADD = \ $(top_builddir)/src/librfxencode.la test_dwt_rem_LDADD = \ $(top_builddir)/src/librfxencode.la xrdp-0.10.1/librfxcodec/tests/rfxcodectest.c000644 001751 000000 00000026065 14652432052 021131 0ustar00metawheel000000 000000 /** * RFX codec encoder test * * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include static const unsigned char g_rfx_default_quantization_values[] = { /* LL3 LH3 HL3 HH3 LH2 HL2 HH2 LH1 HL1 HH1 */ 0x66, 0x66, 0x77, 0x88, 0x98, 0x99, 0x99, 0xaa, 0xcc, 0xdc }; /*****************************************************************************/ static int get_mstime(void) { struct timeval tp; gettimeofday(&tp, 0); return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); } /******************************************************************************/ static int speed_random(int count, const char *quants) { void *han; int error; int index; int cdata_bytes; int fd; char *cdata; char *buf; struct rfx_rect regions[1]; struct rfx_tile tiles[2]; int stime; int etime; int tiles_per_second; int num_regions; int num_tiles; int num_quants; int flags; printf("speed_random:\n"); //flags = RFX_FLAGS_RLGR1 | RFX_FLAGS_NOACCEL; flags = RFX_FLAGS_RLGR1; //flags = RFX_FLAGS_RLGR3; //flags = RFX_FLAGS_RLGR1 | RFX_FLAGS_ALPHAV1; error = rfxcodec_encode_create_ex(1920, 1024, RFX_FORMAT_BGRA, flags, &han); if (error != 0) { printf("speed_random: rfxcodec_encode_create_ex failed\n"); return 1; } printf("speed_random: rfxcodec_encode_create_ex ok\n"); cdata = (char *) malloc(128 * 64 * 4); cdata_bytes = 128 * 64 * 4; buf = (char *) malloc(128 * 64 * 4); #if 1 fd = open("/dev/urandom", O_RDONLY); //fd = open("/dev/zero", O_RDONLY); if (read(fd, buf, 128 * 64 * 4) != 128 * 64 * 4) { printf("speed_random: read error\n"); } close(fd); #else memset(buf, 0x7f, 128 * 64 * 4); #endif regions[0].x = 0; regions[0].y = 0; regions[0].cx = 128; regions[0].cy = 64; num_regions = 1; tiles[0].x = 0; tiles[0].y = 0; tiles[0].cx = 64; tiles[0].cy = 64; tiles[0].quant_y = 0; tiles[0].quant_cb = 0; tiles[0].quant_cr = 0; tiles[1].x = 64; tiles[1].y = 0; tiles[1].cx = 64; tiles[1].cy = 64; tiles[1].quant_y = 0; tiles[1].quant_cb = 0; tiles[1].quant_cr = 0; num_tiles = 1; num_quants = 1; error = 0; stime = get_mstime(); flags = 0; //flags = RFX_FLAGS_ALPHAV1; for (index = 0; index < count; index++) { error = rfxcodec_encode_ex(han, cdata, &cdata_bytes, buf, 64, 64, 64 * 4, regions, num_regions, tiles, num_tiles, quants, num_quants, flags); if (error < num_tiles) { break; } } etime = get_mstime(); tiles_per_second = count * num_tiles * 1000 / (etime - stime + 1); printf("speed_random: cdata_bytes %d count %d ms time %d " "tiles_per_second %d\n", cdata_bytes, count, etime - stime, tiles_per_second); rfxcodec_encode_destroy(han); free(buf); free(cdata); return 0; } struct bmp_magic { char magic[2]; }; struct bmp_hdr { unsigned int size; unsigned short reserved1; unsigned short reserved2; unsigned int offset; }; struct dib_hdr { unsigned int hdr_size; int width; int height; unsigned short nplanes; unsigned short bpp; unsigned int compress_type; unsigned int image_size; int hres; int vres; unsigned int ncolors; unsigned int nimpcolors; }; /******************************************************************************/ static int load_bmp_file(int in_fd, char **data, int *width, int *height) { struct bmp_magic bmpm; struct bmp_hdr bmph; struct dib_hdr dibh; int awidth; int aheight; int line_bytes; int index; int jndex; int red; int gre; int blu; int *dst32; char *line; char *line_ptr; if (read(in_fd, &bmpm, sizeof(struct bmp_magic)) != sizeof(struct bmp_magic)) { return 1; } if (read(in_fd, &bmph, sizeof(struct bmp_hdr)) != sizeof(struct bmp_hdr)) { return 1; } if (read(in_fd, &dibh, sizeof(struct dib_hdr)) != sizeof(struct dib_hdr)) { return 1; } if (dibh.bpp != 24) { printf("only support 24 bpp bmp file now\n"); return 1; } printf("bpp %d\n", dibh.bpp); *width = dibh.width; *height = dibh.height; awidth = (dibh.width + 63) & ~63; aheight = (dibh.height + 63) & ~63; *data = (char *) malloc(awidth * aheight * 4); line_bytes = dibh.width * 3; line_bytes = (line_bytes + 3) & ~3; line = (char *) malloc(line_bytes); memset(*data, 0, awidth * aheight); for (index = 0; index < dibh.height; index++) { dst32 = (int *) (*data); dst32 += index * awidth; line_ptr = line; if (read(in_fd, line, line_bytes) != line_bytes) { return 1; } for (jndex = 0; jndex < dibh.width; jndex++) { red = *(line_ptr++); gre = *(line_ptr++); blu = *(line_ptr++); *(dst32++) = (red << 16) | (gre << 8) | blu; } } free(line); return 0; } /******************************************************************************/ static int encode_file(char *data, int width, int height, char *cdata, int *cdata_bytes, const char *quants, int num_quants) { int awidth; int aheight; int num_tiles; int index; int jndex; int error; int num_regions; struct rfx_tile *tiles; struct rfx_tile *tiles_ptr; void *han; struct rfx_rect regions[1]; error = rfxcodec_encode_create_ex(1920, 1024, RFX_FORMAT_BGRA, RFX_FLAGS_RLGR1, &han); if (error != 0) { printf("encode_file: rfxcodec_encode_create_ex failed\n"); return 1; } awidth = (width + 63) & ~63; aheight = (height + 63) & ~63; num_tiles = (awidth / 64) * (aheight / 64); tiles = (struct rfx_tile *) malloc(num_tiles * sizeof(struct rfx_tile)); tiles_ptr = tiles; for (index = 0; index < aheight; index += 64) { for (jndex = 0; jndex < awidth; jndex += 64) { tiles_ptr[0].x = jndex; tiles_ptr[0].y = index; tiles_ptr[0].cx = 64; tiles_ptr[0].cy = 64; tiles_ptr[0].quant_y = 0; tiles_ptr[0].quant_cb = num_quants - 1; tiles_ptr[0].quant_cr = num_quants - 1; tiles_ptr++; } } regions[0].x = 0; regions[0].y = 0; regions[0].cx = width; regions[0].cy = height; num_regions = 1; error = rfxcodec_encode_ex(han, cdata, cdata_bytes, data, width, height, width * 4, regions, num_regions, tiles, num_tiles, quants, num_quants, 0); if (error < num_tiles) { printf("encode_file: rfxcodec_encode failed error %d\n", error); return 1; } rfxcodec_encode_destroy(han); free(tiles); return 0; } /******************************************************************************/ static int read_file(int count, const char *quants, int num_quants, const char *in_file, const char *out_file) { int in_fd; int out_fd; int width; int height; int cdata_bytes; char *data; char *cdata; in_fd = open(in_file, O_RDONLY); if (in_fd == -1) { printf("error opening %s\n", in_file); return 1; } out_fd = -1; if (out_file[0] != 0) { if (access(out_file, F_OK) == 0) { printf("out files exists\n"); return 1; } out_fd = open(out_file, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (out_fd == -1) { printf("error opening %s\n", out_file); return 1; } } data = 0; width = 0; height = 0; if (load_bmp_file(in_fd, &data, &width, &height) != 0) { printf("load_bmp_file failed\n"); return 1; } printf("loaded file ok width %d height %d\n", width, height); cdata_bytes = (width + 64) * (height + 64); cdata = (char *) malloc(cdata_bytes); if (encode_file(data, width, height, cdata, &cdata_bytes, quants, num_quants) != 0) { printf("encode_file failed\n"); return 1; } printf("encode data ok bytes %d\n", cdata_bytes); if (out_fd != -1) { if (write(out_fd, cdata, cdata_bytes) != cdata_bytes) { printf("write failed\n"); } } free(data); free(cdata); close(in_fd); if (out_fd != -1) { close(out_fd); } return 0; } /******************************************************************************/ static int out_usage(void) { printf("rfxdectest usage\n"); printf("this program is used for testing the rfx encoder for both speed " "and integrity\n"); printf("examples\n"); printf(" ./rfxcodectest --speed --count 1000\n"); printf(" ./rfxcodectest -i infile.bmp -o outfile.rfx\n"); printf("\n"); return 0; } /******************************************************************************/ int main(int argc, char **argv) { int index; int do_speed; int do_read; int count; char in_file[256]; char out_file[256]; const char *quants = (const char *) g_rfx_default_quantization_values; do_speed = 0; do_read = 0; in_file[0] = 0; out_file[0] = 0; count = 1; if (argc < 2) { return out_usage(); } for (index = 1; index < argc; index++) { if (strcmp("--speed", argv[index]) == 0) { do_speed = 1; } else if (strcmp("--count", argv[index]) == 0) { index++; count = atoi(argv[index]); } else if (strcmp("-i", argv[index]) == 0) { index++; snprintf(in_file, 255, "%s", argv[index]); do_read = 1; } else if (strcmp("-o", argv[index]) == 0) { index++; snprintf(out_file, 255, "%s", argv[index]); } else { return out_usage(); } } if (do_speed) { speed_random(count, quants); } if (do_read) { read_file(count, quants, 2, in_file, out_file); } return 0; } xrdp-0.10.1/librfxcodec/tests/test_dwt_rem.c000644 001751 000000 00000007622 14652432052 021132 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include "../include/rfxcodec_encode.h" int main(int argc, char **argv) { struct rfxcodec_encode_internals internals; int error; int index; unsigned char in_buffer[4096]; short out_buffer1[4096]; short tmp_buffer1[4096]; //char quans[5] = { 0x66, 0x66, 0x66, 0x66, 0x66 }; char quans[5] = { 0x99, 0x99, 0x99, 0x99, 0x99 }; #if 0 short diff_buffer1[4096]; short diff_buffer2[4096]; short dwt_buffer[4096]; short hist_buffer[4096]; int diff_zeros1; int dwt_zeros1; int diff_zeros2; int dwt_zeros2; short out_buffer2[4096]; short tmp_buffer2[4096]; int fd; fd = open("/dev/urandom", O_RDONLY); #endif error = rfxcodec_encode_get_internals(&internals); if (error == 0) { #if 0 read(fd, tmp_buffer2, 4096 * 2); for (index = 0; index < 1024 * 1024; index++) { int jndex; int kndex; short *dst; short *src; for (kndex = 0; kndex < 64; kndex++) { src = tmp_buffer2 + kndex * 64; dst = tmp_buffer1 + kndex; for (jndex = 0; jndex < 64; jndex += 8) { *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; *dst = *src; src++; dst += 64; } } } if (memcmp(tmp_buffer1, tmp_buffer2, 4096 * 2) == 0) { printf("match\n"); } else { printf("no match\n"); } #endif #if 0 read(fd, dwt_buffer, 4096 * 2); read(fd, hist_buffer, 4096 * 2); internals.rfx_encode_diff_count(diff_buffer1, dwt_buffer, hist_buffer, &diff_zeros1, &dwt_zeros1); internals.rfx_encode_diff_count_amd64(diff_buffer2, dwt_buffer, hist_buffer, &diff_zeros2, &dwt_zeros2); if (memcmp(diff_buffer1, diff_buffer2, 4096 * 2) == 0 && diff_zeros1 == diff_zeros2 && dwt_zeros1 == dwt_zeros2) { //printf("match\n"); } else { printf("no match\n"); } #endif #if 0 read(fd, in_buffer, 4096); internals.rfx_encode_dwt_shift_rem(in_buffer, out_buffer1, tmp_buffer1, quans); //internals.rfx_encode_dwt_shift_rem(in_buffer, out_buffer2, tmp_buffer2, quans); internals.rfx_encode_dwt_shift_rem_sse2(in_buffer, out_buffer2, tmp_buffer2, quans); if (memcmp(out_buffer1, out_buffer2, 4096 * 2) == 0) //if (memcmp(tmp_buffer1, tmp_buffer2, 4096 * 2) == 0) { printf("match\n"); } else { printf("no match\n"); } #endif #if 1 for (index = 0; index < 1024 * 1024; index++) { //internals.rfx_encode_diff_count_amd64(diff_buffer1, dwt_buffer, hist_buffer, &diff_zeros1, &dwt_zeros1); //internals.rfx_encode_diff_count(diff_buffer1, dwt_buffer, hist_buffer, &diff_zeros1, &dwt_zeros1); internals.rfx_encode_dwt_shift_rem_sse2(in_buffer, out_buffer1, tmp_buffer1, quans); //internals.rfx_encode_dwt_shift_rem(in_buffer, out_buffer1, tmp_buffer1, quans); //printf("hi %p\n", internals.rfxencode_dwt_shift_amd64_sse2); //internals.rfxencode_dwt_shift_amd64_sse2(quans, (char*)((int)in_buffer & ~31), // (short*)(((int)out_buffer1) & ~31), // (short*)(((int)tmp_buffer1) & ~31)); } #endif } return 0; } xrdp-0.10.1/librfxcodec/tests/Makefile.in000644 001751 000000 00000046375 14652432071 020344 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = rfxcodectest$(EXEEXT) rfxencode$(EXEEXT) \ test_dwt_rem$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_rfxcodectest_OBJECTS = rfxcodectest.$(OBJEXT) rfxcodectest_OBJECTS = $(am_rfxcodectest_OBJECTS) rfxcodectest_DEPENDENCIES = $(top_builddir)/src/librfxencode.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_rfxencode_OBJECTS = rfxencode.$(OBJEXT) rfxencode_OBJECTS = $(am_rfxencode_OBJECTS) rfxencode_DEPENDENCIES = $(top_builddir)/src/librfxencode.la am_test_dwt_rem_OBJECTS = test_dwt_rem.$(OBJEXT) test_dwt_rem_OBJECTS = $(am_test_dwt_rem_OBJECTS) test_dwt_rem_DEPENDENCIES = $(top_builddir)/src/librfxencode.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rfxcodectest.Po \ ./$(DEPDIR)/rfxencode.Po ./$(DEPDIR)/test_dwt_rem.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(rfxcodectest_SOURCES) $(rfxencode_SOURCES) \ $(test_dwt_rem_SOURCES) DIST_SOURCES = $(rfxcodectest_SOURCES) $(rfxencode_SOURCES) \ $(test_dwt_rem_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ EXTRA_DIST = readme.txt AM_CPPFLAGS = \ -I$(top_srcdir)/include rfxcodectest_SOURCES = rfxcodectest.c rfxencode_SOURCES = rfxencode.c test_dwt_rem_SOURCES = test_dwt_rem.c rfxcodectest_LDADD = \ $(top_builddir)/src/librfxencode.la rfxencode_LDADD = \ $(top_builddir)/src/librfxencode.la test_dwt_rem_LDADD = \ $(top_builddir)/src/librfxencode.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) rfxcodectest$(EXEEXT): $(rfxcodectest_OBJECTS) $(rfxcodectest_DEPENDENCIES) $(EXTRA_rfxcodectest_DEPENDENCIES) @rm -f rfxcodectest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rfxcodectest_OBJECTS) $(rfxcodectest_LDADD) $(LIBS) rfxencode$(EXEEXT): $(rfxencode_OBJECTS) $(rfxencode_DEPENDENCIES) $(EXTRA_rfxencode_DEPENDENCIES) @rm -f rfxencode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rfxencode_OBJECTS) $(rfxencode_LDADD) $(LIBS) test_dwt_rem$(EXEEXT): $(test_dwt_rem_OBJECTS) $(test_dwt_rem_DEPENDENCIES) $(EXTRA_test_dwt_rem_DEPENDENCIES) @rm -f test_dwt_rem$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dwt_rem_OBJECTS) $(test_dwt_rem_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxcodectest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dwt_rem.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/rfxcodectest.Po -rm -f ./$(DEPDIR)/rfxencode.Po -rm -f ./$(DEPDIR)/test_dwt_rem.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/rfxcodectest.Po -rm -f ./$(DEPDIR)/rfxencode.Po -rm -f ./$(DEPDIR)/test_dwt_rem.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/m4/ltoptions.m4000644 001751 000000 00000034275 14652432066 017752 0ustar00metawheel000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _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], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [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_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _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@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [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])]) xrdp-0.10.1/librfxcodec/m4/ltsugar.m4000644 001751 000000 00000010453 14652432066 017370 0ustar00metawheel000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 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 ]) xrdp-0.10.1/librfxcodec/m4/ax_require_defined.m4000644 001751 000000 00000002302 14652432052 021516 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html # =========================================================================== # # SYNOPSIS # # AX_REQUIRE_DEFINED(MACRO) # # DESCRIPTION # # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have # been defined and thus are available for use. This avoids random issues # where a macro isn't expanded. Instead the configure script emits a # non-fatal: # # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found # # It's like AC_REQUIRE except it doesn't expand the required macro. # # Here's an example: # # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) # # LICENSE # # Copyright (c) 2014 Mike Frysinger # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 2 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) ])dnl AX_REQUIRE_DEFINED xrdp-0.10.1/librfxcodec/m4/pkg.m4000644 001751 000000 00000024011 14652432052 016456 0ustar00metawheel000000 000000 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR xrdp-0.10.1/librfxcodec/m4/ax_append_flag.m4000644 001751 000000 00000005333 14652432052 020633 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AC_DEFUN([AX_APPEND_FLAG], [dnl AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) AS_VAR_SET_IF(FLAGS,[ AS_CASE([" AS_VAR_GET(FLAGS) "], [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], [ AS_VAR_APPEND(FLAGS,[" $1"]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) ], [ AS_VAR_SET(FLAGS,[$1]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG xrdp-0.10.1/librfxcodec/m4/ax_check_compile_flag.m4000644 001751 000000 00000006403 14652432052 022150 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 5 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS xrdp-0.10.1/librfxcodec/m4/ltversion.m4000644 001751 000000 00000001312 14652432066 017726 0ustar00metawheel000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2022 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. # @configure_input@ # serial 4245 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.7' macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xrdp-0.10.1/librfxcodec/m4/ax_cflags_warn_all.m4000644 001751 000000 00000011703 14652432052 021507 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html # =========================================================================== # # SYNOPSIS # # AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # # DESCRIPTION # # Try to find a compiler option that enables most reasonable warnings. # # For the GNU compiler it will be -Wall (and -ansi -pedantic) The result # is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default. # # Currently this macro knows about the GCC, Solaris, Digital Unix, AIX, # HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and # Intel compilers. For a given compiler, the Fortran flags are much more # experimental than their C equivalents. # # - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS # - $2 add-value-if-not-found : nothing # - $3 action-if-found : add value to shellvariable # - $4 action-if-not-found : nothing # # NOTE: These macros depend on AX_APPEND_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2010 Rhys Ulerich # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 16 AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], VAR,[VAR="no, unknown" ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-warn all % -warn all" dnl Intel "-pedantic % -Wall" dnl GCC "-xstrconst % -v" dnl Solaris C "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX "-ansi -ansiE % -fullwarn" dnl IRIX "+ESlit % +w1" dnl HP-UX C "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) "-h conform % -h msglevel 2" dnl Cray C (Unicos) # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" ]) AS_VAR_POPDEF([FLAGS])dnl AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; esac AS_VAR_POPDEF([VAR])dnl ])dnl AX_FLAGS_WARN_ALL dnl implementation tactics: dnl the for-argument contains a list of options. The first part of dnl these does only exist to detect the compiler - usually it is dnl a global option to enable -ansi or -extrawarnings. All other dnl compilers will fail about it. That was needed since a lot of dnl compilers will give false positives for some option-syntax dnl like -Woption or -Xoption as they think of it is a pass-through dnl to later compile stages or something. The "%" is used as a dnl delimiter. A non-option comment can be given after "%%" marks dnl which will be shown but not added to the respective C/CXXFLAGS. AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([C]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([C]) ]) AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([C++]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([C++]) ]) AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([Fortran]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([Fortran]) ]) xrdp-0.10.1/librfxcodec/m4/ax_append_compile_flags.m4000644 001751 000000 00000005660 14652432052 022531 0ustar00metawheel000000 000000 # ============================================================================ # https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # ============================================================================ # # SYNOPSIS # # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # For every FLAG1, FLAG2 it is checked whether the compiler works with the # flag. If it does, the flag is added FLAGS-VARIABLE # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. During the check the flag is always added to the # current language's flags. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: This macro depends on the AX_APPEND_FLAG and # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with # AX_APPEND_LINK_FLAGS. # # LICENSE # # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) done ])dnl AX_APPEND_COMPILE_FLAGS xrdp-0.10.1/librfxcodec/m4/nasm.m4000644 001751 000000 00000006451 14652432052 016643 0ustar00metawheel000000 000000 # AC_PROG_NASM # -------------------------- # Check that NASM exists and determine flags AC_DEFUN([AC_PROG_NASM],[ AC_CHECK_PROGS(NASM, [nasm nasmw yasm]) test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found]) AC_MSG_CHECKING([for object file format of host system]) case "$host_os" in cygwin* | mingw* | pw32* | interix*) case "$host_cpu" in x86_64) objfmt='Win64-COFF' ;; *) objfmt='Win32-COFF' ;; esac ;; msdosdjgpp* | go32*) objfmt='COFF' ;; os2-emx*) # not tested objfmt='MSOMF' # obj ;; linux*coff* | linux*oldld*) objfmt='COFF' # ??? ;; linux*aout*) objfmt='a.out' ;; linux*) case "$host_cpu" in x86_64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac ;; kfreebsd* | freebsd* | netbsd* | openbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then objfmt='BSD-a.out' else case "$host_cpu" in x86_64 | amd64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac fi ;; solaris* | sunos* | sysv* | sco*) case "$host_cpu" in x86_64) objfmt='ELF64' ;; *) objfmt='ELF' ;; esac ;; darwin* | rhapsody* | nextstep* | openstep* | macos*) case "$host_cpu" in x86_64) objfmt='Mach-O64' ;; *) objfmt='Mach-O' ;; esac ;; *) objfmt='ELF ?' ;; esac AC_MSG_RESULT([$objfmt]) if test "$objfmt" = 'ELF ?'; then objfmt='ELF' AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.]) fi AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ]) case "$objfmt" in MSOMF) NAFLAGS='-fobj -DOBJ32';; Win32-COFF) NAFLAGS='-fwin32 -DWIN32';; Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';; COFF) NAFLAGS='-fcoff -DCOFF';; a.out) NAFLAGS='-faout -DAOUT';; BSD-a.out) NAFLAGS='-faoutb -DAOUT';; ELF) NAFLAGS='-felf -DELF';; ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';; RDF) NAFLAGS='-frdf -DRDF';; Mach-O) NAFLAGS='-fmacho -DMACHO';; Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';; esac AC_MSG_RESULT([$NAFLAGS]) AC_SUBST([NAFLAGS]) AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works]) cat > conftest.asm <&AS_MESSAGE_LOG_FD cat conftest.asm >&AS_MESSAGE_LOG_FD rm -rf conftest* AC_MSG_RESULT(no) AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.]) fi AC_MSG_CHECKING([whether the linker accepts assembler output]) nasm_save_LIBS="$LIBS" LIBS="conftest-nasm.o $LIBS" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ #ifdef __cplusplus extern "C" #endif void nasmfunc(void); ]], [[nasmfunc();]])], [nasm_link_ok=yes], [nasm_link_ok=no]) LIBS="$nasm_save_LIBS" AC_MSG_RESULT([$nasm_link_ok]) if test "x$nasm_link_ok" = "xno"; then AC_MSG_ERROR([configuration problem: maybe object file format mismatch.]) fi ]) xrdp-0.10.1/librfxcodec/m4/lt~obsolete.m4000644 001751 000000 00000014007 14652432067 020261 0ustar00metawheel000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 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 5 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_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])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) xrdp-0.10.1/librfxcodec/m4/libtool.m4000644 001751 000000 00001127551 14652432066 017364 0ustar00metawheel000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2022 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) 2014 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 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 this program. If not, see . ]) # serial 59 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 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 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) 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_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _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 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl 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_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that 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 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.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_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify 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' ]) # _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 "$][$1" | $SED "$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 "$" | $SED "$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' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_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]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false 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) 2011 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. lt_cl_success=: test yes = "$silent" && 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) ])# 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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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 '$q' "$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' 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)], [Go], [_LT_LANG(GO)], [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 m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _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([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) 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)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) 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], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _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 there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; 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 ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) 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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # 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 if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _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 yes != "$lt_cv_apple_cc_single_mod"; 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([TAGNAME]) # ---------------------------------- # 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. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _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 no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _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_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _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" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 yes = "[$]$2"; 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 "$_lt_linker_boilerplate" | $SED '/^$/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 yes = "[$]$2"; 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 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 yes = "$cross_compiling"; 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 $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* 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 yes != "$enable_dlopen"; 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 ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; 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:$LINENO: $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:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; 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 -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _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 m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 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 AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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 # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[[23]].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no 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], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _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([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _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], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that 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 that 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 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 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* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi 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_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi 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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $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:$LINENO: 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_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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 yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _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([AC_PROG_AWK])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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # 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 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #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. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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_globsym_save_LIBS=$LIBS lt_globsym_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 yes = "$pipe_works"; 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' 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_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _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_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _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)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $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 ia64 = "$host_cpu"; 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 ;; 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; 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* | midnightbsd*) # 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 ia64 != "$host_cpu"; 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 | 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* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _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*) ;; *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* | sunCC*) # 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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 case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; 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 ia64 = "$host_cpu"; 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 ;; 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' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 | 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' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny 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)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _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\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # 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)='' ;; *Sun\ F* | *Sun*Fortran*) _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 ' ;; *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,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; 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* | sunf77* | sunf90* | sunf95*) _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 that 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_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # 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]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # 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_PATH_MANIFEST_TOOL])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' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ 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_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++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([[^)]]\+)\s\+//' 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 ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _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(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _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/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] 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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; 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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; 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; func_echo_all \"$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 yes = "$supports_anon_versioning"; 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 tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # 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)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; 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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 cannot *** 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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([$1]) _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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([$1]) _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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _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' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _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 `func_echo_all "$deplibs" | $SED '\''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(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; 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 ;; # 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* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -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 yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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 no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$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 yes,no = "$GCC,$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_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 no = "$with_gnu_ld"; 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 yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) 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* | bitrig*) 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__`"; 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 _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' 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 shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $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" && func_echo_all "-set_version $verstring"` -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 yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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 yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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 $pic_flag $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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; 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_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$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_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_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* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_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_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([], [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([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _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], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi 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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_caught_CXX_error"; 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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS 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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -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 -v "^Configured with:" | $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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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([$1]) _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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # 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 _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _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(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $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 ;; freebsd2.*) # 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* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; 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 "x$output_objdir/$soname" = "x$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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $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" && func_echo_all "-set_version $verstring"` -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 yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -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 | 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; func_echo_all "$list"' _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 | sort | $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 | sort | $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 | sort | $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 | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above 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; func_echo_all \"$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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # 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 yes = "$supports_anon_versioning"; 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; func_echo_all \"$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='func_echo_all' # 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 ;; openbsd* | bitrig*) 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__`"; 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=func_echo_all 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" && func_echo_all "$wl-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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 -v "^Configured with:" | $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* | sunCC*) # 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='func_echo_all' # 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 yes,no = "$GXX,$with_gnu_ld"; 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 $pic_flag -nostdlib $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 $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $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 $wl-h $wl$soname -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 -v "^Configured with:" | $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 CANNOT 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(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 CFLAGS=$lt_save_CFLAGS 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 yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf 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). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _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 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])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 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac 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 $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 no = "$pre_test_object_deps_done"; 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 CFLAGS=$_lt_libdeps_save_CFLAGS # 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)= ;; 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_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_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_disable_F77"; 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 lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _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_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_disable_FC"; 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 lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" 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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS 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 _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # 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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go 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 _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= 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 CFLAGS=$lt_save_CFLAGS ])# _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 set = "${GCJFLAGS+set}" || 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_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # 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_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_TOOL([FILECMD], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _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 10 -lt "$lt_ac_count" && 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], [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_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS xrdp-0.10.1/librfxcodec/include/rfxcodec_encode.h000644 001751 000000 00000011627 14652432052 022032 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2014-2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXCODEC_ENCODE_H #define __RFXCODEC_ENCODE_H #include struct rfx_rect { int x; int y; int cx; int cy; }; struct rfx_tile { int x; /* multiple of 64 */ int y; /* multiple of 64 */ int cx; /* must be 64 or less */ int cy; /* must be 64 or less */ int quant_y; int quant_cb; int quant_cr; }; void * rfxcodec_encode_create(int width, int height, int format, int flags); int rfxcodec_encode_create_ex(int width, int height, int format, int flags, void **handle); int rfxcodec_encode_destroy(void *handle); /* quants, 5 ints per set, should be num_quants * 5 chars in quants) * each char is 2 quant values * quantizer order is * 0 - LL3 * 1 - LH3 * 2 - HL3 * 3 - HH3 * 4 - LH2 * 5 - HL2 * 6 - HH2 * 7 - LH1 * 8 - HL1 * 9 - HH1 */ int rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes, const char *buf, int width, int height, int stride_bytes, const struct rfx_rect *region, int num_region, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants); int rfxcodec_encode_ex(void *handle, char *cdata, int *cdata_bytes, const char *buf, int width, int height, int stride_bytes, const struct rfx_rect *region, int num_region, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags); /* use simple types here, no sint16_t, uint8_t, ... */ typedef int (*rfxencode_rlgr1_proc)(const short *data, unsigned char *buffer, int buffer_size); typedef int (*rfxencode_rlgr3_proc)(const short *data, unsigned char *buffer, int buffer_size); typedef int (*rfxencode_differential_proc)(short *buffer, int buffer_size); typedef int (*rfxencode_quantization_proc)(short *buffer, const char *quantization_values); typedef int (*rfxencode_dwt_2d_proc)(const unsigned char *in_buffer, short *buffer, short *dwt_buffer); typedef int (*rfxencode_diff_rlgr1_proc)(short *coef, unsigned char *cdata, int cdata_size, int diff_bytes); typedef int (*rfxencode_diff_rlgr3_proc)(short *coef, unsigned char *cdata, int cdata_size, int diff_bytes); typedef int (*rfxencode_dwt_shift_x86_sse2_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); typedef int (*rfxencode_dwt_shift_x86_sse41_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); typedef int (*rfxencode_dwt_shift_amd64_sse2_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); typedef int (*rfxencode_dwt_shift_amd64_sse41_proc)(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); typedef int (*rfx_encode_diff_count_proc)(short *diff_buffer, const short *dwt_buffer, const short *hist_buffer, int *diff_zeros, int *dwt_zeros); typedef int (*rfx_encode_dwt_shift_rem_proc)(const unsigned char *in_buffer, short *out_buffer, short *tmp_buffer, const char *quants); typedef int (*rfx_encode_diff_count_sse2_proc)(short *diff_buffer, const short *dwt_buffer, const short *hist_buffer, int *diff_zeros, int *dwt_zeros); typedef int (*rfx_encode_dwt_shift_rem_sse2_proc)(const unsigned char *in_buffer, short *out_buffer, short *tmp_buffer, const char *quants); struct rfxcodec_encode_internals { rfxencode_rlgr1_proc rfxencode_rlgr1; rfxencode_rlgr3_proc rfxencode_rlgr3; rfxencode_differential_proc rfxencode_differential; rfxencode_quantization_proc rfxencode_quantization; rfxencode_dwt_2d_proc rfxencode_dwt_2d; rfxencode_diff_rlgr1_proc rfxencode_diff_rlgr1; rfxencode_diff_rlgr3_proc rfxencode_diff_rlgr3; rfxencode_dwt_shift_x86_sse2_proc rfxencode_dwt_shift_x86_sse2; rfxencode_dwt_shift_x86_sse41_proc rfxencode_dwt_shift_x86_sse41; rfxencode_dwt_shift_amd64_sse2_proc rfxencode_dwt_shift_amd64_sse2; rfxencode_dwt_shift_amd64_sse41_proc rfxencode_dwt_shift_amd64_sse41; rfx_encode_diff_count_proc rfx_encode_diff_count; rfx_encode_dwt_shift_rem_proc rfx_encode_dwt_shift_rem; rfx_encode_diff_count_sse2_proc rfx_encode_diff_count_sse2; rfx_encode_dwt_shift_rem_sse2_proc rfx_encode_dwt_shift_rem_sse2; }; int rfxcodec_encode_get_internals(struct rfxcodec_encode_internals *internals); #endif xrdp-0.10.1/librfxcodec/include/Makefile.in000644 001751 000000 00000041140 14652432071 020606 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) 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__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ include_HEADERS = \ rfxcodec_encode.h \ rfxcodec_decode.h \ rfxcodec_common.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS 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-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/include/rfxcodec_decode.h000644 001751 000000 00000002004 14652432052 022005 0ustar00metawheel000000 000000 /** * RFX codec decoder * * Copyright 2014-2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXCODEC_DECODE_H #define __RFXCODEC_DECODE_H #include int rfxcodec_decode_create(int width, int height, int format, int flags, void **handle); int rfxcodec_decode_destroy(void *handle); int rfxcodec_decode(void *handle, char *cdata, int cdata_bytes, char *data, int width, int height, int stride_bytes); #endif xrdp-0.10.1/librfxcodec/include/Makefile.am000644 001751 000000 00000000124 14652432052 020571 0ustar00metawheel000000 000000 include_HEADERS = \ rfxcodec_encode.h \ rfxcodec_decode.h \ rfxcodec_common.h xrdp-0.10.1/librfxcodec/include/rfxcodec_common.h000644 001751 000000 00000002467 14652432052 022067 0ustar00metawheel000000 000000 /** * RFX codec * * Copyright 2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXCODEC_COMMON_H #define __RFXCODEC_COMMON_H #define RFX_FORMAT_BGRA 0 #define RFX_FORMAT_RGBA 1 #define RFX_FORMAT_BGR 2 #define RFX_FORMAT_RGB 3 #define RFX_FORMAT_YUV 4 /* YUV444 linear tiled mode */ #define RFX_FLAGS_NONE 0 /* default RFX_FLAGS_RLGR3 and RFX_FLAGS_SAFE */ #define RFX_FLAGS_SAFE 0 /* default */ #define RFX_FLAGS_OPT1 (1 << 3) #define RFX_FLAGS_OPT2 (1 << 4) #define RFX_FLAGS_NOACCEL (1 << 6) #define RFX_FLAGS_PRO1 (1 << 7) #define RFX_FLAGS_PRO_KEY (1 << 8) /* Force rendering of Progressive Key Frame */ #define RFX_FLAGS_RLGR3 0 /* default */ #define RFX_FLAGS_RLGR1 1 #define RFX_FLAGS_ALPHAV1 1 /* used in flags for rfxcodec_encode */ #endif xrdp-0.10.1/librfxcodec/src/rfxencode_quantization.c000644 001751 000000 00000014767 14652432052 022652 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Quantization * * Copyright 2011 Vic Lee * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxconstants.h" #include "rfxencode_quantization.h" #if 0 /******************************************************************************/ /* return round(d1 / d2) as if d1 ad d2 are float */ static int divround(int d1, int d2) { if ((d1 < 0) ^ (d2 < 0)) { return (d1 - (d2 / 2)) / d2; } return (d1 + (d2 / 2)) / d2; } #endif #if 0 #define DIVROUND(_d1, _d2) \ (_d1) < 0 ? \ ((_d1) - ((_d2) / 2)) / (_d2) : \ ((_d1) + ((_d2) / 2)) / (_d2) /******************************************************************************/ static int rfx_quantization_encode_block(sint16 *buffer, int buffer_size, uint32 factor) { sint16 *dst; sint16 scale_value; if (factor == 0) { return 1; } scale_value = 1 << factor; for (dst = buffer; buffer_size > 0; dst++, buffer_size--) { *dst = DIVROUND(*dst, scale_value); } return 0; } #endif #if 0 /******************************************************************************/ static int rfx_quantization_encode_block(sint16 *buffer, int buffer_size, uint32 factor) { sint16 *dst; if (factor == 0) { return 1; } for (dst = buffer; buffer_size > 0; dst++, buffer_size--) { *dst = *dst >> factor; } return 0; } #endif #if 0 /******************************************************************************/ static int rfx_quantization_encode_block(sint16 *buffer, int buffer_size, uint32 factor) { sint16 *dst; sint16 half; if (factor == 0) { return 1; } half = (1 << (factor - 1)); for (dst = buffer; buffer_size > 0; dst++, buffer_size--) { *dst = (*dst + half) >> factor; } return 0; } #endif #if 1 /******************************************************************************/ static int rfx_quantization_encode_block(sint16 *buffer, int buffer_size, uint32 factor) { sint16 *dst; sint16 half; factor += DWT_FACTOR; if (factor == 0) { return 1; } half = (1 << (factor - 1)); for (dst = buffer; buffer_size > 0; dst++, buffer_size--) { *dst = (*dst + half) >> factor; } return 0; } #endif /******************************************************************************/ /* 8 x 8 = 64 16 x 16 = 256 32 x 32 = 1024 HL1 = 32 x 32 = 1024 (1024) LH1 = 32 x 32 = 1024 (2048) HH1 = 32 x 32 = 1024 (3072) HL2 = 16 x 16 = 256 (3328) LH2 = 16 x 16 = 256 (3584) HH2 = 16 x 16 = 256 (3840) HL3 = 8 x 8 = 64 (3904) LH3 = 8 x 8 = 64 (3968) HH3 = 8 x 8 = 64 (4032) LL3 = 8 x 8 = 64 (4096) */ int rfx_quantization_encode(sint16 *buffer, const char *qtable) { uint32 factor; factor = ((qtable[4] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer, 1024, factor); /* HL1 */ factor = ((qtable[3] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 1024, 1024, factor); /* LH1 */ factor = ((qtable[4] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 2048, 1024, factor); /* HH1 */ factor = ((qtable[2] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3072, 256, factor); /* HL2 */ factor = ((qtable[2] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3328, 256, factor); /* LH2 */ factor = ((qtable[3] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3584, 256, factor); /* HH2 */ factor = ((qtable[1] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3840, 64, factor); /* HL3 */ factor = ((qtable[0] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3904, 64, factor); /* LH3 */ factor = ((qtable[1] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3968, 64, factor); /* HH3 */ factor = ((qtable[0] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 4032, 64, factor); /* LL3 */ return 0; } /******************************************************************************/ /* 8 x 8 = 64 8 x 9 = 72 9 x 9 = 81 16 x 16 = 256 16 x 17 = 272 31 x 31 = 961 31 x 33 = 1023 HL1 = 31 x 33 = 1023 (1023) LH1 = 33 x 31 = 1023 (2046) HH1 = 31 x 31 = 961 (3007) HL2 = 16 x 17 = 272 (3279) LH2 = 17 x 16 = 272 (3551) HH2 = 16 x 16 = 256 (3807) HL3 = 8 x 9 = 72 (3879) LH3 = 9 x 8 = 72 (3951) HH3 = 8 x 8 = 64 (4015) LL3 = 9 x 9 = 81 (4096) */ int rfx_rem_quantization_encode(sint16 *buffer, const char *qtable) { uint32 factor; factor = ((qtable[4] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer, 1023, factor); /* HL1 */ factor = ((qtable[3] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 1023, 1023, factor); /* LH1 */ factor = ((qtable[4] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 2046, 961, factor); /* HH1 */ factor = ((qtable[2] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3007, 272, factor); /* HL2 */ factor = ((qtable[2] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3279, 272, factor); /* LH2 */ factor = ((qtable[3] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3551, 256, factor); /* HH2 */ factor = ((qtable[1] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3807, 72, factor); /* HL3 */ factor = ((qtable[0] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3879, 72, factor); /* LH3 */ factor = ((qtable[1] >> 4) & 0xf) - 6; rfx_quantization_encode_block(buffer + 3951, 64, factor); /* HH3 */ factor = ((qtable[0] >> 0) & 0xf) - 6; rfx_quantization_encode_block(buffer + 4015, 81, factor); /* LL3 */ return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode.c000644 001751 000000 00000041464 14652432052 020036 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxencode_compose.h" #include "rfxconstants.h" #include "rfxencode_tile.h" #include "rfxencode_rlgr1.h" #include "rfxencode_rlgr3.h" #include "rfxencode_differential.h" #include "rfxencode_quantization.h" #include "rfxencode_dwt.h" #include "rfxencode_diff_rlgr1.h" #include "rfxencode_diff_rlgr3.h" #include "rfxencode_rgb_to_yuv.h" #include "rfxencode_dwt_shift_rem.h" #ifdef RFX_USE_ACCEL_X86 #include "x86/funcs_x86.h" #include "rfxencode_diff_count_sse2.h" #include "rfxencode_dwt_shift_rem_sse2.h" #endif #ifdef RFX_USE_ACCEL_AMD64 #include "amd64/funcs_amd64.h" #include "rfxencode_diff_count_sse2.h" #include "rfxencode_dwt_shift_rem_sse2.h" #endif static void clear_encoder_rbs(struct rfxencode *enc) { int index; int jndex; for (index = 0; index < enc->max_rb_y; ++index) { for (jndex = 0; jndex < enc->max_rb_x; ++jndex) { free(enc->rbs[index * enc->max_rb_x + jndex]); enc->rbs[index * enc->max_rb_x + jndex] = NULL; } } } static int rfxencode_reset_encoder(void *handle) { struct rfxencode *enc; enc = (struct rfxencode *) handle; enc->frame_idx = 0; enc->header_processed = 0; memset(enc->a_buffer, 0, sizeof(enc->a_buffer)); memset(enc->y_r_buffer, 0, sizeof(enc->y_r_buffer)); memset(enc->u_g_buffer, 0, sizeof(enc->u_g_buffer)); memset(enc->v_b_buffer, 0, sizeof(enc->v_b_buffer)); memset(enc->dwt_buffer_a, 0, sizeof(enc->dwt_buffer_a)); enc->dwt_buffer = (sint16 *) (((size_t) (enc->dwt_buffer_a)) & ~15); memset(enc->dwt_buffer1_a, 0, sizeof(enc->dwt_buffer1_a)); enc->dwt_buffer1 = (sint16 *) (((size_t) (enc->dwt_buffer1_a)) & ~15); memset(enc->dwt_buffer2_a, 0, sizeof(enc->dwt_buffer2_a)); enc->dwt_buffer2 = (sint16 *) (((size_t) (enc->dwt_buffer2_a)) & ~15); memset(enc->dwt_buffer3_a, 0, sizeof(enc->dwt_buffer3_a)); enc->dwt_buffer3 = (sint16 *) (((size_t) (enc->dwt_buffer3_a)) & ~15); memset(enc->dwt_buffer4_a, 0, sizeof(enc->dwt_buffer4_a)); enc->dwt_buffer4 = (sint16 *) (((size_t) (enc->dwt_buffer4_a)) & ~15); memset(enc->dwt_buffer5_a, 0, sizeof(enc->dwt_buffer5_a)); enc->dwt_buffer5 = (sint16 *) (((size_t) (enc->dwt_buffer5_a)) & ~15); memset(enc->dwt_buffer6_a, 0, sizeof(enc->dwt_buffer6_a)); enc->dwt_buffer6 = (sint16 *) (((size_t) (enc->dwt_buffer6_a)) & ~15); clear_encoder_rbs(enc); return 0; } /******************************************************************************/ int rfxcodec_encode_create_ex(int width, int height, int format, int flags, void **handle) { struct rfxencode *enc; int ax; int bx; int cx; int dx; enc = (struct rfxencode *) calloc(1, sizeof(struct rfxencode)); if (enc == NULL) { return 1; } enc->dwt_buffer = (sint16 *) (((size_t) (enc->dwt_buffer_a)) & ~15); enc->dwt_buffer1 = (sint16 *) (((size_t) (enc->dwt_buffer1_a)) & ~15); enc->dwt_buffer2 = (sint16 *) (((size_t) (enc->dwt_buffer2_a)) & ~15); enc->dwt_buffer3 = (sint16 *) (((size_t) (enc->dwt_buffer3_a)) & ~15); enc->dwt_buffer4 = (sint16 *) (((size_t) (enc->dwt_buffer4_a)) & ~15); enc->dwt_buffer5 = (sint16 *) (((size_t) (enc->dwt_buffer5_a)) & ~15); enc->dwt_buffer6 = (sint16 *) (((size_t) (enc->dwt_buffer6_a)) & ~15); #if defined(RFX_USE_ACCEL_X86) cpuid_x86(1, 0, &ax, &bx, &cx, &dx); #elif defined(RFX_USE_ACCEL_AMD64) cpuid_amd64(1, 0, &ax, &bx, &cx, &dx); #else ax = 0; bx = 0; cx = 0; dx = 0; #endif if (dx & (1 << 26)) /* SSE 2 */ { printf("rfxcodec_encode_create: got sse2\n"); enc->got_sse2 = 1; } if (cx & (1 << 0)) /* SSE 3 */ { printf("rfxcodec_encode_create: got sse3\n"); enc->got_sse3 = 1; } if (cx & (1 << 19)) /* SSE 4.1 */ { printf("rfxcodec_encode_create: got sse4.1\n"); enc->got_sse41 = 1; } if (cx & (1 << 20)) /* SSE 4.2 */ { printf("rfxcodec_encode_create: got sse4.2\n"); enc->got_sse42 = 1; } if (cx & (1 << 23)) /* popcnt */ { printf("rfxcodec_encode_create: got popcnt\n"); enc->got_popcnt = 1; } #if defined(RFX_USE_ACCEL_X86) cpuid_x86(0x80000001, 0, &ax, &bx, &cx, &dx); #elif defined(RFX_USE_ACCEL_AMD64) cpuid_amd64(0x80000001, 0, &ax, &bx, &cx, &dx); #else ax = 0; bx = 0; cx = 0; dx = 0; #endif if (cx & (1 << 5)) /* lzcnt */ { printf("rfxcodec_encode_create: got lzcnt\n"); enc->got_lzcnt = 1; } if (cx & (1 << 6)) /* SSE 4.a */ { printf("rfxcodec_encode_create: got sse4.a\n"); enc->got_sse4a = 1; } enc->width = width; enc->height = height; enc->mode = RLGR3; if (flags & RFX_FLAGS_RLGR1) { enc->mode = RLGR1; } switch (format) { case RFX_FORMAT_BGRA: enc->bits_per_pixel = 32; break; case RFX_FORMAT_RGBA: enc->bits_per_pixel = 32; break; case RFX_FORMAT_BGR: enc->bits_per_pixel = 24; break; case RFX_FORMAT_RGB: enc->bits_per_pixel = 24; break; case RFX_FORMAT_YUV: enc->bits_per_pixel = 32; break; default: free(enc); return 2; } enc->format = format; enc->rfx_encode_rgb_to_yuv = rfx_encode_rgb_to_yuv; enc->rfx_encode_argb_to_yuva = rfx_encode_argb_to_yuva; enc->rfx_encode_dwt_shift_rem = rfx_encode_dwt_shift_rem; enc->rfx_encode_diff_count = rfx_encode_diff_count; /* assign encoding functions */ if (flags & RFX_FLAGS_PRO1) { enc->pro_ver = 1; enc->max_rb_x = (width + 63) / 64; enc->max_rb_y = (height + 63) / 64; enc->rbs = (struct rfx_rb **) calloc(enc->max_rb_x * enc->max_rb_y, sizeof(struct rfx_rb *)); if (flags & RFX_FLAGS_NOACCEL) { } else if (enc->got_sse2) { #if defined(RFX_USE_ACCEL_X86) || defined(RFX_USE_ACCEL_AMD64) enc->rfx_encode_diff_count = rfx_encode_diff_count_sse2; enc->rfx_encode_dwt_shift_rem = rfx_encode_dwt_shift_rem_sse2; #endif } } else if (flags & RFX_FLAGS_NOACCEL) { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3\n"); enc->rfx_encode = rfx_encode_component_rlgr3; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1\n"); enc->rfx_encode = rfx_encode_component_rlgr1; /* rfxencode_tile.c */ } } else { #if defined(RFX_USE_ACCEL_X86) if (enc->got_sse41) { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3_x86_sse41\n"); enc->rfx_encode = rfx_encode_component_rlgr3_x86_sse41; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1_x86_sse41\n"); enc->rfx_encode = rfx_encode_component_rlgr1_x86_sse41; /* rfxencode_tile.c */ } } else if (enc->got_sse2) { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3_x86_sse2\n"); enc->rfx_encode = rfx_encode_component_rlgr3_x86_sse2; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1_x86_sse2\n"); enc->rfx_encode = rfx_encode_component_rlgr1_x86_sse2; /* rfxencode_tile.c */ } } else { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3\n"); enc->rfx_encode = rfx_encode_component_rlgr3; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1\n"); enc->rfx_encode = rfx_encode_component_rlgr1; /* rfxencode_tile.c */ } } #elif defined(RFX_USE_ACCEL_AMD64) if (enc->got_sse41) { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3_amd64_sse41\n"); enc->rfx_encode = rfx_encode_component_rlgr3_amd64_sse41; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1_amd64_sse41\n"); enc->rfx_encode = rfx_encode_component_rlgr1_amd64_sse41; /* rfxencode_tile.c */ } } else if (enc->got_sse2) { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3_amd64_sse2\n"); enc->rfx_encode = rfx_encode_component_rlgr3_amd64_sse2; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1_amd64_sse2\n"); enc->rfx_encode = rfx_encode_component_rlgr1_amd64_sse2; /* rfxencode_tile.c */ } } else { if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3\n"); enc->rfx_encode = rfx_encode_component_rlgr3; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1\n"); enc->rfx_encode = rfx_encode_component_rlgr1; /* rfxencode_tile.c */ } } #else if (enc->mode == RLGR3) { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3\n"); enc->rfx_encode = rfx_encode_component_rlgr3; /* rfxencode_tile.c */ } else { printf("rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr1\n"); enc->rfx_encode = rfx_encode_component_rlgr1; /* rfxencode_tile.c */ } #endif } if (ax == 0) { } if (bx == 0) { } *handle = enc; return 0; } /******************************************************************************/ void * rfxcodec_encode_create(int width, int height, int format, int flags) { int error; void *handle; error = rfxcodec_encode_create_ex(width, height, format, flags, &handle); if (error == 0) { return handle; } return 0; } /******************************************************************************/ int rfxcodec_encode_destroy(void *handle) { struct rfxencode *enc; enc = (struct rfxencode *) handle; if (enc == NULL) { return 0; } clear_encoder_rbs(enc); free(enc->rbs); free(enc); return 0; } /******************************************************************************/ int rfxcodec_encode_ex(void *handle, char *cdata, int *cdata_bytes, const char *buf, int width, int height, int stride_bytes, const struct rfx_rect *regions, int num_regions, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags) { struct rfxencode *enc; int tiles_written; STREAM s; enc = (struct rfxencode *) handle; s.data = (uint8 *) cdata; s.p = s.data; s.size = *cdata_bytes; if (enc->pro_ver > 0) { if (flags & RFX_FLAGS_PRO_KEY) { rfxencode_reset_encoder(handle); } /* Only the first frame should send the RemoteFX header */ if ((enc->frame_idx == 0) && (enc->header_processed == 0)) { if (rfx_pro_compose_message_header(enc, &s) != 0) { return -1; } } tiles_written = rfx_pro_compose_message_data(enc, &s, regions, num_regions, buf, width, height, stride_bytes, tiles, num_tiles, quants, num_quants, flags); if (tiles_written <= 0) { return -1; } *cdata_bytes = (int) (s.p - s.data); return tiles_written; } /* Only the first frame should send the RemoteFX header */ if ((enc->frame_idx == 0) && (enc->header_processed == 0)) { if (rfx_compose_message_header(enc, &s) != 0) { return -1; } } tiles_written = rfx_compose_message_data(enc, &s, regions, num_regions, buf, width, height, stride_bytes, tiles, num_tiles, quants, num_quants, flags); *cdata_bytes = (int) (s.p - s.data); return tiles_written; } /******************************************************************************/ int rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes, const char *buf, int width, int height, int stride_bytes, const struct rfx_rect *regions, int num_regions, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants) { return rfxcodec_encode_ex(handle, cdata, cdata_bytes, buf, width, height, stride_bytes, regions, num_regions, tiles, num_tiles, quants, num_quants, 0); } /******************************************************************************/ int rfxcodec_encode_get_internals(struct rfxcodec_encode_internals *internals) { memset(internals, 0, sizeof(struct rfxcodec_encode_internals)); internals->rfxencode_rlgr1 = rfx_rlgr1_encode; internals->rfxencode_rlgr3 = rfx_rlgr3_encode; internals->rfxencode_differential = rfx_differential_encode; internals->rfxencode_quantization = rfx_quantization_encode; internals->rfxencode_dwt_2d = rfx_dwt_2d_encode; internals->rfxencode_diff_rlgr1 = rfx_encode_diff_rlgr1; internals->rfxencode_diff_rlgr3 = rfx_encode_diff_rlgr3; internals->rfx_encode_diff_count = rfx_encode_diff_count; internals->rfx_encode_dwt_shift_rem = rfx_encode_dwt_shift_rem; #if defined(RFX_USE_ACCEL_X86) internals->rfxencode_dwt_shift_x86_sse2 = rfxcodec_encode_dwt_shift_x86_sse2; internals->rfxencode_dwt_shift_x86_sse41 = rfxcodec_encode_dwt_shift_x86_sse41; internals->rfx_encode_diff_count_sse2 = rfx_encode_diff_count_sse2; internals->rfx_encode_dwt_shift_rem_sse2 = rfx_encode_dwt_shift_rem_sse2; #endif #if defined(RFX_USE_ACCEL_AMD64) internals->rfxencode_dwt_shift_amd64_sse2 = rfxcodec_encode_dwt_shift_amd64_sse2; internals->rfxencode_dwt_shift_amd64_sse41 = rfxcodec_encode_dwt_shift_amd64_sse41; internals->rfx_encode_diff_count_sse2 = rfx_encode_diff_count_sse2; internals->rfx_encode_dwt_shift_rem_sse2 = rfx_encode_dwt_shift_rem_sse2; #endif return 0; } /*****************************************************************************/ /* produce a hex dump */ void rfxcodec_hexdump(const void *p, int len) { unsigned char *line; int i; int thisline; int offset; line = (unsigned char *)p; offset = 0; while (offset < len) { printf("%04x ", offset); thisline = len - offset; if (thisline > 16) { thisline = 16; } for (i = 0; i < thisline; i++) { printf("%02x ", line[i]); } for (; i < 16; i++) { printf(" "); } for (i = 0; i < thisline; i++) { printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); } printf("%s", "\n"); offset += thisline; line += thisline; } } xrdp-0.10.1/librfxcodec/src/rfxencode_rgb_to_yuv.c000644 001751 000000 00000034542 14652432052 022274 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Encode * * Copyright 2011 Vic Lee * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxconstants.h" #include "rfxencode_tile.h" #include "rfxencode_dwt.h" #include "rfxencode_quantization.h" #include "rfxencode_differential.h" #include "rfxencode_rlgr1.h" #include "rfxencode_rlgr3.h" #include "rfxencode_alpha.h" #include "rfxencode_rgb_to_yuv.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) /******************************************************************************/ static int rfx_encode_format_rgb(const char *rgb_data, int width, int height, int stride_bytes, int pixel_format, uint8 *r_buf, uint8 *g_buf, uint8 *b_buf) { int x; int y; const uint8 *src; uint8 r; uint8 g; uint8 b; uint8 *lr_buf; uint8 *lg_buf; uint8 *lb_buf; LLOGLN(10, ("rfx_encode_format_rgb: pixel_format %d", pixel_format)); b = 0; g = 0; r = 0; switch (pixel_format) { case RFX_FORMAT_BGRA: for (y = 0; y < height; y++) { src = (uint8 *) (rgb_data + y * stride_bytes); lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { b = *src++; *lb_buf++ = b; g = *src++; *lg_buf++ = g; r = *src++; *lr_buf++ = r; src++; } while (x < 64) { *lb_buf++ = b; *lg_buf++ = g; *lr_buf++ = r; x++; } } while (y < 64) { lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; case RFX_FORMAT_RGBA: for (y = 0; y < height; y++) { src = (uint8 *) (rgb_data + y * stride_bytes); lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { r = *src++; *lr_buf++ = r; g = *src++; *lg_buf++ = g; b = *src++; *lb_buf++ = b; src++; } while (x < 64) { *lr_buf++ = r; *lg_buf++ = g; *lb_buf++ = b; x++; } } while (y < 64) { lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; case RFX_FORMAT_BGR: for (y = 0; y < height; y++) { src = (uint8 *) (rgb_data + y * stride_bytes); lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { b = *src++; *lb_buf++ = b; g = *src++; *lg_buf++ = g; r = *src++; *lr_buf++ = r; } while (x < 64) { *lb_buf++ = b; *lg_buf++ = g; *lr_buf++ = r; x++; } } while (y < 64) { lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; case RFX_FORMAT_RGB: for (y = 0; y < height; y++) { src = (uint8 *) (rgb_data + y * stride_bytes); lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { r = *src++; *lr_buf++ = r; g = *src++; *lg_buf++ = g; b = *src++; *lb_buf++ = b; } while (x < 64) { *lr_buf++ = r; *lg_buf++ = g; *lb_buf++ = b; x++; } } while (y < 64) { lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; } return 0; } /******************************************************************************/ static int rfx_encode_format_argb(const char *argb_data, int width, int height, int stride_bytes, int pixel_format, uint8 *a_buf, uint8 *r_buf, uint8 *g_buf, uint8 *b_buf) { int x; int y; const uint8 *src; uint8 a; uint8 r; uint8 g; uint8 b; uint8 *la_buf; uint8 *lr_buf; uint8 *lg_buf; uint8 *lb_buf; LLOGLN(10, ("rfx_encode_format_argb: pixel_format %d", pixel_format)); b = 0; g = 0; r = 0; a = 0; switch (pixel_format) { case RFX_FORMAT_BGRA: for (y = 0; y < height; y++) { src = (uint8 *) (argb_data + y * stride_bytes); la_buf = a_buf + y * 64; lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { b = *src++; *lb_buf++ = b; g = *src++; *lg_buf++ = g; r = *src++; *lr_buf++ = r; a = *src++; *la_buf++ = a; } while (x < 64) { *lb_buf++ = b; *lg_buf++ = g; *lr_buf++ = r; *la_buf++ = a; x++; } } while (y < 64) { la_buf = a_buf + y * 64; lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(la_buf, la_buf - 64, 64); memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; case RFX_FORMAT_RGBA: for (y = 0; y < height; y++) { src = (uint8 *) (argb_data + y * stride_bytes); la_buf = a_buf + y * 64; lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { r = *src++; *lr_buf++ = r; g = *src++; *lg_buf++ = g; b = *src++; *lb_buf++ = b; a = *src++; *la_buf++ = a; } while (x < 64) { *lr_buf++ = r; *lg_buf++ = g; *lb_buf++ = b; *la_buf++ = a; x++; } } while (y < 64) { la_buf = a_buf + y * 64; lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(la_buf, la_buf - 64, 64); memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; case RFX_FORMAT_BGR: for (y = 0; y < height; y++) { src = (uint8 *) (argb_data + y * stride_bytes); lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { b = *src++; *lb_buf++ = b; g = *src++; *lg_buf++ = g; r = *src++; *lr_buf++ = r; } while (x < 64) { *lb_buf++ = b; *lg_buf++ = g; *lr_buf++ = r; x++; } } while (y < 64) { lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; case RFX_FORMAT_RGB: for (y = 0; y < height; y++) { src = (uint8 *) (argb_data + y * stride_bytes); lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; for (x = 0; x < width; x++) { r = *src++; *lr_buf++ = r; g = *src++; *lg_buf++ = g; b = *src++; *lb_buf++ = b; } while (x < 64) { *lr_buf++ = r; *lg_buf++ = g; *lb_buf++ = b; x++; } } while (y < 64) { lr_buf = r_buf + y * 64; lg_buf = g_buf + y * 64; lb_buf = b_buf + y * 64; memcpy(lr_buf, lr_buf - 64, 64); memcpy(lg_buf, lg_buf - 64, 64); memcpy(lb_buf, lb_buf - 64, 64); y++; } break; } return 0; } /******************************************************************************/ /* http://msdn.microsoft.com/en-us/library/ff635643.aspx * 0.299 -0.168935 0.499813 * 0.587 -0.331665 -0.418531 * 0.114 0.50059 -0.081282 y = r * 0.299000 + g * 0.587000 + b * 0.114000; u = r * -0.168935 + g * -0.331665 + b * 0.500590; v = r * 0.499813 + g * -0.418531 + b * -0.081282; */ /* 19595 38470 7471 -11071 -21736 32807 32756 -27429 -5327 */ static int rfx_encode_rgb_to_yuv_tile(uint8 *y_r_buf, uint8 *u_g_buf, uint8 *v_b_buf) { int i; sint32 r, g, b; sint32 y, u, v; for (i = 0; i < 4096; i++) { r = y_r_buf[i]; g = u_g_buf[i]; b = v_b_buf[i]; y = (r * 19595 + g * 38470 + b * 7471) >> 16; u = (r * -11071 + g * -21736 + b * 32807) >> 16; v = (r * 32756 + g * -27429 + b * -5327) >> 16; y_r_buf[i] = MINMAX(y, 0, 255); u_g_buf[i] = MINMAX(u + 128, 0, 255); v_b_buf[i] = MINMAX(v + 128, 0, 255); } return 0; } /******************************************************************************/ int rfx_encode_rgb_to_yuv(struct rfxencode *enc, const char *rgb_data, int width, int height, int stride_bytes) { uint8 *y_r_buffer; uint8 *u_g_buffer; uint8 *v_b_buffer; y_r_buffer = enc->y_r_buffer; u_g_buffer = enc->u_g_buffer; v_b_buffer = enc->v_b_buffer; if (rfx_encode_format_rgb(rgb_data, width, height, stride_bytes, enc->format, y_r_buffer, u_g_buffer, v_b_buffer) != 0) { return 1; } if (rfx_encode_rgb_to_yuv_tile(y_r_buffer, u_g_buffer, v_b_buffer) != 0) { return 1; } return 0; } /******************************************************************************/ int rfx_encode_argb_to_yuva(struct rfxencode *enc, const char *argb_data, int width, int height, int stride_bytes) { uint8 *a_buffer; uint8 *y_r_buffer; uint8 *u_g_buffer; uint8 *v_b_buffer; a_buffer = enc->a_buffer; y_r_buffer = enc->y_r_buffer; u_g_buffer = enc->u_g_buffer; v_b_buffer = enc->v_b_buffer; if (rfx_encode_format_argb(argb_data, width, height, stride_bytes, enc->format, a_buffer, y_r_buffer, u_g_buffer, v_b_buffer) != 0) { return 1; } if (rfx_encode_rgb_to_yuv_tile(y_r_buffer, u_g_buffer, v_b_buffer) != 0) { return 1; } return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode_dwt_shift_rem.c000644 001751 000000 00000036110 14652432052 022744 0ustar00metawheel000000 000000 /** * RemoteFX Codec Library * * Copyright 2020-2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * DWT Reduce-Extrapolate Method MS-RDPEGFX 3.2.8.1.2.2 * also does Quantization and Linearization 3.2.8.1.3 */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode_dwt_shift_rem.h" #include "rfxencode_dwt_shift_rem_common.h" /******************************************************************************/ static void rfx_encode_dwt_shift_rem_vert_lv1_u8(const uint8 *in_buffer, sint16 *out_buffer) { const uint8 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic62; int n; int y; for (y = 0; y < 64; y++) { /* setup */ ic = SETUP_IC_LL0(y); lo = SETUP_OC_L0(y); hi = SETUP_OC_H0(y); /* pre */ IC_LL0_U8(x2n, 0); IC_LL0_U8(x2n1, 1); IC_LL0_U8(x2n2, 2); OC_H0(0, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L0(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 31; n++) { hn1 = hn; x2n = x2n2; IC_LL0_U8(x2n1, 2 * n + 1); IC_LL0_U8(x2n2, 2 * n + 2); OC_H0(n, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L0(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic62 = x2n = x2n2; IC_LL0_U8(x2n1, 63); x2n2 = 2 * x2n1 - x2n; /* ic[64] = 2 * ic[63] - ic[62] */ OC_L0(31, NOQ(x2n + (hn1 >> 1))); /* post ex */ x2n = x2n2; /* x2n1 already set, mirror 65 -> 63 */ x2n2 = ic62; /* mirror 66 -> 62 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_L0(32, NOQ(x2n + (hn >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_horz_lv1(const sint16 *in_buffer, sint16 *out_buffer, const char *quants) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic62; int n; int y; int lo_fact; int hi_fact; int lo_half; int hi_half; /* LL1 no Q */ SETUPHIQ(4, 0); /* HL1 */ for (y = 0; y < 33; y++) /* lo */ { /* setup */ ic = SETUP_IC_L0(y); lo = SETUP_OC_LL1(y); hi = SETUP_OC_HL1(y); /* pre */ IC_L0(x2n, 0); IC_L0(x2n1, 1); IC_L0(x2n2, 2); OC_HL1(0, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL1(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 31; n++) { hn1 = hn; x2n = x2n2; IC_L0(x2n1, 2 * n + 1); IC_L0(x2n2, 2 * n + 2); OC_HL1(n, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL1(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic62 = x2n = x2n2; IC_L0(x2n1, 63); x2n2 = 2 * x2n1 - x2n; /* ic[64] = 2 * ic[63] - ic[62] */ OC_LL1(31, NOQ(x2n + (hn1 >> 1))); /* post ex */ x2n = x2n2; /* x2n1 already set, mirror 65 -> 63 */ x2n2 = ic62; /* mirror 66 -> 62 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LL1(32, NOQ(x2n + (hn >> 1))); } SETUPLOQ(3, 4); /* LH1 */ SETUPHIQ(4, 4); /* HH1 */ for (y = 0; y < 31; y++) /* hi */ { /* setup */ ic = SETUP_IC_H0(y); lo = SETUP_OC_LH1(y); hi = SETUP_OC_HH1(y); /* pre */ IC_H0(x2n, 0); IC_H0(x2n1, 1); IC_H0(x2n2, 2); OC_HH1(0, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH1(0, LOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 31; n++) { hn1 = hn; x2n = x2n2; IC_H0(x2n1, 2 * n + 1); IC_H0(x2n2, 2 * n + 2); OC_HH1(n, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH1(n, LOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic62 = x2n = x2n2; IC_H0(x2n1, 63); x2n2 = 2 * x2n1 - x2n; /* ic[64] = 2 * ic[63] - ic[62] */ OC_LH1(31, LOQ(x2n + (hn1 >> 1))); /* post ex */ x2n = x2n2; /* x2n1 already set, mirror 65 -> 63 */ x2n2 = ic62; /* mirror 66 -> 62 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LH1(32, LOQ(x2n + (hn >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_vert_lv2(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic30; int n; int y; for (y = 0; y < 33; y++) { /* setup */ ic = SETUP_IC_LL1(y); lo = SETUP_OC_L1(y); hi = SETUP_OC_H1(y); /* pre */ IC_LL1(x2n, 0); IC_LL1(x2n1, 1); IC_LL1(x2n2, 2); OC_H1(0, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L1(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; IC_LL1(x2n1, 2 * n + 1); IC_LL1(x2n2, 2 * n + 2); OC_H1(n, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L1(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic30 = x2n = x2n2; IC_LL1(x2n1, 31); IC_LL1(x2n2, 32); OC_H1(15, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L1(15, NOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_L1(16, NOQ(x2n + ((hn1 + hn) >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_horz_lv2(const sint16 *in_buffer, sint16 *out_buffer, const char *quants) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic30; int n; int y; int lo_fact; int hi_fact; int lo_half; int hi_half; /* LL2 no Q */ SETUPHIQ(2, 4); /* HL2 */ for (y = 0; y < 17; y++) /* lo */ { /* setup */ ic = SETUP_IC_L1(y); lo = SETUP_OC_LL2(y); hi = SETUP_OC_HL2(y); /* pre */ IC_L1(x2n, 0); IC_L1(x2n1, 1); IC_L1(x2n2, 2); OC_HL2(0, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL2(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; IC_L1(x2n1, 2 * n + 1); IC_L1(x2n2, 2 * n + 2); OC_HL2(n, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL2(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic30 = x2n = x2n2; IC_L1(x2n1, 31); IC_L1(x2n2, 32); OC_HL2(15, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL2(15, NOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LL2(16, NOQ(x2n + ((hn1 + hn) >> 1))); } SETUPLOQ(2, 0); /* LH2 */ SETUPHIQ(3, 0); /* HH2 */ for (y = 0; y < 16; y++) /* hi */ { /* setup */ ic = SETUP_IC_H1(y); lo = SETUP_OC_LH2(y); hi = SETUP_OC_HH2(y); /* pre */ IC_H1(x2n, 0); IC_H1(x2n1, 1); IC_H1(x2n2, 2); OC_HH2(0, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH2(0, LOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; IC_H1(x2n1, 2 * n + 1); IC_H1(x2n2, 2 * n + 2); OC_HH2(n, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH2(n, LOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic30 = x2n = x2n2; IC_H1(x2n1, 31); IC_H1(x2n2, 32); OC_HH2(15, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH2(15, LOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LH2(16, LOQ(x2n + ((hn1 + hn) >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_vert_lv3(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic14; int n; int y; for (y = 0; y < 17; y++) { /* setup */ ic = SETUP_IC_LL2(y); lo = SETUP_OC_L2(y); hi = SETUP_OC_H2(y); /* pre */ IC_LL2(x2n, 0); IC_LL2(x2n1, 1); IC_LL2(x2n2, 2); OC_H2(0, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L2(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; IC_LL2(x2n1, 2 * n + 1); IC_LL2(x2n2, 2 * n + 2); OC_H2(n, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L2(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic14 = x2n = x2n2; IC_LL2(x2n1, 15); IC_LL2(x2n2, 16); OC_H2(7, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L2(7, NOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_L2(8, NOQ(x2n + ((hn1 + hn) >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_horz_lv3(const sint16 *in_buffer, sint16 *out_buffer, const char *quants) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic14; int n; int y; int lo_fact; int hi_fact; int lo_half; int hi_half; SETUPLOQ(0, 0); /* LL3 */ SETUPHIQ(1, 0); /* HL3 */ for (y = 0; y < 9; y++) /* lo */ { /* setup */ ic = SETUP_IC_L2(y); lo = SETUP_OC_LL3(y); hi = SETUP_OC_HL3(y); /* pre */ IC_L2(x2n, 0); IC_L2(x2n1, 1); IC_L2(x2n2, 2); OC_HL3(0, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL3(0, LOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; IC_L2(x2n1, 2 * n + 1); IC_L2(x2n2, 2 * n + 2); OC_HL3(n, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL3(n, LOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic14 = x2n = x2n2; IC_L2(x2n1, 15); IC_L2(x2n2, 16); OC_HL3(7, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LL3(7, LOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LL3(8, LOQ(x2n + ((hn1 + hn) >> 1))); } SETUPLOQ(0, 4); /* LH3 */ SETUPHIQ(1, 4); /* HH3 */ for (y = 0; y < 8; y++) /* hi */ { /* setup */ ic = SETUP_IC_H2(y); lo = SETUP_OC_LH3(y); hi = SETUP_OC_HH3(y); /* pre */ IC_H2(x2n, 0); IC_H2(x2n1, 1); IC_H2(x2n2, 2); OC_HH3(0, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH3(0, LOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; IC_H2(x2n1, 2 * n + 1); IC_H2(x2n2, 2 * n + 2); OC_HH3(n, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH3(n, LOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic14 = x2n = x2n2; IC_H2(x2n1, 15); IC_H2(x2n2, 16); OC_HH3(7, HIQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_LH3(7, LOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LH3(8, LOQ(x2n + ((hn1 + hn) >> 1))); } } /******************************************************************************/ int rfx_encode_dwt_shift_rem(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer, const char *quants) { rfx_encode_dwt_shift_rem_vert_lv1_u8(in_buffer, tmp_buffer); rfx_encode_dwt_shift_rem_horz_lv1(tmp_buffer, out_buffer, quants); rfx_encode_dwt_shift_rem_vert_lv2(out_buffer + 3007, tmp_buffer); rfx_encode_dwt_shift_rem_horz_lv2(tmp_buffer, out_buffer + 3007, quants); rfx_encode_dwt_shift_rem_vert_lv3(out_buffer + 3807, tmp_buffer); rfx_encode_dwt_shift_rem_horz_lv3(tmp_buffer, out_buffer + 3807, quants); return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode_differential.c000644 001751 000000 00000002416 14652432052 022544 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Differential Encoding * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxconstants.h" #include "rfxencode_differential.h" /******************************************************************************/ int rfx_differential_encode(sint16 *buffer, int buffer_size) { sint16 n1, n2; sint16 *dst; for (n1 = *buffer, dst = buffer + 1; buffer_size > 1; dst++, buffer_size--) { n2 = *dst; *dst -= n1; n1 = n2; } return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode_dwt_shift_rem_common.h000644 001751 000000 00000011215 14652432052 024320 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_DWT_SHIFT_REM_COMMON_H #define __RFXENCODE_DWT_SHIFT_REM_COMMON_H /* LL0 -> L0, H0 - level 1 vertical L0 -> LL1, HL1 - level 1 horizontal H0 -> LH1, HH1 LL1 -> L1, H1 - level 2 vertical L1 -> LL2, HL2 - level 2 horizontal H1 -> LH2, HH2 LL2 -> L2, H2 - level 3 vertical L2 -> LL3, HL3 - level 3 horizontal H2 -> LH3, HH3 */ /* level 1 LL0 -> L0, H0 */ #define SETUP_IC_LL0(_y) in_buffer + (_y) #define SETUP_OC_L0(_y) out_buffer + (_y) #define SETUP_OC_H0(_y) out_buffer + 64 * 33 + (_y) #define IC_LL0_U8(_val, _offset) _val = (ic[(_offset) * 64] - 128) << DWT_FACTOR #define IC_LL0_S16(_val, _offset) _val = ic[(_offset) * 64] #define OC_L0(_offset, _val) lo[(_offset) * 64] = _val #define OC_H0(_offset, _val) hi[(_offset) * 64] = _val /* L0 -> LL1, HL1 */ #define SETUP_IC_L0(_y) in_buffer + 64 * (_y) #define SETUP_OC_LL1(_y) out_buffer + 31 * 33 + 33 * 31 + 31 * 31 + 33 * (_y) #define SETUP_OC_HL1(_y) out_buffer + 31 * (_y); #define IC_L0(_val, _offset) _val = ic[(_offset)] #define OC_LL1(_offset, _val) lo[(_offset)] = _val #define OC_HL1(_offset, _val) hi[(_offset)] = _val /* H0 -> LH1, HH1 */ #define SETUP_IC_H0(_y) in_buffer + 64 * (33 + (_y)) #define SETUP_OC_LH1(_y) out_buffer + 31 * 33 + 33 * (_y) #define SETUP_OC_HH1(_y) out_buffer + 31 * 33 + 33 * 31 + 31 * (_y) #define IC_H0(_val, _offset) _val = ic[(_offset)] #define OC_LH1(_offset, _val) lo[(_offset)] = _val #define OC_HH1(_offset, _val) hi[(_offset)] = _val /* level 2 LL1 -> L1, H1 */ #define SETUP_IC_LL1(_y) in_buffer + (_y) #define SETUP_OC_L1(_y) out_buffer + (_y) #define SETUP_OC_H1(_y) out_buffer + 33 * 17 + (_y) #define IC_LL1(_val, _offset) _val = ic[(_offset) * 33] #define OC_L1(_offset, _val) lo[(_offset) * 33] = _val #define OC_H1(_offset, _val) hi[(_offset) * 33] = _val /* L1 -> LL2, HL2 */ #define SETUP_IC_L1(_y) in_buffer + 33 * (_y) #define SETUP_OC_LL2(_y) out_buffer + 16 * 17 + 17 * 16 + 16 * 16 + 17 * (_y) #define SETUP_OC_HL2(_y) out_buffer + 16 * (_y) #define IC_L1(_val, _offset) _val = ic[(_offset)] #define OC_LL2(_offset, _val) lo[(_offset)] = _val #define OC_HL2(_offset, _val) hi[(_offset)] = _val /* H1 -> LH2, HH2 */ #define SETUP_IC_H1(_y) in_buffer + 33 * (17 + (_y)) #define SETUP_OC_LH2(_y) out_buffer + 16 * 17 + 17 * (_y) #define SETUP_OC_HH2(_y) out_buffer + 16 * 17 + 17 * 16 + 16 * (_y) #define IC_H1(_val, _offset) _val = ic[(_offset)] #define OC_LH2(_offset, _val) lo[(_offset)] = _val #define OC_HH2(_offset, _val) hi[(_offset)] = _val /* level 3 LL2 -> L2, H2 */ #define SETUP_IC_LL2(_y) in_buffer + (_y) #define SETUP_OC_L2(_y) out_buffer + (_y) #define SETUP_OC_H2(_y) out_buffer + 17 * 9 + (_y) #define IC_LL2(_val, _offset) _val = ic[(_offset) * 17] #define OC_L2(_offset, _val) lo[(_offset) * 17] = _val #define OC_H2(_offset, _val) hi[(_offset) * 17] = _val /* L2 -> LL3, HL3 */ #define SETUP_IC_L2(_y) in_buffer + 17 * (_y) #define SETUP_OC_LL3(_y) out_buffer + 8 * 9 + 9 * 8 + 8 * 8 + 9 * (_y) #define SETUP_OC_HL3(_y) out_buffer + 8 * (_y) #define IC_L2(_val, _offset) _val = ic[(_offset)] #define OC_LL3(_offset, _val) lo[(_offset)] = _val #define OC_HL3(_offset, _val) hi[(_offset)] = _val /* H2 -> LH3, HH3 */ #define SETUP_IC_H2(_y) in_buffer + 17 * (9 + (_y)) #define SETUP_OC_LH3(_y) out_buffer + 8 * 9 + 9 * (_y) #define SETUP_OC_HH3(_y) out_buffer + 8 * 9 + 9 * 8 + 8 * (_y) #define IC_H2(_val, _offset) _val = ic[(_offset)] #define OC_LH3(_offset, _val) lo[(_offset)] = _val #define OC_HH3(_offset, _val) hi[(_offset)] = _val #define SETUPLOQ(_index, _shift) do { \ lo_fact = (((quants[_index] >> (_shift)) & 0xf) - 6) + DWT_FACTOR; \ lo_half = 1 << (lo_fact - 1); } while (0) #define SETUPHIQ(_index, _shift) do { \ hi_fact = (((quants[_index] >> (_shift)) & 0xf) - 6) + DWT_FACTOR; \ hi_half = 1 << (hi_fact - 1); } while (0) #define LOQ(_val) ((_val) + lo_half) >> lo_fact #define HIQ(_val) ((_val) + hi_half) >> hi_fact #define NOQ(_val) _val #endif xrdp-0.10.1/librfxcodec/src/rfxencode_diff_rlgr1.h000644 001751 000000 00000001601 14652432052 022127 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_DIFF_RLGR1_H #define __RFX_DIFF_RLGR1_H #include "rfxcommon.h" int rfx_encode_diff_rlgr1(sint16 *coef, uint8 *cdata, int cdata_size, int diff_bytes); #endif /* __RFX_DIFF_RLGR1_H */ xrdp-0.10.1/librfxcodec/src/rfxencode_tile.c000644 001751 000000 00000024741 14652432052 021052 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Encode * * Copyright 2011 Vic Lee * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxconstants.h" #include "rfxencode_tile.h" #include "rfxencode_dwt.h" #include "rfxencode_dwt_rem.h" #include "rfxencode_quantization.h" #include "rfxencode_differential.h" #include "rfxencode_rlgr1.h" #include "rfxencode_rlgr3.h" #include "rfxencode_diff_rlgr1.h" #include "rfxencode_diff_rlgr3.h" #include "rfxencode_alpha.h" #ifdef RFX_USE_ACCEL_X86 #include "x86/funcs_x86.h" #endif #ifdef RFX_USE_ACCEL_AMD64 #include "amd64/funcs_amd64.h" #endif #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) /** * In order not to overflow the output buffer, we need to have an * upper limit on the size of a tile which could possibly be written to * the buffer. * * The tile data structure (TS_RFX_TILE) is defined in [MS-RDPRFX] * 2.2.2.3.4.1 * * We make the conservative assumption that the RLGR1/RLGL3 algorithm * worst case results in a doubling of the YCbCr data for each pixel. * This is likely to be far higher than necessary. */ #define RLGR_WORST_CASE_SIZE_FACTOR 2 #define TILE_SIZE_UPPER_LIMIT (6 + 1 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + \ (64 * 64) * 3 * RLGR_WORST_CASE_SIZE_FACTOR) /******************************************************************************/ int rfx_encode_component_rlgr1(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr1:")); if (rfx_dwt_2d_encode(data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } if (rfx_quantization_encode(enc->dwt_buffer1, qtable) != 0) { return 1; } if (rfx_differential_encode(enc->dwt_buffer1 + 4032, 64) != 0) { return 1; } *size = rfx_rlgr1_encode(enc->dwt_buffer1, buffer, buffer_size); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr3(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr3:")); if (rfx_dwt_2d_encode(data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } if (rfx_quantization_encode(enc->dwt_buffer1, qtable) != 0) { return 1; } if (rfx_differential_encode(enc->dwt_buffer1 + 4032, 64) != 0) { return 1; } *size = rfx_rlgr3_encode(enc->dwt_buffer1, buffer, buffer_size); return 0; } /******************************************************************************/ static int check_and_rfx_encode(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { if (buffer_size < TILE_SIZE_UPPER_LIMIT) { return 1; } return enc->rfx_encode(enc, qtable, data, buffer, buffer_size, size); } /******************************************************************************/ int rfx_encode_rgb(struct rfxencode *enc, const char *rgb_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size) { uint8 *y_r_buffer; uint8 *u_g_buffer; uint8 *v_b_buffer; LLOGLN(10, ("rfx_encode_rgb:")); if (enc->rfx_encode_rgb_to_yuv(enc, rgb_data, width, height, stride_bytes) != 0) { return 1; } y_r_buffer = enc->y_r_buffer; u_g_buffer = enc->u_g_buffer; v_b_buffer = enc->v_b_buffer; if (check_and_rfx_encode(enc, y_quants, y_r_buffer, stream_get_tail(data_out), stream_get_left(data_out), y_size) != 0) { return 1; } LLOGLN(10, ("rfx_encode_rgb: y_size %d", *y_size)); stream_seek(data_out, *y_size); if (check_and_rfx_encode(enc, u_quants, u_g_buffer, stream_get_tail(data_out), stream_get_left(data_out), u_size) != 0) { return 1; } LLOGLN(10, ("rfx_encode_rgb: u_size %d", *u_size)); stream_seek(data_out, *u_size); if (check_and_rfx_encode(enc, v_quants, v_b_buffer, stream_get_tail(data_out), stream_get_left(data_out), v_size) != 0) { return 1; } LLOGLN(10, ("rfx_encode_rgb: v_size %d", *v_size)); stream_seek(data_out, *v_size); return 0; } /******************************************************************************/ int rfx_encode_argb(struct rfxencode *enc, const char *argb_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size, int *a_size) { uint8 *a_buffer; uint8 *y_r_buffer; uint8 *u_g_buffer; uint8 *v_b_buffer; LLOGLN(10, ("rfx_encode_argb:")); if (enc->rfx_encode_argb_to_yuva(enc, argb_data, width, height, stride_bytes) != 0) { return 1; } a_buffer = enc->a_buffer; y_r_buffer = enc->y_r_buffer; u_g_buffer = enc->u_g_buffer; v_b_buffer = enc->v_b_buffer; if (check_and_rfx_encode(enc, y_quants, y_r_buffer, stream_get_tail(data_out), stream_get_left(data_out), y_size) != 0) { return 1; } LLOGLN(10, ("rfx_encode_rgb: y_size %d", *y_size)); stream_seek(data_out, *y_size); if (check_and_rfx_encode(enc, u_quants, u_g_buffer, stream_get_tail(data_out), stream_get_left(data_out), u_size) != 0) { return 1; } LLOGLN(10, ("rfx_encode_rgb: u_size %d", *u_size)); stream_seek(data_out, *u_size); if (check_and_rfx_encode(enc, v_quants, v_b_buffer, stream_get_tail(data_out), stream_get_left(data_out), v_size) != 0) { return 1; } LLOGLN(10, ("rfx_encode_rgb: v_size %d", *v_size)); stream_seek(data_out, *v_size); *a_size = rfx_encode_plane(enc, a_buffer, 64, 64, data_out); return 0; } /******************************************************************************/ int rfx_encode_yuv(struct rfxencode *enc, const char *yuv_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size) { const uint8 *y_buffer; const uint8 *u_buffer; const uint8 *v_buffer; y_buffer = (const uint8 *) yuv_data; u_buffer = (const uint8 *) (yuv_data + RFX_YUV_BTES); v_buffer = (const uint8 *) (yuv_data + RFX_YUV_BTES * 2); if (check_and_rfx_encode(enc, y_quants, y_buffer, stream_get_tail(data_out), stream_get_left(data_out), y_size) != 0) { return 1; } stream_seek(data_out, *y_size); if (check_and_rfx_encode(enc, u_quants, u_buffer, stream_get_tail(data_out), stream_get_left(data_out), u_size) != 0) { return 1; } stream_seek(data_out, *u_size); if (check_and_rfx_encode(enc, v_quants, v_buffer, stream_get_tail(data_out), stream_get_left(data_out), v_size) != 0) { return 1; } stream_seek(data_out, *v_size); return 0; } /******************************************************************************/ int rfx_encode_yuva(struct rfxencode *enc, const char *yuva_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size, int *a_size) { const uint8 *y_buffer; const uint8 *u_buffer; const uint8 *v_buffer; const uint8 *a_buffer; y_buffer = (const uint8 *) yuva_data; u_buffer = (const uint8 *) (yuva_data + RFX_YUV_BTES); v_buffer = (const uint8 *) (yuva_data + RFX_YUV_BTES * 2); a_buffer = (const uint8 *) (yuva_data + RFX_YUV_BTES * 3); if (check_and_rfx_encode(enc, y_quants, y_buffer, stream_get_tail(data_out), stream_get_left(data_out), y_size) != 0) { return 1; } stream_seek(data_out, *y_size); if (check_and_rfx_encode(enc, u_quants, u_buffer, stream_get_tail(data_out), stream_get_left(data_out), u_size) != 0) { return 1; } stream_seek(data_out, *u_size); if (check_and_rfx_encode(enc, v_quants, v_buffer, stream_get_tail(data_out), stream_get_left(data_out), v_size) != 0) { return 1; } stream_seek(data_out, *v_size); *a_size = rfx_encode_plane(enc, a_buffer, 64, 64, data_out); return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode_rlgr1.h000644 001751 000000 00000001515 14652432052 021143 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_RLGR1_H #define __RFX_RLGR1_H #include "rfxcommon.h" int rfx_rlgr1_encode(const sint16 *data, uint8 *buffer, int buffer_size); #endif /* __RFX_RLGR_H */ xrdp-0.10.1/librfxcodec/src/rfxencode_alpha.h000644 001751 000000 00000001561 14652432052 021202 0ustar00metawheel000000 000000 /** * librfxcodec: A Remote Desktop Protocol client. * RemoteFX Codec Library * * Copyright 2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXCODEC_ENCODE_ALPHA_H #define __RFXCODEC_ENCODE_ALPHA_H int rfx_encode_plane(struct rfxencode *enc, const uint8 *plane, int cx, int cy, STREAM *s); #endif xrdp-0.10.1/librfxcodec/src/rfxencode_rlgr3.h000644 001751 000000 00000001515 14652432052 021145 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_RLGR3_H #define __RFX_RLGR3_H #include "rfxcommon.h" int rfx_rlgr3_encode(const sint16 *data, uint8 *buffer, int buffer_size); #endif /* __RFX_RLGR_H */ xrdp-0.10.1/librfxcodec/src/rfxencode_diff_rlgr3.h000644 001751 000000 00000001601 14652432052 022131 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_DIFF_RLGR3_H #define __RFX_DIFF_RLGR3_H #include "rfxcommon.h" int rfx_encode_diff_rlgr3(sint16 *coef, uint8 *cdata, int cdata_size, int diff_bytes); #endif /* __RFX_DIFF_RLGR3_H */ xrdp-0.10.1/librfxcodec/src/rfxcommon.h000644 001751 000000 00000010334 14652432052 020066 0ustar00metawheel000000 000000 /** * RFX codec * * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXCOMMON_H #define __RFXCOMMON_H #define MIN(_val1, _val2) (_val1) < (_val2) ? (_val1) : (_val2) #define MAX(_val1, _val2) (_val1) > (_val2) ? (_val1) : (_val2) #define MINMAX(_v, _l, _h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v))) #define DWT_FACTOR 5 typedef signed char sint8; typedef unsigned char uint8; typedef signed short sint16; typedef unsigned short uint16; typedef signed int sint32; typedef unsigned int uint32; struct _STREAM { uint8 *data; uint8 *p; int size; }; typedef struct _STREAM STREAM; #if defined(__x86__) || defined(__x86_64__) || \ defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \ defined(__i386__) #define stream_read_uint8(_s, _v) do { _v = ((uint8 *) ((_s)->p))[0]; (_s)->p += 1; } while (0) #define stream_read_uint16(_s, _v) do { _v = ((uint16 *) ((_s)->p))[0]; (_s)->p += 2; } while (0) #define stream_read_uint32(_s, _v) do { _v = ((uint32 *) ((_s)->p))[0]; (_s)->p += 4; } while (0) #define stream_write_uint8(_s, _v) do { ((uint8 *) ((_s)->p))[0] = _v; (_s)->p += 1; } while (0) #define stream_write_uint16(_s, _v) do { ((uint16 *) ((_s)->p))[0] = _v; (_s)->p += 2; } while (0) #define stream_write_uint32(_s, _v) do { ((uint32 *) ((_s)->p))[0] = _v; (_s)->p += 4; } while (0) #else #define stream_read_uint8(_s, _v) do { \ _v = ((uint8 *) ((_s)->p))[0]; \ (_s)->p += 1; \ } while (0) #define stream_read_uint16(_s, _v) do { \ _v = (((uint8 *) ((_s)->p))[0]) | \ ((((uint8 *) ((_s)->p))[1]) << 8); \ (_s)->p += 2; \ } while (0) #define stream_read_uint32(_s, _v) do { \ _v = (((uint8 *) ((_s)->p))[0]) | \ ((((uint8 *) ((_s)->p))[1]) << 8) | \ ((((uint8 *) ((_s)->p))[2]) << 16) | \ ((((uint8 *) ((_s)->p))[3]) << 24); \ (_s)->p += 4; \ } while (0) #define stream_write_uint8(_s, _v) do { \ ((uint8 *) ((_s)->p))[0] = _v; \ (_s)->p += 1; \ } while (0) #define stream_write_uint16(_s, _v) do { \ ((uint8 *) ((_s)->p))[0] = (uint8) (_v); \ ((uint8 *) ((_s)->p))[1] = (uint8) ((_v) >> 8); \ (_s)->p += 2; \ } while (0) #define stream_write_uint32(_s, _v) do { \ ((uint8 *) ((_s)->p))[0] = (uint8) (_v); \ ((uint8 *) ((_s)->p))[1] = (uint8) ((_v) >> 8); \ ((uint8 *) ((_s)->p))[2] = (uint8) ((_v) >> 16); \ ((uint8 *) ((_s)->p))[3] = (uint8) ((_v) >> 24); \ (_s)->p += 4; \ } while (0) #endif #define stream_read(_s, _b, _n) do { memcpy(_b, (_s)->p, _n); (_s)->p += _n; } while (0) #define stream_write(_s, _b, _n) do { memcpy((_s)->p, _b, _n); (_s)->p += _n; } while (0) #define stream_seek(_s, _n) (_s)->p += _n #define stream_seek_uint8(_s) (_s)->p += 1 #define stream_seek_uint16(_s) (_s)->p += 2 #define stream_seek_uint32(_s) (_s)->p += 4 #define stream_get_pos(_s) ((int) ((_s)->p - (_s)->data)) #define stream_get_tail(_s) (_s)->p #define stream_get_left(_s) ((_s)->size - ((_s)->p - (_s)->data)) #define stream_set_pos(_s, _m) (_s)->p = (_s)->data + (_m) #define xnew(_type) (_type *) calloc(1, sizeof(_type)) /* GCC has __builtin_clz that translates to BSR on x86/x64, CLZ on ARM, etc. and emulates the instruction if the hardware does not implement it. Visual C++ 2005 and up has _BitScanReverse LZCNT = BSR ^ 31 */ #if defined(__GNUC__) #define GBSR(_in, _r) do { \ _r = __builtin_clz(_in) ^ 31; \ } while (0) #elif defined(_MSC_VER) && (_MSC_VER > 1000) #define GBSR(_in, _r) do { \ unsigned long rv = 0; \ _BitScanReverse(&rv, _in); \ _r = rv; \ } while (0) #else #define GBSR(_in, _r) do { \ int rv = -1; \ int x = _in; \ while (x != 0) \ { \ rv++; \ x = x >> 1; \ } \ _r = rv; \ } while (0) #endif #endif xrdp-0.10.1/librfxcodec/src/rfx_bitstream.h000644 001751 000000 00000005076 14652432052 020736 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Bit Stream * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_BITSTREAM_H #define __RFX_BITSTREAM_H #include "rfxcommon.h" struct _RFX_BITSTREAM { uint8 *buffer; int nbytes; int byte_pos; int bits_left; }; typedef struct _RFX_BITSTREAM RFX_BITSTREAM; #define rfx_bitstream_attach(bs, _buffer, _nbytes) do { \ bs.buffer = (uint8 *) (_buffer); \ bs.nbytes = (_nbytes); \ bs.byte_pos = 0; \ bs.bits_left = 8; } while (0) #define rfx_bitstream_get_bits(bs, _nbits, _r) do { \ int nbits = _nbits; \ int b; \ uint16 n = 0; \ while (bs.byte_pos < bs.nbytes && nbits > 0) \ { \ b = nbits; \ if (b > bs.bits_left) \ b = bs.bits_left; \ if (n) \ n <<= b; \ n |= (bs.buffer[bs.byte_pos] >> (bs.bits_left - b)) & ((1 << b) - 1); \ bs.bits_left -= b; \ nbits -= b; \ if (bs.bits_left == 0) \ { \ bs.bits_left = 8; \ bs.byte_pos++; \ } \ } \ _r = n; } while (0) #define rfx_bitstream_put_bits(bs, _bits, _nbits) do { \ uint16 bits = (_bits); \ int nbits = (_nbits); \ int b; \ while (bs.byte_pos < bs.nbytes && nbits > 0) \ { \ b = nbits; \ if (b > bs.bits_left) \ b = bs.bits_left; \ bs.buffer[bs.byte_pos] &= ~((1 << bs.bits_left) - 1); \ bs.buffer[bs.byte_pos] |= ((bits >> (nbits - b)) & ((1 << b) - 1)) << (bs.bits_left - b); \ bs.bits_left -= b; \ nbits -= b; \ if (bs.bits_left == 0) \ { \ bs.bits_left = 8; \ bs.byte_pos++; \ } \ } } while (0) #define rfx_bitstream_eos(_bs) ((_bs).byte_pos >= (_bs).nbytes) #define rfx_bitstream_left(_bs) ((_bs).byte_pos >= (_bs).nbytes ? 0 : ((_bs).nbytes - (_bs).byte_pos - 1) * 8 + (_bs)->bits_left) #define rfx_bitstream_get_processed_bytes(_bs) ((_bs).bits_left < 8 ? (_bs).byte_pos + 1 : (_bs).byte_pos) #endif /* __RFX_BITSTREAM_H */ xrdp-0.10.1/librfxcodec/src/rfxencode_dwt.c000644 001751 000000 00000015637 14652432052 020717 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - DWT * * Copyright 2011 Vic Lee * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode_dwt.h" /******************************************************************************/ static int rfx_dwt_2d_encode_horz(const sint16 *in_buffer, sint16 *out_buffer, int subband_width) { const sint16 *l_src, *h_src; sint16 *hl, *lh, *hh, *ll; int x, y; int n; /* DWT in horizontal direction, results in 4 sub-bands in * HL(0), LH(1), HH(2), LL(3) order, stored in original buffer. */ /* The lower part L generates LL(3) and HL(0). */ /* The higher part H generates LH(1) and HH(2). */ ll = out_buffer + subband_width * subband_width * 3; hl = out_buffer; l_src = in_buffer; lh = out_buffer + subband_width * subband_width; hh = out_buffer + subband_width * subband_width * 2; h_src = in_buffer + subband_width * subband_width * 2; for (y = 0; y < subband_width; y++) { /* pre */ hl[0] = (l_src[1] - ((l_src[0] + l_src[2]) >> 1)) >> 1; ll[0] = l_src[0] + hl[0]; /* loop */ for (n = 1; n < subband_width - 1; n++) { x = n << 1; hl[n] = (l_src[x + 1] - ((l_src[x] + l_src[x + 2]) >> 1)) >> 1; ll[n] = l_src[x] + ((hl[n - 1] + hl[n]) >> 1); } /* post */ n = subband_width - 1; x = n << 1; hl[n] = (l_src[x + 1] - ((l_src[x] + l_src[x]) >> 1)) >> 1; ll[n] = l_src[x] + ((hl[n - 1] + hl[n]) >> 1); /* pre */ hh[0] = (h_src[1] - ((h_src[0] + h_src[2]) >> 1)) >> 1; lh[0] = h_src[0] + hh[0]; /* loop */ for (n = 1; n < subband_width - 1; n++) { x = n << 1; hh[n] = (h_src[x + 1] - ((h_src[x] + h_src[x + 2]) >> 1)) >> 1; lh[n] = h_src[x] + ((hh[n - 1] + hh[n]) >> 1); } /* post */ n = subband_width - 1; x = n << 1; hh[n] = (h_src[x + 1] - ((h_src[x] + h_src[x]) >> 1)) >> 1; lh[n] = h_src[x] + ((hh[n - 1] + hh[n]) >> 1); ll += subband_width; hl += subband_width; l_src += subband_width << 1; lh += subband_width; hh += subband_width; h_src += subband_width << 1; } return 0; } /******************************************************************************/ static int rfx_dwt_2d_encode_block(sint16 *in_out_buffer, sint16 *tmp_buffer, int subband_width) { sint16 *src, *l, *h; int total_width; int x, y; int n; total_width = subband_width << 1; /* DWT in vertical direction, results in 2 sub-bands in L, H order in * tmp buffer. */ for (x = 0; x < total_width; x++) { /* pre */ l = tmp_buffer + x; h = l + subband_width * total_width; src = in_out_buffer + x; *h = (src[total_width] - ((src[0] + src[2 * total_width]) >> 1)) >> 1; *l = src[0] + (*h); /* loop */ for (n = 1; n < subband_width - 1; n++) { y = n << 1; l = tmp_buffer + n * total_width + x; h = l + subband_width * total_width; src = in_out_buffer + y * total_width + x; *h = (src[total_width] - ((src[0] + src[2 * total_width]) >> 1)) >> 1; *l = src[0] + ((*(h - total_width) + *h) >> 1); } /* post */ n = subband_width - 1; y = n << 1; l = tmp_buffer + n * total_width + x; h = l + subband_width * total_width; src = in_out_buffer + y * total_width + x; *h = (src[total_width] - ((src[0] + src[0]) >> 1)) >> 1; *l = src[0] + ((*(h - total_width) + *h) >> 1); } return rfx_dwt_2d_encode_horz(tmp_buffer, in_out_buffer, subband_width); } /******************************************************************************/ static int rfx_dwt_2d_encode_block8(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer, int subband_width) { const uint8 *src; sint16 *l, *h; sint16 s1, s2, s3; int total_width; int x, y; int n; total_width = subband_width << 1; /* DWT in vertical direction, results in 2 sub-bands in L, H order in * tmp buffer. */ for (x = 0; x < total_width; x++) { /* pre */ l = tmp_buffer + x; h = l + subband_width * total_width; src = in_buffer + x; s1 = (src[total_width] - 128) << DWT_FACTOR; s2 = (src[0] - 128) << DWT_FACTOR; s3 = (src[2 * total_width] - 128) << DWT_FACTOR; *h = (s1 - ((s2 + s3) >> 1)) >> 1; s1 = (src[0] - 128) << DWT_FACTOR; *l = s1 + *h; /* loop */ for (n = 1; n < subband_width - 1; n++) { y = n << 1; l = tmp_buffer + n * total_width + x; h = l + subband_width * total_width; src = in_buffer + y * total_width + x; s1 = (src[total_width] - 128) << DWT_FACTOR; s2 = (src[0] - 128) << DWT_FACTOR; s3 = (src[2 * total_width] - 128) << DWT_FACTOR; *h = (s1 - ((s2 + s3) >> 1)) >> 1; s1 = (src[0] - 128) << DWT_FACTOR; *l = s1 + ((*(h - total_width) + *h) >> 1); } /* post */ n = subband_width - 1; y = n << 1; l = tmp_buffer + n * total_width + x; h = l + subband_width * total_width; src = in_buffer + y * total_width + x; s1 = (src[total_width] - 128) << DWT_FACTOR; s2 = (src[0] - 128) << DWT_FACTOR; s3 = (src[0] - 128) << DWT_FACTOR; *h = (s1 - ((s2 + s3) >> 1)) >> 1; s1 = (src[0] - 128) << DWT_FACTOR; *l = s1 + ((*(h - total_width) + *h) >> 1); } return rfx_dwt_2d_encode_horz(tmp_buffer, out_buffer, subband_width); } /******************************************************************************/ int rfx_dwt_2d_encode(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer) { rfx_dwt_2d_encode_block8(in_buffer, out_buffer, tmp_buffer, 32); rfx_dwt_2d_encode_block(out_buffer + 3072, tmp_buffer, 16); rfx_dwt_2d_encode_block(out_buffer + 3840, tmp_buffer, 8); return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode_dwt_rem.h000644 001751 000000 00000001467 14652432052 021563 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2020 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_RFX_REM_DWT_H #define __RFXENCODE_RFX_REM_DWT_H int rfx_rem_dwt_encode(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer); #endif xrdp-0.10.1/librfxcodec/src/rfxencode_compose.c000644 001751 000000 00000105101 14652432052 021550 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library * * Copyright 2011 Vic Lee * Copyright 2015-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxconstants.h" #include "rfxencode_tile.h" #include "rfxencode_quantization.h" #include "rfxencode_dwt_rem.h" #include "rfxencode_dwt_shift_rem.h" #include "rfxencode_diff_rlgr1.h" #include "rfxencode_rlgr1.h" #include "rfxencode_differential.h" #include "rfxencode_compose.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) /* * LL3, LH3, HL3, HH3, LH2, HL2, HH2, LH1, HL1, HH1 */ static const unsigned char g_rfx_default_quantization_values[] = { 0x66, 0x66, 0x77, 0x88, 0x98 }; /******************************************************************************/ static int rfx_compose_message_sync(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 12) { return 1; } stream_write_uint16(s, WBT_SYNC); /* BlockT.blockType */ stream_write_uint32(s, 12); /* BlockT.blockLen */ stream_write_uint32(s, WF_MAGIC); /* magic */ stream_write_uint16(s, WF_VERSION_1_0); /* version */ return 0; } /******************************************************************************/ static int rfx_compose_message_context(struct rfxencode *enc, STREAM *s) { uint16 properties; int rlgr; if (stream_get_left(s) < 13) { return 1; } stream_write_uint16(s, WBT_CONTEXT); /* CodecChannelT.blockType */ stream_write_uint32(s, 13); /* CodecChannelT.blockLen */ stream_write_uint8(s, 1); /* CodecChannelT.codecId */ stream_write_uint8(s, 255); /* CodecChannelT.channelId */ stream_write_uint8(s, 0); /* ctxId */ stream_write_uint16(s, CT_TILE_64x64); /* tileSize */ /* properties */ properties = enc->flags; /* flags */ properties |= (COL_CONV_ICT << 3); /* cct */ properties |= (CLW_XFORM_DWT_53_A << 5); /* xft */ rlgr = enc->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3; properties |= rlgr << 9; /* et */ properties |= (SCALAR_QUANTIZATION << 13); /* qt */ stream_write_uint16(s, properties); /* properties in tilesets: note that this has different format from * the one in TS_RFX_CONTEXT */ properties = 1; /* lt */ properties |= (enc->flags << 1); /* flags */ properties |= (COL_CONV_ICT << 4); /* cct */ properties |= (CLW_XFORM_DWT_53_A << 6); /* xft */ properties |= rlgr << 10; /* et */ properties |= (SCALAR_QUANTIZATION << 14); /* qt */ enc->properties = properties; return 0; } /******************************************************************************/ static int rfx_compose_message_codec_versions(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 10) { return 1; } stream_write_uint16(s, WBT_CODEC_VERSIONS); /* BlockT.blockType */ stream_write_uint32(s, 10); /* BlockT.blockLen */ stream_write_uint8(s, 1); /* numCodecs */ stream_write_uint8(s, 1); /* codecs.codecId */ stream_write_uint16(s, WF_VERSION_1_0); /* codecs.version */ return 0; } /******************************************************************************/ static int rfx_compose_message_channels(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 12) { return 1; } stream_write_uint16(s, WBT_CHANNELS); /* BlockT.blockType */ stream_write_uint32(s, 12); /* BlockT.blockLen */ stream_write_uint8(s, 1); /* numChannels */ stream_write_uint8(s, 0); /* Channel.channelId */ stream_write_uint16(s, enc->width); /* Channel.width */ stream_write_uint16(s, enc->height); /* Channel.height */ return 0; } /******************************************************************************/ int rfx_compose_message_header(struct rfxencode *enc, STREAM *s) { if (rfx_compose_message_sync(enc, s) != 0) { return 1; } if (rfx_compose_message_context(enc, s) != 0) { return 1; } if (rfx_compose_message_codec_versions(enc, s) != 0) { return 1; } if (rfx_compose_message_channels(enc, s) != 0) { return 1; } enc->header_processed = 1; return 0; } /******************************************************************************/ static int rfx_compose_message_frame_begin(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 14) { return 1; } stream_write_uint16(s, WBT_FRAME_BEGIN); /* CodecChannelT.blockType */ stream_write_uint32(s, 14); /* CodecChannelT.blockLen */ stream_write_uint8(s, 1); /* CodecChannelT.codecId */ stream_write_uint8(s, 0); /* CodecChannelT.channelId */ stream_write_uint32(s, enc->frame_idx); /* frameIdx */ stream_write_uint16(s, 1); /* numRegions */ enc->frame_idx++; return 0; } /******************************************************************************/ static int rfx_compose_message_region(struct rfxencode *enc, STREAM *s, const struct rfx_rect *regions, int num_regions) { int size; int i; size = 15 + num_regions * 8; if (stream_get_left(s) < size) { return 1; } stream_write_uint16(s, WBT_REGION); /* CodecChannelT.blockType */ stream_write_uint32(s, size); /* set CodecChannelT.blockLen later */ stream_write_uint8(s, 1); /* CodecChannelT.codecId */ stream_write_uint8(s, 0); /* CodecChannelT.channelId */ stream_write_uint8(s, 1); /* regionFlags */ stream_write_uint16(s, num_regions); /* numRects */ for (i = 0; i < num_regions; i++) { stream_write_uint16(s, regions[i].x); stream_write_uint16(s, regions[i].y); stream_write_uint16(s, regions[i].cx); stream_write_uint16(s, regions[i].cy); } stream_write_uint16(s, CBT_REGION); /* regionType */ stream_write_uint16(s, 1); /* numTilesets */ return 0; } /******************************************************************************/ static int rfx_compose_message_tile_yuv(struct rfxencode *enc, STREAM *s, const char *tile_data, int tile_width, int tile_height, int stride_bytes, const char *quantVals, int quantIdxY, int quantIdxCb, int quantIdxCr, int xIdx, int yIdx) { int YLen = 0; int CbLen = 0; int CrLen = 0; int start_pos; int end_pos; start_pos = stream_get_pos(s); stream_write_uint16(s, CBT_TILE); /* BlockT.blockType */ stream_seek_uint32(s); /* set BlockT.blockLen later */ stream_write_uint8(s, quantIdxY); stream_write_uint8(s, quantIdxCb); stream_write_uint8(s, quantIdxCr); stream_write_uint16(s, xIdx); stream_write_uint16(s, yIdx); stream_seek(s, 6); /* YLen, CbLen, CrLen */ if (rfx_encode_yuv(enc, tile_data, tile_width, tile_height, stride_bytes, quantVals + quantIdxY * 5, quantVals + quantIdxCb * 5, quantVals + quantIdxCr * 5, s, &YLen, &CbLen, &CrLen) != 0) { return 1; } LLOGLN(10, ("rfx_compose_message_tile_yuv: YLen %d CbLen %d CrLen %d", YLen, CbLen, CrLen)); end_pos = stream_get_pos(s); stream_set_pos(s, start_pos + 2); stream_write_uint32(s, 19 + YLen + CbLen + CrLen); /* BlockT.blockLen */ stream_set_pos(s, start_pos + 13); stream_write_uint16(s, YLen); stream_write_uint16(s, CbLen); stream_write_uint16(s, CrLen); stream_set_pos(s, end_pos); return 0; } /******************************************************************************/ static int rfx_compose_message_tile_yuva(struct rfxencode *enc, STREAM *s, const char *tile_data, int tile_width, int tile_height, int stride_bytes, const char *quantVals, int quantIdxY, int quantIdxCb, int quantIdxCr, int xIdx, int yIdx) { int YLen = 0; int CbLen = 0; int CrLen = 0; int ALen = 0; int start_pos; int end_pos; start_pos = stream_get_pos(s); stream_write_uint16(s, CBT_TILE); /* BlockT.blockType */ stream_seek_uint32(s); /* set BlockT.blockLen later */ stream_write_uint8(s, quantIdxY); stream_write_uint8(s, quantIdxCb); stream_write_uint8(s, quantIdxCr); stream_write_uint16(s, xIdx); stream_write_uint16(s, yIdx); stream_seek(s, 8); /* YLen, CbLen, CrLen, ALen */ if (rfx_encode_yuva(enc, tile_data, tile_width, tile_height, stride_bytes, quantVals + quantIdxY * 5, quantVals + quantIdxCb * 5, quantVals + quantIdxCr * 5, s, &YLen, &CbLen, &CrLen, &ALen) != 0) { return 1; } end_pos = stream_get_pos(s); stream_set_pos(s, start_pos + 2); stream_write_uint32(s, 19 + YLen + CbLen + CrLen + ALen); /* BlockT.blockLen */ stream_set_pos(s, start_pos + 13); stream_write_uint16(s, YLen); stream_write_uint16(s, CbLen); stream_write_uint16(s, CrLen); stream_write_uint16(s, ALen); stream_set_pos(s, end_pos); return 0; } /******************************************************************************/ static int rfx_compose_message_tile_rgb(struct rfxencode *enc, STREAM *s, const char *tile_data, int tile_width, int tile_height, int stride_bytes, const char *quantVals, int quantIdxY, int quantIdxCb, int quantIdxCr, int xIdx, int yIdx) { int YLen = 0; int CbLen = 0; int CrLen = 0; int start_pos; int end_pos; start_pos = stream_get_pos(s); stream_write_uint16(s, CBT_TILE); /* BlockT.blockType */ stream_seek_uint32(s); /* set BlockT.blockLen later */ stream_write_uint8(s, quantIdxY); stream_write_uint8(s, quantIdxCb); stream_write_uint8(s, quantIdxCr); stream_write_uint16(s, xIdx); stream_write_uint16(s, yIdx); stream_seek(s, 6); /* YLen, CbLen, CrLen */ if (rfx_encode_rgb(enc, tile_data, tile_width, tile_height, stride_bytes, quantVals + quantIdxY * 5, quantVals + quantIdxCb * 5, quantVals + quantIdxCr * 5, s, &YLen, &CbLen, &CrLen) != 0) { return 1; } end_pos = stream_get_pos(s); stream_set_pos(s, start_pos + 2); stream_write_uint32(s, 19 + YLen + CbLen + CrLen); /* BlockT.blockLen */ stream_set_pos(s, start_pos + 13); stream_write_uint16(s, YLen); stream_write_uint16(s, CbLen); stream_write_uint16(s, CrLen); stream_set_pos(s, end_pos); return 0; } /******************************************************************************/ static int rfx_compose_message_tile_argb(struct rfxencode *enc, STREAM *s, const char *tile_data, int tile_width, int tile_height, int stride_bytes, const char *quantVals, int quantIdxY, int quantIdxCb, int quantIdxCr, int xIdx, int yIdx) { int YLen = 0; int CbLen = 0; int CrLen = 0; int ALen = 0; int start_pos; int end_pos; LLOGLN(10, ("rfx_compose_message_tile_argb:")); start_pos = stream_get_pos(s); stream_write_uint16(s, CBT_TILE); /* BlockT.blockType */ stream_seek_uint32(s); /* set BlockT.blockLen later */ stream_write_uint8(s, quantIdxY); stream_write_uint8(s, quantIdxCb); stream_write_uint8(s, quantIdxCr); stream_write_uint16(s, xIdx); stream_write_uint16(s, yIdx); stream_seek(s, 8); /* YLen, CbLen, CrLen, ALen */ if (rfx_encode_argb(enc, tile_data, tile_width, tile_height, stride_bytes, quantVals + quantIdxY * 5, quantVals + quantIdxCb * 5, quantVals + quantIdxCr * 5, s, &YLen, &CbLen, &CrLen, &ALen) != 0) { LLOGLN(10, ("rfx_compose_message_tile_argb: rfx_encode_argb failed")); return 1; } end_pos = stream_get_pos(s); stream_set_pos(s, start_pos + 2); stream_write_uint32(s, 19 + YLen + CbLen + CrLen + ALen); /* BlockT.blockLen */ stream_set_pos(s, start_pos + 13); stream_write_uint16(s, YLen); stream_write_uint16(s, CbLen); stream_write_uint16(s, CrLen); stream_write_uint16(s, ALen); stream_set_pos(s, end_pos); return 0; } /******************************************************************************/ static int rfx_compose_message_tileset(struct rfxencode *enc, STREAM *s, const char *buf, int width, int height, int stride_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags) { int size; int start_pos; int end_pos; int tiles_end_checkpoint; int tiles_written; int index; int numQuants; const char *quantVals; int quantIdxY; int quantIdxCb; int quantIdxCr; int numTiles; int tilesDataSize; int x; int y; int cx; int cy; const char *tile_data; LLOGLN(10, ("rfx_compose_message_tileset:")); if (quants == 0) { numQuants = 1; quantVals = (const char *) g_rfx_default_quantization_values; } else { numQuants = num_quants; quantVals = quants; } numTiles = num_tiles; size = 22 + numQuants * 5; start_pos = stream_get_pos(s); if (flags & RFX_FLAGS_ALPHAV1) { LLOGLN(10, ("rfx_compose_message_tileset: RFX_FLAGS_ALPHAV1 set")); stream_write_uint16(s, WBT_EXTENSION_PLUS); /* CodecChannelT.blockType */ } else { stream_write_uint16(s, WBT_EXTENSION); /* CodecChannelT.blockType */ } stream_seek_uint32(s); /* set CodecChannelT.blockLen later */ stream_write_uint8(s, 1); /* CodecChannelT.codecId */ stream_write_uint8(s, 0); /* CodecChannelT.channelId */ stream_write_uint16(s, CBT_TILESET); /* subtype */ stream_write_uint16(s, 0); /* idx */ stream_write_uint16(s, enc->properties); /* properties */ stream_write_uint8(s, numQuants); /* numQuants */ stream_write_uint8(s, 0x40); /* tileSize */ stream_write_uint16(s, numTiles); /* numTiles */ stream_seek_uint32(s); /* set tilesDataSize later */ memcpy(s->p, quantVals, numQuants * 5); s->p += numQuants * 5; end_pos = stream_get_pos(s); tiles_written = 0; tiles_end_checkpoint = stream_get_pos(s); if (enc->format == RFX_FORMAT_YUV) { if (flags & RFX_FLAGS_ALPHAV1) { for (index = 0; index < numTiles; index++) { x = tiles[index].x; y = tiles[index].y; cx = tiles[index].cx; cy = tiles[index].cy; quantIdxY = tiles[index].quant_y; quantIdxCb = tiles[index].quant_cb; quantIdxCr = tiles[index].quant_cr; tile_data = buf + (y << 8) * (stride_bytes >> 8) + (x << 8); if (rfx_compose_message_tile_yuva(enc, s, tile_data, cx, cy, stride_bytes, quantVals, quantIdxY, quantIdxCb, quantIdxCr, x / 64, y / 64) != 0) { break; } tiles_end_checkpoint = stream_get_pos(s); tiles_written += 1; } } else { for (index = 0; index < numTiles; index++) { x = tiles[index].x; y = tiles[index].y; cx = tiles[index].cx; cy = tiles[index].cy; quantIdxY = tiles[index].quant_y; quantIdxCb = tiles[index].quant_cb; quantIdxCr = tiles[index].quant_cr; tile_data = buf + (y << 8) * (stride_bytes >> 8) + (x << 8); if (rfx_compose_message_tile_yuv(enc, s, tile_data, cx, cy, stride_bytes, quantVals, quantIdxY, quantIdxCb, quantIdxCr, x / 64, y / 64) != 0) { break; } tiles_end_checkpoint = stream_get_pos(s); tiles_written += 1; } } } else { if (flags & RFX_FLAGS_ALPHAV1) { for (index = 0; index < numTiles; index++) { x = tiles[index].x; y = tiles[index].y; cx = tiles[index].cx; cy = tiles[index].cy; quantIdxY = tiles[index].quant_y; quantIdxCb = tiles[index].quant_cb; quantIdxCr = tiles[index].quant_cr; tile_data = buf + y * stride_bytes + x * (enc->bits_per_pixel / 8); if (rfx_compose_message_tile_argb(enc, s, tile_data, cx, cy, stride_bytes, quantVals, quantIdxY, quantIdxCb, quantIdxCr, x / 64, y / 64) != 0) { break; } tiles_end_checkpoint = stream_get_pos(s); tiles_written += 1; } } else { for (index = 0; index < numTiles; index++) { x = tiles[index].x; y = tiles[index].y; cx = tiles[index].cx; cy = tiles[index].cy; quantIdxY = tiles[index].quant_y; quantIdxCb = tiles[index].quant_cb; quantIdxCr = tiles[index].quant_cr; tile_data = buf + y * stride_bytes + x * (enc->bits_per_pixel / 8); if (rfx_compose_message_tile_rgb(enc, s, tile_data, cx, cy, stride_bytes, quantVals, quantIdxY, quantIdxCb, quantIdxCr, x / 64, y / 64) != 0) { break; } tiles_end_checkpoint = stream_get_pos(s); tiles_written += 1; } } } tilesDataSize = tiles_end_checkpoint - end_pos; size += tilesDataSize; end_pos = tiles_end_checkpoint; stream_set_pos(s, start_pos + 2); stream_write_uint32(s, size); /* CodecChannelT.blockLen */ stream_set_pos(s, start_pos + 16); stream_write_uint16(s, tiles_written); stream_set_pos(s, start_pos + 18); stream_write_uint32(s, tilesDataSize); stream_set_pos(s, end_pos); return tiles_written; } /******************************************************************************/ static int rfx_compose_message_frame_end(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 8) { return 1; } stream_write_uint16(s, WBT_FRAME_END); /* CodecChannelT.blockType */ stream_write_uint32(s, 8); /* CodecChannelT.blockLen */ stream_write_uint8(s, 1); /* CodecChannelT.codecId */ stream_write_uint8(s, 0); /* CodecChannelT.channelId */ return 0; } /******************************************************************************/ int rfx_compose_message_data(struct rfxencode *enc, STREAM *s, const struct rfx_rect *regions, int num_regions, const char *buf, int width, int height, int stride_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags) { int tiles_written; if (rfx_compose_message_frame_begin(enc, s) != 0) { return -1; } if (rfx_compose_message_region(enc, s, regions, num_regions) != 0) { return -1; } tiles_written = rfx_compose_message_tileset(enc, s, buf, width, height, stride_bytes, tiles, num_tiles, quants, num_quants, flags); if (rfx_compose_message_frame_end(enc, s) != 0) { return -1; } return tiles_written; } /******************************************************************************/ static int rfx_pro_compose_message_context(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 10) { return 1; } stream_write_uint16(s, PRO_WBT_CONTEXT); stream_write_uint32(s, 10); stream_write_uint8(s, 0); /* ctxId */ stream_write_uint16(s, CT_TILE_64x64); /* tileSize */ stream_write_uint8(s, RFX_SUBBAND_DIFFING); /* flags */ return 0; } /******************************************************************************/ int rfx_pro_compose_message_header(struct rfxencode *enc, STREAM *s) { if (rfx_compose_message_sync(enc, s) != 0) { return 1; } if (rfx_pro_compose_message_context(enc, s) != 0) { return 1; } enc->header_processed = 1; return 0; } /******************************************************************************/ static int rfx_pro_compose_message_frame_begin(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 12) { return 1; } stream_write_uint16(s, PRO_WBT_FRAME_BEGIN); stream_write_uint32(s, 12); stream_write_uint32(s, enc->frame_idx); stream_write_uint16(s, 1); enc->frame_idx++; return 0; } /******************************************************************************/ /* coef1 = coef2 - coef3 (QCdt = QCot - QCrb) count zeros in coef1, coef2 coef3 = coef2 */ #define COEF_DIFF_COUNT_COPY(_coef1, _coef2, _coef3, _loop, _count1, _count2) \ do { _count1 = 0; _count2 = 0; \ for (_loop = 0; _loop < 4096 - 81; _loop++) { \ _coef1[_loop] = _coef2[_loop] - _coef3[_loop]; \ if (_coef1[_loop] == 0) { _count1++; } \ if (_coef2[_loop] == 0) { _count2++; } \ _coef3[_loop] = _coef2[_loop]; } \ while (_loop < 4096) { \ _coef1[_loop] = _coef2[_loop] - _coef3[_loop]; \ _coef3[_loop] = _coef2[_loop]; _loop++; } \ } while (0) /******************************************************************************/ /* coef1 = coef2 - coef3 (QCdt = QCot - QCrb) count zeros in coef1, coef2 */ #define COEF_DIFF_COUNT(_coef1, _coef2, _coef3, _loop, _count1, _count2) \ do { _count1 = 0; _count2 = 0; \ for (_loop = 0; _loop < 4096 - 81; _loop++) { \ _coef1[_loop] = _coef2[_loop] - _coef3[_loop]; \ if (_coef1[_loop] == 0) { _count1++; } \ if (_coef2[_loop] == 0) { _count2++; } } \ while (_loop < 4096) { \ _coef1[_loop] = _coef2[_loop] - _coef3[_loop]; _loop++; } \ } while (0) /******************************************************************************/ /* coef1 = coef2 - coef3 (QCdt = QCot - QCrb) coef3 = coef2 */ #define COEF_DIFF_COPY(_coef1, _coef2, _coef3, _loop) \ do { \ for (_loop = 0; _loop < 4096; _loop++) { \ _coef1[_loop] = _coef2[_loop] - _coef3[_loop]; \ _coef3[_loop] = _coef2[_loop]; } \ } while (0) /******************************************************************************/ /* coef1 = coef2 - coef3 (QCdt = QCot - QCrb) */ #define COEF_DIFF(_coef1, _coef2, _coef3, _loop) \ do { \ for (_loop = 0; _loop < 4096; _loop++) { \ _coef1[_loop] = _coef2[_loop] - _coef3[_loop]; } \ } while (0) /******************************************************************************/ int rfx_encode_diff_count(sint16 *diff_buffer, const sint16 *dwt_buffer, const sint16 *hist_buffer, int *diff_zeros, int *dwt_zeros) { int index; int ldiff_zeros; int ldwt_zeros; COEF_DIFF_COUNT(diff_buffer, dwt_buffer, hist_buffer, index, ldiff_zeros, ldwt_zeros); *diff_zeros = ldiff_zeros; *dwt_zeros = ldwt_zeros; return 0; } /******************************************************************************/ /* return tiles written or -1 on error */ static int rfx_pro_compose_message_region(struct rfxencode *enc, STREAM *s, const struct rfx_rect *regions, int num_regions, const char *buf, int width, int height, int stride_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags) { int index; int jndex; int start_pos; int tiles_start_pos; int end_pos; int tiles_written; int x; int y; uint8 quantIdxY; uint8 quantIdxCb; uint8 quantIdxCr; const char *tile_data; int y_bytes; int u_bytes; int v_bytes; int tile_start_pos; int tile_end_pos; uint16 xIdx; uint16 yIdx; const uint8 *y_buffer; const uint8 *u_buffer; const uint8 *v_buffer; const char *y_quants; const char *u_quants; const char *v_quants; struct rfx_rb *rb; int dt_y_zeros; int dt_u_zeros; int dt_v_zeros; int ot_y_zeros; int ot_u_zeros; int ot_v_zeros; int tile_flags; sint16 *dwt_buffer_y; sint16 *dwt_buffer_u; sint16 *dwt_buffer_v; if (stream_get_left(s) < 18 + num_regions * 8 + num_quants * 5) { return -1; } if (quants == NULL) { num_quants = 1; quants = (const char *) g_rfx_default_quantization_values; } start_pos = stream_get_pos(s); stream_write_uint16(s, PRO_WBT_REGION); stream_seek_uint32(s); /* blockLen, set later */ stream_write_uint8(s, CT_TILE_64x64); stream_write_uint16(s, num_regions); stream_write_uint8(s, num_quants); stream_write_uint8(s, 0); /* numProgQuant */ stream_write_uint8(s, RFX_DWT_REDUCE_EXTRAPOLATE); /* flags */ stream_seek_uint16(s); /* num_tiles, set later */ stream_seek_uint32(s); /* tileDataSize, set later */ for (index = 0; index < num_regions; index++) { stream_write_uint16(s, regions[index].x); stream_write_uint16(s, regions[index].y); stream_write_uint16(s, regions[index].cx); stream_write_uint16(s, regions[index].cy); } stream_write(s, quants, num_quants * 5); tiles_start_pos = stream_get_pos(s); tile_end_pos = -1; tiles_written = 0; for (index = 0; index < num_tiles; index++) { if (stream_get_left(s) < 22) { break; } x = tiles[index].x; y = tiles[index].y; quantIdxY = tiles[index].quant_y; quantIdxCb = tiles[index].quant_cb; quantIdxCr = tiles[index].quant_cr; if ((quantIdxY >= num_quants) || (quantIdxCb >= num_quants) || (quantIdxCr >= num_quants)) { return -1; } tile_data = buf + (y << 8) * (stride_bytes >> 8) + (x << 8); xIdx = x / 64; yIdx = y / 64; if ((xIdx >= enc->max_rb_x) || (yIdx >= enc->max_rb_y)) { return -1; } tile_start_pos = stream_get_pos(s); stream_write_uint16(s, PRO_WBT_TILE_SIMPLE); stream_seek_uint32(s); /* set later */ stream_write_uint8(s, quantIdxY); stream_write_uint8(s, quantIdxCb); stream_write_uint8(s, quantIdxCr); stream_write_uint16(s, xIdx); stream_write_uint16(s, yIdx); stream_seek(s, 1); /* flags, set later */ stream_seek(s, 8); /* yLen, cbLen, crLen, tailLen, set later */ y_buffer = (const uint8 *) tile_data; u_buffer = (const uint8 *) (tile_data + RFX_YUV_BTES); v_buffer = (const uint8 *) (tile_data + RFX_YUV_BTES * 2); y_quants = quants + quantIdxY * 5; u_quants = quants + quantIdxCb * 5; v_quants = quants + quantIdxCr * 5; rb = enc->rbs[xIdx + yIdx * enc->max_rb_x]; if (rb == NULL) { rb = xnew(struct rfx_rb); if (rb == NULL) { return -1; } enc->rbs[xIdx + yIdx * enc->max_rb_x] = rb; } enc->rfx_encode_dwt_shift_rem(y_buffer, enc->dwt_buffer1, enc->dwt_buffer, y_quants); enc->rfx_encode_dwt_shift_rem(u_buffer, enc->dwt_buffer2, enc->dwt_buffer, u_quants); enc->rfx_encode_dwt_shift_rem(v_buffer, enc->dwt_buffer3, enc->dwt_buffer, v_quants); enc->rfx_encode_diff_count(enc->dwt_buffer4, enc->dwt_buffer1, rb->y, &dt_y_zeros, &ot_y_zeros); enc->rfx_encode_diff_count(enc->dwt_buffer5, enc->dwt_buffer2, rb->u, &dt_u_zeros, &ot_u_zeros); enc->rfx_encode_diff_count(enc->dwt_buffer6, enc->dwt_buffer3, rb->v, &dt_v_zeros, &ot_v_zeros); if (ot_y_zeros + ot_u_zeros + ot_v_zeros < dt_y_zeros + dt_u_zeros + dt_v_zeros) { LLOGLN(10, ("rfx_pro_compose_message_region: diff")); tile_flags = RFX_TILE_DIFFERENCE; dwt_buffer_y = enc->dwt_buffer4; dwt_buffer_u = enc->dwt_buffer5; dwt_buffer_v = enc->dwt_buffer6; } else { LLOGLN(10, ("rfx_pro_compose_message_region: orig")); tile_flags = 0; dwt_buffer_y = enc->dwt_buffer1; dwt_buffer_u = enc->dwt_buffer2; dwt_buffer_v = enc->dwt_buffer3; } y_bytes = rfx_encode_diff_rlgr1(dwt_buffer_y, stream_get_tail(s), stream_get_left(s), 81); if (y_bytes < 0) { break; } stream_seek(s, y_bytes); u_bytes = rfx_encode_diff_rlgr1(dwt_buffer_u, stream_get_tail(s), stream_get_left(s), 81); if (u_bytes < 0) { break; } stream_seek(s, u_bytes); v_bytes = rfx_encode_diff_rlgr1(dwt_buffer_v, stream_get_tail(s), stream_get_left(s), 81); if (v_bytes < 0) { break; } stream_seek(s, v_bytes); LLOGLN(10, ("rfx_pro_compose_message_region: y_bytes %d " "u_bytes %d v_bytes %d", y_bytes, u_bytes, v_bytes)); tile_end_pos = stream_get_pos(s); stream_set_pos(s, tile_start_pos + 2); stream_write_uint32(s, tile_end_pos - tile_start_pos); /* blockLen */ stream_set_pos(s, tile_start_pos + 13); stream_write_uint8(s, tile_flags); /* flags */ stream_write_uint16(s, y_bytes); /* yLen */ stream_write_uint16(s, u_bytes); /* cbLen */ stream_write_uint16(s, v_bytes); /* crLen */ stream_write_uint16(s, 0); /* tailLen */ stream_set_pos(s, tile_end_pos); ++tiles_written; /* update the history only after you know there is space for this tile in the compressed buffer */ if (tile_flags == 0) { /* undo the diff from rfx_encode_diff_rlgr */ for (jndex = 4096 - 80; jndex < 4096; jndex++) { enc->dwt_buffer1[jndex] += enc->dwt_buffer1[jndex - 1]; enc->dwt_buffer2[jndex] += enc->dwt_buffer2[jndex - 1]; enc->dwt_buffer3[jndex] += enc->dwt_buffer3[jndex - 1]; } } memcpy(rb->y, enc->dwt_buffer1, 64 * 64 * 2); memcpy(rb->u, enc->dwt_buffer2, 64 * 64 * 2); memcpy(rb->v, enc->dwt_buffer3, 64 * 64 * 2); } if (tile_end_pos == -1) { return -1; } stream_set_pos(s, tile_end_pos); end_pos = stream_get_pos(s); stream_set_pos(s, start_pos + 2); stream_write_uint32(s, end_pos - start_pos); /* blockLen */ stream_set_pos(s, start_pos + 12); stream_write_uint16(s, tiles_written); /* num_tiles */ stream_write_uint32(s, end_pos - tiles_start_pos); /* tileDataSize */ stream_set_pos(s, end_pos); return tiles_written; } /******************************************************************************/ static int rfx_pro_compose_message_frame_end(struct rfxencode *enc, STREAM *s) { if (stream_get_left(s) < 6) { return 1; } stream_write_uint16(s, PRO_WBT_FRAME_END); stream_write_uint32(s, 6); return 0; } /******************************************************************************/ int rfx_pro_compose_message_data(struct rfxencode *enc, STREAM *s, const struct rfx_rect *regions, int num_regions, const char *buf, int width, int height, int stride_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags) { int tiles_written; LLOGLN(10, ("rfx_pro_compose_message_data:")); if (rfx_pro_compose_message_frame_begin(enc, s) != 0) { return -1; } /* save 6 bytes for end_frame */ s->size -= 6; tiles_written = rfx_pro_compose_message_region(enc, s, regions, num_regions, buf, width, height, stride_bytes, tiles, num_tiles, quants, num_quants, flags); s->size += 6; if (tiles_written <= 0) { return -1; } if (rfx_pro_compose_message_frame_end(enc, s) != 0) { return -1; } return tiles_written; } xrdp-0.10.1/librfxcodec/src/rfxencode_diff_rlgr_common.h000644 001751 000000 00000005110 14652432052 023415 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_DIFF_RLGR_COMMON_H #define __RFXENCODE_DIFF_RLGR_COMMON_H #define PIXELS_IN_TILE 4096 /* Constants used within the RLGR1/RLGR3 algorithm */ #define KPMAX (80) /* max value for kp or krp */ #define LSGR (3) /* shift count to convert kp to k */ #define UP_GR (4) /* increase in kp after a zero run in RL mode */ #define DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ #define UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ #define DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ #define GetNextInput do { \ input = *coef; \ coef++; \ coef_size--; \ } while (0) #define CheckWrite do { \ while (bit_count >= 8) \ { \ if (cdata_size < 1) \ { \ return -1; \ } \ cdata_size--; \ bit_count -= 8; \ *cdata = bits >> bit_count; \ cdata++; \ } \ } while (0) /* output GR code for (mag - 1) */ #define CodeGR(_krp, _lmag) do { \ int lkr = _krp >> LSGR; \ /* unary part of GR code */ \ int lvk = _lmag >> lkr; \ int llvk = lvk; \ if (llvk > 0) \ { \ if (cdata_size < llvk / 8) \ { \ return -1; \ } \ while (llvk >= 8) \ { \ cdata_size--; \ bits <<= 8; \ bits |= 0xFF; \ llvk -= 8; \ *cdata = bits >> bit_count; \ cdata++; \ } \ bits <<= llvk; \ bits |= (1 << llvk) - 1; \ bit_count += llvk; \ } \ bits <<= 1; \ bit_count++; \ /* remainder part of GR code, if needed */ \ if (lkr) \ { \ bits <<= lkr; \ bits |= _lmag & ((1 << lkr) - 1); \ bit_count += lkr; \ } \ /* update _krp, only if it is not equal to 1 */ \ if (lvk == 0) \ { \ _krp = MAX(0, _krp - 2); \ } \ else if (lvk > 1) \ { \ _krp = MIN(KPMAX, _krp + lvk); \ } \ } while (0) #endifxrdp-0.10.1/librfxcodec/src/common.asm000644 001751 000000 00000005115 14652432052 017700 0ustar00metawheel000000 000000 ; ;Copyright 2017 Pavel Roskin ;Copyright 2017 mirabilos ; ;Permission to use, copy, modify, distribute, and sell this software and its ;documentation for any purpose is hereby granted without fee, provided that ;the above copyright notice appear in all copies and that both that ;copyright notice and this permission notice appear in supporting ;documentation. ; ;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 ;OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ;AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ;CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; ;Common nasm code ; ; Detect ELF formats %ifidn __OUTPUT_FORMAT__,elf %define is_elf 1 %endif %ifidn __OUTPUT_FORMAT__,elf32 %define is_elf 1 %endif %ifidn __OUTPUT_FORMAT__,elf64 %define is_elf 1 %endif ; Detect Mach-O formats %ifidn __OUTPUT_FORMAT__,macho %define is_macho 1 %endif %ifidn __OUTPUT_FORMAT__,macho32 %define is_macho 1 %endif %ifidn __OUTPUT_FORMAT__,macho64 %define is_macho 1 %endif ; Mark stack non-executable %ifdef is_elf section .note.GNU-stack noalloc noexec nowrite progbits %endif ; Global function header %macro PROC 1 align 16 %ifdef is_elf global %1:function %1: %else global _%1 _%1: %endif %endmacro ; Macros for relative access to local data %undef lsym %ifdef ASM_ARCH_AMD64 ; amd64; don't define or call RETRIEVE_RODATA %define lsym(name) rel name %endif %ifdef ASM_ARCH_I386 %ifdef PIC ; i386 PIC %macro END_OF_FILE 0 %ifdef I386_PIC_NEEDED section .text ..@get_caller_address: mov ebx, [esp] ret %endif %ifdef is_macho ; see below align 16 %endif %endmacro %macro RETRIEVE_RODATA 0 %define I386_PIC_NEEDED 1 call ..@get_caller_address %%the_caller_address: sub ebx, %%the_caller_address - ..@rodata_begin %endmacro %define lsym(name) ebx + name - ..@rodata_begin %else ; i386 non-PIC; default case for lsym and RETRIEVE_RODATA %endif %endif %ifndef lsym %macro RETRIEVE_RODATA 0 %endmacro %define lsym(name) name %endif %macro PREPARE_RODATA 0 section .text align 16 ..@rodata_begin: %endmacro %ifnmacro END_OF_FILE 0 %macro END_OF_FILE 0 %ifdef is_macho ; cf. https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/simd/jccolext-mmx.asm#L474-L476 align 16 %endif %endmacro %endif section .text xrdp-0.10.1/librfxcodec/src/sse2/000755 001751 000000 00000000000 14652432104 016556 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/src/Makefile.in000644 001751 000000 00000073270 14652432071 017763 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @WITH_SIMD_AMD64_TRUE@am__append_1 = amd64 sse2 @WITH_SIMD_AMD64_TRUE@am__append_2 = -I$(top_srcdir)/src/sse2 -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1 @WITH_SIMD_X86_TRUE@am__append_3 = x86 sse2 @WITH_SIMD_X86_TRUE@am__append_4 = -I$(top_srcdir)/src/sse2 -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_X86=1 subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) @WITH_SIMD_AMD64_FALSE@@WITH_SIMD_X86_TRUE@librfxencode_la_DEPENDENCIES = x86/librfxencode-x86.la \ @WITH_SIMD_AMD64_FALSE@@WITH_SIMD_X86_TRUE@ sse2/librfxencode-sse2.la @WITH_SIMD_AMD64_TRUE@librfxencode_la_DEPENDENCIES = \ @WITH_SIMD_AMD64_TRUE@ amd64/librfxencode-amd64.la \ @WITH_SIMD_AMD64_TRUE@ sse2/librfxencode-sse2.la am__objects_1 = am_librfxencode_la_OBJECTS = $(am__objects_1) rfxencode.lo \ rfxencode_compose.lo rfxencode_tile.lo rfxencode_dwt.lo \ rfxencode_quantization.lo rfxencode_differential.lo \ rfxencode_rlgr1.lo rfxencode_rlgr3.lo rfxencode_alpha.lo \ rfxencode_diff_rlgr1.lo rfxencode_diff_rlgr3.lo \ rfxencode_rgb_to_yuv.lo rfxencode_dwt_rem.lo \ rfxencode_dwt_shift_rem.lo $(am__objects_1) librfxencode_la_OBJECTS = $(am_librfxencode_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = librfxencode_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librfxencode_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rfxencode.Plo \ ./$(DEPDIR)/rfxencode_alpha.Plo \ ./$(DEPDIR)/rfxencode_compose.Plo \ ./$(DEPDIR)/rfxencode_diff_rlgr1.Plo \ ./$(DEPDIR)/rfxencode_diff_rlgr3.Plo \ ./$(DEPDIR)/rfxencode_differential.Plo \ ./$(DEPDIR)/rfxencode_dwt.Plo \ ./$(DEPDIR)/rfxencode_dwt_rem.Plo \ ./$(DEPDIR)/rfxencode_dwt_shift_rem.Plo \ ./$(DEPDIR)/rfxencode_quantization.Plo \ ./$(DEPDIR)/rfxencode_rgb_to_yuv.Plo \ ./$(DEPDIR)/rfxencode_rlgr1.Plo \ ./$(DEPDIR)/rfxencode_rlgr3.Plo ./$(DEPDIR)/rfxencode_tile.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(librfxencode_la_SOURCES) DIST_SOURCES = $(librfxencode_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = amd64 sse2 x86 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ EXTRA_DIST = common.asm nasm_lt.sh SUBDIRS = $(am__append_1) $(am__append_3) AM_CPPFLAGS = -I$(top_srcdir)/include $(am__append_2) $(am__append_4) EXTRA_SOURCES = @WITH_SIMD_AMD64_TRUE@librfxencode_la_LIBADD = amd64/librfxencode-amd64.la sse2/librfxencode-sse2.la @WITH_SIMD_X86_TRUE@librfxencode_la_LIBADD = x86/librfxencode-x86.la sse2/librfxencode-sse2.la noinst_HEADERS = \ rfx_bitstream.h \ rfxcommon.h \ rfxencode_compose.h \ rfxconstants.h \ rfxencode_alpha.h \ rfxencode_differential.h \ rfxencode_dwt.h \ rfxencode.h \ rfxencode_quantization.h \ rfxencode_rlgr1.h \ rfxencode_rlgr3.h \ rfxencode_tile.h \ rfxencode_diff_rlgr1.h \ rfxencode_diff_rlgr3.h \ rfxencode_diff_rlgr_common.h \ rfxencode_rgb_to_yuv.h \ rfxencode_dwt_rem.h \ rfxencode_dwt_shift_rem.h \ rfxencode_dwt_shift_rem_common.h lib_LTLIBRARIES = librfxencode.la librfxencode_la_LDFLAGS = -all-static librfxencode_la_SOURCES = $(noinst_HEADERS) rfxencode.c \ rfxencode_compose.c rfxencode_tile.c rfxencode_dwt.c \ rfxencode_quantization.c rfxencode_differential.c \ rfxencode_rlgr1.c rfxencode_rlgr3.c rfxencode_alpha.c \ rfxencode_diff_rlgr1.c rfxencode_diff_rlgr3.c \ rfxencode_rgb_to_yuv.c \ rfxencode_dwt_rem.c \ rfxencode_dwt_shift_rem.c \ $(EXTRA_SOURCES) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -$(am__rm_f) $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} librfxencode.la: $(librfxencode_la_OBJECTS) $(librfxencode_la_DEPENDENCIES) $(EXTRA_librfxencode_la_DEPENDENCIES) $(AM_V_CCLD)$(librfxencode_la_LINK) -rpath $(libdir) $(librfxencode_la_OBJECTS) $(librfxencode_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_alpha.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_compose.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_diff_rlgr1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_diff_rlgr3.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_differential.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_dwt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_dwt_rem.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_dwt_shift_rem.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_quantization.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_rgb_to_yuv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_rlgr1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_rlgr3.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_tile.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/rfxencode.Plo -rm -f ./$(DEPDIR)/rfxencode_alpha.Plo -rm -f ./$(DEPDIR)/rfxencode_compose.Plo -rm -f ./$(DEPDIR)/rfxencode_diff_rlgr1.Plo -rm -f ./$(DEPDIR)/rfxencode_diff_rlgr3.Plo -rm -f ./$(DEPDIR)/rfxencode_differential.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt_rem.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt_shift_rem.Plo -rm -f ./$(DEPDIR)/rfxencode_quantization.Plo -rm -f ./$(DEPDIR)/rfxencode_rgb_to_yuv.Plo -rm -f ./$(DEPDIR)/rfxencode_rlgr1.Plo -rm -f ./$(DEPDIR)/rfxencode_rlgr3.Plo -rm -f ./$(DEPDIR)/rfxencode_tile.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/rfxencode.Plo -rm -f ./$(DEPDIR)/rfxencode_alpha.Plo -rm -f ./$(DEPDIR)/rfxencode_compose.Plo -rm -f ./$(DEPDIR)/rfxencode_diff_rlgr1.Plo -rm -f ./$(DEPDIR)/rfxencode_diff_rlgr3.Plo -rm -f ./$(DEPDIR)/rfxencode_differential.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt_rem.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt_shift_rem.Plo -rm -f ./$(DEPDIR)/rfxencode_quantization.Plo -rm -f ./$(DEPDIR)/rfxencode_rgb_to_yuv.Plo -rm -f ./$(DEPDIR)/rfxencode_rlgr1.Plo -rm -f ./$(DEPDIR)/rfxencode_rlgr3.Plo -rm -f ./$(DEPDIR)/rfxencode_tile.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/src/rfxencode_differential.h000644 001751 000000 00000001572 14652432052 022553 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Differential Encoding * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_DIFFERENTIAL_H #define __RFXENCODE_DIFFERENTIAL_H #include "rfxcommon.h" int rfx_differential_encode(sint16 *buffer, int buffer_size); #endif /* __RFXENCODE_DIFFERENTIAL_H */ xrdp-0.10.1/librfxcodec/src/x86/000755 001751 000000 00000000000 14652432105 016330 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/src/rfxencode_diff_rlgr1.c000644 001751 000000 00000010437 14652432052 022131 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * Copyright 2016-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This implementation of RLGR refers to * [MS-RDPRFX] 3.1.8.1.7.3 RLGR1/RLGR3 Pseudocode */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode_diff_rlgr1.h" #include "rfxencode_diff_rlgr_common.h" int rfx_encode_diff_rlgr1(sint16 *coef, uint8 *cdata, int cdata_size, int diff_bytes) { int k; int kp; int krp; int input; int numZeros; int runmax; int mag; int sign; int processed_size; int lmag; int coef_size; int y; int bit_count; unsigned int bits; uint8 *cdata_org; uint32 twoMs; /* the last x bytes are diff */ for (k = PIXELS_IN_TILE - 1; k > PIXELS_IN_TILE - diff_bytes; k--) { coef[k] -= coef[k - 1]; } /* initialize the parameters */ k = 1; kp = 1 << LSGR; krp = 1 << LSGR; bit_count = 0; bits = 0; cdata_org = cdata; /* process all the input coefficients */ coef_size = PIXELS_IN_TILE; while (coef_size > 0) { if (k) { /* RUN-LENGTH MODE */ /* collect the run of zeros in the input stream */ numZeros = 0; GetNextInput; while (input == 0) { numZeros++; if (coef_size < 1) { break; } GetNextInput; } /* emit output zeros */ runmax = 1 << k; while (numZeros >= runmax) { bits <<= 1; bit_count++; CheckWrite; numZeros -= runmax; kp = MIN(KPMAX, kp + UP_GR); k = kp >> LSGR; runmax = 1 << k; } /* output a 1 to terminate runs */ bits <<= 1; bits |= 1; bit_count++; /* output the remaining run length using k bits */ bits <<= k; bits |= numZeros; bit_count += k; CheckWrite; if (input == 0) { continue; } /* encode the nonzero value using GR coding */ if (input < 0) { mag = -input; sign = 1; } else { mag = input; sign = 0; } bits <<= 1; bits |= sign; bit_count++; lmag = mag - 1; CodeGR(krp, lmag); /* output GR code for (mag - 1) */ CheckWrite; kp = MAX(0, kp - DN_GR); k = kp >> LSGR; } else { /* GOLOMB-RICE MODE */ /* RLGR1 variant */ /* convert input to (2*magnitude - sign), encode using GR code */ GetNextInput; y = input >> 15; twoMs = (((input ^ y) - y) << 1) + y; CodeGR(krp, twoMs); CheckWrite; /* update k, kp */ if (twoMs) { kp = MAX(0, kp - DQ_GR); k = kp >> LSGR; } else { kp = MIN(KPMAX, kp + UQ_GR); k = kp >> LSGR; } } } if (bit_count > 0) { if (cdata_size < 1) { return -1; } bits <<= 8 - bit_count; *cdata = bits; cdata++; } processed_size = cdata - cdata_org; return processed_size; } xrdp-0.10.1/librfxcodec/src/rfxencode_tile.h000644 001751 000000 00000010204 14652432052 021044 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Encode * * Copyright 2011 Vic Lee * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXTILE_H #define __RFXTILE_H #include "rfxcommon.h" #define RFX_YUV_BTES (64 * 64) int rfx_encode_component_rlgr1(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr3(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_rgb(struct rfxencode *enc, const char *rgb_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *cb_size, int *cr_size); int rfx_encode_argb(struct rfxencode *enc, const char *argb_data, int width, int height, int stride_bytes, const char *y_quants, const char *cb_quants, const char *cr_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size, int *a_size); int rfx_encode_yuv(struct rfxencode *enc, const char *yuv_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size); int rfx_encode_yuva(struct rfxencode *enc, const char *yuv_data, int width, int height, int stride_bytes, const char *y_quants, const char *u_quants, const char *v_quants, STREAM *data_out, int *y_size, int *u_size, int *v_size, int *a_size); int rfx_encode_component_rlgr1_x86_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr3_x86_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr1_x86_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr3_x86_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr1_amd64_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr3_amd64_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr1_amd64_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); int rfx_encode_component_rlgr3_amd64_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); #endif xrdp-0.10.1/librfxcodec/src/rfxencode_rlgr1.c000644 001751 000000 00000014121 14652432052 021133 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This implementation of RLGR refers to * [MS-RDPRFX] 3.1.8.1.7.3 RLGR1/RLGR3 Pseudocode */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfx_bitstream.h" #include "rfxencode_rlgr1.h" /* Constants used within the RLGR1/RLGR3 algorithm */ #define KPMAX (80) /* max value for kp or krp */ #define LSGR (3) /* shift count to convert kp to k */ #define UP_GR (4) /* increase in kp after a zero run in RL mode */ #define DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ #define UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ #define DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ /* Returns the least number of bits required to represent a given value */ #define GetMinBits(_val, _nbits) \ do { \ uint32 _v = _val; \ _nbits = 0; \ while (_v) \ { \ _v >>= 1; \ _nbits++; \ } \ } while (0) /* * Update the passed parameter and clamp it to the range [0, KPMAX] * Return the value of parameter right-shifted by LSGR */ #define UpdateParam(_param, _deltaP, _k) \ do { \ _param += _deltaP; \ if (_param > KPMAX) \ { \ _param = KPMAX; \ } \ if (_param < 0) \ { \ _param = 0; \ } \ _k = (_param >> LSGR); \ } while (0) /* Returns the next coefficient (a signed int) to encode, from the input stream */ #define GetNextInput(_n) \ do { \ if (data_size > 0) \ { \ _n = *data++; \ data_size--; \ } \ else \ { \ _n = 0; \ } \ } while (0) /* Emit bitPattern to the output bitstream */ #define OutputBits(_numBits, _bitPattern) rfx_bitstream_put_bits(bs, _bitPattern, _numBits) /* Emit a bit (0 or 1), count number of times, to the output bitstream */ #define OutputBit(_count, _bit) \ do \ { \ uint16 b = (_bit ? 0xFFFF : 0); \ int c = _count; \ for (; c > 0; c -= 16) \ { \ rfx_bitstream_put_bits(bs, b, (c > 16 ? 16 : c)); \ } \ } while (0) /* Converts the input value to (2 * abs(input) - sign(input)), where sign(input) = (input < 0 ? 1 : 0) and returns it */ #define Get2MagSign(_input) ((_input) >= 0 ? 2 * (_input) : -2 * (_input) - 1) /* Outputs the Golomb/Rice encoding of a non-negative integer */ #define CodeGR(_krp, _val) \ do { \ int lkr = (_krp) >> LSGR; \ int lval = _val; \ /* unary part of GR code */ \ uint32 lvk = lval >> lkr; \ OutputBit(lvk, 1); \ OutputBit(1, 0); \ /* remainder part of GR code, if needed */ \ if (lkr) \ { \ OutputBits(lkr, lval & ((1 << lkr) - 1)); \ } \ /* update krp, only if it is not equal to 1 */ \ if (lvk == 0) \ { \ UpdateParam(_krp, -2, lkr); \ } \ else if (lvk > 1) \ { \ UpdateParam(_krp, lvk, lkr); \ } \ } while (0) int rfx_rlgr1_encode(const sint16 *data, uint8 *buffer, int buffer_size) { int k; int kp; int krp; int input; int numZeros; int runmax; int mag; int sign; int processed_size; int lmag; int data_size; RFX_BITSTREAM bs; uint32 twoMs; rfx_bitstream_attach(bs, buffer, buffer_size); /* initialize the parameters */ k = 1; kp = 1 << LSGR; krp = 1 << LSGR; /* process all the input coefficients */ data_size = 4096; while (data_size > 0) { if (k) { /* RUN-LENGTH MODE */ /* collect the run of zeros in the input stream */ numZeros = 0; GetNextInput(input); while (input == 0) { numZeros++; if (data_size < 1) { break; } GetNextInput(input); } /* emit output zeros */ runmax = 1 << k; while (numZeros >= runmax) { OutputBit(1, 0); /* output a zero bit */ numZeros -= runmax; UpdateParam(kp, UP_GR, k); /* update kp, k */ runmax = 1 << k; } /* output a 1 to terminate runs */ OutputBit(1, 1); /* output the remaining run length using k bits */ OutputBits(k, numZeros); if (input == 0) { continue; } /* encode the nonzero value using GR coding */ mag = (input < 0 ? -input : input); /* absolute value of input coefficient */ sign = (input < 0 ? 1 : 0); /* sign of input coefficient */ OutputBit(1, sign); /* output the sign bit */ lmag = mag - 1; CodeGR(krp, lmag); /* output GR code for (mag - 1) */ UpdateParam(kp, -DN_GR, k); } else { /* GOLOMB-RICE MODE */ /* RLGR1 variant */ /* convert input to (2*magnitude - sign), encode using GR code */ GetNextInput(input); twoMs = Get2MagSign(input); CodeGR(krp, twoMs); /* update k, kp */ /* NOTE: as of Aug 2011, the algorithm is still wrongly documented and the update direction is reversed */ if (twoMs) { UpdateParam(kp, -DQ_GR, k); } else { UpdateParam(kp, UQ_GR, k); } } } processed_size = rfx_bitstream_get_processed_bytes(bs); return processed_size; } xrdp-0.10.1/librfxcodec/src/rfxencode_dwt_shift_rem.h000644 001751 000000 00000001540 14652432052 022750 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2020-2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_DWT_SHIFT_REM_H #define __RFXENCODE_DWT_SHIFT_REM_H int rfx_encode_dwt_shift_rem(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer, const char *quants); #endif xrdp-0.10.1/librfxcodec/src/nasm_lt.sh000755 001751 000000 00000003044 14652432052 017701 0ustar00metawheel000000 000000 #! /bin/sh command="" infile="" o_opt=no pic=no while [ $# -gt 0 ]; do case "$1" in -DPIC|-fPIC|-fpic|-Kpic|-KPIC) if [ "$pic" != "yes" ] ; then command="$command -DPIC" pic=yes fi ;; -f|-fbin|-faout|-faoutb|-fcoff|-felf|-felf64|-fas86| \ -fobj|-fwin32|-fwin64|-frdf|-fieee|-fmacho|-fmacho64) # it's a file format specifier for nasm. command="$command $1" ;; -f*) # maybe a code-generation flag for gcc. ;; -[Ii]*) incdir=`echo "$1" | sed 's/^-[Ii]//'` if [ "x$incdir" = x -a "x$2" != x ] ; then case "$2" in -*) ;; *) incdir="$2"; shift;; esac fi if [ "x$incdir" != x ] ; then # In the case of NASM, the trailing slash is necessary. incdir=`echo "$incdir" | sed 's%/*$%/%'` command="$command -I$incdir" fi ;; -o*) o_opt=yes command="$command $1" ;; *.asm) infile=$1 command="$command $1" ;; *) command="$command $1" ;; esac shift done if [ "$o_opt" != yes ] ; then # By default, NASM creates an output file # in the same directory as the input file. outfile="-o `echo $infile | sed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.o" command="$command $outfile" fi exec $command xrdp-0.10.1/librfxcodec/src/rfxencode_quantization.h000644 001751 000000 00000001701 14652432052 022637 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Quantization * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_QUANTIZATION_H #define __RFX_QUANTIZATION_H #include "rfxcommon.h" int rfx_quantization_encode(sint16 *buffer, const char *quantization_values); int rfx_rem_quantization_encode(sint16 *buffer, const char *quantization_values); #endif /* __RFX_QUANTIZATION_H */ xrdp-0.10.1/librfxcodec/src/amd64/000755 001751 000000 00000000000 14652432104 016615 5ustar00metawheel000000 000000 xrdp-0.10.1/librfxcodec/src/rfxencode.h000644 001751 000000 00000006247 14652432052 020043 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2014-2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_H #define __RFXENCODE_H struct rfxencode; typedef int (*rfx_encode_rgb_to_yuv_proc)(struct rfxencode *enc, const char *rgb_data, int width, int height, int stride_bytes); typedef int (*rfx_encode_argb_to_yuva_proc)(struct rfxencode *enc, const char *argb_data, int width, int height, int stride_bytes); typedef int (*rfx_encode_proc)(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size); typedef int (*rfx_encode_dwt_shift_rem_proc)(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer, const char *quants); typedef int (*rfx_encode_diff_count_proc)(sint16 *diff_buffer, const sint16 *dwt_buffer, const sint16 *hist_buffer, int *diff_zeros, int *dwt_zeros); struct rfx_rb { sint16 y[4096]; sint16 u[4096]; sint16 v[4096]; }; struct rfxencode { int width; int height; int frame_idx; int header_processed; int mode; int properties; int flags; int bits_per_pixel; int format; int pro_ver; int pad0[6]; uint8 a_buffer[4096]; uint8 y_r_buffer[4096]; uint8 u_g_buffer[4096]; uint8 v_b_buffer[4096]; uint8 pad1[16]; sint16 dwt_buffer_a[4096]; sint16 dwt_buffer1_a[4096]; sint16 dwt_buffer2_a[4096]; sint16 dwt_buffer3_a[4096]; sint16 dwt_buffer4_a[4096]; sint16 dwt_buffer5_a[4096]; sint16 dwt_buffer6_a[4096]; uint8 pad2[16]; sint16 *dwt_buffer; sint16 *dwt_buffer1; sint16 *dwt_buffer2; sint16 *dwt_buffer3; sint16 *dwt_buffer4; sint16 *dwt_buffer5; sint16 *dwt_buffer6; rfx_encode_proc rfx_encode; rfx_encode_rgb_to_yuv_proc rfx_encode_rgb_to_yuv; rfx_encode_argb_to_yuva_proc rfx_encode_argb_to_yuva; rfx_encode_proc rfx_rem_encode; rfx_encode_dwt_shift_rem_proc rfx_encode_dwt_shift_rem; rfx_encode_diff_count_proc rfx_encode_diff_count; int max_rb_x; int max_rb_y; struct rfx_rb ** rbs; int got_sse2; int got_sse3; int got_sse41; int got_sse42; int got_sse4a; int got_popcnt; int got_lzcnt; int got_neon; }; void rfxcodec_hexdump(const void *p, int len); #endif xrdp-0.10.1/librfxcodec/src/rfxencode_rgb_to_yuv.h000644 001751 000000 00000002076 14652432052 022276 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Encode * * Copyright 2011 Vic Lee * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXRBGTOYUV_H #define __RFXRBGTOYUV_H #include "rfxcommon.h" int rfx_encode_rgb_to_yuv(struct rfxencode *enc, const char *rgb_data, int width, int height, int stride_bytes); int rfx_encode_argb_to_yuva(struct rfxencode *enc, const char *argb_data, int width, int height, int stride_bytes); #endif xrdp-0.10.1/librfxcodec/src/rfxencode_dwt.h000644 001751 000000 00000001462 14652432052 020713 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_RFX_DWT_H #define __RFXENCODE_RFX_DWT_H int rfx_dwt_2d_encode(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer); #endif xrdp-0.10.1/librfxcodec/src/Makefile.am000644 001751 000000 00000002652 14652432052 017745 0ustar00metawheel000000 000000 EXTRA_DIST = common.asm nasm_lt.sh SUBDIRS = AM_CPPFLAGS = \ -I$(top_srcdir)/include EXTRA_SOURCES= if WITH_SIMD_AMD64 SUBDIRS += amd64 sse2 librfxencode_la_LIBADD = amd64/librfxencode-amd64.la sse2/librfxencode-sse2.la AM_CPPFLAGS += -I$(top_srcdir)/src/sse2 -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1 endif if WITH_SIMD_X86 SUBDIRS += x86 sse2 librfxencode_la_LIBADD = x86/librfxencode-x86.la sse2/librfxencode-sse2.la AM_CPPFLAGS += -I$(top_srcdir)/src/sse2 -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_X86=1 endif noinst_HEADERS = \ rfx_bitstream.h \ rfxcommon.h \ rfxencode_compose.h \ rfxconstants.h \ rfxencode_alpha.h \ rfxencode_differential.h \ rfxencode_dwt.h \ rfxencode.h \ rfxencode_quantization.h \ rfxencode_rlgr1.h \ rfxencode_rlgr3.h \ rfxencode_tile.h \ rfxencode_diff_rlgr1.h \ rfxencode_diff_rlgr3.h \ rfxencode_diff_rlgr_common.h \ rfxencode_rgb_to_yuv.h \ rfxencode_dwt_rem.h \ rfxencode_dwt_shift_rem.h \ rfxencode_dwt_shift_rem_common.h lib_LTLIBRARIES = librfxencode.la librfxencode_la_LDFLAGS = -all-static librfxencode_la_SOURCES = $(noinst_HEADERS) rfxencode.c \ rfxencode_compose.c rfxencode_tile.c rfxencode_dwt.c \ rfxencode_quantization.c rfxencode_differential.c \ rfxencode_rlgr1.c rfxencode_rlgr3.c rfxencode_alpha.c \ rfxencode_diff_rlgr1.c rfxencode_diff_rlgr3.c \ rfxencode_rgb_to_yuv.c \ rfxencode_dwt_rem.c \ rfxencode_dwt_shift_rem.c \ $(EXTRA_SOURCES) xrdp-0.10.1/librfxcodec/src/rfxencode_dwt_rem.c000644 001751 000000 00000034317 14652432052 021556 0ustar00metawheel000000 000000 /** * RemoteFX Codec Library * * Copyright 2020 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * DWT Reduce-Extrapolate Method MS-RDPEGFX 3.2.8.1.2.2 * also does Quantization and Linearization 3.2.8.1.3 */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode_dwt_rem.h" #define ICL1(_offset) (ic[(_offset) * 64] - 128) << DWT_FACTOR #define ICL2(_offset) ic[(_offset) * 33] #define ICL3(_offset) ic[(_offset) * 17] #define LOL1(_offset) lo[(_offset) * 64] #define HIL1(_offset) hi[(_offset) * 64] #define LOL2(_offset) lo[(_offset) * 33] #define HIL2(_offset) hi[(_offset) * 33] #define LOL3(_offset) lo[(_offset) * 17] #define HIL3(_offset) hi[(_offset) * 17] /******************************************************************************/ static void rfx_rem_dwt_encode_vert_lv1(const uint8 *in_buffer, sint16 *out_buffer) { const uint8 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic62; int n; int y; for (y = 0; y < 64; y++) { /* setup */ ic = in_buffer + y; lo = out_buffer + y; hi = lo + 64 * 33; /* pre */ x2n = ICL1(0); x2n1 = ICL1(1); x2n2 = ICL1(2); HIL1(0) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL1(0) = x2n + hn; /* mirror */ /* loop */ for (n = 1; n < 31; n++) { hn1 = hn; x2n = x2n2; x2n1 = ICL1(2 * n + 1); x2n2 = ICL1(2 * n + 2); HIL1(n) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL1(n) = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic62 = x2n = x2n2; x2n1 = ICL1(63); x2n2 = 2 * x2n1 - x2n; /* ic[64] = 2 * ic[63] - ic[62] */ LOL1(31) = x2n + (hn1 >> 1); x2n = x2n2; /* x2n1 already set, mirror 65 -> 63 */ x2n2 = ic62; /* mirror 66 -> 62 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL1(32) = x2n + (hn >> 1); } } /******************************************************************************/ static void rfx_rem_dwt_encode_horz_lv1(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic62; int n; int y; for (y = 0; y < 33; y++) /* lo */ { /* setup */ ic = in_buffer + 64 * y; lo = out_buffer + 31 * 33 + 33 * 31 + 31 * 31 + 33 * y; /* LL1 */ hi = out_buffer + 31 * y; /* HL1 */ /* pre */ x2n = ic[0]; x2n1 = ic[1]; x2n2 = ic[2]; hi[0] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[0] = x2n + hn; /* mirror */ /* loop */ for (n = 1; n < 31; n++) { hn1 = hn; x2n = x2n2; x2n1 = ic[2 * n + 1]; x2n2 = ic[2 * n + 2]; hi[n] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[n] = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic62 = x2n = x2n2; x2n1 = ic[63]; x2n2 = 2 * x2n1 - x2n; /* ic[64] = 2 * ic[63] - ic[62] */ lo[31] = x2n + (hn1 >> 1); x2n = x2n2; /* x2n1 already set, mirror 65 -> 63 */ x2n2 = ic62; /* mirror 66 -> 62 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[32] = x2n + (hn >> 1); } for (y = 0; y < 31; y++) /* hi */ { /* setup */ ic = in_buffer + 64 * (33 + y); lo = out_buffer + 31 * 33 + 33 * y; /* LH1 */ hi = out_buffer + 31 * 33 + 33 * 31 + 31 * y; /* HH1 */ /* pre */ x2n = ic[0]; x2n1 = ic[1]; x2n2 = ic[2]; hi[0] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[0] = x2n + hn; /* loop */ for (n = 1; n < 31; n++) { hn1 = hn; x2n = x2n2; x2n1 = ic[2 * n + 1]; x2n2 = ic[2 * n + 2]; hi[n] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[n] = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic62 = x2n = x2n2; x2n1 = ic[63]; x2n2 = 2 * x2n1 - x2n; /* ic[64] = 2 * ic[63] - ic[62] */ lo[31] = x2n + (hn1 >> 1); x2n = x2n2; /* x2n1 already set, mirror 65 -> 63 */ x2n2 = ic62; /* mirror 66 -> 62 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[32] = x2n + (hn >> 1); } } /******************************************************************************/ static void rfx_rem_dwt_encode_vert_lv2(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic30; int n; int y; for (y = 0; y < 33; y++) { /* setup */ ic = in_buffer + y; lo = out_buffer + y; hi = lo + 33 * 17; /* pre */ x2n = ICL2(0); x2n1 = ICL2(1); x2n2 = ICL2(2); HIL2(0) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL2(0) = x2n + hn; /* mirror */ /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; x2n1 = ICL2(2 * n + 1); x2n2 = ICL2(2 * n + 2); HIL2(n) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL2(n) = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic30 = x2n = x2n2; x2n1 = ICL2(31); x2n2 = ICL2(32); HIL2(15) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL2(15) = x2n + ((hn1 + hn) >> 1); hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL2(16) = x2n + ((hn1 + hn) >> 1); } } /******************************************************************************/ static void rfx_rem_dwt_encode_horz_lv2(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic30; int n; int y; for (y = 0; y < 17; y++) /* lo */ { /* setup */ ic = in_buffer + 33 * y; lo = out_buffer + 16 * 17 + 17 * 16 + 16 * 16 + 17 * y; /* LL2 */ hi = out_buffer + 16 * y; /* HL2 */ /* pre */ x2n = ic[0]; x2n1 = ic[1]; x2n2 = ic[2]; hi[0] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[0] = x2n + hn; /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; x2n1 = ic[2 * n + 1]; x2n2 = ic[2 * n + 2]; hi[n] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[n] = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic30 = x2n = x2n2; x2n1 = ic[31]; x2n2 = ic[32]; hi[15] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[15] = x2n + ((hn1 + hn) >> 1); hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[16] = x2n + ((hn1 + hn) >> 1); } for (y = 0; y < 16; y++) /* hi */ { /* setup */ ic = in_buffer + 33 * (17 + y); lo = out_buffer + 16 * 17 + 17 * y; /* LH2 */ hi = out_buffer + 16 * 17 + 17 * 16 + 16 * y; /* HH2 */ /* pre */ x2n = ic[0]; x2n1 = ic[1]; x2n2 = ic[2]; hi[0] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[0] = x2n + hn; /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; x2n1 = ic[2 * n + 1]; x2n2 = ic[2 * n + 2]; hi[n] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[n] = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic30 = x2n = x2n2; x2n1 = ic[31]; x2n2 = ic[32]; hi[15] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[15] = x2n + ((hn1 + hn) >> 1); hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[16] = x2n + ((hn1 + hn) >> 1); } } /******************************************************************************/ static void rfx_rem_dwt_encode_vert_lv3(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic14; int n; int y; for (y = 0; y < 17; y++) { /* setup */ ic = in_buffer + y; lo = out_buffer + y; hi = lo + 17 * 9; /* pre */ x2n = ICL3(0); x2n1 = ICL3(1); x2n2 = ICL3(2); HIL3(0) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL3(0) = x2n + hn; /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; x2n1 = ICL3(2 * n + 1); x2n2 = ICL3(2 * n + 2); HIL3(n) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL3(n) = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic14 = x2n = x2n2; x2n1 = ICL3(15); x2n2 = ICL3(16); HIL3(7) = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL3(7) = x2n + ((hn1 + hn) >> 1); hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; LOL3(8) = x2n + ((hn1 + hn) >> 1); } } /******************************************************************************/ static void rfx_rem_dwt_encode_horz_lv3(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic14; int n; int y; for (y = 0; y < 9; y++) /* lo */ { /* setup */ ic = in_buffer + 17 * y; lo = out_buffer + 8 * 9 + 9 * 8 + 8 * 8 + 9 * y; /* LL3 */ hi = out_buffer + 8 * y; /* HL3 */ /* pre */ x2n = ic[0]; x2n1 = ic[1]; x2n2 = ic[2]; hi[0] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[0] = x2n + hn; /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; x2n1 = ic[2 * n + 1]; x2n2 = ic[2 * n + 2]; hi[n] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[n] = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic14 = x2n = x2n2; x2n1 = ic[15]; x2n2 = ic[16]; hi[7] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[7] = x2n + ((hn1 + hn) >> 1); hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[8] = x2n + ((hn1 + hn) >> 1); } for (y = 0; y < 8; y++) /* hi */ { /* setup */ ic = in_buffer + 17 * (9 + y); lo = out_buffer + 8 * 9 + 9 * y; /* LH3 */ hi = out_buffer + 8 * 9 + 9 * 8 + 8 * y; /* HH3 */ /* pre */ x2n = ic[0]; x2n1 = ic[1]; x2n2 = ic[2]; hi[0] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[0] = x2n + hn; /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; x2n1 = ic[2 * n + 1]; x2n2 = ic[2 * n + 2]; hi[n] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[n] = x2n + ((hn1 + hn) >> 1); } /* post */ hn1 = hn; ic14 = x2n = x2n2; x2n1 = ic[15]; x2n2 = ic[16]; hi[7] = hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[7] = x2n + ((hn1 + hn) >> 1); hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; lo[8] = x2n + ((hn1 + hn) >> 1); } } /******************************************************************************/ int rfx_rem_dwt_encode(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer) { rfx_rem_dwt_encode_vert_lv1(in_buffer, tmp_buffer); rfx_rem_dwt_encode_horz_lv1(tmp_buffer, out_buffer); rfx_rem_dwt_encode_vert_lv2(out_buffer + 3007, tmp_buffer); rfx_rem_dwt_encode_horz_lv2(tmp_buffer, out_buffer + 3007); rfx_rem_dwt_encode_vert_lv3(out_buffer + 3807, tmp_buffer); rfx_rem_dwt_encode_horz_lv3(tmp_buffer, out_buffer + 3807); return 0; } xrdp-0.10.1/librfxcodec/src/rfxencode_compose.h000644 001751 000000 00000003504 14652432052 021561 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2014-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXCOMPOSE_H #define __RFXCOMPOSE_H #include "rfxcommon.h" int rfx_compose_message_header(struct rfxencode *enc, STREAM *s); int rfx_compose_message_data(struct rfxencode *enc, STREAM *s, const struct rfx_rect *regions, int num_regions, const char *buf, int width, int height, int stride_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags); int rfx_encode_diff_count(sint16 *diff_buffer, const sint16 *dwt_buffer, const sint16 *hist_buffer, int *diff_zeros, int *dwt_zeros); int rfx_pro_compose_message_header(struct rfxencode *enc, STREAM *s); int rfx_pro_compose_message_data(struct rfxencode *enc, STREAM *s, const struct rfx_rect *regions, int num_regions, const char *buf, int width, int height, int stride_bytes, const struct rfx_tile *tiles, int num_tiles, const char *quants, int num_quants, int flags); #endif xrdp-0.10.1/librfxcodec/src/rfxencode_rlgr3.c000644 001751 000000 00000014606 14652432052 021145 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This implementation of RLGR refers to * [MS-RDPRFX] 3.1.8.1.7.3 RLGR1/RLGR3 Pseudocode */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfx_bitstream.h" #include "rfxencode_rlgr3.h" /* Constants used within the RLGR1/RLGR3 algorithm */ #define KPMAX (80) /* max value for kp or krp */ #define LSGR (3) /* shift count to convert kp to k */ #define UP_GR (4) /* increase in kp after a zero run in RL mode */ #define DN_GR (6) /* decrease in kp after a nonzero symbol in RL mode */ #define UQ_GR (3) /* increase in kp after nonzero symbol in GR mode */ #define DQ_GR (3) /* decrease in kp after zero symbol in GR mode */ /* Returns the least number of bits required to represent a given value */ #define GetMinBits(_val, _nbits) \ do { \ uint32 _v = _val; \ _nbits = 0; \ while (_v) \ { \ _v >>= 1; \ _nbits++; \ } \ } while (0) /* * Update the passed parameter and clamp it to the range [0, KPMAX] * Return the value of parameter right-shifted by LSGR */ #define UpdateParam(_param, _deltaP, _k) \ do { \ _param += _deltaP; \ if (_param > KPMAX) \ { \ _param = KPMAX; \ } \ if (_param < 0) \ { \ _param = 0; \ } \ _k = (_param >> LSGR); \ } while (0) /* Returns the next coefficient (a signed int) to encode, from the input stream */ #define GetNextInput(_n) \ do { \ if (data_size > 0) \ { \ _n = *data++; \ data_size--; \ } \ else \ { \ _n = 0; \ } \ } while (0) /* Emit bitPattern to the output bitstream */ #define OutputBits(_numBits, _bitPattern) rfx_bitstream_put_bits(bs, _bitPattern, _numBits) /* Emit a bit (0 or 1), count number of times, to the output bitstream */ #define OutputBit(_count, _bit) \ do \ { \ uint16 b = (_bit ? 0xFFFF : 0); \ int c = _count; \ for (; c > 0; c -= 16) \ { \ rfx_bitstream_put_bits(bs, b, (c > 16 ? 16 : c)); \ } \ } while (0) /* Converts the input value to (2 * abs(input) - sign(input)), where sign(input) = (input < 0 ? 1 : 0) and returns it */ #define Get2MagSign(_input) ((_input) >= 0 ? 2 * (_input) : -2 * (_input) - 1) /* Outputs the Golomb/Rice encoding of a non-negative integer */ #define CodeGR(_krp, _val) \ do { \ int lkr = (_krp) >> LSGR; \ int lval = _val; \ /* unary part of GR code */ \ uint32 lvk = lval >> lkr; \ OutputBit(lvk, 1); \ OutputBit(1, 0); \ /* remainder part of GR code, if needed */ \ if (lkr) \ { \ OutputBits(lkr, lval & ((1 << lkr) - 1)); \ } \ /* update krp, only if it is not equal to 1 */ \ if (lvk == 0) \ { \ UpdateParam(_krp, -2, lkr); \ } \ else if (lvk > 1) \ { \ UpdateParam(_krp, lvk, lkr); \ } \ } while (0) int rfx_rlgr3_encode(const sint16 *data, uint8 *buffer, int buffer_size) { int k; int kp; int krp; int input; int numZeros; int runmax; int mag; int sign; int processed_size; int lmag; int data_size; RFX_BITSTREAM bs; uint32 twoMs1; uint32 twoMs2; uint32 sum2Ms; uint32 nIdx; rfx_bitstream_attach(bs, buffer, buffer_size); /* initialize the parameters */ k = 1; kp = 1 << LSGR; krp = 1 << LSGR; /* process all the input coefficients */ data_size = 4096; while (data_size > 0) { if (k) { /* RUN-LENGTH MODE */ /* collect the run of zeros in the input stream */ numZeros = 0; GetNextInput(input); while (input == 0) { numZeros++; if (data_size < 1) { break; } GetNextInput(input); } /* emit output zeros */ runmax = 1 << k; while (numZeros >= runmax) { OutputBit(1, 0); /* output a zero bit */ numZeros -= runmax; UpdateParam(kp, UP_GR, k); /* update kp, k */ runmax = 1 << k; } /* output a 1 to terminate runs */ OutputBit(1, 1); /* output the remaining run length using k bits */ OutputBits(k, numZeros); if (input == 0) { continue; } /* encode the nonzero value using GR coding */ mag = (input < 0 ? -input : input); /* absolute value of input coefficient */ sign = (input < 0 ? 1 : 0); /* sign of input coefficient */ OutputBit(1, sign); /* output the sign bit */ lmag = mag - 1; CodeGR(krp, lmag); /* output GR code for (mag - 1) */ UpdateParam(kp, -DN_GR, k); } else { /* GOLOMB-RICE MODE */ /* RLGR3 variant */ /* convert the next two input values to (2*magnitude - sign) and */ /* encode their sum using GR code */ GetNextInput(input); twoMs1 = Get2MagSign(input); GetNextInput(input); twoMs2 = Get2MagSign(input); sum2Ms = twoMs1 + twoMs2; CodeGR(krp, sum2Ms); /* encode binary representation of the first input (twoMs1). */ GetMinBits(sum2Ms, nIdx); OutputBits(nIdx, twoMs1); /* update k,kp for the two input values */ if (twoMs1 && twoMs2) { UpdateParam(kp, -2 * DQ_GR, k); } else if (!twoMs1 && !twoMs2) { UpdateParam(kp, 2 * UQ_GR, k); } } } processed_size = rfx_bitstream_get_processed_bytes(bs); return processed_size; } xrdp-0.10.1/librfxcodec/src/rfxencode_diff_rlgr3.c000644 001751 000000 00000012137 14652432052 022132 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - RLGR * * Copyright 2011 Vic Lee * Copyright 2016-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This implementation of RLGR refers to * [MS-RDPRFX] 3.1.8.1.7.3 RLGR1/RLGR3 Pseudocode */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode_diff_rlgr3.h" #include "rfxencode_diff_rlgr_common.h" int rfx_encode_diff_rlgr3(sint16 *coef, uint8 *cdata, int cdata_size, int diff_bytes) { int k; int kp; int krp; int input; int numZeros; int runmax; int mag; int sign; int processed_size; int lmag; int coef_size; int y; int bit_count; unsigned int bits; uint8 *cdata_org; uint32 twoMs1; uint32 twoMs2; uint32 sum2Ms; uint32 nIdx; /* the last x bytes are diff */ for (k = PIXELS_IN_TILE - 1; k > PIXELS_IN_TILE - diff_bytes; k--) { coef[k] -= coef[k - 1]; } /* initialize the parameters */ k = 1; kp = 1 << LSGR; krp = 1 << LSGR; bit_count = 0; bits = 0; cdata_org = cdata; /* process all the input coefficients */ coef_size = PIXELS_IN_TILE; while (coef_size > 0) { if (k) { /* RUN-LENGTH MODE */ /* collect the run of zeros in the input stream */ numZeros = 0; GetNextInput; while (input == 0) { numZeros++; if (coef_size < 1) { break; } GetNextInput; } /* emit output zeros */ runmax = 1 << k; while (numZeros >= runmax) { bits <<= 1; bit_count++; CheckWrite; numZeros -= runmax; kp = MIN(KPMAX, kp + UP_GR); k = kp >> LSGR; runmax = 1 << k; } /* output a 1 to terminate runs */ bits <<= 1; bits |= 1; bit_count++; /* output the remaining run length using k bits */ bits <<= k; bits |= numZeros; bit_count += k; CheckWrite; if (input == 0) { continue; } /* encode the nonzero value using GR coding */ if (input < 0) { mag = -input; sign = 1; } else { mag = input; sign = 0; } bits <<= 1; bits |= sign; bit_count++; lmag = mag - 1; CodeGR(krp, lmag); /* output GR code for (mag - 1) */ CheckWrite; kp = MAX(0, kp - DN_GR); k = kp >> LSGR; } else { /* GOLOMB-RICE MODE */ /* RLGR3 variant */ /* convert the next two input values to (2*magnitude - sign) and */ /* encode their sum using GR code */ GetNextInput; y = input >> 15; twoMs1 = (((input ^ y) - y) << 1) + y; GetNextInput; y = input >> 15; twoMs2 = (((input ^ y) - y) << 1) + y; sum2Ms = twoMs1 + twoMs2; CodeGR(krp, sum2Ms); CheckWrite; /* encode binary representation of the first input (twoMs1). */ if (sum2Ms != 0) { GBSR(sum2Ms, nIdx); nIdx++; } else { nIdx = 0; } bits <<= nIdx; bits |= twoMs1; bit_count += nIdx; CheckWrite; /* update k,kp for the two input values */ if (twoMs1 != 0) { if (twoMs2 != 0) { kp = MAX(0, kp - (2 * DQ_GR)); k = kp >> LSGR; } } else { if (twoMs2 == 0) { kp = MIN(KPMAX, kp + (2 * UQ_GR)); k = kp >> LSGR; } } } } if (bit_count > 0) { if (cdata_size < 1) { return -1; } bits <<= 8 - bit_count; *cdata = bits; cdata++; } processed_size = cdata - cdata_org; return processed_size; } xrdp-0.10.1/librfxcodec/src/rfxconstants.h000644 001751 000000 00000004433 14652432052 020615 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - API Header * * Copyright 2011 Vic Lee * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFX_CONSTANTS_H #define __RFX_CONSTANTS_H enum _RLGR_MODE { RLGR1, RLGR3 }; /* sync */ #define WF_MAGIC 0xCACCACCA #define WF_VERSION_1_0 0x0100 /* blockType */ #define WBT_SYNC 0xCCC0 #define WBT_CODEC_VERSIONS 0xCCC1 #define WBT_CHANNELS 0xCCC2 #define WBT_CONTEXT 0xCCC3 #define WBT_FRAME_BEGIN 0xCCC4 #define WBT_FRAME_END 0xCCC5 #define WBT_REGION 0xCCC6 #define WBT_EXTENSION 0xCCC7 #define WBT_EXTENSION_PLUS 0xDDD7 #define CBT_REGION 0xCAC1 #define CBT_TILESET 0xCAC2 #define CBT_TILE 0xCAC3 /* progressive blockType */ #define PRO_WBT_SYNC 0xCCC0 #define PRO_WBT_FRAME_BEGIN 0xCCC1 #define PRO_WBT_FRAME_END 0xCCC2 #define PRO_WBT_CONTEXT 0xCCC3 #define PRO_WBT_REGION 0xCCC4 #define PRO_WBT_TILE_SIMPLE 0xCCC5 #define PRO_WBT_TILE_PROGRESSIVE_FIRST 0xCCC6 #define PRO_WBT_TILE_PROGRESSIVE_UPGRADE 0xCCC7 #define RFX_SUBBAND_DIFFING 0x01 #define RFX_DWT_REDUCE_EXTRAPOLATE 0x01 #define RFX_TILE_DIFFERENCE 0x01 /* tileSize */ #define CT_TILE_64x64 0x0040 /* properties.flags */ #define CODEC_MODE 0x02 /* properties.cct */ #define COL_CONV_ICT 0x1 /* properties.xft */ #define CLW_XFORM_DWT_53_A 0x1 /* properties.et */ #define CLW_ENTROPY_RLGR1 0x01 #define CLW_ENTROPY_RLGR3 0x04 /* properties.qt */ #define SCALAR_QUANTIZATION 0x1 #endif /* __RFX_CONSTANTS_H */ xrdp-0.10.1/librfxcodec/src/rfxencode_alpha.c000644 001751 000000 00000015504 14652432052 021177 0ustar00metawheel000000 000000 /** * librfxcodec: A Remote Desktop Protocol client. * RemoteFX Codec Library * * Copyright 2015-2017 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxconstants.h" #include "rfxencode_tile.h" #include "rfxencode_alpha.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) #if 1 /*****************************************************************************/ static int fdelta(const char *in_plane, char *out_plane, int cx, int cy) { char delta; const char *src8; char *dst8; int index; int jndex; memcpy(out_plane, in_plane, cx); src8 = in_plane; dst8 = out_plane; for (jndex = 1; jndex < cy; jndex++) { for (index = 0; index < cx; index++) { delta = src8[cx] - src8[0]; if (delta & 0x80) { delta = (((~delta) + 1) << 1) - 1; } else { delta = delta << 1; } dst8[cx] = delta; src8++; dst8++; } } return 0; } #endif #if 0 /*****************************************************************************/ #define DELTA_ONE \ do { \ delta = src8[cx] - src8[0]; \ is_neg = (delta >> 7) & 1; \ dst8[cx] = (((delta ^ -is_neg) + is_neg) << 1) - is_neg; \ src8++; \ dst8++; \ } while (0) /*****************************************************************************/ static int fdelta(char *in_plane, char *out_plane, int cx, int cy) { char delta; char is_neg; char *src8; char *dst8; char *src8_end; memcpy(out_plane, in_plane, cx); src8 = in_plane; dst8 = out_plane; src8_end = src8 + (cx * cy - cx); while (src8 + 8 <= src8_end) { DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; } while (src8 < src8_end) { DELTA_ONE; } return 0; } #endif /*****************************************************************************/ static int fout(int collen, int replen, char *colptr, STREAM *s) { int code; int lcollen; int lreplen; int cont; LLOGLN(10, ("fout: collen %d replen %d", collen, replen)); cont = collen > 13; while (cont) { lcollen = collen; if (lcollen > 15) { lcollen = 15; } code = lcollen << 4; stream_write_uint8(s, code); memcpy(s->p, colptr, lcollen); s->p += lcollen; colptr += lcollen; collen -= lcollen; cont = collen > 13; } cont = (collen > 0) || (replen > 0); while (cont) { lreplen = replen; if ((collen == 0) && (lreplen > 15)) { /* big run */ if (lreplen > 47) { lreplen = 47; } LLOGLN(10, ("fout: big run lreplen %d", lreplen)); replen -= lreplen; code = ((lreplen & 0xF) << 4) | ((lreplen & 0xF0) >> 4); stream_write_uint8(s, code); colptr += lreplen; } else { if (lreplen > 15) { lreplen = 15; } replen -= lreplen; if (lreplen < 3) { collen += lreplen; lreplen = 0; } code = (collen << 4) | lreplen; stream_write_uint8(s, code); memcpy(s->p, colptr, collen); s->p += collen; colptr += collen + lreplen; collen = 0; } cont = replen > 0; } return 0; } /*****************************************************************************/ static int fpack(char *plane, int cx, int cy, STREAM *s) { char *ptr8; char *colptr; char *lend; uint8 *holdp; int jndex; int collen; int replen; LLOGLN(10, ("fpack:")); holdp = s->p; for (jndex = 0; jndex < cy; jndex++) { LLOGLN(10, ("line start line %d cx %d cy %d", jndex, cx, cy)); ptr8 = (char *) (plane + jndex * cx); lend = ptr8 + (cx - 1); colptr = ptr8; if (colptr[0] == 0) { collen = 0; replen = 1; } else { collen = 1; replen = 0; } while (ptr8 < lend) { if (ptr8[0] == ptr8[1]) { replen++; } else { if (replen > 0) { if (replen < 3) { collen += replen + 1; replen = 0; } else { fout(collen, replen, colptr, s); colptr = ptr8 + 1; replen = 0; collen = 1; } } else { collen++; } } ptr8++; } /* end of line */ fout(collen, replen, colptr, s); } return (int) (s->p - holdp); } /*****************************************************************************/ int rfx_encode_plane(struct rfxencode *enc, const uint8 *plane, int cx, int cy, STREAM *s) { const char *org_plane; char *delta_plane; int bytes; uint8 *holdp; org_plane = (const char *) plane; delta_plane = (char *) (enc->dwt_buffer1); fdelta(org_plane, delta_plane, cx, cy); holdp = s->p; stream_write_uint8(s, 0x10); /* flags, RLE */ bytes = fpack(delta_plane, cx, cy, s); if (bytes > cx * cy) { LLOGLN(10, ("rfx_encode_plane: too big bytes %d", bytes)); s->p = holdp; stream_write_uint8(s, 0); /* flags */ memcpy(s->p, plane, cx * cy); s->p += cx * cy; stream_write_uint8(s, 0); /* pad if not RLE */ bytes = cx * cy + 2; } else { LLOGLN(10, ("rfx_encode_plane: ok bytes %d", bytes)); } return bytes; } xrdp-0.10.1/librfxcodec/src/amd64/cpuid_amd64.asm000644 001751 000000 00000001045 14652432052 021420 0ustar00metawheel000000 000000 %include "common.asm" ;The first six integer or pointer arguments are passed in registers ;RDI, RSI, RDX, RCX, R8, and R9 ;int ;cpuid_amd64(int eax_in, int ecx_in, int *eax, int *ebx, int *ecx, int *edx) PROC cpuid_amd64 ; save registers push rbx push rdx push rcx push r8 push r9 mov rax, rdi mov rcx, rsi cpuid pop rdi mov [rdi], edx pop rdi mov [rdi], ecx pop rdi mov [rdi], ebx pop rdi mov [rdi], eax mov rax, 0 ; restore registers pop rbx ret END_OF_FILE xrdp-0.10.1/librfxcodec/src/amd64/Makefile.in000644 001751 000000 00000045167 14652432071 020702 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = src/amd64 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) librfxencode_amd64_la_LIBADD = am__objects_1 = cpuid_amd64.lo rfxcodec_encode_dwt_shift_amd64_sse2.lo \ rfxcodec_encode_dwt_shift_amd64_sse41.lo am_librfxencode_amd64_la_OBJECTS = rfxencode_tile_amd64.lo \ $(am__objects_1) librfxencode_amd64_la_OBJECTS = $(am_librfxencode_amd64_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rfxencode_tile_amd64.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(librfxencode_amd64_la_SOURCES) DIST_SOURCES = $(librfxencode_amd64_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ -DASM_ARCH_AMD64 NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ AMD64_ASM = \ cpuid_amd64.asm \ rfxcodec_encode_dwt_shift_amd64_sse2.asm \ rfxcodec_encode_dwt_shift_amd64_sse41.asm AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src noinst_LTLIBRARIES = librfxencode-amd64.la librfxencode_amd64_la_SOURCES = \ funcs_amd64.h \ rfxencode_tile_amd64.c \ $(AMD64_ASM) nasm_verbose = $(nasm_verbose_@AM_V@) nasm_verbose_ = $(nasm_verbose_@AM_DEFAULT_V@) nasm_verbose_0 = @echo " NASM $@"; all: all-am .SUFFIXES: .SUFFIXES: .asm .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/amd64/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/amd64/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} librfxencode-amd64.la: $(librfxencode_amd64_la_OBJECTS) $(librfxencode_amd64_la_DEPENDENCIES) $(EXTRA_librfxencode_amd64_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(librfxencode_amd64_la_OBJECTS) $(librfxencode_amd64_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_tile_amd64.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/rfxencode_tile_amd64.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/rfxencode_tile_amd64.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile .asm.lo: $(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --mode=compile \ $(top_srcdir)/src/nasm_lt.sh $(NASM) $(NAFLAGS) \ -I$(top_srcdir)/src $< -o $@ # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/src/amd64/rfxencode_tile_amd64.c000644 001751 000000 00000007372 14652432052 022761 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Encode * * Copyright 2011 Vic Lee * Copyright 2014-2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxencode_differential.h" #include "rfxencode_rlgr1.h" #include "rfxencode_rlgr3.h" #include "rfxencode_alpha.h" #include "rfxencode_diff_rlgr1.h" #include "rfxencode_diff_rlgr3.h" #include "rfxencode_tile.h" #include "amd64/funcs_amd64.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) /******************************************************************************/ int rfx_encode_component_rlgr1_amd64_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr1_amd64_sse2:")); if (rfxcodec_encode_dwt_shift_amd64_sse2(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr1(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr3_amd64_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr3_amd64_sse2:")); if (rfxcodec_encode_dwt_shift_amd64_sse2(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr3(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr1_amd64_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr1_amd64_sse41:")); if (rfxcodec_encode_dwt_shift_amd64_sse41(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr1(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr3_amd64_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr3_amd64_sse41:")); if (rfxcodec_encode_dwt_shift_amd64_sse41(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr3(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } xrdp-0.10.1/librfxcodec/src/amd64/Makefile.am000644 001751 000000 00000001172 14652432052 020654 0ustar00metawheel000000 000000 NAFLAGS += -DASM_ARCH_AMD64 AMD64_ASM = \ cpuid_amd64.asm \ rfxcodec_encode_dwt_shift_amd64_sse2.asm \ rfxcodec_encode_dwt_shift_amd64_sse41.asm AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src noinst_LTLIBRARIES = librfxencode-amd64.la librfxencode_amd64_la_SOURCES = \ funcs_amd64.h \ rfxencode_tile_amd64.c \ $(AMD64_ASM) nasm_verbose = $(nasm_verbose_@AM_V@) nasm_verbose_ = $(nasm_verbose_@AM_DEFAULT_V@) nasm_verbose_0 = @echo " NASM $@"; .asm.lo: $(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --mode=compile \ $(top_srcdir)/src/nasm_lt.sh $(NASM) $(NAFLAGS) \ -I$(top_srcdir)/src $< -o $@ xrdp-0.10.1/librfxcodec/src/amd64/rfxcodec_encode_dwt_shift_amd64_sse41.asm000644 001751 000000 00000106072 14652432052 026526 0ustar00metawheel000000 000000 ; ;Copyright 2016 Jay Sorg ; ;Permission to use, copy, modify, distribute, and sell this software and its ;documentation for any purpose is hereby granted without fee, provided that ;the above copyright notice appear in all copies and that both that ;copyright notice and this permission notice appear in supporting ;documentation. ; ;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 ;OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ;AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ;CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; ;amd64 asm dwt %include "common.asm" PREPARE_RODATA cw128 times 8 dw 128 cdFFFF times 4 dd 65535 ; these are 1 << (factor - 1) 0 to 15 is factor cwa0 times 8 dw 0 ; 0 cwa1 times 8 dw 1 ; 1 cwa2 times 8 dw 2 ; 2 cwa4 times 8 dw 4 ; 3 cwa8 times 8 dw 8 ; 4 cwa16 times 8 dw 16 ; 5 cwa32 times 8 dw 32 ; 6 cwa64 times 8 dw 64 ; 7 cwa128 times 8 dw 128 ; 8 cwa256 times 8 dw 256 ; 9 cwa512 times 8 dw 512 ; 10 cwa1024 times 8 dw 1024 ; 11 cwa2048 times 8 dw 2048 ; 12 cwa4096 times 8 dw 4096 ; 13 cwa8192 times 8 dw 8192 ; 14 cwa16384 times 8 dw 16384 ; 15 ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_horiz_16_16: mov ecx, 8 loop1a: ; pre / post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 16 * 2] lea rdi, [rdi - 8 * 2] lea rdx, [rdx - 8 * 2] ; move down lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] dec ecx jnz loop1a ret ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_verti_16_16: mov ecx, 2 loop1b: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 16 * 2 * 2] ; 2 rows lea rdi, [rdi + 16 * 2] ; 1 row lea rdx, [rdx + 16 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 6 loop2b: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 16 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 16 * 2 * 2] ; 2 rows lea rdi, [rdi + 16 * 2] ; 1 row lea rdx, [rdx + 16 * 2] ; 1 row dec cx jnz loop2b shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 16 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move down lea rsi, [rsi + 16 * 2 * 2] ; 2 row lea rdi, [rdi + 16 * 2] ; 1 row lea rdx, [rdx + 16 * 2] ; 1 row ; move up lea rsi, [rsi - 16 * 16 * 2] lea rdi, [rdi - 8 * 16 * 2] lea rdx, [rdx - 8 * 16 * 2] ; move right lea rsi, [rsi + 16] lea rdi, [rdi + 16] lea rdx, [rdx + 16] dec ecx jnz loop1b ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32: mov ecx, 16 loop1c: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 32 * 2] lea rdi, [rdi - 16 * 2] lea rdx, [rdx - 16 * 2] ; move down lea rsi, [rsi + 32 * 2] lea rdi, [rdi + 16 * 2] lea rdx, [rdx + 16 * 2] dec ecx jnz loop1c ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32_no_lo: mov ecx, 16 loop1c1: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 32 * 2] lea rdi, [rdi - 16 * 2] lea rdx, [rdx - 16 * 2] ; move down lea rsi, [rsi + 32 * 2] lea rdi, [rdi + 16 * 2] lea rdx, [rdx + 16 * 2] dec ecx jnz loop1c1 ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_verti_16_32: mov ecx, 4 loop1d: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 32 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 32 * 2 * 2] ; 2 rows lea rdi, [rdi + 32 * 2] ; 1 row lea rdx, [rdx + 32 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 14 loop2d: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 32 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 32 * 2 * 2] ; 2 rows lea rdi, [rdi + 32 * 2] ; 1 row lea rdx, [rdx + 32 * 2] ; 1 row dec cx jnz loop2d shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 32 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move down lea rsi, [rsi + 32 * 2 * 2] ; 2 row lea rdi, [rdi + 32 * 2] ; 1 row lea rdx, [rdx + 32 * 2] ; 1 row ; move up lea rsi, [rsi - 32 * 32 * 2] lea rdi, [rdi - 16 * 32 * 2] lea rdx, [rdx - 16 * 32 * 2] ; move right lea rsi, [rsi + 16] lea rdi, [rdi + 16] lea rdx, [rdx + 16] dec ecx jnz loop1d ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64: mov ecx, 32 loop1e: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e: movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] dec cx jnz loop2e shr ecx, 16 ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 64 * 2] lea rdi, [rdi - 32 * 2] lea rdx, [rdx - 32 * 2] ; move down lea rsi, [rsi + 64 * 2] lea rdi, [rdi + 32 * 2] lea rdx, [rdx + 32 * 2] dec ecx jnz loop1e ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64_no_lo: mov ecx, 32 loop1e1: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e1: movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] dec cx jnz loop2e1 shr ecx, 16 ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 64 * 2] lea rdi, [rdi - 32 * 2] lea rdx, [rdx - 32 * 2] ; move down lea rsi, [rsi + 64 * 2] lea rdi, [rdi + 32 * 2] lea rdx, [rdx + 32 * 2] dec ecx jnz loop1e1 ret ;****************************************************************************** ; source 8 bit unsigned, 64 pixel width rfx_dwt_2d_encode_block_verti_8_64: mov ecx, 8 loop1f: ; pre movq xmm1, [rsi] ; src[2n] movq xmm2, [rsi + 64 * 1] ; src[2n + 1] movq xmm3, [rsi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm1, xmm0 punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm1, [lsym(cw128)] psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm1, 5 psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 64 * 1 * 2] ; 2 rows lea rdi, [rdi + 64 * 2] ; 1 row lea rdx, [rdx + 64 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 30 loop2f: movdqa xmm1, xmm3 ; src[2n] movq xmm2, [rsi + 64 * 1] ; src[2n + 1] movq xmm3, [rsi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 64 * 1 * 2] ; 2 rows lea rdi, [rdi + 64 * 2] ; 1 row lea rdx, [rdx + 64 * 2] ; 1 row dec cx jnz loop2f shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movq xmm2, [rsi + 64 * 1] ; src[2n + 1] punpcklbw xmm2, xmm0 psubw xmm2, [lsym(cw128)] psllw xmm2, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move down lea rsi, [rsi + 64 * 1 * 2] ; 2 rows lea rdi, [rdi + 64 * 2] ; 1 row lea rdx, [rdx + 64 * 2] ; 1 row ; move up lea rsi, [rsi - 64 * 1 * 64] lea rdi, [rdi - 32 * 64 * 2] lea rdx, [rdx - 32 * 64 * 2] ; move right lea rsi, [rsi + 8] lea rdi, [rdi + 16] lea rdx, [rdx + 16] dec ecx jnz loop1f ret set_quants_hi: sub rax, 6 - 5 movd xmm9, eax imul rax, 16 lea rdx, [lsym(cwa0)] add rdx, rax movdqa xmm8, [rdx] ret set_quants_lo: sub rax, 6 - 5 movd xmm11, eax imul rax, 16 lea rdx, [lsym(cwa0)] add rdx, rax movdqa xmm10, [rdx] ret ; Per System V AMD64 ABI, the first six integer or pointer arguments are ; passed in registers RDI, RSI, RDX, RCX, R8, and R9 ;int ;rfxcodec_encode_dwt_shift_amd64_sse41(const char *qtable, ; unsigned char *in_buffer, ; short *out_buffer, ; short *work_buffer); ;****************************************************************************** PROC rfxcodec_encode_dwt_shift_amd64_sse41 ; prologue. this will make the function appear to the debugger as ; having a stack frame, so that a backtrace can be obtained %ifdef DEBUG push rbp mov rbp, rsp %endif ; save registers push rbx push rdx ; rsp+24: out_buffer push rcx ; rsp+16: work_buffer push rsi ; rsp+ 8: in_buffer push rdi ; rsp+ 0: qtable pxor xmm0, xmm0 ; verical DWT to work buffer, level 1 mov rsi, [rsp + 8] ; src mov rdi, [rsp + 16] ; dst hi lea rdi, [rdi + 64 * 32 * 2] ; dst hi mov rdx, [rsp + 16] ; dst lo call rfx_dwt_2d_encode_block_verti_8_64 ; horizontal DWT to out buffer, level 1, part 1 xor rax, rax mov rdx, [rsp] mov al, [rdx + 4] and al, 0xF call set_quants_hi mov rsi, [rsp + 16] ; src mov rdi, [rsp + 24] ; dst hi - HL1 mov rdx, [rsp + 24] ; dst lo - LL1 lea rdx, [rdx + 32 * 32 * 6] ; dst lo - LL1 call rfx_dwt_2d_encode_block_horiz_16_64_no_lo ; horizontal DWT to out buffer, level 1, part 2 xor rax, rax mov rdx, [rsp] mov al, [rdx + 4] shr al, 4 call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 3] shr al, 4 call set_quants_lo mov rsi, [rsp + 16] ; src lea rsi, [rsi + 64 * 32 * 2] ; src mov rdi, [rsp + 24] ; dst hi - HH1 lea rdi, [rdi + 32 * 32 * 4] ; dst hi - HH1 mov rdx, [rsp + 24] ; dst lo - LH1 lea rdx, [rdx + 32 * 32 * 2] ; dst lo - LH1 call rfx_dwt_2d_encode_block_horiz_16_64 ; verical DWT to work buffer, level 2 mov rsi, [rsp + 24] ; src lea rsi, [rsi + 32 * 32 * 6] ; src mov rdi, [rsp + 16] ; dst hi lea rdi, [rdi + 32 * 16 * 2] ; dst hi mov rdx, [rsp + 16] ; dst lo call rfx_dwt_2d_encode_block_verti_16_32 ; horizontal DWT to out buffer, level 2, part 1 xor rax, rax mov rdx, [rsp] mov al, [rdx + 2] shr al, 4 call set_quants_hi mov rsi, [rsp + 16] ; src ; 32 * 32 * 6 + 16 * 16 * 0 = 6144 mov rdi, [rsp + 24] ; dst hi - HL2 lea rdi, [rdi + 6144] ; dst hi - HL2 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov rdx, [rsp + 24] ; dst lo - LL2 lea rdx, [rdx + 7680] ; dst lo - LL2 call rfx_dwt_2d_encode_block_horiz_16_32_no_lo ; horizontal DWT to out buffer, level 2, part 2 xor rax, rax mov rdx, [rsp] mov al, [rdx + 3] and al, 0xF call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 2] and al, 0xF call set_quants_lo mov rsi, [rsp + 16] ; src lea rsi, [rsi + 32 * 16 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 4 = 7168 mov rdi, [rsp + 24] ; dst hi - HH2 lea rdi, [rdi + 7168] ; dst hi - HH2 ; 32 * 32 * 6 + 16 * 16 * 2 = 6656 mov rdx, [rsp + 24] ; dst lo - LH2 lea rdx, [rdx + 6656] ; dst lo - LH2 call rfx_dwt_2d_encode_block_horiz_16_32 ; verical DWT to work buffer, level 3 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov rsi, [rsp + 24] ; src lea rsi, [rsi + 7680] ; src mov rdi, [rsp + 16] ; dst hi lea rdi, [rdi + 16 * 8 * 2] ; dst hi mov rdx, [rsp + 16] ; dst lo call rfx_dwt_2d_encode_block_verti_16_16 ; horizontal DWT to out buffer, level 3, part 1 xor rax, rax mov rdx, [rsp] mov al, [rdx + 1] and al, 0xF call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 0] and al, 0xF call set_quants_lo mov rsi, [rsp + 16] ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 0 = 7680 mov rdi, [rsp + 24] ; dst hi - HL3 lea rdi, [rdi + 7680] ; dst hi - HL3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 6 = 8064 mov rdx, [rsp + 24] ; dst lo - LL3 lea rdx, [rdx + 8064] ; dst lo - LL3 call rfx_dwt_2d_encode_block_horiz_16_16 ; horizontal DWT to out buffer, level 3, part 2 xor rax, rax mov rdx, [rsp] mov al, [rdx + 1] shr al, 4 call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 0] shr al, 4 call set_quants_lo mov rsi, [rsp + 16] ; src lea rsi, [rsi + 16 * 8 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 4 = 7936 mov rdi, [rsp + 24] ; dst hi - HH3 lea rdi, [rdi + 7936] ; dst hi - HH3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 2 = 7808 mov rdx, [rsp + 24] ; dst lo - LH3 lea rdx, [rdx + 7808] ; dst lo - LH3 call rfx_dwt_2d_encode_block_horiz_16_16 mov rax, 0 ; restore registers pop rdi pop rsi pop rcx pop rdx pop rbx ; epilogue %ifdef DEBUG mov rsp, rbp pop rbp %endif ret END_OF_FILE xrdp-0.10.1/librfxcodec/src/amd64/rfxcodec_encode_dwt_shift_amd64_sse2.asm000644 001751 000000 00000113001 14652432052 026431 0ustar00metawheel000000 000000 ; ;Copyright 2016 Jay Sorg ; ;Permission to use, copy, modify, distribute, and sell this software and its ;documentation for any purpose is hereby granted without fee, provided that ;the above copyright notice appear in all copies and that both that ;copyright notice and this permission notice appear in supporting ;documentation. ; ;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 ;OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ;AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ;CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; ;amd64 asm dwt %include "common.asm" PREPARE_RODATA cw128 times 8 dw 128 cdFFFF times 4 dd 65535 ; these are 1 << (factor - 1) 0 to 15 is factor cwa0 times 8 dw 0 ; 0 cwa1 times 8 dw 1 ; 1 cwa2 times 8 dw 2 ; 2 cwa4 times 8 dw 4 ; 3 cwa8 times 8 dw 8 ; 4 cwa16 times 8 dw 16 ; 5 cwa32 times 8 dw 32 ; 6 cwa64 times 8 dw 64 ; 7 cwa128 times 8 dw 128 ; 8 cwa256 times 8 dw 256 ; 9 cwa512 times 8 dw 512 ; 10 cwa1024 times 8 dw 1024 ; 11 cwa2048 times 8 dw 2048 ; 12 cwa4096 times 8 dw 4096 ; 13 cwa8192 times 8 dw 8192 ; 14 cwa16384 times 8 dw 16384 ; 15 ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_horiz_16_16: mov ecx, 8 loop1a: ; pre / post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 16 * 2] lea rdi, [rdi - 8 * 2] lea rdx, [rdx - 8 * 2] ; move down lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] dec ecx jnz loop1a ret ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_verti_16_16: mov ecx, 2 loop1b: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 16 * 2 * 2] ; 2 rows lea rdi, [rdi + 16 * 2] ; 1 row lea rdx, [rdx + 16 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 6 loop2b: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 16 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 16 * 2 * 2] ; 2 rows lea rdi, [rdi + 16 * 2] ; 1 row lea rdx, [rdx + 16 * 2] ; 1 row dec cx jnz loop2b shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 16 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move down lea rsi, [rsi + 16 * 2 * 2] ; 2 row lea rdi, [rdi + 16 * 2] ; 1 row lea rdx, [rdx + 16 * 2] ; 1 row ; move up lea rsi, [rsi - 16 * 16 * 2] lea rdi, [rdi - 8 * 16 * 2] lea rdx, [rdx - 8 * 16 * 2] ; move right lea rsi, [rsi + 16] lea rdi, [rdi + 16] lea rdx, [rdx + 16] dec ecx jnz loop1b ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32: mov ecx, 16 loop1c: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 32 * 2] lea rdi, [rdi - 16 * 2] lea rdx, [rdx - 16 * 2] ; move down lea rsi, [rsi + 32 * 2] lea rdi, [rdi + 16 * 2] lea rdx, [rdx + 16 * 2] dec ecx jnz loop1c ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32_no_lo: mov ecx, 16 loop1c1: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 32 * 2] lea rdi, [rdi - 16 * 2] lea rdx, [rdx - 16 * 2] ; move down lea rsi, [rsi + 32 * 2] lea rdi, [rdi + 16 * 2] lea rdx, [rdx + 16 * 2] dec ecx jnz loop1c1 ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_verti_16_32: mov ecx, 4 loop1d: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 32 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 32 * 2 * 2] ; 2 rows lea rdi, [rdi + 32 * 2] ; 1 row lea rdx, [rdx + 32 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 14 loop2d: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 32 * 2] ; src[2n + 1] movdqa xmm3, [rsi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 32 * 2 * 2] ; 2 rows lea rdi, [rdi + 32 * 2] ; 1 row lea rdx, [rdx + 32 * 2] ; 1 row dec cx jnz loop2d shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [rsi + 32 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move down lea rsi, [rsi + 32 * 2 * 2] ; 2 row lea rdi, [rdi + 32 * 2] ; 1 row lea rdx, [rdx + 32 * 2] ; 1 row ; move up lea rsi, [rsi - 32 * 32 * 2] lea rdi, [rdi - 16 * 32 * 2] lea rdx, [rdx - 16 * 32 * 2] ; move right lea rsi, [rsi + 16] lea rdi, [rdi + 16] lea rdx, [rdx + 16] dec ecx jnz loop1d ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64: mov ecx, 32 loop1e: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e: movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] dec cx jnz loop2e shr ecx, 16 ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, xmm10 psraw xmm6, xmm11 movdqa [rdx], xmm6 ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 64 * 2] lea rdi, [rdi - 32 * 2] lea rdx, [rdx - 32 * 2] ; move down lea rsi, [rsi + 64 * 2] lea rdi, [rdi + 32 * 2] lea rdx, [rdx + 32 * 2] dec ecx jnz loop1e ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64_no_lo: mov ecx, 32 loop1e1: ; pre movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e1: movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [rsi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebx, xmm2 ; save hi movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] dec cx jnz loop2e1 shr ecx, 16 ; post movdqa xmm1, [rsi] ; src[2n] movdqa xmm2, [rsi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, xmm8 psraw xmm6, xmm9 movdqa [rdi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebx por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move right lea rsi, [rsi + 16 * 2] lea rdi, [rdi + 8 * 2] lea rdx, [rdx + 8 * 2] ; move left lea rsi, [rsi - 64 * 2] lea rdi, [rdi - 32 * 2] lea rdx, [rdx - 32 * 2] ; move down lea rsi, [rsi + 64 * 2] lea rdi, [rdi + 32 * 2] lea rdx, [rdx + 32 * 2] dec ecx jnz loop1e1 ret ;****************************************************************************** ; source 8 bit unsigned, 64 pixel width rfx_dwt_2d_encode_block_verti_8_64: mov ecx, 8 loop1f: ; pre movq xmm1, [rsi] ; src[2n] movq xmm2, [rsi + 64 * 1] ; src[2n + 1] movq xmm3, [rsi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm1, xmm0 punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm1, [lsym(cw128)] psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm1, 5 psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 64 * 1 * 2] ; 2 rows lea rdi, [rdi + 64 * 2] ; 1 row lea rdx, [rdx + 64 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 30 loop2f: movdqa xmm1, xmm3 ; src[2n] movq xmm2, [rsi + 64 * 1] ; src[2n + 1] movq xmm3, [rsi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea rsi, [rsi + 64 * 1 * 2] ; 2 rows lea rdi, [rdi + 64 * 2] ; 1 row lea rdx, [rdx + 64 * 2] ; 1 row dec cx jnz loop2f shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movq xmm2, [rsi + 64 * 1] ; src[2n + 1] punpcklbw xmm2, xmm0 psubw xmm2, [lsym(cw128)] psllw xmm2, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [rdi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [rdx], xmm5 ; out lo ; move down lea rsi, [rsi + 64 * 1 * 2] ; 2 rows lea rdi, [rdi + 64 * 2] ; 1 row lea rdx, [rdx + 64 * 2] ; 1 row ; move up lea rsi, [rsi - 64 * 1 * 64] lea rdi, [rdi - 32 * 64 * 2] lea rdx, [rdx - 32 * 64 * 2] ; move right lea rsi, [rsi + 8] lea rdi, [rdi + 16] lea rdx, [rdx + 16] dec ecx jnz loop1f ret set_quants_hi: sub rax, 6 - 5 movd xmm9, eax imul rax, 16 lea rdx, [lsym(cwa0)] add rdx, rax movdqa xmm8, [rdx] ret set_quants_lo: sub rax, 6 - 5 movd xmm11, eax imul rax, 16 lea rdx, [lsym(cwa0)] add rdx, rax movdqa xmm10, [rdx] ret ; Per System V AMD64 ABI, the first six integer or pointer arguments are ; passed in registers RDI, RSI, RDX, RCX, R8, and R9 ;int ;rfxcodec_encode_dwt_shift_amd64_sse2(const char *qtable, ; unsigned char *in_buffer, ; short *out_buffer, ; short *work_buffer); ;****************************************************************************** PROC rfxcodec_encode_dwt_shift_amd64_sse2 ; prologue. this will make the function appear to the debugger as ; having a stack frame, so that a backtrace can be obtained %ifdef DEBUG push rbp mov rbp, rsp %endif ; save registers push rbx push rdx ; rsp+24: out_buffer push rcx ; rsp+16: work_buffer push rsi ; rsp+ 8: in_buffer push rdi ; rsp+ 0: qtable pxor xmm0, xmm0 ; verical DWT to work buffer, level 1 mov rsi, [rsp + 8] ; src mov rdi, [rsp + 16] ; dst hi lea rdi, [rdi + 64 * 32 * 2] ; dst hi mov rdx, [rsp + 16] ; dst lo call rfx_dwt_2d_encode_block_verti_8_64 ; horizontal DWT to out buffer, level 1, part 1 xor rax, rax mov rdx, [rsp] mov al, [rdx + 4] and al, 0xF call set_quants_hi mov rsi, [rsp + 16] ; src mov rdi, [rsp + 24] ; dst hi - HL1 mov rdx, [rsp + 24] ; dst lo - LL1 lea rdx, [rdx + 32 * 32 * 6] ; dst lo - LL1 call rfx_dwt_2d_encode_block_horiz_16_64_no_lo ; horizontal DWT to out buffer, level 1, part 2 xor rax, rax mov rdx, [rsp] mov al, [rdx + 4] shr al, 4 call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 3] shr al, 4 call set_quants_lo mov rsi, [rsp + 16] ; src lea rsi, [rsi + 64 * 32 * 2] ; src mov rdi, [rsp + 24] ; dst hi - HH1 lea rdi, [rdi + 32 * 32 * 4] ; dst hi - HH1 mov rdx, [rsp + 24] ; dst lo - LH1 lea rdx, [rdx + 32 * 32 * 2] ; dst lo - LH1 call rfx_dwt_2d_encode_block_horiz_16_64 ; verical DWT to work buffer, level 2 mov rsi, [rsp + 24] ; src lea rsi, [rsi + 32 * 32 * 6] ; src mov rdi, [rsp + 16] ; dst hi lea rdi, [rdi + 32 * 16 * 2] ; dst hi mov rdx, [rsp + 16] ; dst lo call rfx_dwt_2d_encode_block_verti_16_32 ; horizontal DWT to out buffer, level 2, part 1 xor rax, rax mov rdx, [rsp] mov al, [rdx + 2] shr al, 4 call set_quants_hi mov rsi, [rsp + 16] ; src ; 32 * 32 * 6 + 16 * 16 * 0 = 6144 mov rdi, [rsp + 24] ; dst hi - HL2 lea rdi, [rdi + 6144] ; dst hi - HL2 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov rdx, [rsp + 24] ; dst lo - LL2 lea rdx, [rdx + 7680] ; dst lo - LL2 call rfx_dwt_2d_encode_block_horiz_16_32_no_lo ; horizontal DWT to out buffer, level 2, part 2 xor rax, rax mov rdx, [rsp] mov al, [rdx + 3] and al, 0xF call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 2] and al, 0xF call set_quants_lo mov rsi, [rsp + 16] ; src lea rsi, [rsi + 32 * 16 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 4 = 7168 mov rdi, [rsp + 24] ; dst hi - HH2 lea rdi, [rdi + 7168] ; dst hi - HH2 ; 32 * 32 * 6 + 16 * 16 * 2 = 6656 mov rdx, [rsp + 24] ; dst lo - LH2 lea rdx, [rdx + 6656] ; dst lo - LH2 call rfx_dwt_2d_encode_block_horiz_16_32 ; verical DWT to work buffer, level 3 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov rsi, [rsp + 24] ; src lea rsi, [rsi + 7680] ; src mov rdi, [rsp + 16] ; dst hi lea rdi, [rdi + 16 * 8 * 2] ; dst hi mov rdx, [rsp + 16] ; dst lo call rfx_dwt_2d_encode_block_verti_16_16 ; horizontal DWT to out buffer, level 3, part 1 xor rax, rax mov rdx, [rsp] mov al, [rdx + 1] and al, 0xF call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 0] and al, 0xF call set_quants_lo mov rsi, [rsp + 16] ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 0 = 7680 mov rdi, [rsp + 24] ; dst hi - HL3 lea rdi, [rdi + 7680] ; dst hi - HL3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 6 = 8064 mov rdx, [rsp + 24] ; dst lo - LL3 lea rdx, [rdx + 8064] ; dst lo - LL3 call rfx_dwt_2d_encode_block_horiz_16_16 ; horizontal DWT to out buffer, level 3, part 2 xor rax, rax mov rdx, [rsp] mov al, [rdx + 1] shr al, 4 call set_quants_hi xor rax, rax mov rdx, [rsp] mov al, [rdx + 0] shr al, 4 call set_quants_lo mov rsi, [rsp + 16] ; src lea rsi, [rsi + 16 * 8 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 4 = 7936 mov rdi, [rsp + 24] ; dst hi - HH3 lea rdi, [rdi + 7936] ; dst hi - HH3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 2 = 7808 mov rdx, [rsp + 24] ; dst lo - LH3 lea rdx, [rdx + 7808] ; dst lo - LH3 call rfx_dwt_2d_encode_block_horiz_16_16 mov rax, 0 ; restore registers pop rdi pop rsi pop rcx pop rdx pop rbx ; epilogue %ifdef DEBUG mov rsp, rbp pop rbp %endif ret END_OF_FILE xrdp-0.10.1/librfxcodec/src/amd64/funcs_amd64.h000644 001751 000000 00000003120 14652432052 021075 0ustar00metawheel000000 000000 /* Copyright 2014-2015 Jay Sorg Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. amd64 asm files */ #ifndef __FUNCS_AMD64_H #define __FUNCS_AMD64_H #ifdef __cplusplus extern "C" { #endif int cpuid_amd64(int eax_in, int ecx_in, int *eax, int *ebx, int *ecx, int *edx); int rfxcodec_encode_dwt_shift_amd64_sse2(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); int rfxcodec_encode_dwt_shift_amd64_sse41(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); #ifdef __cplusplus } #endif #endif xrdp-0.10.1/librfxcodec/src/x86/Makefile.in000644 001751 000000 00000045066 14652432071 020412 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = src/x86 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) librfxencode_x86_la_LIBADD = am__objects_1 = cpuid_x86.lo rfxcodec_encode_dwt_shift_x86_sse2.lo \ rfxcodec_encode_dwt_shift_x86_sse41.lo am_librfxencode_x86_la_OBJECTS = rfxencode_tile_x86.lo \ $(am__objects_1) librfxencode_x86_la_OBJECTS = $(am_librfxencode_x86_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rfxencode_tile_x86.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(librfxencode_x86_la_SOURCES) DIST_SOURCES = $(librfxencode_x86_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ -DASM_ARCH_I386 NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ X86_ASM = \ cpuid_x86.asm \ rfxcodec_encode_dwt_shift_x86_sse2.asm \ rfxcodec_encode_dwt_shift_x86_sse41.asm AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src noinst_LTLIBRARIES = librfxencode-x86.la librfxencode_x86_la_SOURCES = \ funcs_x86.h \ rfxencode_tile_x86.c \ $(X86_ASM) nasm_verbose = $(nasm_verbose_@AM_V@) nasm_verbose_ = $(nasm_verbose_@AM_DEFAULT_V@) nasm_verbose_0 = @echo " NASM $@"; all: all-am .SUFFIXES: .SUFFIXES: .asm .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/x86/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/x86/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} librfxencode-x86.la: $(librfxencode_x86_la_OBJECTS) $(librfxencode_x86_la_DEPENDENCIES) $(EXTRA_librfxencode_x86_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(librfxencode_x86_la_OBJECTS) $(librfxencode_x86_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_tile_x86.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/rfxencode_tile_x86.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/rfxencode_tile_x86.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile .asm.lo: $(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --mode=compile \ $(top_srcdir)/src/nasm_lt.sh $(NASM) $(NAFLAGS) \ -I$(top_srcdir)/src $< -o $@ # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/src/x86/rfxcodec_encode_dwt_shift_x86_sse41.asm000644 001751 000000 00000107073 14652432052 025754 0ustar00metawheel000000 000000 ; ;Copyright 2016 Jay Sorg ;Copyright 2017 mirabilos ; ;Permission to use, copy, modify, distribute, and sell this software and its ;documentation for any purpose is hereby granted without fee, provided that ;the above copyright notice appear in all copies and that both that ;copyright notice and this permission notice appear in supporting ;documentation. ; ;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 ;OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ;AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ;CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; ;x86 asm dwt %include "common.asm" PREPARE_RODATA cw128 times 8 dw 128 cdFFFF times 4 dd 65535 ; these are 1 << (factor - 1) 0 to 15 is factor cwa0 times 8 dw 0 ; 0 cwa1 times 8 dw 1 ; 1 cwa2 times 8 dw 2 ; 2 cwa4 times 8 dw 4 ; 3 cwa8 times 8 dw 8 ; 4 cwa16 times 8 dw 16 ; 5 cwa32 times 8 dw 32 ; 6 cwa64 times 8 dw 64 ; 7 cwa128 times 8 dw 128 ; 8 cwa256 times 8 dw 256 ; 9 cwa512 times 8 dw 512 ; 10 cwa1024 times 8 dw 1024 ; 11 cwa2048 times 8 dw 2048 ; 12 cwa4096 times 8 dw 4096 ; 13 cwa8192 times 8 dw 8192 ; 14 cwa16384 times 8 dw 16384 ; 15 %define LHI_ADD [esp + 1 * 16 + 4] %define LHI_SFT [esp + 2 * 16 + 4] %define LLO_ADD [esp + 3 * 16 + 4] %define LLO_SFT [esp + 4 * 16 + 4] ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_horiz_16_16: mov ecx, 8 loop1a: ; pre / post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 16 * 2] lea edi, [edi - 8 * 2] lea edx, [edx - 8 * 2] ; move down lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] dec ecx jnz loop1a ret ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_verti_16_16: mov ecx, 2 loop1b: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16 * 2] ; src[2n + 1] movdqa xmm3, [esi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 16 * 2 * 2] ; 2 rows lea edi, [edi + 16 * 2] ; 1 row lea edx, [edx + 16 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 6 loop2b: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 16 * 2] ; src[2n + 1] movdqa xmm3, [esi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 16 * 2 * 2] ; 2 rows lea edi, [edi + 16 * 2] ; 1 row lea edx, [edx + 16 * 2] ; 1 row dec cx jnz loop2b shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 16 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move down lea esi, [esi + 16 * 2 * 2] ; 2 row lea edi, [edi + 16 * 2] ; 1 row lea edx, [edx + 16 * 2] ; 1 row ; move up lea esi, [esi - 16 * 16 * 2] lea edi, [edi - 8 * 16 * 2] lea edx, [edx - 8 * 16 * 2] ; move right lea esi, [esi + 16] lea edi, [edi + 16] lea edx, [edx + 16] dec ecx jnz loop1b ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32: mov ecx, 16 loop1c: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 32 * 2] lea edi, [edi - 16 * 2] lea edx, [edx - 16 * 2] ; move down lea esi, [esi + 32 * 2] lea edi, [edi + 16 * 2] lea edx, [edx + 16 * 2] dec ecx jnz loop1c ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32_no_lo: mov ecx, 16 loop1c1: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 32 * 2] lea edi, [edi - 16 * 2] lea edx, [edx - 16 * 2] ; move down lea esi, [esi + 32 * 2] lea edi, [edi + 16 * 2] lea edx, [edx + 16 * 2] dec ecx jnz loop1c1 ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_verti_16_32: mov ecx, 4 loop1d: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 32 * 2] ; src[2n + 1] movdqa xmm3, [esi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 32 * 2 * 2] ; 2 rows lea edi, [edi + 32 * 2] ; 1 row lea edx, [edx + 32 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 14 loop2d: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 32 * 2] ; src[2n + 1] movdqa xmm3, [esi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 32 * 2 * 2] ; 2 rows lea edi, [edi + 32 * 2] ; 1 row lea edx, [edx + 32 * 2] ; 1 row dec cx jnz loop2d shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 32 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move down lea esi, [esi + 32 * 2 * 2] ; 2 row lea edi, [edi + 32 * 2] ; 1 row lea edx, [edx + 32 * 2] ; 1 row ; move up lea esi, [esi - 32 * 32 * 2] lea edi, [edi - 16 * 32 * 2] lea edx, [edx - 16 * 32 * 2] ; move right lea esi, [esi + 16] lea edi, [edi + 16] lea edx, [edx + 16] dec ecx jnz loop1d ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64: mov ecx, 32 loop1e: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e: movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] dec cx jnz loop2e shr ecx, 16 ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 64 * 2] lea edi, [edi - 32 * 2] lea edx, [edx - 32 * 2] ; move down lea esi, [esi + 64 * 2] lea edi, [edi + 32 * 2] lea edx, [edx + 32 * 2] dec ecx jnz loop1e ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64_no_lo: mov ecx, 32 loop1e1: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e1: movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] dec cx jnz loop2e1 shr ecx, 16 ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] packusdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] packusdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] packusdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 64 * 2] lea edi, [edi - 32 * 2] lea edx, [edx - 32 * 2] ; move down lea esi, [esi + 64 * 2] lea edi, [edi + 32 * 2] lea edx, [edx + 32 * 2] dec ecx jnz loop1e1 ret ;****************************************************************************** ; source 8 bit unsigned, 64 pixel width rfx_dwt_2d_encode_block_verti_8_64: mov ecx, 8 loop1f: ; pre movq xmm1, [esi] ; src[2n] movq xmm2, [esi + 64 * 1] ; src[2n + 1] movq xmm3, [esi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm1, xmm0 punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm1, [lsym(cw128)] psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm1, 5 psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 64 * 1 * 2] ; 2 rows lea edi, [edi + 64 * 2] ; 1 row lea edx, [edx + 64 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 30 loop2f: movdqa xmm1, xmm3 ; src[2n] movq xmm2, [esi + 64 * 1] ; src[2n + 1] movq xmm3, [esi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 64 * 1 * 2] ; 2 rows lea edi, [edi + 64 * 2] ; 1 row lea edx, [edx + 64 * 2] ; 1 row dec cx jnz loop2f shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movq xmm2, [esi + 64 * 1] ; src[2n + 1] punpcklbw xmm2, xmm0 psubw xmm2, [lsym(cw128)] psllw xmm2, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move down lea esi, [esi + 64 * 1 * 2] ; 2 rows lea edi, [edi + 64 * 2] ; 1 row lea edx, [edx + 64 * 2] ; 1 row ; move up lea esi, [esi - 64 * 1 * 64] lea edi, [edi - 32 * 64 * 2] lea edx, [edx - 32 * 64 * 2] ; move right lea esi, [esi + 8] lea edi, [edi + 16] lea edx, [edx + 16] dec ecx jnz loop1f ret set_quants_hi: sub eax, 6 - 5 movd xmm1, eax movdqa LHI_SFT, xmm1 imul eax, 16 lea edx, [lsym(cwa0)] add edx, eax movdqa xmm1, [edx] movdqa LHI_ADD, xmm1 ret set_quants_lo: sub eax, 6 - 5 movd xmm1, eax movdqa LLO_SFT, xmm1 imul eax, 16 lea edx, [lsym(cwa0)] add edx, eax movdqa xmm1, [edx] movdqa LLO_ADD, xmm1 ret %define LQTABLE [esp + 144] ; qtable %define LIN_BUFFER [esp + 148] ; in_buffer %define LOUT_BUFFER [esp + 152] ; out_buffer %define LWORK_BUFFER [esp + 156] ; work_buffer ;int ;rfxcodec_encode_dwt_shift_x86_sse41(const char *qtable, ; unsigned char *in_buffer, ; short *out_buffer, ; short *work_buffer); ;****************************************************************************** PROC rfxcodec_encode_dwt_shift_x86_sse41 ; align stack mov eax, esp sub eax, 0x10 and eax, 0x0F sub esp, eax push eax sub esp, 3 * 4 sub esp, 4 * 4 ; copy params to after align movdqu xmm0, [esp + eax + 4 * 4 + 3 * 4 + 4 + 4] movdqu [esp], xmm0 ; save registers push ebx RETRIEVE_RODATA push esi push edi push ebp sub esp, 16 * 8 pxor xmm0, xmm0 ; verical DWT to work buffer, level 1 mov esi, LIN_BUFFER ; src mov edi, LWORK_BUFFER ; dst hi lea edi, [edi + 64 * 32 * 2] ; dst hi mov edx, LWORK_BUFFER ; dst lo call rfx_dwt_2d_encode_block_verti_8_64 ; horizontal DWT to out buffer, level 1, part 1 xor eax, eax mov edx, LQTABLE mov al, [edx + 4] and al, 0xF call set_quants_hi mov esi, LWORK_BUFFER ; src mov edi, LOUT_BUFFER ; dst hi - HL1 mov edx, LOUT_BUFFER ; dst lo - LL1 lea edx, [edx + 32 * 32 * 6] ; dst lo - LL1 call rfx_dwt_2d_encode_block_horiz_16_64_no_lo ; horizontal DWT to out buffer, level 1, part 2 xor eax, eax mov edx, LQTABLE mov al, [edx + 4] shr al, 4 call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 3] shr al, 4 call set_quants_lo mov esi, LWORK_BUFFER ; src lea esi, [esi + 64 * 32 * 2] ; src mov edi, LOUT_BUFFER ; dst hi - HH1 lea edi, [edi + 32 * 32 * 4] ; dst hi - HH1 mov edx, LOUT_BUFFER ; dst lo - LH1 lea edx, [edx + 32 * 32 * 2] ; dst lo - LH1 call rfx_dwt_2d_encode_block_horiz_16_64 ; verical DWT to work buffer, level 2 mov esi, LOUT_BUFFER ; src lea esi, [esi + 32 * 32 * 6] ; src mov edi, LWORK_BUFFER ; dst hi lea edi, [edi + 32 * 16 * 2] ; dst hi mov edx, LWORK_BUFFER ; dst lo call rfx_dwt_2d_encode_block_verti_16_32 ; horizontal DWT to out buffer, level 2, part 1 xor eax, eax mov edx, LQTABLE mov al, [edx + 2] shr al, 4 call set_quants_hi mov esi, LWORK_BUFFER ; src ; 32 * 32 * 6 + 16 * 16 * 0 = 6144 mov edi, LOUT_BUFFER ; dst hi - HL2 lea edi, [edi + 6144] ; dst hi - HL2 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov edx, LOUT_BUFFER ; dst lo - LL2 lea edx, [edx + 7680] ; dst lo - LL2 call rfx_dwt_2d_encode_block_horiz_16_32_no_lo ; horizontal DWT to out buffer, level 2, part 2 xor eax, eax mov edx, LQTABLE mov al, [edx + 3] and al, 0xF call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 2] and al, 0xF call set_quants_lo mov esi, LWORK_BUFFER ; src lea esi, [esi + 32 * 16 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 4 = 7168 mov edi, LOUT_BUFFER ; dst hi - HH2 lea edi, [edi + 7168] ; dst hi - HH2 ; 32 * 32 * 6 + 16 * 16 * 2 = 6656 mov edx, LOUT_BUFFER ; dst lo - LH2 lea edx, [edx + 6656] ; dst lo - LH2 call rfx_dwt_2d_encode_block_horiz_16_32 ; verical DWT to work buffer, level 3 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov esi, LOUT_BUFFER ; src lea esi, [esi + 7680] ; src mov edi, LWORK_BUFFER ; dst hi lea edi, [edi + 16 * 8 * 2] ; dst hi mov edx, LWORK_BUFFER ; dst lo call rfx_dwt_2d_encode_block_verti_16_16 ; horizontal DWT to out buffer, level 3, part 1 xor eax, eax mov edx, LQTABLE mov al, [edx + 1] and al, 0xF call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 0] and al, 0xF call set_quants_lo mov esi, LWORK_BUFFER ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 0 = 7680 mov edi, LOUT_BUFFER ; dst hi - HL3 lea edi, [edi + 7680] ; dst hi - HL3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 6 = 8064 mov edx, LOUT_BUFFER ; dst lo - LL3 lea edx, [edx + 8064] ; dst lo - LL3 call rfx_dwt_2d_encode_block_horiz_16_16 ; horizontal DWT to out buffer, level 3, part 2 xor eax, eax mov edx, LQTABLE mov al, [edx + 1] shr al, 4 call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 0] shr al, 4 call set_quants_lo mov esi, LWORK_BUFFER ; src lea esi, [esi + 16 * 8 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 4 = 7936 mov edi, LOUT_BUFFER ; dst hi - HH3 lea edi, [edi + 7936] ; dst hi - HH3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 2 = 7808 mov edx, LOUT_BUFFER ; dst lo - LH3 lea edx, [edx + 7808] ; dst lo - LH3 call rfx_dwt_2d_encode_block_horiz_16_16 ; quants add esp, 16 * 8 ; restore registers pop ebp pop edi pop esi pop ebx ; params add esp, 3 * 4 add esp, 4 * 4 ; align pop eax add esp, eax ; return value mov eax, 0 ret END_OF_FILE xrdp-0.10.1/librfxcodec/src/x86/Makefile.am000644 001751 000000 00000001147 14652432052 020370 0ustar00metawheel000000 000000 NAFLAGS += -DASM_ARCH_I386 X86_ASM = \ cpuid_x86.asm \ rfxcodec_encode_dwt_shift_x86_sse2.asm \ rfxcodec_encode_dwt_shift_x86_sse41.asm AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/src noinst_LTLIBRARIES = librfxencode-x86.la librfxencode_x86_la_SOURCES = \ funcs_x86.h \ rfxencode_tile_x86.c \ $(X86_ASM) nasm_verbose = $(nasm_verbose_@AM_V@) nasm_verbose_ = $(nasm_verbose_@AM_DEFAULT_V@) nasm_verbose_0 = @echo " NASM $@"; .asm.lo: $(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --mode=compile \ $(top_srcdir)/src/nasm_lt.sh $(NASM) $(NAFLAGS) \ -I$(top_srcdir)/src $< -o $@ xrdp-0.10.1/librfxcodec/src/x86/rfxencode_tile_x86.c000644 001751 000000 00000007252 14652432052 022202 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol client. * RemoteFX Codec Library - Encode * * Copyright 2011 Vic Lee * Copyright 2014-2015 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "rfxcommon.h" #include "rfxencode.h" #include "rfxencode_differential.h" #include "rfxencode_rlgr1.h" #include "rfxencode_rlgr3.h" #include "rfxencode_alpha.h" #include "rfxencode_diff_rlgr1.h" #include "rfxencode_diff_rlgr3.h" #include "x86/funcs_x86.h" #define LLOG_LEVEL 1 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) /******************************************************************************/ int rfx_encode_component_rlgr1_x86_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr1_x86_sse2:")); if (rfxcodec_encode_dwt_shift_x86_sse2(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr1(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr3_x86_sse2(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr3_x86_sse2:")); if (rfxcodec_encode_dwt_shift_x86_sse2(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr3(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr1_x86_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr1_x86_sse41:")); if (rfxcodec_encode_dwt_shift_x86_sse41(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr1(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } /******************************************************************************/ int rfx_encode_component_rlgr3_x86_sse41(struct rfxencode *enc, const char *qtable, const uint8 *data, uint8 *buffer, int buffer_size, int *size) { LLOGLN(10, ("rfx_encode_component_rlgr3_x86_sse41:")); if (rfxcodec_encode_dwt_shift_x86_sse41(qtable, data, enc->dwt_buffer1, enc->dwt_buffer) != 0) { return 1; } *size = rfx_encode_diff_rlgr3(enc->dwt_buffer1, buffer, buffer_size, 64); return 0; } xrdp-0.10.1/librfxcodec/src/x86/cpuid_x86.asm000644 001751 000000 00000001035 14652432052 020643 0ustar00metawheel000000 000000 %include "common.asm" ;int ;cpuid_x86(int eax_in, int ecx_in, int *eax, int *ebx, int *ecx, int *edx) PROC cpuid_x86 ; save registers push ebx push ecx push edx push edi ; cpuid mov eax, [esp + 20] mov ecx, [esp + 24] cpuid mov edi, [esp + 28] mov [edi], eax mov edi, [esp + 32] mov [edi], ebx mov edi, [esp + 36] mov [edi], ecx mov edi, [esp + 40] mov [edi], edx mov eax, 0 ; restore registers pop edi pop edx pop ecx pop ebx ret END_OF_FILE xrdp-0.10.1/librfxcodec/src/x86/rfxcodec_encode_dwt_shift_x86_sse2.asm000644 001751 000000 00000114002 14652432052 025657 0ustar00metawheel000000 000000 ; ;Copyright 2016 Jay Sorg ;Copyright 2017 mirabilos ; ;Permission to use, copy, modify, distribute, and sell this software and its ;documentation for any purpose is hereby granted without fee, provided that ;the above copyright notice appear in all copies and that both that ;copyright notice and this permission notice appear in supporting ;documentation. ; ;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 ;OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ;AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ;CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; ;x86 asm dwt %include "common.asm" PREPARE_RODATA cw128 times 8 dw 128 cdFFFF times 4 dd 65535 ; these are 1 << (factor - 1) 0 to 15 is factor cwa0 times 8 dw 0 ; 0 cwa1 times 8 dw 1 ; 1 cwa2 times 8 dw 2 ; 2 cwa4 times 8 dw 4 ; 3 cwa8 times 8 dw 8 ; 4 cwa16 times 8 dw 16 ; 5 cwa32 times 8 dw 32 ; 6 cwa64 times 8 dw 64 ; 7 cwa128 times 8 dw 128 ; 8 cwa256 times 8 dw 256 ; 9 cwa512 times 8 dw 512 ; 10 cwa1024 times 8 dw 1024 ; 11 cwa2048 times 8 dw 2048 ; 12 cwa4096 times 8 dw 4096 ; 13 cwa8192 times 8 dw 8192 ; 14 cwa16384 times 8 dw 16384 ; 15 %define LHI_ADD [esp + 1 * 16 + 4] %define LHI_SFT [esp + 2 * 16 + 4] %define LLO_ADD [esp + 3 * 16 + 4] %define LLO_SFT [esp + 4 * 16 + 4] ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_horiz_16_16: mov ecx, 8 loop1a: ; pre / post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 16 * 2] lea edi, [edi - 8 * 2] lea edx, [edx - 8 * 2] ; move down lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] dec ecx jnz loop1a ret ;****************************************************************************** ; source 16 bit signed, 16 pixel width rfx_dwt_2d_encode_block_verti_16_16: mov ecx, 2 loop1b: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16 * 2] ; src[2n + 1] movdqa xmm3, [esi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 16 * 2 * 2] ; 2 rows lea edi, [edi + 16 * 2] ; 1 row lea edx, [edx + 16 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 6 loop2b: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 16 * 2] ; src[2n + 1] movdqa xmm3, [esi + 16 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 16 * 2 * 2] ; 2 rows lea edi, [edi + 16 * 2] ; 1 row lea edx, [edx + 16 * 2] ; 1 row dec cx jnz loop2b shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 16 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move down lea esi, [esi + 16 * 2 * 2] ; 2 row lea edi, [edi + 16 * 2] ; 1 row lea edx, [edx + 16 * 2] ; 1 row ; move up lea esi, [esi - 16 * 16 * 2] lea edi, [edi - 8 * 16 * 2] lea edx, [edx - 8 * 16 * 2] ; move right lea esi, [esi + 16] lea edi, [edi + 16] lea edx, [edx + 16] dec ecx jnz loop1b ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32: mov ecx, 16 loop1c: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 32 * 2] lea edi, [edi - 16 * 2] lea edx, [edx - 16 * 2] ; move down lea esi, [esi + 32 * 2] lea edi, [edi + 16 * 2] lea edx, [edx + 16 * 2] dec ecx jnz loop1c ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_horiz_16_32_no_lo: mov ecx, 16 loop1c1: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 32 * 2] lea edi, [edi - 16 * 2] lea edx, [edx - 16 * 2] ; move down lea esi, [esi + 32 * 2] lea edi, [edi + 16 * 2] lea edx, [edx + 16 * 2] dec ecx jnz loop1c1 ret ;****************************************************************************** ; source 16 bit signed, 32 pixel width rfx_dwt_2d_encode_block_verti_16_32: mov ecx, 4 loop1d: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 32 * 2] ; src[2n + 1] movdqa xmm3, [esi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 32 * 2 * 2] ; 2 rows lea edi, [edi + 32 * 2] ; 1 row lea edx, [edx + 32 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 14 loop2d: movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 32 * 2] ; src[2n + 1] movdqa xmm3, [esi + 32 * 2 * 2] ; src[2n + 2] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 32 * 2 * 2] ; 2 rows lea edi, [edi + 32 * 2] ; 1 row lea edx, [edx + 32 * 2] ; 1 row dec cx jnz loop2d shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movdqa xmm2, [esi + 32 * 2] ; src[2n + 1] movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move down lea esi, [esi + 32 * 2 * 2] ; 2 row lea edi, [edi + 32 * 2] ; 1 row lea edx, [edx + 32 * 2] ; 1 row ; move up lea esi, [esi - 32 * 32 * 2] lea edi, [edi - 16 * 32 * 2] lea edx, [edx - 16 * 32 * 2] ; move right lea esi, [esi + 16] lea edi, [edi + 16] lea edx, [edx + 16] dec ecx jnz loop1d ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64: mov ecx, 32 loop1e: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e: movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] dec cx jnz loop2e shr ecx, 16 ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa xmm6, xmm5 ; out lo paddw xmm6, LLO_ADD psraw xmm6, LLO_SFT movdqa [edx], xmm6 ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 64 * 2] lea edi, [edi - 32 * 2] lea edx, [edx - 32 * 2] ; move down lea esi, [esi + 64 * 2] lea edi, [edi + 32 * 2] lea edx, [edx + 32 * 2] dec ecx jnz loop1e ret ;****************************************************************************** ; source 16 bit signed, 64 pixel width rfx_dwt_2d_encode_block_horiz_16_64_no_lo: mov ecx, 32 loop1e1: ; pre movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 movd eax, xmm7 pslldq xmm7, 2 and eax, 0xFFFF movd xmm6, eax por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; loop shl ecx, 16 mov cx, 2 loop2e1: movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 mov eax, [esi + 32] movd xmm5, eax pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 movdqa xmm2, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 psrldq xmm2, 14 movd ebp, xmm2 ; save hi movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] dec cx jnz loop2e1 shr ecx, 16 ; post movdqa xmm1, [esi] ; src[2n] movdqa xmm2, [esi + 16] movdqa xmm6, xmm1 movdqa xmm7, xmm2 pand xmm1, [lsym(cdFFFF)] pand xmm2, [lsym(cdFFFF)] pslld xmm1, 16 pslld xmm2, 16 psrad xmm1, 16 psrad xmm2, 16 packssdw xmm1, xmm2 movdqa xmm2, xmm6 ; src[2n + 1] movdqa xmm3, xmm7 psrldq xmm2, 2 psrldq xmm3, 2 pand xmm2, [lsym(cdFFFF)] pand xmm3, [lsym(cdFFFF)] pslld xmm2, 16 pslld xmm3, 16 psrad xmm2, 16 psrad xmm3, 16 packssdw xmm2, xmm3 movdqa xmm3, xmm6 ; src[2n + 2] movdqa xmm4, xmm7 psrldq xmm3, 4 psrldq xmm4, 4 movd eax, xmm7 movd xmm5, eax pslldq xmm5, 12 por xmm3, xmm5 movdqa xmm5, xmm7 psrldq xmm5, 12 pslldq xmm5, 12 por xmm4, xmm5 pand xmm3, [lsym(cdFFFF)] pand xmm4, [lsym(cdFFFF)] pslld xmm3, 16 pslld xmm4, 16 psrad xmm3, 16 psrad xmm4, 16 packssdw xmm3, xmm4 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa xmm6, xmm5 ; out hi paddw xmm6, LHI_ADD psraw xmm6, LHI_SFT movdqa [edi], xmm6 ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) movdqa xmm7, xmm5 pslldq xmm7, 2 movd xmm6, ebp por xmm7, xmm6 paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move right lea esi, [esi + 16 * 2] lea edi, [edi + 8 * 2] lea edx, [edx + 8 * 2] ; move left lea esi, [esi - 64 * 2] lea edi, [edi - 32 * 2] lea edx, [edx - 32 * 2] ; move down lea esi, [esi + 64 * 2] lea edi, [edi + 32 * 2] lea edx, [edx + 32 * 2] dec ecx jnz loop1e1 ret ;****************************************************************************** ; source 8 bit unsigned, 64 pixel width rfx_dwt_2d_encode_block_verti_8_64: mov ecx, 8 loop1f: ; pre movq xmm1, [esi] ; src[2n] movq xmm2, [esi + 64 * 1] ; src[2n + 1] movq xmm3, [esi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm1, xmm0 punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm1, [lsym(cw128)] psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm1, 5 psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 64 * 1 * 2] ; 2 rows lea edi, [edi + 64 * 2] ; 1 row lea edx, [edx + 64 * 2] ; 1 row ; loop shl ecx, 16 mov cx, 30 loop2f: movdqa xmm1, xmm3 ; src[2n] movq xmm2, [esi + 64 * 1] ; src[2n + 1] movq xmm3, [esi + 64 * 1 * 2] ; src[2n + 2] punpcklbw xmm2, xmm0 punpcklbw xmm3, xmm0 psubw xmm2, [lsym(cw128)] psubw xmm3, [lsym(cw128)] psllw xmm2, 5 psllw xmm3, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi movdqa xmm6, xmm5 ; save hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo movdqa xmm7, xmm6 ; save hi ; move down lea esi, [esi + 64 * 1 * 2] ; 2 rows lea edi, [edi + 64 * 2] ; 1 row lea edx, [edx + 64 * 2] ; 1 row dec cx jnz loop2f shr ecx, 16 ; post movdqa xmm1, xmm3 ; src[2n] movq xmm2, [esi + 64 * 1] ; src[2n + 1] punpcklbw xmm2, xmm0 psubw xmm2, [lsym(cw128)] psllw xmm2, 5 movdqa xmm4, xmm1 movdqa xmm5, xmm2 movdqa xmm6, xmm3 ; h[n] = (src[2n + 1] - ((src[2n] + src[2n + 2]) >> 1)) >> 1 paddw xmm4, xmm6 psraw xmm4, 1 psubw xmm5, xmm4 psraw xmm5, 1 movdqa [edi], xmm5 ; out hi ; l[n] = src[2n] + ((h[n - 1] + h[n]) >> 1) paddw xmm5, xmm7 psraw xmm5, 1 paddw xmm5, xmm1 movdqa [edx], xmm5 ; out lo ; move down lea esi, [esi + 64 * 1 * 2] ; 2 rows lea edi, [edi + 64 * 2] ; 1 row lea edx, [edx + 64 * 2] ; 1 row ; move up lea esi, [esi - 64 * 1 * 64] lea edi, [edi - 32 * 64 * 2] lea edx, [edx - 32 * 64 * 2] ; move right lea esi, [esi + 8] lea edi, [edi + 16] lea edx, [edx + 16] dec ecx jnz loop1f ret set_quants_hi: sub eax, 6 - 5 movd xmm1, eax movdqa LHI_SFT, xmm1 imul eax, 16 lea edx, [lsym(cwa0)] add edx, eax movdqa xmm1, [edx] movdqa LHI_ADD, xmm1 ret set_quants_lo: sub eax, 6 - 5 movd xmm1, eax movdqa LLO_SFT, xmm1 imul eax, 16 lea edx, [lsym(cwa0)] add edx, eax movdqa xmm1, [edx] movdqa LLO_ADD, xmm1 ret %define LQTABLE [esp + 144] ; qtable %define LIN_BUFFER [esp + 148] ; in_buffer %define LOUT_BUFFER [esp + 152] ; out_buffer %define LWORK_BUFFER [esp + 156] ; work_buffer ;int ;rfxcodec_encode_dwt_shift_x86_sse2(const char *qtable, ; unsigned char *in_buffer, ; short *out_buffer, ; short *work_buffer); ;****************************************************************************** PROC rfxcodec_encode_dwt_shift_x86_sse2 ; align stack mov eax, esp sub eax, 0x10 and eax, 0x0F sub esp, eax push eax sub esp, 3 * 4 sub esp, 4 * 4 ; copy params to after align movdqu xmm0, [esp + eax + 4 * 4 + 3 * 4 + 4 + 4] movdqu [esp], xmm0 ; save registers push ebx RETRIEVE_RODATA push esi push edi push ebp sub esp, 16 * 8 pxor xmm0, xmm0 ; verical DWT to work buffer, level 1 mov esi, LIN_BUFFER ; src mov edi, LWORK_BUFFER ; dst hi lea edi, [edi + 64 * 32 * 2] ; dst hi mov edx, LWORK_BUFFER ; dst lo call rfx_dwt_2d_encode_block_verti_8_64 ; horizontal DWT to out buffer, level 1, part 1 xor eax, eax mov edx, LQTABLE mov al, [edx + 4] and al, 0xF call set_quants_hi mov esi, LWORK_BUFFER ; src mov edi, LOUT_BUFFER ; dst hi - HL1 mov edx, LOUT_BUFFER ; dst lo - LL1 lea edx, [edx + 32 * 32 * 6] ; dst lo - LL1 call rfx_dwt_2d_encode_block_horiz_16_64_no_lo ; horizontal DWT to out buffer, level 1, part 2 xor eax, eax mov edx, LQTABLE mov al, [edx + 4] shr al, 4 call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 3] shr al, 4 call set_quants_lo mov esi, LWORK_BUFFER ; src lea esi, [esi + 64 * 32 * 2] ; src mov edi, LOUT_BUFFER ; dst hi - HH1 lea edi, [edi + 32 * 32 * 4] ; dst hi - HH1 mov edx, LOUT_BUFFER ; dst lo - LH1 lea edx, [edx + 32 * 32 * 2] ; dst lo - LH1 call rfx_dwt_2d_encode_block_horiz_16_64 ; verical DWT to work buffer, level 2 mov esi, LOUT_BUFFER ; src lea esi, [esi + 32 * 32 * 6] ; src mov edi, LWORK_BUFFER ; dst hi lea edi, [edi + 32 * 16 * 2] ; dst hi mov edx, LWORK_BUFFER ; dst lo call rfx_dwt_2d_encode_block_verti_16_32 ; horizontal DWT to out buffer, level 2, part 1 xor eax, eax mov edx, LQTABLE mov al, [edx + 2] shr al, 4 call set_quants_hi mov esi, LWORK_BUFFER ; src ; 32 * 32 * 6 + 16 * 16 * 0 = 6144 mov edi, LOUT_BUFFER ; dst hi - HL2 lea edi, [edi + 6144] ; dst hi - HL2 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov edx, LOUT_BUFFER ; dst lo - LL2 lea edx, [edx + 7680] ; dst lo - LL2 call rfx_dwt_2d_encode_block_horiz_16_32_no_lo ; horizontal DWT to out buffer, level 2, part 2 xor eax, eax mov edx, LQTABLE mov al, [edx + 3] and al, 0xF call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 2] and al, 0xF call set_quants_lo mov esi, LWORK_BUFFER ; src lea esi, [esi + 32 * 16 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 4 = 7168 mov edi, LOUT_BUFFER ; dst hi - HH2 lea edi, [edi + 7168] ; dst hi - HH2 ; 32 * 32 * 6 + 16 * 16 * 2 = 6656 mov edx, LOUT_BUFFER ; dst lo - LH2 lea edx, [edx + 6656] ; dst lo - LH2 call rfx_dwt_2d_encode_block_horiz_16_32 ; verical DWT to work buffer, level 3 ; 32 * 32 * 6 + 16 * 16 * 6 = 7680 mov esi, LOUT_BUFFER ; src lea esi, [esi + 7680] ; src mov edi, LWORK_BUFFER ; dst hi lea edi, [edi + 16 * 8 * 2] ; dst hi mov edx, LWORK_BUFFER ; dst lo call rfx_dwt_2d_encode_block_verti_16_16 ; horizontal DWT to out buffer, level 3, part 1 xor eax, eax mov edx, LQTABLE mov al, [edx + 1] and al, 0xF call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 0] and al, 0xF call set_quants_lo mov esi, LWORK_BUFFER ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 0 = 7680 mov edi, LOUT_BUFFER ; dst hi - HL3 lea edi, [edi + 7680] ; dst hi - HL3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 6 = 8064 mov edx, LOUT_BUFFER ; dst lo - LL3 lea edx, [edx + 8064] ; dst lo - LL3 call rfx_dwt_2d_encode_block_horiz_16_16 ; horizontal DWT to out buffer, level 3, part 2 xor eax, eax mov edx, LQTABLE mov al, [edx + 1] shr al, 4 call set_quants_hi xor eax, eax mov edx, LQTABLE mov al, [edx + 0] shr al, 4 call set_quants_lo mov esi, LWORK_BUFFER ; src lea esi, [esi + 16 * 8 * 2] ; src ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 4 = 7936 mov edi, LOUT_BUFFER ; dst hi - HH3 lea edi, [edi + 7936] ; dst hi - HH3 ; 32 * 32 * 6 + 16 * 16 * 6 + 8 * 8 * 2 = 7808 mov edx, LOUT_BUFFER ; dst lo - LH3 lea edx, [edx + 7808] ; dst lo - LH3 call rfx_dwt_2d_encode_block_horiz_16_16 ; quants add esp, 16 * 8 ; restore registers pop ebp pop edi pop esi pop ebx ; params add esp, 3 * 4 add esp, 4 * 4 ; align pop eax add esp, eax ; return value mov eax, 0 ret END_OF_FILE xrdp-0.10.1/librfxcodec/src/x86/funcs_x86.h000644 001751 000000 00000003070 14652432052 020325 0ustar00metawheel000000 000000 /* Copyright 2014-2015 Jay Sorg Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. x86 asm files */ #ifndef __FUNCS_X86_H #define __FUNCS_X86_H #ifdef __cplusplus extern "C" { #endif int cpuid_x86(int eax_in, int ecx_in, int *eax, int *ebx, int *ecx, int *edx); int rfxcodec_encode_dwt_shift_x86_sse2(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); int rfxcodec_encode_dwt_shift_x86_sse41(const char *qtable, const unsigned char *data, short *dwt_buffer1, short *dwt_buffer); #ifdef __cplusplus } #endif #endif xrdp-0.10.1/librfxcodec/src/sse2/Makefile.am000644 001751 000000 00000001151 14652432052 020612 0ustar00metawheel000000 000000 EXTRA_DIST = SUBDIRS = AM_CPPFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src EXTRA_SOURCES= if WITH_SIMD_AMD64 AM_CPPFLAGS += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1 -msse2 -mfpmath=sse endif if WITH_SIMD_X86 AM_CPPFLAGS += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_X86=1 -msse2 -mfpmath=sse endif noinst_HEADERS = \ rfxencode_diff_count_sse2.h \ rfxencode_dwt_shift_rem_sse2.h noinst_LTLIBRARIES = librfxencode-sse2.la librfxencode_sse2_la_LDFLAGS = -all-static librfxencode_sse2_la_SOURCES = $(noinst_HEADERS) \ rfxencode_diff_count_sse2.c \ rfxencode_dwt_shift_rem_sse2.c \ $(EXTRA_SOURCES) xrdp-0.10.1/librfxcodec/src/sse2/rfxencode_diff_count_sse2.h000644 001751 000000 00000001655 14652432052 024051 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_DIFF_COUNT_SSE2_H #define __RFXENCODE_DIFF_COUNT_SSE2_H int rfx_encode_diff_count_sse2(short *diff_buffer, const short *dwt_buffer, const short *hist_buffer, int *diff_zeros, int *dwt_zeros); #endif xrdp-0.10.1/librfxcodec/src/sse2/rfxencode_dwt_shift_rem_sse2.c000644 001751 000000 00000055077 14652432052 024571 0ustar00metawheel000000 000000 /** * RemoteFX Codec Library * * Copyright 2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * DWT Reduce-Extrapolate Method MS-RDPEGFX 3.2.8.1.2.2 * also does Quantization and Linearization 3.2.8.1.3 * SSE2 accel */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode_dwt_shift_rem.h" #include "rfxencode_dwt_shift_rem_sse2.h" #include "rfxencode_dwt_shift_rem_common.h" /* level 1 LL0 -> L0, H0 */ #define IC_LL0_U8V(_val, _offset) \ _val = _mm_slli_epi16(_mm_sub_epi16(_mm_unpacklo_epi8( \ _mm_loadl_epi64((__m128i_u const *)(ic + (_offset) * 64)), \ g_vec_zerov), g_vec_128v), DWT_FACTOR) #define OC_L0V(_offset, _val) \ _mm_storeu_si128((__m128i *)(lo + (_offset) * 64), _val) #define OC_H0V(_offset, _val) \ _mm_storeu_si128((__m128i *)(hi + (_offset) * 64), _val) /* L0 -> LL1, HL1 */ #define IC_L0V(_x2nv, _x2n1v, _x2n2v, _offset) do { \ v1 = _mm_loadu_si128((const __m128i *)(ic + 2 * (_offset) + 0)); \ v2 = _mm_loadu_si128((const __m128i *)(ic + 2 * (_offset) + 8)); \ _x2nv = _mm_packs_epi32(_mm_srai_epi32(_mm_slli_epi32(v1, 16), 16), \ _mm_srai_epi32(_mm_slli_epi32(v2, 16), 16)); \ _x2n1v = _mm_packs_epi32(_mm_srai_epi32( \ _mm_slli_epi32(_mm_srli_si128(v1, 2), 16), 16), \ _mm_srai_epi32( \ _mm_slli_epi32(_mm_srli_si128(v2, 2), 16), 16)); \ _x2n2v = _mm_insert_epi16(_mm_srli_si128(_x2nv, 2), \ ic[(_offset) * 2 + 16], 7); \ } while (0) #define IC_L0V_POST(_x2nv, _x2n1v, _x2n2v, _offset) do { \ v1 = _mm_loadu_si128((const __m128i *)(ic + 2 * (_offset))); \ v2 = _mm_loadu_si128((const __m128i *)(ic + 2 * (_offset) + 8)); \ _x2nv = _mm_packs_epi32(_mm_srai_epi32(_mm_slli_epi32(v1, 16), 16), \ _mm_srai_epi32(_mm_slli_epi32(v2, 16), 16)); \ _x2n1v = _mm_packs_epi32(_mm_srai_epi32( \ _mm_slli_epi32(_mm_srli_si128(v1, 2), 16), 16), \ _mm_srai_epi32( \ _mm_slli_epi32(_mm_srli_si128(v2, 2), 16), 16)); \ /* ic[64] = 2 * ic[63] - ic[62] */ \ ic64 = 2 * ic[(_offset) * 2 + 15] - ic[(_offset) * 2 + 14]; \ _x2n2v = _mm_insert_epi16(_mm_srli_si128(_x2nv, 2), ic64, 7); \ } while (0) #define OC_LL1V(_offset, _val) \ _mm_storeu_si128((__m128i *)(lo + (_offset)), _val) #define OC_HL1V(_offset, _val) \ _mm_storeu_si128((__m128i *)(hi + (_offset)), _val) /* H0 -> LH1, HH1 */ #define IC_H0V_PRE IC_L0V_PRE #define IC_H0V IC_L0V #define IC_H0V_LOOP IC_L0V_LOOP #define IC_H0V_POST IC_L0V_POST #define OC_LH1V OC_LL1V #define OC_HH1V OC_HL1V /* level 2 LL1 -> L1, H1 */ #define IC_LL1V(_val, _offset) \ _val = _mm_loadu_si128((const __m128i *)(ic + (_offset) * 33)) #define OC_L1V(_offset, _val) \ _mm_storeu_si128((__m128i *)(lo + (_offset) * 33), _val) #define OC_H1V(_offset, _val) \ _mm_storeu_si128((__m128i *)(hi + (_offset) * 33), _val) /* L1 -> LL2, HL2 */ #define IC_L1V IC_L0V #define OC_LL2V OC_LL1V #define OC_HL2V OC_HL1V /* H1 -> LH2, HH2 */ #define IC_H1V IC_L0V #define OC_LH2V OC_LL1V #define OC_HH2V OC_HL1V /* level 3 LL2 -> L2, H2 */ #define IC_LL2V(_val, _offset) \ _val = _mm_loadu_si128((const __m128i *)(ic + (_offset) * 17)) #define OC_L2V(_offset, _val) \ _mm_storeu_si128((__m128i *)(lo + (_offset) * 17), _val) #define OC_H2V(_offset, _val) \ _mm_storeu_si128((__m128i *)(hi + (_offset) * 17), _val) /* L2 -> LL3, HL3 */ #define IC_L2V IC_L0V #define OC_LL3V OC_LL1V #define OC_HL3V OC_HL1V /* H2 -> LH3, HH3 */ #define IC_H2V IC_L0V #define OC_LH3V OC_LL1V #define OC_HH3V OC_HL1V #define SETUPLOQV lo_halfv = _mm_set1_epi16(lo_half) #define SETUPHIQV hi_halfv = _mm_set1_epi16(hi_half) #define LOQV(_val) _mm_srai_epi16(_mm_add_epi16(_val, lo_halfv), lo_fact) #define HIQV(_val) _mm_srai_epi16(_mm_add_epi16(_val, hi_halfv), hi_fact) #define LO_MATHV(_hn, _hn1, _x2n) \ _mm_add_epi16(_x2n, _mm_srai_epi16(_mm_add_epi16(_hn1, _hn), 1)) #define HI_MATHV(_x2n, _x2n1, _x2n2) \ _mm_srai_epi16(_mm_sub_epi16(_x2n1, _mm_srai_epi16( \ _mm_add_epi16(_x2n, _x2n2), 1)), 1) static const __m128i g_vec_zerov = { 0, 0 }; static const __m128i g_vec_128v = { 0x0080008000800080, 0x0080008000800080 }; static const __m128i g_i16_0 = { 0xFFFF, 0x0 }; /******************************************************************************/ static void rfx_encode_dwt_shift_rem_vert_lv1_u8(const uint8 *in_buffer, sint16 *out_buffer) { const uint8 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; __m128i x2nv; /* n[2n] */ __m128i x2n1v; /* n[2n + 1] */ __m128i x2n2v; /* n[2n + 2] */ __m128i hn1v; /* H[n - 1] */ __m128i hnv; /* H[n] */ __m128i ic62v; int n; int y; for (y = 0; y < 64; y += 8) { /* setup */ ic = SETUP_IC_LL0(y); lo = SETUP_OC_L0(y); hi = SETUP_OC_H0(y); /* pre */ IC_LL0_U8V(x2nv, 0); IC_LL0_U8V(x2n1v, 1); IC_LL0_U8V(x2n2v, 2); OC_H0V(0, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L0V(0, NOQ(_mm_add_epi16(x2nv, hnv))); /* mirror */ /* loop */ for (n = 1; n < 31; n++) { hn1v = hnv; x2nv = x2n2v; IC_LL0_U8V(x2n1v, 2 * n + 1); IC_LL0_U8V(x2n2v, 2 * n + 2); OC_H0V(n, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L0V(n, NOQ(LO_MATHV(hnv, hn1v, x2nv))); } /* post */ hn1v = hnv; ic62v = x2nv = x2n2v; IC_LL0_U8V(x2n1v, 63); /* ic[64] = 2 * ic[63] - ic[62] */ x2n2v = _mm_sub_epi16(_mm_slli_epi16(x2n1v, 1), x2nv); OC_L0V(31, NOQ(_mm_add_epi16(x2nv, _mm_srai_epi16(hn1v, 1)))); /* post ex */ x2nv = x2n2v; /* x2n1 already set, mirror 65 -> 63 */ x2n2v = ic62v; /* mirror 66 -> 62 */ hnv = HI_MATHV(x2nv, x2n1v, x2n2v); OC_L0V(32, NOQ(_mm_add_epi16(x2nv, _mm_srai_epi16(hnv, 1)))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_horz_lv1(const sint16 *in_buffer, sint16 *out_buffer, const char *quants) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; __m128i x2nv; /* n[2n] */ __m128i x2n1v; /* n[2n + 1] */ __m128i x2n2v; /* n[2n + 2] */ __m128i hn1v; /* H[n - 1] */ __m128i hnv; /* H[n] */ __m128i lo_halfv; __m128i hi_halfv; __m128i v1; __m128i v2; __m128i hn_savev; sint16 x2n; /* n[2n] */ sint16 hn; /* H[n] */ sint16 hi31; sint16 ic64; int n; int y; int lo_fact; int hi_fact; int lo_half; int hi_half; /* LL1 no Q */ SETUPHIQ(4, 0); /* HL1 */ SETUPHIQV; for (y = 0; y < 33; y++) /* lo */ { /* setup */ ic = SETUP_IC_L0(y); lo = SETUP_OC_LL1(y); hi = SETUP_OC_HL1(y); /* pre */ IC_L0V(x2nv, x2n1v, x2n2v, 0); OC_HL1V(0, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn_savev = _mm_and_si128(hnv, g_i16_0); /* mirror */ hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn_savev = _mm_srli_si128(hnv, 14); OC_LL1V(0, NOQ(LO_MATHV(hnv, hn1v, x2nv))); /* loop */ for (n = 8; n < 24; n += 8) { IC_L0V(x2nv, x2n1v, x2n2v, n); OC_HL1V(n, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn_savev = _mm_srli_si128(hnv, 14); OC_LL1V(n, NOQ(LO_MATHV(hnv, hn1v, x2nv))); } /* post */ IC_L0V_POST(x2nv, x2n1v, x2n2v, 24); /* this will write 2 bytes past HL1 buffer, but still in tile, next buffer is LH1(not done yet) so no save and restore */ OC_HL1V(24, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn = _mm_extract_epi16(hnv, 7); OC_LL1V(n, NOQ(LO_MATHV(hnv, hn1v, x2nv))); /* hn already set */ x2n = ic64; OC_LL1(32, NOQ(x2n + (hn >> 1))); } SETUPLOQ(3, 4); /* LH1 */ SETUPHIQ(4, 4); /* HH1 */ SETUPLOQV; SETUPHIQV; for (y = 0; y < 31; y++) /* hi */ { /* setup */ ic = SETUP_IC_H0(y); lo = SETUP_OC_LH1(y); hi = SETUP_OC_HH1(y); /* pre */ IC_H0V(x2nv, x2n1v, x2n2v, 0); OC_HH1V(0, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn_savev = _mm_and_si128(hnv, g_i16_0); /* mirror */ hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn_savev = _mm_srli_si128(hnv, 14); OC_LH1V(0, LOQV(LO_MATHV(hnv, hn1v, x2nv))); /* loop */ for (n = 8; n < 24; n += 8) { IC_H0V(x2nv, x2n1v, x2n2v, n); OC_HH1V(n, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn_savev = _mm_srli_si128(hnv, 14); OC_LH1V(n, LOQV(LO_MATHV(hnv, hn1v, x2nv))); } /* post */ IC_H0V_POST(x2nv, x2n1v, x2n2v, 24); /* this will write 2 bytes past HH1 buffer, but still in tile, next buffer is LL1(done already) so save and restore */ hi31 = hi[31]; OC_HH1V(24, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hi[31] = hi31; hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn = _mm_extract_epi16(hnv, 7); OC_LH1V(24, LOQV(LO_MATHV(hnv, hn1v, x2nv))); /* hn already set */ x2n = ic64; OC_LH1(32, LOQ(x2n + (hn >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_vert_lv2(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; __m128i x2nv; /* n[2n] */ __m128i x2n1v; /* n[2n + 1] */ __m128i x2n2v; /* n[2n + 2] */ __m128i hn1v; /* H[n - 1] */ __m128i hnv; /* H[n] */ __m128i ic30v; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic30; int n; int y; for (y = 0; y < 32; y += 8) { /* setup */ ic = SETUP_IC_LL1(y); lo = SETUP_OC_L1(y); hi = SETUP_OC_H1(y); /* pre */ IC_LL1V(x2nv, 0); IC_LL1V(x2n1v, 1); IC_LL1V(x2n2v, 2); OC_H1V(0, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L1V(0, NOQ(_mm_add_epi16(x2nv, hnv))); /* mirror */ /* loop */ for (n = 1; n < 15; n++) { hn1v = hnv; x2nv = x2n2v; IC_LL1V(x2n1v, 2 * n + 1); IC_LL1V(x2n2v, 2 * n + 2); OC_H1V(n, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L1V(n, NOQ(LO_MATHV(hnv, hn1v, x2nv))); } /* post */ hn1v = hnv; ic30v = x2nv = x2n2v; IC_LL1V(x2n1v, 31); IC_LL1V(x2n2v, 32); OC_H1V(15, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L1V(15, NOQ(LO_MATHV(hnv, hn1v, x2nv))); /* post ex */ hn1v = hnv; x2nv = x2n2v; /* x2n1 already set, mirror 33 -> 31 */ x2n2v = ic30v; /* mirror 34 -> 30 */ hnv = HI_MATHV(x2nv, x2n1v, x2n2v); OC_L1V(16, NOQ(LO_MATHV(hnv, hn1v, x2nv))); } /* 33rd column */ /* setup */ ic = SETUP_IC_LL1(32); lo = SETUP_OC_L1(32); hi = SETUP_OC_H1(32); /* pre */ IC_LL1(x2n, 0); IC_LL1(x2n1, 1); IC_LL1(x2n2, 2); OC_H1(0, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L1(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 15; n++) { hn1 = hn; x2n = x2n2; IC_LL1(x2n1, 2 * n + 1); IC_LL1(x2n2, 2 * n + 2); OC_H1(n, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L1(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic30 = x2n = x2n2; IC_LL1(x2n1, 31); IC_LL1(x2n2, 32); OC_H1(15, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L1(15, NOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_L1(16, NOQ(x2n + ((hn1 + hn) >> 1))); } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_horz_lv2(const sint16 *in_buffer, sint16 *out_buffer, const char *quants) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; __m128i x2nv; /* n[2n] */ __m128i x2n1v; /* n[2n + 1] */ __m128i x2n2v; /* n[2n + 2] */ __m128i hn1v; /* H[n - 1] */ __m128i hnv; /* H[n] */ __m128i lo_halfv; __m128i hi_halfv; __m128i v1; __m128i v2; __m128i hn_savev; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic30; int y; int lo_fact; int hi_fact; int lo_half; int hi_half; /* LL2 no Q */ SETUPHIQ(2, 4); /* HL2 */ SETUPHIQV; for (y = 0; y < 17; y++) /* lo */ { /* setup */ ic = SETUP_IC_L1(y); lo = SETUP_OC_LL2(y); hi = SETUP_OC_HL2(y); /* pre */ IC_L1V(x2nv, x2n1v, x2n2v, 0); OC_HL2V(0, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn_savev = _mm_and_si128(hnv, g_i16_0); /* mirror */ hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn_savev = _mm_srli_si128(hnv, 14); OC_LL2V(0, NOQ(LO_MATHV(hnv, hn1v, x2nv))); /* loop */ IC_L1V(x2nv, x2n1v, x2n2v, 8); OC_HL2V(8, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn = _mm_extract_epi16(hnv, 7); OC_LL2V(8, NOQ(LO_MATHV(hnv, hn1v, x2nv))); /* hn already set */ IC_L1(ic30, 30); IC_L1(x2n1, 31); IC_L1(x2n2, 32); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LL2(16, NOQ(x2n + ((hn1 + hn) >> 1))); } SETUPLOQ(2, 0); /* LH2 */ SETUPHIQ(3, 0); /* HH2 */ SETUPLOQV; SETUPHIQV; for (y = 0; y < 16; y++) /* hi */ { /* setup */ ic = SETUP_IC_H1(y); lo = SETUP_OC_LH2(y); hi = SETUP_OC_HH2(y); /* pre */ IC_H1V(x2nv, x2n1v, x2n2v, 0); OC_HH2V(0, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn_savev = _mm_and_si128(hnv, g_i16_0); /* mirror */ hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn_savev = _mm_srli_si128(hnv, 14); OC_LH2V(0, LOQV(LO_MATHV(hnv, hn1v, x2nv))); /* loop */ IC_H1V(x2nv, x2n1v, x2n2v, 8); OC_HH2V(8, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn = _mm_extract_epi16(hnv, 7); OC_LH2V(8, LOQV(LO_MATHV(hnv, hn1v, x2nv))); /* hn already set */ IC_H1(ic30, 30); IC_H1(x2n1, 31); IC_H1(x2n2, 32); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 33 -> 31 */ x2n2 = ic30; /* mirror 34 -> 30 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LH2(16, LOQ(x2n + ((hn1 + hn) >> 1))); } } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_vert_lv3(const sint16 *in_buffer, sint16 *out_buffer) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; __m128i x2nv; /* n[2n] */ __m128i x2n1v; /* n[2n + 1] */ __m128i x2n2v; /* n[2n + 2] */ __m128i hn1v; /* H[n - 1] */ __m128i hnv; /* H[n] */ __m128i ic14v; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic14; int n; int y; for (y = 0; y < 16; y += 8) { /* setup */ ic = SETUP_IC_LL2(y); lo = SETUP_OC_L2(y); hi = SETUP_OC_H2(y); /* pre */ IC_LL2V(x2nv, 0); IC_LL2V(x2n1v, 1); IC_LL2V(x2n2v, 2); OC_H2V(0, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L2V(0, NOQ(_mm_add_epi16(x2nv, hnv))); /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1v = hnv; x2nv = x2n2v; IC_LL2V(x2n1v, 2 * n + 1); IC_LL2V(x2n2v, 2 * n + 2); OC_H2V(n, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L2V(n, NOQ(LO_MATHV(hnv, hn1v, x2nv))); } /* post */ hn1v = hnv; ic14v = x2nv = x2n2v; IC_LL2V(x2n1v, 15); IC_LL2V(x2n2v, 16); OC_H2V(7, NOQ(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); OC_L2V(7, NOQ(LO_MATHV(hnv, hn1v, x2nv))); /* post ex */ hn1v = hnv; x2nv = x2n2v; /* x2n1 already set, mirror 17 -> 15 */ x2n2v = ic14v; /* mirror 18 -> 14 */ hnv = HI_MATHV(x2nv, x2n1v, x2n2v); OC_L2V(8, NOQ(LO_MATHV(hnv, hn1v, x2nv))); } /* 17th column */ /* setup */ ic = SETUP_IC_LL2(16); lo = SETUP_OC_L2(16); hi = SETUP_OC_H2(16); /* pre */ IC_LL2(x2n, 0); IC_LL2(x2n1, 1); IC_LL2(x2n2, 2); OC_H2(0, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L2(0, NOQ(x2n + hn)); /* mirror */ /* loop */ for (n = 1; n < 7; n++) { hn1 = hn; x2n = x2n2; IC_LL2(x2n1, 2 * n + 1); IC_LL2(x2n2, 2 * n + 2); OC_H2(n, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L2(n, NOQ(x2n + ((hn1 + hn) >> 1))); } /* post */ hn1 = hn; ic14 = x2n = x2n2; IC_LL2(x2n1, 15); IC_LL2(x2n2, 16); OC_H2(7, NOQ(hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1)); OC_L2(7, NOQ(x2n + ((hn1 + hn) >> 1))); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_L2(8, NOQ(x2n + ((hn1 + hn) >> 1))); } /******************************************************************************/ static void rfx_encode_dwt_shift_rem_horz_lv3(const sint16 *in_buffer, sint16 *out_buffer, const char *quants) { const sint16 *ic; /* input coefficients */ sint16 *lo; sint16 *hi; __m128i x2nv; /* n[2n] */ __m128i x2n1v; /* n[2n + 1] */ __m128i x2n2v; /* n[2n + 2] */ __m128i hn1v; /* H[n - 1] */ __m128i hnv; /* H[n] */ __m128i lo_halfv; __m128i hi_halfv; __m128i v1; __m128i v2; __m128i hn_savev; sint16 x2n; /* n[2n] */ sint16 x2n1; /* n[2n + 1] */ sint16 x2n2; /* n[2n + 2] */ sint16 hn1; /* H[n - 1] */ sint16 hn; /* H[n] */ sint16 ic14; int y; int lo_fact; int hi_fact; int lo_half; int hi_half; SETUPLOQ(0, 0); /* LL3 */ SETUPHIQ(1, 0); /* HL3 */ SETUPLOQV; SETUPHIQV; for (y = 0; y < 9; y++) /* lo */ { /* setup */ ic = SETUP_IC_L2(y); lo = SETUP_OC_LL3(y); hi = SETUP_OC_HL3(y); /* pre */ IC_L2V(x2nv, x2n1v, x2n2v, 0); OC_HL3V(0, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn_savev = _mm_and_si128(hnv, g_i16_0); /* mirror */ hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn = _mm_extract_epi16(hnv, 7); OC_LL3V(0, LOQV(LO_MATHV(hnv, hn1v, x2nv))); /* no loop */ /* hn already set */ IC_L2(ic14, 14); IC_L2(x2n1, 15); IC_L2(x2n2, 16); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LL3(8, LOQ(x2n + ((hn1 + hn) >> 1))); } SETUPLOQ(0, 4); /* LH3 */ SETUPHIQ(1, 4); /* HH3 */ SETUPLOQV; SETUPHIQV; for (y = 0; y < 8; y++) /* hi */ { /* setup */ ic = SETUP_IC_H2(y); lo = SETUP_OC_LH3(y); hi = SETUP_OC_HH3(y); /* pre */ IC_H2V(x2nv, x2n1v, x2n2v, 0); OC_HH3V(0, HIQV(hnv = HI_MATHV(x2nv, x2n1v, x2n2v))); hn_savev = _mm_and_si128(hnv, g_i16_0); /* mirror */ hn1v = _mm_or_si128(_mm_slli_si128(hnv, 2), hn_savev); hn = _mm_extract_epi16(hnv, 7); OC_LH3V(0, LOQV(LO_MATHV(hnv, hn1v, x2nv))); /* no loop */ /* hn already set */ IC_H2(ic14, 14); IC_H2(x2n1, 15); IC_H2(x2n2, 16); /* post ex */ hn1 = hn; x2n = x2n2; /* x2n1 already set, mirror 17 -> 15 */ x2n2 = ic14; /* mirror 18 -> 14 */ hn = (x2n1 - ((x2n + x2n2) >> 1)) >> 1; OC_LH3(8, LOQ(x2n + ((hn1 + hn) >> 1))); } } /******************************************************************************/ int rfx_encode_dwt_shift_rem_sse2(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer, const char *quants) { rfx_encode_dwt_shift_rem_vert_lv1_u8(in_buffer, tmp_buffer); rfx_encode_dwt_shift_rem_horz_lv1(tmp_buffer, out_buffer, quants); rfx_encode_dwt_shift_rem_vert_lv2(out_buffer + 3007, tmp_buffer); rfx_encode_dwt_shift_rem_horz_lv2(tmp_buffer, out_buffer + 3007, quants); rfx_encode_dwt_shift_rem_vert_lv3(out_buffer + 3807, tmp_buffer); rfx_encode_dwt_shift_rem_horz_lv3(tmp_buffer, out_buffer + 3807, quants); return 0; } xrdp-0.10.1/librfxcodec/src/sse2/Makefile.in000644 001751 000000 00000056566 14652432071 020650 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @WITH_SIMD_AMD64_TRUE@am__append_1 = -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1 -msse2 -mfpmath=sse @WITH_SIMD_X86_TRUE@am__append_2 = -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_X86=1 -msse2 -mfpmath=sse subdir = src/sse2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nasm.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) librfxencode_sse2_la_LIBADD = am__objects_1 = am_librfxencode_sse2_la_OBJECTS = $(am__objects_1) \ rfxencode_diff_count_sse2.lo rfxencode_dwt_shift_rem_sse2.lo \ $(am__objects_1) librfxencode_sse2_la_OBJECTS = $(am_librfxencode_sse2_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = librfxencode_sse2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(librfxencode_sse2_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/rfxencode_diff_count_sse2.Plo \ ./$(DEPDIR)/rfxencode_dwt_shift_rem_sse2.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(librfxencode_sse2_la_SOURCES) DIST_SOURCES = $(librfxencode_sse2_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NAFLAGS = @NAFLAGS@ NASM = @NASM@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ EXTRA_DIST = SUBDIRS = AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ $(am__append_1) $(am__append_2) EXTRA_SOURCES = noinst_HEADERS = \ rfxencode_diff_count_sse2.h \ rfxencode_dwt_shift_rem_sse2.h noinst_LTLIBRARIES = librfxencode-sse2.la librfxencode_sse2_la_LDFLAGS = -all-static librfxencode_sse2_la_SOURCES = $(noinst_HEADERS) \ rfxencode_diff_count_sse2.c \ rfxencode_dwt_shift_rem_sse2.c \ $(EXTRA_SOURCES) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/sse2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/sse2/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} librfxencode-sse2.la: $(librfxencode_sse2_la_OBJECTS) $(librfxencode_sse2_la_DEPENDENCIES) $(EXTRA_librfxencode_sse2_la_DEPENDENCIES) $(AM_V_CCLD)$(librfxencode_sse2_la_LINK) $(librfxencode_sse2_la_OBJECTS) $(librfxencode_sse2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_diff_count_sse2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfxencode_dwt_shift_rem_sse2.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/rfxencode_diff_count_sse2.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt_shift_rem_sse2.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/rfxencode_diff_count_sse2.Plo -rm -f ./$(DEPDIR)/rfxencode_dwt_shift_rem_sse2.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/librfxcodec/src/sse2/rfxencode_dwt_shift_rem_sse2.h000644 001751 000000 00000001564 14652432052 024566 0ustar00metawheel000000 000000 /** * RemoteFX Codec Library * * Copyright 2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __RFXENCODE_DWT_SHIFT_REM_SSE2_H #define __RFXENCODE_DWT_SHIFT_REM_SSE2_H int rfx_encode_dwt_shift_rem_sse2(const uint8 *in_buffer, sint16 *out_buffer, sint16 *tmp_buffer, const char *quants); #endif xrdp-0.10.1/librfxcodec/src/sse2/rfxencode_diff_count_sse2.c000644 001751 000000 00000007120 14652432052 024035 0ustar00metawheel000000 000000 /** * RFX codec encoder * * Copyright 2024 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rfxcommon.h" #include "rfxencode_diff_count_sse2.h" static const __m128i g_vec_zerov = { 0, 0 }; /******************************************************************************/ int rfx_encode_diff_count_sse2(sint16 *diff_buffer, const sint16 *dwt_buffer, const sint16 *hist_buffer, int *diff_zeros, int *dwt_zeros) { int index; int ldiff_zeros = 0; int ldwt_zeros = 0; __m128i dwt_vec; __m128i hist_vec; __m128i diff_vec; __m128i cmp_vec; __m128i dwt_sum_vec = { 0, 0 }; __m128i diff_sum_vec = { 0, 0 }; /* diff and count for most of tile */ for (index = 0; index < 4096 - 88; index += 8) { /* diff */ dwt_vec = _mm_load_si128((const __m128i *)(dwt_buffer + index)); hist_vec = _mm_load_si128((__m128i *)(hist_buffer + index)); diff_vec = _mm_sub_epi16(dwt_vec, hist_vec); _mm_store_si128((__m128i *)(diff_buffer + index), diff_vec); /* count */ cmp_vec = _mm_cmpeq_epi16(dwt_vec, g_vec_zerov); dwt_sum_vec = _mm_sub_epi16(dwt_sum_vec, cmp_vec); /* sub -1 or 0 */ cmp_vec = _mm_cmpeq_epi16(diff_vec, g_vec_zerov); diff_sum_vec = _mm_sub_epi16(diff_sum_vec, cmp_vec); /* sub -1 or 0 */ } /* diff for the rest of tile */ while (index < 4096) { dwt_vec = _mm_load_si128((const __m128i *)(dwt_buffer + index)); hist_vec = _mm_load_si128((__m128i *)(hist_buffer + index)); diff_vec = _mm_sub_epi16(dwt_vec, hist_vec); _mm_store_si128((__m128i *)(diff_buffer + index), diff_vec); index += 8; } /* count for the missing part */ for (index = 4096 - 88; index < 4096 - 81; index++) { if (diff_buffer[index] == 0) { ldiff_zeros++; } if (dwt_buffer[index] == 0) { ldwt_zeros++; } } ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 0); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 0); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 1); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 1); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 2); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 2); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 3); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 3); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 4); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 4); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 5); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 5); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 6); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 6); ldwt_zeros += _mm_extract_epi16(dwt_sum_vec, 7); ldiff_zeros += _mm_extract_epi16(diff_sum_vec, 7); *diff_zeros = ldiff_zeros; *dwt_zeros = ldwt_zeros; return 0; } xrdp-0.10.1/vrplayer/demuxmedia.cpp000644 001751 000000 00000007373 14652432047 017341 0ustar00metawheel000000 000000 #include #include "demuxmedia.h" DemuxMedia::DemuxMedia(QObject *parent, QQueue *videoQueue, void *channel, int stream_id) : QObject(parent) { this->channel = channel; this->stream_id = stream_id; this->vcrFlag = 0; this->elapsedTime = 0; this->la_seekPos = -1; this->isStopped = 0; this->pausedTime = 0; this->videoQueue = videoQueue; playVideo = new PlayVideo(NULL, videoQueue, &sendMutex, channel, 101, 24); playVideoThread = new QThread(this); connect(playVideoThread, SIGNAL(started()), playVideo, SLOT(play())); playVideo->moveToThread(playVideoThread); playVideoThread->start(); } void DemuxMedia::setVcrOp(int op) { vcrMutex.lock(); vcrFlag = op; vcrMutex.unlock(); if (op == VCR_STOP) { clear(); } } int DemuxMedia::clear() { sendMutex.lock(); videoQueue->clear(); sendMutex.unlock(); return 0; } void DemuxMedia::startDemuxing() { MediaPacket *mediaPkt; int is_video_frame; int rv; while (1) { vcrMutex.lock(); switch (vcrFlag) { case VCR_PLAY: vcrFlag = 0; vcrMutex.unlock(); if (pausedTime) { elapsedTime = av_gettime() - pausedTime; pausedTime = 0; } isStopped = false; continue; break; case VCR_PAUSE: vcrMutex.unlock(); if (!pausedTime) { /* save amount of video played so far */ pausedTime = av_gettime() - elapsedTime; } usleep(1000 * 100); isStopped = false; continue; break; case VCR_STOP: vcrMutex.unlock(); if (isStopped) { usleep(1000 * 100); continue; } elapsedTime = 0; pausedTime = 0; la_seekPos = -1; xrdpvr_seek_media(0, 0); isStopped = true; continue; break; default: vcrMutex.unlock(); break; } mediaPkt = new MediaPacket; rv = xrdpvr_get_frame(&mediaPkt->av_pkt, &is_video_frame, &mediaPkt->delay_in_us); if (rv < 0) { /* looks like we reached end of file */ delete mediaPkt; usleep(1000 * 100); xrdpvr_seek_media(0, 0); this->elapsedTime = 0; continue; } if (is_video_frame) { sendMutex.lock(); #if 1 videoQueue->enqueue(mediaPkt); #else send_video_pkt(channel, stream_id, mediaPkt->av_pkt); delete mediaPkt; #endif sendMutex.unlock(); } else { int frame; sendMutex.lock(); send_audio_pkt(channel, stream_id, mediaPkt->av_pkt); sendMutex.unlock(); xrdpvr_read_ack(channel, &frame); delete mediaPkt; } updateMediaPos(); if (elapsedTime == 0) { elapsedTime = av_gettime(); } /* time elapsed in 1/100th sec units since play started */ emit onElapsedtime((av_gettime() - elapsedTime) / 10000); } /* end while (1) */ } void DemuxMedia::onMediaSeek(int value) { posMutex.lock(); la_seekPos = value; posMutex.unlock(); } void DemuxMedia::updateMediaPos() { posMutex.lock(); if (la_seekPos >= 0) { xrdpvr_seek_media(la_seekPos, 0); elapsedTime = av_gettime() - la_seekPos * 1000000; la_seekPos = -1; } posMutex.unlock(); } xrdp-0.10.1/vrplayer/main.cpp000644 001751 000000 00000000360 14652432047 016130 0ustar00metawheel000000 000000 #include #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication::setGraphicsSystem(QLatin1String("native")); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } xrdp-0.10.1/vrplayer/mainwindow.ui000644 001751 000000 00000003502 14652432047 017214 0ustar00metawheel000000 000000 MainWindow 0 0 800 600 MainWindow 0 0 800 25 File Help TopToolBarArea false Open Media File Exit application Exit application About xrdp-0.10.1/vrplayer/mainwindow.cpp000644 001751 000000 00000034307 14652432047 017370 0ustar00metawheel000000 000000 #include "mainwindow.h" #include "ui_mainwindow.h" /* * TODO * o should we use tick marks in QSlider? * o check for memory leaks * o double click should make it full screen * o when opening files, pause video */ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { gotMediaOnCmdline = false; moveResizeTimer = NULL; /* connect to remote client */ interface = new OurInterface(); if (interface->oneTimeInit()) { oneTimeInitSuccess = false; /* connection to remote client failed; error msg has */ /* already been displayed so it's ok to close app now */ QTimer::singleShot(1000, this, SLOT(close())); } else { oneTimeInitSuccess = true; } remoteClientInited = false; ui->setupUi(this); acceptSliderMove = false; setupUI(); vcrFlag = 0; connect(this, SIGNAL(onGeometryChanged(int,int,int,int)), interface, SLOT(onGeometryChanged(int,int,int,int))); connect(interface, SIGNAL(onMediaDurationInSeconds(int)), this, SLOT(onMediaDurationInSeconds(int))); /* if media file is specified on cmd line, use it */ QStringList args = QApplication::arguments(); if (args.count() > 1) { if (QFile::exists(args.at(1))) { interface->setFilename(args.at(1)); filename = args.at(1); gotMediaOnCmdline = true; on_actionOpen_Media_File_triggered(); } else { QMessageBox::warning(this, "Invalid media file specified", "\nThe media file\n\n" + args.at(1) + "\n\ndoes not exist"); } } } MainWindow::~MainWindow() { delete ui; //if (moveResizeTimer) // delete moveResizeTimer; } void MainWindow::closeEvent(QCloseEvent *event) { if (oneTimeInitSuccess) { interface->deInitRemoteClient(); } else { QMessageBox::warning(this, "Closing application", "This is not an xrdp session with xrdpvr"); } event->accept(); } void MainWindow::resizeEvent(QResizeEvent *) { //if (vcrFlag != VCR_PLAY) { QRect rect; getVdoGeometry(&rect); interface->sendGeometry(rect); //return; } //interface->setVcrOp(VCR_PAUSE); //vcrFlag = VCR_PAUSE; //if (!moveResizeTimer) //{ // moveResizeTimer = new QTimer; // connect(moveResizeTimer, SIGNAL(timeout()), // this, SLOT(onMoveCompleted())); //} //lblVideo->setStyleSheet("QLabel { background-color : black; color : blue; }"); //moveResizeTimer->start(1000); } void MainWindow::moveEvent(QMoveEvent *) { //if (vcrFlag != VCR_PLAY) { QRect rect; getVdoGeometry(&rect); interface->sendGeometry(rect); //return; } //interface->setVcrOp(VCR_PAUSE); //vcrFlag = VCR_PAUSE; //if (!moveResizeTimer) //{ // moveResizeTimer = new QTimer; // connect(moveResizeTimer, SIGNAL(timeout()), // this, SLOT(onMoveCompleted())); //} //lblVideo->setStyleSheet("QLabel { background-color : black; color : blue; }"); //moveResizeTimer->start(1000); } void MainWindow::onVolSliderValueChanged(int value) { int volume; volume = (value * 0xffff) / 100; if (interface != 0) { interface->setVolume(volume); } qDebug() << "vol = " << volume; } void MainWindow::setupUI() { this->setWindowTitle("vrplayer"); /* setup area to display video */ lblVideo = new QLabel(); lblVideo->setMinimumWidth(320); lblVideo->setMinimumHeight(200); QPalette palette = lblVideo->palette(); palette.setColor(lblVideo->backgroundRole(), QColor(0x00, 0x00, 0x01, 0xff)); palette.setColor(lblVideo->foregroundRole(), QColor(0x00, 0x00, 0x01, 0xff)); lblVideo->setAutoFillBackground(true); lblVideo->setPalette(palette); hboxLayoutTop = new QHBoxLayout; hboxLayoutTop->addWidget(lblVideo); /* setup label to display current pos in media */ lblCurrentPos = new QLabel("00:00:00"); lblCurrentPos->setMinimumHeight(20); lblCurrentPos->setMaximumHeight(20); /* setup slider to seek into media */ slider = new QSlider(); slider->setOrientation(Qt::Horizontal); slider->setMinimumHeight(20); slider->setMaximumHeight(20); connect(slider, SIGNAL(actionTriggered(int)), this, SLOT(onSliderActionTriggered(int))); connect(slider, SIGNAL(valueChanged(int)), this, SLOT(onSliderValueChanged(int))); /* setup label to display media duration */ lblDuration = new QLabel("00:00:00"); lblDuration->setMinimumHeight(20); lblDuration->setMaximumHeight(20); /* add above three widgets to mid layout */ hboxLayoutMiddle = new QHBoxLayout; hboxLayoutMiddle->addWidget(lblCurrentPos); hboxLayoutMiddle->addWidget(slider); hboxLayoutMiddle->addWidget(lblDuration); /* setup play button */ btnPlay = new QPushButton("Play"); btnPlay->setMinimumHeight(40); btnPlay->setMaximumHeight(40); btnPlay->setMinimumWidth(40); btnPlay->setMaximumWidth(40); btnPlay->setCheckable(true); connect(btnPlay, SIGNAL(clicked(bool)), this, SLOT(onBtnPlayClicked(bool))); /* setup stop button */ btnStop = new QPushButton("Stop"); btnStop->setMinimumHeight(40); btnStop->setMaximumHeight(40); btnStop->setMinimumWidth(40); btnStop->setMaximumWidth(40); connect(btnStop, SIGNAL(clicked(bool)), this, SLOT(onBtnStopClicked(bool))); /* setup rewind button */ btnRewind = new QPushButton("R"); btnRewind->setMinimumHeight(40); btnRewind->setMaximumHeight(40); btnRewind->setMinimumWidth(40); btnRewind->setMaximumWidth(40); connect(btnRewind, SIGNAL(clicked(bool)), this, SLOT(onBtnRewindClicked(bool))); /* setup volume control slider */ volSlider = new QSlider(); volSlider->setOrientation(Qt::Horizontal); volSlider->setMinimumWidth(100); volSlider->setMaximumWidth(100); volSlider->setMinimum(0); volSlider->setMaximum(100); volSlider->setValue(20); volSlider->setTickPosition(QSlider::TicksAbove); volSlider->setTickInterval(10); connect(volSlider, SIGNAL(valueChanged(int)), this, SLOT(onVolSliderValueChanged(int))); /* add buttons to bottom panel */ hboxLayoutBottom = new QHBoxLayout; hboxLayoutBottom->addWidget(btnPlay); hboxLayoutBottom->addWidget(btnStop); hboxLayoutBottom->addWidget(volSlider); //hboxLayoutBottom->addWidget(btnRewind); hboxLayoutBottom->addStretch(); /* add all three layouts to one vertical layout */ vboxLayout = new QVBoxLayout; vboxLayout->addLayout(hboxLayoutTop); vboxLayout->addLayout(hboxLayoutMiddle); vboxLayout->addLayout(hboxLayoutBottom); /* add all of them to central widget */ window = new QWidget; window->setLayout(vboxLayout); this->setCentralWidget(window); } void MainWindow::openMediaFile() { /* TODO take last stored value from QSettings */ if (filename.length() == 0) { /* no previous selection - open user's home folder TODO */ // TODO filename = QFileDialog::getOpenFileName(this, "Select Media File", "/"); //filename = QFileDialog::getOpenFileName(this, "Select Media File", // QDir::currentPath()); filename = QFileDialog::getOpenFileName(this, "Select Media File", QDir::currentPath(), "Media *.mov *.mp4 *.mkv (*.mov *.mp4 *.mkv)"); } else { /* show last selected file */ filename = QFileDialog::getOpenFileName(this, "Select Media File", filename); } interface->setFilename(filename); } void MainWindow::getVdoGeometry(QRect *rect) { int x; int y; int width; int height; QPoint pt; pt = lblVideo->mapToGlobal(QPoint(0, 0)); x = pt.x(); y = pt.y(); width = lblVideo->width(); height = lblVideo->height(); rect->setX(x); rect->setY(y); rect->setWidth(width); rect->setHeight(height); } void MainWindow::clearDisplay() { /* TODO: this needs to be set after video actually stops * a few frames come after this */ lblVideo->update(); } /******************************************************************************* * actions and slots go here * ******************************************************************************/ void MainWindow::on_actionOpen_Media_File_triggered() { if (vcrFlag != 0) { onBtnStopClicked(true); } /* if media was specified on cmd line, use it just once */ if (gotMediaOnCmdline) { gotMediaOnCmdline = false; } else { openMediaFile(); } if (filename.length() == 0) { /* cancel btn was clicked */ return; } if (remoteClientInited) { remoteClientInited = false; interface->deInitRemoteClient(); if (interface->initRemoteClient() != 0) { QMessageBox::question(this, "vrplayer", "Unsupported codec", QMessageBox::Ok); return; } } else { if (interface->initRemoteClient() != 0) { QMessageBox::question(this, "vrplayer", "Unsupported codec", QMessageBox::Ok); return; } } demuxMedia = interface->getDemuxMediaInstance(); if (demuxMedia) { connect(demuxMedia, SIGNAL(onElapsedtime(int)), this, SLOT(onElapsedTime(int))); } remoteClientInited = true; interface->playMedia(); //if (vcrFlag != 0) { interface->setVcrOp(VCR_PLAY); btnPlay->setText("Pause"); vcrFlag = VCR_PLAY; } } void MainWindow::on_actionExit_triggered() { clearDisplay(); this->close(); } void MainWindow::onBtnPlayClicked(bool) { if (vcrFlag == 0) { /* first time play button3 has been clicked */ on_actionOpen_Media_File_triggered(); btnPlay->setText("Pause"); vcrFlag = VCR_PLAY; } else if (vcrFlag == VCR_PLAY) { /* btn clicked while in play mode - enter pause mode */ btnPlay->setText("Play"); interface->setVcrOp(VCR_PAUSE); vcrFlag = VCR_PAUSE; } else if (vcrFlag == VCR_PAUSE) { /* btn clicked while in pause mode - enter play mode */ btnPlay->setText("Pause"); interface->setVcrOp(VCR_PLAY); vcrFlag = VCR_PLAY; } else if (vcrFlag == VCR_STOP) { /* btn clicked while stopped - enter play mode */ btnPlay->setText("Play"); interface->setVcrOp(VCR_PLAY); vcrFlag = VCR_PLAY; } } void MainWindow::onBtnRewindClicked(bool) { //if (playVideo) // playVideo->onMediaSeek(0); } void MainWindow::onBtnStopClicked(bool) { vcrFlag = VCR_STOP; btnPlay->setText("Play"); interface->setVcrOp(VCR_STOP); /* reset slider */ slider->setSliderPosition(0); lblCurrentPos->setText("00:00:00"); /* clear screen by filling it with black */ usleep(500 * 1000); clearDisplay(); btnPlay->setChecked(false); } void MainWindow::onMediaDurationInSeconds(int duration) { int hours = 0; int minutes = 0; int secs = 0; char buf[20]; /* setup progress bar */ slider->setMinimum(0); slider->setMaximum(duration * 100); /* in hundredth of a sec */ slider->setValue(0); slider->setSliderPosition(0); lblCurrentPos->setText("00:00:00"); //qDebug() << "media_duration=" << duration << " in hundredth of a sec:" << duration * 100; /* convert from seconds to hours:minutes:seconds */ hours = duration / 3600; if (hours) duration -= (hours * 3600); minutes = duration / 60; if (minutes) duration -= minutes * 60; secs = duration; sprintf(buf, "%.2d:%.2d:%.2d", hours, minutes, secs); lblDuration->setText(QString(buf)); } /** * time elapsed in 1/100th sec units since play started ******************************************************************************/ void MainWindow::onElapsedTime(int val) { int hours = 0; int minutes = 0; int secs = 0; int duration = 0; char buf[20]; if (vcrFlag == VCR_STOP) return; /* if slider bar is down, do not update */ if (slider->isSliderDown()) return; /* update progress bar */ if (val >= slider->maximum()) val = 0; slider->setSliderPosition(val); /* convert from seconds to hours:minutes:seconds */ duration = val / 100; hours = duration / 3600; if (hours) duration -= (hours * 3600); minutes = duration / 60; if (minutes) duration -= minutes * 60; secs = duration; /* update current position in progress bar */ sprintf(buf, "%.2d:%.2d:%.2d", hours, minutes, secs); lblCurrentPos->setText(QString(buf)); } void MainWindow::onSliderValueChanged(int value) { if (acceptSliderMove) { acceptSliderMove = false; if (demuxMedia != NULL) { demuxMedia->onMediaSeek(value / 100); } } } void MainWindow::onSliderActionTriggered(int action) { switch (action) { case QAbstractSlider::SliderPageStepAdd: acceptSliderMove = true; break; case QAbstractSlider::SliderPageStepSub: acceptSliderMove = true; break; case QAbstractSlider::SliderMove: if (slider->isSliderDown()) acceptSliderMove = true; break; } } // not called void MainWindow::onMoveCompleted() { QRect rect; getVdoGeometry(&rect); interface->sendGeometry(rect); interface->setVcrOp(VCR_PLAY); vcrFlag = VCR_PLAY; //moveResizeTimer->stop(); } void MainWindow::on_actionAbout_triggered() { #if 0 QMessageBox msgBox; msgBox.setText("VRPlayer version 1.2"); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); msgBox.exec(); #else DlgAbout *dlgabt = new DlgAbout(this); dlgabt->exec(); #endif } xrdp-0.10.1/vrplayer/README.txt000644 001751 000000 00000001220 14652432047 016172 0ustar00metawheel000000 000000 A QT based media player that runs on a RDP server and redirects audio/video to the client where it is decoded and rendered locally Required packages to build vrplayer: ------------------------------------ libqt4-gui qt4-dev-tools libavutil-dev libavformat-dev to build vrplayer ----------------- cd ../xrdpvr make cd .. qmake make To run vrplayer --------------- include xrdpapi/.libs and xrdpvr/.libs in your LD_LIBRARY_PATH Example: -------- export LD_LIBRARY_PATH=../xrdpapi/.libs:../xrdpvr/.libs run vrplayer inside the xfreerdp session this is how we run xfreerdp: ---------------------------- ./xfreerdp --sec rdp --plugin xrdpvr 192.168.2.149 xrdp-0.10.1/vrplayer/ourinterface.h000644 001751 000000 00000003323 14652432047 017341 0ustar00metawheel000000 000000 #ifndef OURINTERFACE_H #define OURINTERFACE_H #ifdef __cplusplus #define __STDC_CONSTANT_MACROS #ifdef _STDINT_H #undef _STDINT_H #endif #include #endif #include #include #include // LK_TODO #include "xrdpvr.h" #include "xrdpapi.h" #include "demuxmedia.h" #include "playvideo.h" /* ffmpeg related stuff */ extern "C" { #include #include } class OurInterface : public QObject { Q_OBJECT public: explicit OurInterface(QObject *parent = 0); /* public methods */ int oneTimeInit(); void oneTimeDeinit(); int initRemoteClient(); void deInitRemoteClient(); int sendGeometry(QRect rect); void setFilename(QString filename); void playMedia(); //PlayVideo *getPlayVideoInstance(); DemuxMedia *getDemuxMediaInstance(); void setVcrOp(int op); int setVolume(int volume); public slots: void onGeometryChanged(int x, int y, int width, int height); signals: void on_ErrorMsg(QString title, QString msg); void onMediaDurationInSeconds(int duration); private: /* private stuff */ QQueue videoQueue; DemuxMedia *demuxMedia; QThread *demuxMediaThread; //PlayVideo *playVideo; QString filename; void *channel; int stream_id; QRect savedGeometry; /* private methods */ int openVirtualChannel(); int closeVirtualChannel(); int sendMetadataFile(); int sendVideoFormat(); int sendAudioFormat(); }; #endif // INTERFACE_H xrdp-0.10.1/vrplayer/playaudio.h000644 001751 000000 00000002341 14652432047 016641 0ustar00metawheel000000 000000 #ifndef PLAYAUDIO_H #define PLAYAUDIO_H #ifdef __cplusplus #define __STDC_CONSTANT_MACROS #ifdef _STDINT_H #undef _STDINT_H #endif #include #endif #include #include #include #include "mediapacket.h" #include "xrdpvr.h" /* ffmpeg related stuff */ extern "C" { #include #include } #define VCR_PLAY 1 #define VCR_PAUSE 2 #define VCR_STOP 3 #define VCR_REWIND 4 #define VCR_POWER_OFF 5 class PlayAudio : public QObject { Q_OBJECT public: explicit PlayAudio(QObject *parent = 0, QQueue *audioQueue = 0, QMutex *sendMutex = 0, void *channel = 0, int stream_id = 101); void setVcrOp(int op); public slots: // cppcheck-suppress unknownMacro void play(); private: QQueue *audioQueue; QMutex *sendMutex; QMutex vcrMutex; int vcrFlag; void *channel; int stream_id; void clearAudioQ(); }; #endif // PLAYAUDIO_H xrdp-0.10.1/vrplayer/demuxmedia.h000644 001751 000000 00000003264 14652432047 017001 0ustar00metawheel000000 000000 #ifndef DEMUXMEDIA_H #define DEMUXMEDIA_H #ifdef __cplusplus #define __STDC_CONSTANT_MACROS #ifdef _STDINT_H #undef _STDINT_H #endif #include #endif #include #include #include #include #include #include "mediapacket.h" #include "playaudio.h" #include "playvideo.h" /* ffmpeg related stuff */ extern "C" { #include #include } #define VCR_PLAY 1 #define VCR_PAUSE 2 #define VCR_STOP 3 #define VCR_REWIND 4 #define VCR_POWER_OFF 5 class DemuxMedia : public QObject { Q_OBJECT public: explicit DemuxMedia(QObject *parent = 0, QQueue *videoQueue = 0, void *channel = 0, int stream_id = 101); void setVcrOp(int op); int clear(); public slots: void startDemuxing(); void onMediaSeek(int value); private: QMutex vcrMutex; int vcrFlag; void *channel; int stream_id; QMutex sendMutex; QMutex posMutex; int64_t elapsedTime; /* elapsed time in usecs since play started */ int64_t pausedTime; /* time at which stream was paused */ int64_t la_seekPos; /* locked access; must hold posMutex */ bool isStopped; QQueue *videoQueue; PlayVideo *playVideo; QThread *playVideoThread; void updateMediaPos(); signals: void onMediaRestarted(); signals: void onElapsedtime(int val); /* in hundredth of a sec */ }; #endif // DEMUXMEDIA_H xrdp-0.10.1/vrplayer/dlgabout.ui000644 001751 000000 00000001641 14652432047 016643 0ustar00metawheel000000 000000 DlgAbout 0 0 288 168 Dialog 70 60 151 17 VRPlayer v1.6 180 120 94 27 OK xrdp-0.10.1/vrplayer/mediapacket.cpp000644 001751 000000 00000000153 14652432047 017453 0ustar00metawheel000000 000000 #include "mediapacket.h" MediaPacket::MediaPacket() { av_pkt = 0; delay_in_us = 0; seq = 0; } xrdp-0.10.1/vrplayer/dlgabout.h000644 001751 000000 00000000562 14652432047 016456 0ustar00metawheel000000 000000 #ifndef DLGABOUT_H #define DLGABOUT_H #include namespace Ui { class DlgAbout; } class DlgAbout : public QDialog { Q_OBJECT public: explicit DlgAbout(QWidget *parent = 0); ~DlgAbout(); private: Ui::DlgAbout *ui; private slots: // cppcheck-suppress unknownMacro void onOk(); }; #endif // DLGABOUT_H xrdp-0.10.1/vrplayer/mainwindow.h000644 001751 000000 00000006101 14652432047 017024 0ustar00metawheel000000 000000 #ifndef MAINWINDOW_H #define MAINWINDOW_H #ifdef __cplusplus #define __STDC_CONSTANT_MACROS #ifdef _STDINT_H #undef _STDINT_H #endif #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xrdpapi.h" #include "xrdpvr.h" #include "decoder.h" #include "ourinterface.h" #include "playvideo.h" #include "dlgabout.h" /* ffmpeg related stuff */ extern "C" { #include #include } #define VCR_PLAY 1 #define VCR_PAUSE 2 #define VCR_STOP 3 #define VCR_REWIND 4 #define VCR_POWER_OFF 5 namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); signals: void onGeometryChanged(int x, int y, int width, int height); public slots: void onSliderValueChanged(int value); private slots: void on_actionOpen_Media_File_triggered(); void on_actionExit_triggered(); void onBtnPlayClicked(bool flag); void onBtnRewindClicked(bool flag); void onBtnStopClicked(bool flag); void onMediaDurationInSeconds(int duration); void onElapsedTime(int secs); void onSliderActionTriggered(int value); void onMoveCompleted(); void on_actionAbout_triggered(); void onVolSliderValueChanged(int value); protected: void resizeEvent(QResizeEvent *e); void closeEvent(QCloseEvent *e); void moveEvent(QMoveEvent *e); private: Ui::MainWindow *ui; /* for UI */ QLabel *lblCurrentPos; QLabel *lblDuration; QLabel *lblVideo; QHBoxLayout *hboxLayoutTop; QHBoxLayout *hboxLayoutMiddle; QHBoxLayout *hboxLayoutBottom; QVBoxLayout *vboxLayout; QPushButton *btnPlay; QPushButton *btnStop; QPushButton *btnRewind; QSlider *slider; QSlider *volSlider; QWidget *window; bool acceptSliderMove; QTimer *moveResizeTimer; /* private stuff */ OurInterface *interface; //PlayVideo *playVideo; DemuxMedia *demuxMedia; QString filename; bool oneTimeInitSuccess; bool remoteClientInited; void *channel; int stream_id; int64_t elapsedTime; /* elapsed time in usecs since play started */ int vcrFlag; bool gotMediaOnCmdline; /* private methods */ void setupUI(); void openMediaFile(); void getVdoGeometry(QRect *rect); void clearDisplay(); }; #endif // MAINWINDOW_H xrdp-0.10.1/vrplayer/playaudio.cpp000644 001751 000000 00000003453 14652432047 017201 0ustar00metawheel000000 000000 #include #include "playaudio.h" #include PlayAudio::PlayAudio(QObject *parent, QQueue *audioQueue, QMutex *sendMutex, void *channel, int stream_id) : QObject(parent) { this->audioQueue = audioQueue; this->sendMutex = sendMutex; this->channel = channel; this->stream_id = stream_id; this->vcrFlag = 0; } void PlayAudio::play() { MediaPacket *pkt; while (1) { vcrMutex.lock(); switch (vcrFlag) { case VCR_PLAY: vcrFlag = 0; vcrMutex.unlock(); continue; break; case VCR_PAUSE: vcrMutex.unlock(); usleep(1000 * 100); continue; break; case VCR_STOP: vcrMutex.unlock(); clearAudioQ(); usleep(1000 * 100); continue; break; default: vcrMutex.unlock(); goto label1; break; } label1: printf("audio\n"); if (audioQueue->isEmpty()) { qDebug() << "PlayAudio::play: GOT EMPTY"; usleep(1000 * 10); continue; } printf(""); pkt = audioQueue->dequeue(); sendMutex->lock(); send_audio_pkt(channel, stream_id, pkt->av_pkt); sendMutex->unlock(); usleep(pkt->delay_in_us); delete pkt; } } void PlayAudio::setVcrOp(int op) { vcrMutex.lock(); this->vcrFlag = op; vcrMutex.unlock(); } void PlayAudio::clearAudioQ() { MediaPacket *pkt; while (!audioQueue->isEmpty()) { pkt = audioQueue->dequeue(); av_free_packet((AVPacket *) pkt->av_pkt); delete pkt; } } xrdp-0.10.1/vrplayer/decoder.h000644 001751 000000 00000001345 14652432047 016262 0ustar00metawheel000000 000000 #ifndef DECODER_H #define DECODER_H #include #include #include #ifdef __cplusplus #define __STDC_CONSTANT_MACROS #ifdef _STDINT_H #undef _STDINT_H #endif #include #endif #include #include #include /* LK_TODO is this required? */ class Decoder : public QObject { Q_OBJECT public: explicit Decoder(QObject *parent = 0); int init(QString filename); //int deinit(); //int setWindow(QRectangle rect); private: void *channel; QRect mainWindowGeometry; signals: public slots: // cppcheck-suppress unknownMacro void onGeometryChanged(QRect *geometry); }; #endif // DECODER_H xrdp-0.10.1/vrplayer/playvideo.cpp000644 001751 000000 00000002716 14652432047 017207 0ustar00metawheel000000 000000 #include #include #include "playvideo.h" #include PlayVideo::PlayVideo(QObject *parent, QQueue *videoQueue, QMutex *sendMutex, void *channel, int stream_id, int fps) : QObject(parent) { this->videoQueue = videoQueue; this->channel = channel; this->sendMutex = sendMutex; this->stream_id = stream_id; this->fps = fps; } /** ******************************************************************************/ static int get_mstime(void) { struct timeval tp; gettimeofday(&tp, 0); return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); } void PlayVideo::play() { MediaPacket *pkt; int now_time; int sleep_time; int last_display_time; last_display_time = 0; while (1) { sendMutex->lock(); if (videoQueue->isEmpty()) { sendMutex->unlock(); usleep(10 * 1000); continue; } pkt = videoQueue->dequeue(); send_video_pkt(channel, stream_id, pkt->av_pkt); sendMutex->unlock(); now_time = get_mstime(); sleep_time = now_time - last_display_time; if (sleep_time > (1000 / fps)) { sleep_time = (1000 / fps); } if (sleep_time > 0) { usleep(sleep_time * 1000); } last_display_time = now_time; delete pkt; } } xrdp-0.10.1/vrplayer/vrplayer.pro000644 001751 000000 00000001465 14652432047 017075 0ustar00metawheel000000 000000 #------------------------------------------------- # # Project created by QtCreator 2012-11-13T11:52:36 # #------------------------------------------------- QT += core gui TARGET = vrplayer TEMPLATE = app SOURCES += main.cpp\ playvideo.cpp \ mainwindow.cpp \ mediapacket.cpp \ playaudio.cpp \ demuxmedia.cpp \ ourinterface.cpp \ dlgabout.cpp HEADERS += mainwindow.h \ mediapacket.h \ playvideo.h \ playaudio.h \ demuxmedia.h \ ourinterface.h \ dlgabout.h FORMS += mainwindow.ui \ dlgabout.ui # added by LK INCLUDEPATH += ../xrdpvr INCLUDEPATH += ../xrdpapi LIBS += -Wl,-rpath LIBS += -Wl,/usr/local/lib/xrdp LIBS += -L../xrdpvr/.libs -lxrdpvr LIBS += -L../xrdpapi/.libs -lxrdpapi LIBS += -L/usr/lib/x86_64-linux-gnu -lavformat -lavcodec -lavutil xrdp-0.10.1/vrplayer/decoder.cpp000644 001751 000000 00000003675 14652432047 016625 0ustar00metawheel000000 000000 #include "decoder.h" Decoder::Decoder(QObject *parent) : QObject(parent) { channel = NULL; } /* * inititialize the decoder * * @return 0 on success, -1 on failure *****************************************************************************/ int Decoder::init(QString filename) { printf("Decoder::init\n"); if (channel) return -1; /* open a virtual channel and connect to remote client */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "xrdpvr", 0); if (channel == NULL) { qDebug() << "WTSVirtualChannelOpenEx() failed\n"; return -1; } /* initialize the player */ if (xrdpvr_init_player(channel, 101, filename.toAscii().data())) { fprintf(stderr, "failed to initialize the player\n"); return -1; } #if 1 sleep(1); qDebug() << "sleeping 1"; xrdpvr_set_geometry(channel, 101, mainWindowGeometry.x(), mainWindowGeometry.y(), mainWindowGeometry.width(), mainWindowGeometry.height()); qDebug() << "set geometry to:" << mainWindowGeometry.x() << "" << mainWindowGeometry.y() << "" << mainWindowGeometry.width() << "" << mainWindowGeometry.height(); #endif /* send compressed media data to client; client will decompress */ /* the media and play it locally */ xrdpvr_play_media(channel, 101, filename.toAscii().data()); /* perform clean up */ xrdpvr_deinit_player(channel, 101); WTSVirtualChannelClose(channel); return 0; } void Decoder::onGeometryChanged(QRect *g) { #if 1 mainWindowGeometry.setX(g->x()); mainWindowGeometry.setY(g->y()); mainWindowGeometry.setWidth(g->width()); mainWindowGeometry.setHeight(g->height()); #else if (!channel) return; xrdpvr_set_geometry(channel, 101, g->x(), g->y(), g->width(), g->height()); qDebug() << "sent geometry"; #endif } xrdp-0.10.1/vrplayer/playvideo.h000644 001751 000000 00000003416 14652432047 016652 0ustar00metawheel000000 000000 #ifndef PLAYVIDEO_H #define PLAYVIDEO_H #ifdef __cplusplus #define __STDC_CONSTANT_MACROS #ifdef _STDINT_H #undef _STDINT_H #endif #include #endif #include #include #include #include "mediapacket.h" #include "xrdpvr.h" #include "xrdpapi.h" /* ffmpeg related stuff */ extern "C" { #include #include } #define VCR_PLAY 1 #define VCR_PAUSE 2 #define VCR_STOP 3 #define VCR_REWIND 4 #define VCR_POWER_OFF 5 class PlayVideo : public QObject { Q_OBJECT public: explicit PlayVideo(QObject *parent = 0, QQueue *videoQueue = 0, QMutex *sendMutex = 0, void *channel = 0, int stream_id = 101, int fps = 24); //void onMediaSeek(int value); //void setVcrOp(int op); //void onMediaRestarted(); public slots: // cppcheck-suppress unknownMacro void play(); //signals: // void onElapsedtime(int val); /* in hundredth of a sec */ private: QQueue *videoQueue; // int vcrFlag; // QMutex vcrMutex; QMutex *sendMutex; // QMutex posMutex; // int64_t la_seekPos; /* locked access; must hold posMutex */ void *channel; int stream_id; int fps; // int64_t elapsedTime; /* elapsed time in usecs since play started */ // int64_t pausedTime; /* time at which stream was paused */ // bool isStopped; // void updateMediaPos(); // void clearVideoQ(); }; #endif // PLAYVIDEO_H xrdp-0.10.1/vrplayer/mediapacket.h000644 001751 000000 00000000305 14652432047 017117 0ustar00metawheel000000 000000 #ifndef MEDIAPACKET_H #define MEDIAPACKET_H class MediaPacket { public: MediaPacket(); void *av_pkt; int delay_in_us; int seq; }; #endif // MEDIAPACKET_H xrdp-0.10.1/vrplayer/dlgabout.cpp000644 001751 000000 00000000471 14652432047 017010 0ustar00metawheel000000 000000 #include "dlgabout.h" #include "ui_dlgabout.h" DlgAbout::DlgAbout(QWidget *parent) : QDialog(parent), ui(new Ui::DlgAbout) { ui->setupUi(this); connect(ui->okButton, SIGNAL(clicked()), this, SLOT(onOk())); } DlgAbout::~DlgAbout() { delete ui; } void DlgAbout::onOk() { this->done(0); } xrdp-0.10.1/vrplayer/ourinterface.cpp000644 001751 000000 00000013514 14652432047 017677 0ustar00metawheel000000 000000 #include "ourinterface.h" OurInterface::OurInterface(QObject *parent) : QObject(parent) { channel = NULL; savedGeometry.setX(0); savedGeometry.setY(0); savedGeometry.setWidth(0); savedGeometry.setHeight(0); stream_id = 101; demuxMedia = 0; demuxMediaThread = NULL; //elapsedTime = 0; } int OurInterface::oneTimeInit() { /* connect to remote client */ if (openVirtualChannel()) return -1; /* register all formats/codecs */ av_register_all(); return 0; } void OurInterface::oneTimeDeinit() { /* clean up resources */ closeVirtualChannel(); } /* returns error */ int OurInterface::initRemoteClient() { int64_t start_time; int64_t duration; //elapsedTime = 0; if (sendMetadataFile()) return 1; if (sendVideoFormat()) return 1; if (sendAudioFormat()) return 1; if (sendGeometry(savedGeometry)) return 1; if (xrdpvr_play_media(channel, 101, filename.toAscii().data()) != 0) { return 1; } xrdpvr_get_media_duration(&start_time, &duration); //qDebug() << "ourInterface:initRemoteClient: emit onMediaDurationInSecs: dur=" << duration; emit onMediaDurationInSeconds(duration); /* LK_TODO this needs to be undone in deinitRemoteClient() */ if (!demuxMedia) { demuxMedia = new DemuxMedia(NULL, &videoQueue, channel, stream_id); demuxMediaThread = new QThread(this); connect(demuxMediaThread, SIGNAL(started()), demuxMedia, SLOT(startDemuxing())); demuxMedia->moveToThread(demuxMediaThread); //playVideo = demuxMedia->getPlayVideoInstance(); } return 0; } void OurInterface::deInitRemoteClient() { /* perform clean up */ xrdpvr_deinit_player(channel, 101); } /** * @brief Open a virtual connection to remote client * * @return 0 on success, -1 on failure ******************************************************************************/ int OurInterface::openVirtualChannel() { /* is channel already open? */ if (channel) return -1; printf("OurInterface::openVirtualChannel:\n"); /* open a virtual channel and connect to remote client */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "xrdpvr", 0); if (channel == NULL) { emit on_ErrorMsg("Connection failure", "Error connecting to remote client. Application will close now"); return -1; } return 0; } int OurInterface::closeVirtualChannel() { /* channel must be opened first */ if (!channel) return -1; WTSVirtualChannelClose(channel); return 0; } /** * @brief this is a temp hack while we figure out how to set up the right * context for avcodec_decode_video2() on the server side; the workaround * is to send the first 1MB of the media file to the server end which * reads this file and sets up its context * * @return 0 on success, -1 on failure ******************************************************************************/ int OurInterface::sendMetadataFile() { if (xrdpvr_init_player(channel, 101, filename.toAscii().data())) { fprintf(stderr, "failed to initialize the player\n"); return -1; } #if 0 if (xrdpvr_create_metadata_file(channel, filename.toAscii().data())) { emit on_ErrorMsg("I/O Error", "An error occurred while sending data to remote client"); return -1; } #endif return 0; } int OurInterface::sendVideoFormat() { #if 0 if (xrdpvr_set_video_format(channel, stream_id)) { emit on_ErrorMsg("I/O Error", "Error sending video format to remote client"); return -1; } #endif return 0; } int OurInterface::sendAudioFormat() { #if 0 if (xrdpvr_set_audio_format(channel, stream_id)) { emit on_ErrorMsg("I/O Error", "Error sending audio format to remote client"); return -1; } #endif return 0; } int OurInterface::sendGeometry(QRect rect) { int rv; savedGeometry.setX(rect.x()); savedGeometry.setY(rect.y()); savedGeometry.setWidth(rect.width()); savedGeometry.setHeight(rect.height()); rv = xrdpvr_set_geometry(channel, stream_id, savedGeometry.x(), savedGeometry.y(), savedGeometry.width(), savedGeometry.height()); if (rv) { emit on_ErrorMsg("I/O Error", "Error sending screen geometry to remote client"); return -1; } return 0; } void OurInterface::onGeometryChanged(int x, int y, int width, int height) { savedGeometry.setX(x); savedGeometry.setY(y); savedGeometry.setWidth(width); savedGeometry.setHeight(height); #if 0 qDebug() << "OurInterface:signal" << "" << savedGeometry.x() << "" << savedGeometry.y() << "" << savedGeometry.width() << "" << savedGeometry.height(); #endif if (channel) { xrdpvr_set_geometry(channel, 101, savedGeometry.x(), savedGeometry.y(), savedGeometry.width(), savedGeometry.height()); } } void OurInterface::setFilename(QString filename) { this->filename = filename; } void OurInterface::playMedia() { demuxMediaThread->start(); } //PlayVideo * OurInterface::getPlayVideoInstance() //{ // return this->playVideo; //} DemuxMedia * OurInterface::getDemuxMediaInstance() { return this->demuxMedia; } void OurInterface::setVcrOp(int op) { if (demuxMedia) demuxMedia->setVcrOp(op); } int OurInterface::setVolume(int volume) { printf("OurInterface::setVolume\n"); if (xrdpvr_set_volume(channel, volume)) { emit on_ErrorMsg("I/O Error", "Error sending volume to remote client"); return -1; } return 0; } xrdp-0.10.1/instfiles/km-00000407.ini000644 001751 000000 00000025277 14652432047 016652 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=223:223 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=122:122 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=252:252 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=65106:94 Key50=65505:0 Key51=35:35 Key52=121:121 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=167:167 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=90:90 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=220:220 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=176:176 Key50=65505:0 Key51=39:39 Key52=89:89 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=188:188 Key14=189:189 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=65111:168 Key35=126:126 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=16777599:383 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65120:0 Key45=930:312 Key46=435:322 Key47=65113:733 Key48=65106:94 Key49=16785458:8242 Key50=65505:0 Key51=2769:8217 Key52=187:187 Key53=171:171 Key54=162:162 Key55=2814:8222 Key56=2770:8220 Key57=2771:8221 Key58=181:181 Key59=183:183 Key60=16785446:8230 Key61=2730:8211 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=2755:8539 Key12=163:163 Key13=164:164 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=176:176 Key20=191:191 Key21=65116:731 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=8364:8364 Key27=174:174 Key28=940:358 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=216:216 Key33=222:222 Key34=65112:176 Key35=175:175 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=16785054:7838 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65110:729 Key45=38:38 Key46=419:321 Key47=65120:0 Key48=65114:711 Key49=16785459:8243 Key50=65505:0 Key51=65109:728 Key52=16785466:8250 Key53=16785465:8249 Key54=169:169 Key55=2813:8218 Key56=2768:8216 Key57=2769:8217 Key58=186:186 Key59=215:215 Key60=247:247 Key61=2729:8212 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=16785054:7838 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=90:90 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=220:220 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=65106:94 Key50=65505:0 Key51=35:35 Key52=89:89 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=167:167 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=122:122 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=252:252 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=176:176 Key50=65505:0 Key51=39:39 Key52=121:121 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000809.ini000644 001751 000000 00000034400 14652432047 016644 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=35:35 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=163:163 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=58:58 Key48=64:64 Key49=172:172 Key50=65505:0 Key51=126:126 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=8364:8364 Key14=189:189 Key15=190:190 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=101:101 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65121:0 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=65106:94 Key49=124:124 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=2755:8539 Key12=163:163 Key13=188:188 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=176:176 Key20=191:191 Key21=65116:731 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=69:69 Key27=174:174 Key28=940:358 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=216:216 Key33=222:222 Key34=65112:176 Key35=65108:175 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=167:167 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65122:0 Key45=38:38 Key46=419:321 Key47=65113:733 Key48=65114:711 Key49=124:124 Key50=65505:0 Key51=65109:728 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=78:78 Key58=186:186 Key59=215:215 Key60=247:247 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=35:35 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslockaltgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=8364:8364 Key14=189:189 Key15=190:190 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=419:321 Key26=69:69 Key27=182:182 Key28=940:358 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=216:216 Key33=222:222 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=223:223 Key40=208:208 Key41=464:272 Key42=957:330 Key43=673:294 Key44=65121:0 Key45=930:312 Key46=419:321 Key47=65105:180 Key48=65106:94 Key49=124:124 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=78:78 Key58=924:0 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=163:163 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=58:58 Key48=64:64 Key49=172:172 Key50=65505:0 Key51=126:126 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslockaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=2755:8539 Key12=163:163 Key13=188:188 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=176:176 Key20=191:191 Key21=65116:731 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=435:322 Key26=101:101 Key27=174:174 Key28=956:359 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=248:248 Key33=254:254 Key34=65112:176 Key35=65108:175 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=167:167 Key40=240:240 Key41=170:170 Key42=959:331 Key43=689:295 Key44=65122:0 Key45=38:38 Key46=435:322 Key47=65113:733 Key48=65114:711 Key49=124:124 Key50=65505:0 Key51=65109:728 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=110:110 Key58=186:186 Key59=215:215 Key60=247:247 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/xrdp-sesman.service.in000644 001751 000000 00000000607 14652432047 021070 0ustar00metawheel000000 000000 [Unit] Description=xrdp session manager Documentation=man:xrdp-sesman(8) man:sesman.ini(5) After=network.target StopWhenUnneeded=true BindsTo=xrdp.service [Service] Type=exec EnvironmentFile=-@sysconfdir@/sysconfig/xrdp EnvironmentFile=-@sysconfdir@/default/xrdp ExecStart=@sbindir@/xrdp-sesman $SESMAN_OPTIONS --nodaemon ExecReload=kill -HUP $MAINPID [Install] WantedBy=multi-user.target xrdp-0.10.1/instfiles/km-00000409.ini000644 001751 000000 00000024662 14652432047 016651 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65032:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65032:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65032:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000807.ini000644 001751 000000 00000020762 14652432047 016650 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=65106:94 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=122:122 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=252:252 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=167:167 Key50=65505:0 Key51=36:36 Key52=121:121 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=43:43 Key11=34:34 Key12=42:42 Key13=231:231 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=90:90 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=232:232 Key35=33:33 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=233:233 Key48=224:224 Key49=176:176 Key50=65505:0 Key51=163:163 Key52=89:89 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=35:35 Key13=188:188 Key14=189:189 Key15=172:172 Key16=166:166 Key17=162:162 Key18=93:93 Key19=125:125 Key20=65105:180 Key21=65107:126 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=123:123 Key49=172:172 Key50=65505:0 Key51=125:125 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=0:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=65106:94 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=90:90 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=220:220 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=167:167 Key50=65505:0 Key51=36:36 Key52=89:89 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=43:43 Key11=34:34 Key12=42:42 Key13=199:199 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=122:122 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=200:200 Key35=33:33 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=201:201 Key48=192:192 Key49=176:176 Key50=65505:0 Key51=163:163 Key52=121:121 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/Makefile.am000644 001751 000000 00000003551 14652432047 016675 0ustar00metawheel000000 000000 EXTRA_DIST = \ keymap-names.txt \ xrdp-sesman.service.in \ xrdp.service.in # # substitute directories in service file # CLEANFILES= \ xrdp-sesman.service \ xrdp.service SUBST_VARS = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in .in: $(subst_verbose)$(SUBST_VARS) $< > $@ # # files for all platforms # startscriptdir=$(sysconfdir)/xrdp dist_startscript_DATA = \ km-00000406.ini \ km-00000407.ini \ km-00000409.ini \ km-0000040a.ini \ km-0000040b.ini \ km-0000040c.ini \ km-00000410.ini \ km-00000411.ini \ km-00000412.ini \ km-00000414.ini \ km-00000415.ini \ km-00000416.ini \ km-00000419.ini \ km-0000041d.ini \ km-00000807.ini \ km-00000809.ini \ km-0000080a.ini \ km-0000080c.ini \ km-00000813.ini \ km-00000816.ini \ km-0000100c.ini \ km-00010409.ini \ km-19360409.ini # # platform specific files # SUBDIRS = if LINUX SUBDIRS += \ pam.d \ pulse if HAVE_SYSTEMD systemdsystemunit_DATA = \ xrdp-sesman.service \ xrdp.service else SUBDIRS += \ default \ init.d endif # HAVE_SYSTEMD endif # LINUX if FREEBSD SUBDIRS += \ pam.d \ rc.d \ pulse endif if MACOS SUBDIRS += pam.d endif # # install-data-hook for each platform # TODO: subst these directories as well as service files # if LINUX # must be tab below install-data-hook: if [ -f $(DESTDIR)$(sysconfdir)/init.d/xrdp ]; then \ sed -i 's|__BASE__|$(prefix)|' $(DESTDIR)$(sysconfdir)/init.d/xrdp; \ fi endif if FREEBSD # must be tab below install-data-hook: sed -i '' 's|%%PREFIX%%|$(prefix)|g' $(DESTDIR)$(sysconfdir)/rc.d/xrdp \ $(DESTDIR)$(sysconfdir)/rc.d/xrdp-sesman endif xrdp-0.10.1/instfiles/pam.d/000755 001751 000000 00000000000 14652432105 015627 5ustar00metawheel000000 000000 xrdp-0.10.1/instfiles/km-0000040b.ini000644 001751 000000 00000025177 14652432047 016724 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=167:167 Key50=65505:0 Key51=39:39 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=189:189 Key50=65505:0 Key51=42:42 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=64:64 Key12=163:163 Key13=36:36 Key14=8364:8364 Key15=165:165 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=177:177 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=174:174 Key28=254:254 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=5053:339 Key33=254:254 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=170:170 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65121:0 Key45=930:312 Key46=435:322 Key47=248:248 Key48=230:230 Key49=182:182 Key50=65505:0 Key51=180:180 Key52=171:171 Key53=187:187 Key54=169:169 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=65115:184 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=188:188 Key14=162:162 Key15=2757:8541 Key16=247:247 Key17=171:171 Key18=187:187 Key19=176:176 Key20=191:191 Key21=172:172 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=162:162 Key27=174:174 Key28=222:222 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=5052:338 Key33=222:222 Key34=65112:176 Key35=65114:711 Key36=65293:13 Key37=65507:0 Key38=186:186 Key39=167:167 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65122:0 Key45=38:38 Key46=419:321 Key47=216:216 Key48=198:198 Key49=190:190 Key50=65505:0 Key51=215:215 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=78:78 Key58=186:186 Key59=65116:731 Key60=65110:729 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=160:160 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=167:167 Key50=65505:0 Key51=39:39 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=189:189 Key50=65505:0 Key51=42:42 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-0000100c.ini000644 001751 000000 00000020762 14652432047 016715 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=65106:94 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=122:122 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=232:232 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=233:233 Key48=224:224 Key49=167:167 Key50=65505:0 Key51=36:36 Key52=121:121 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=43:43 Key11=34:34 Key12=42:42 Key13=231:231 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=90:90 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=252:252 Key35=33:33 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=246:246 Key48=228:228 Key49=176:176 Key50=65505:0 Key51=163:163 Key52=89:89 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=35:35 Key13=188:188 Key14=189:189 Key15=172:172 Key16=166:166 Key17=162:162 Key18=93:93 Key19=125:125 Key20=65105:180 Key21=65107:126 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=123:123 Key49=172:172 Key50=65505:0 Key51=125:125 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=0:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=65106:94 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=90:90 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=200:200 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=201:201 Key48=192:192 Key49=167:167 Key50=65505:0 Key51=36:36 Key52=89:89 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=43:43 Key11=34:34 Key12=42:42 Key13=199:199 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=122:122 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=220:220 Key35=33:33 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=214:214 Key48=196:196 Key49=176:176 Key50=65505:0 Key51=163:163 Key52=121:121 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65312:0 Key114=0:0 Key115=0:0 Key116=0:0 Key117=0:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/xrdp.service.in000644 001751 000000 00000000633 14652432047 017603 0ustar00metawheel000000 000000 [Unit] Description=xrdp daemon Documentation=man:xrdp(8) man:xrdp.ini(5) Requires=xrdp-sesman.service After=network-online.target xrdp-sesman.service [Service] Type=exec EnvironmentFile=-@sysconfdir@/sysconfig/xrdp EnvironmentFile=-@sysconfdir@/default/xrdp ExecStart=@sbindir@/xrdp $XRDP_OPTIONS --nodaemon SystemCallArchitectures=native SystemCallFilter=@system-service [Install] WantedBy=multi-user.target xrdp-0.10.1/instfiles/rc.d/000755 001751 000000 00000000000 14652432105 015456 5ustar00metawheel000000 000000 xrdp-0.10.1/instfiles/km-0000041d.ini000644 001751 000000 00000025177 14652432047 016727 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=167:167 Key50=65505:0 Key51=39:39 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=189:189 Key50=65505:0 Key51=42:42 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=64:64 Key12=163:163 Key13=36:36 Key14=8364:8364 Key15=165:165 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=177:177 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=174:174 Key28=254:254 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=5053:339 Key33=254:254 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=170:170 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65121:0 Key45=930:312 Key46=435:322 Key47=248:248 Key48=230:230 Key49=182:182 Key50=65505:0 Key51=180:180 Key52=171:171 Key53=187:187 Key54=169:169 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=65115:184 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=188:188 Key14=162:162 Key15=2757:8541 Key16=247:247 Key17=171:171 Key18=187:187 Key19=176:176 Key20=191:191 Key21=172:172 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=162:162 Key27=174:174 Key28=222:222 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=5052:338 Key33=222:222 Key34=65112:176 Key35=65114:711 Key36=65293:13 Key37=65507:0 Key38=186:186 Key39=167:167 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65122:0 Key45=38:38 Key46=419:321 Key47=216:216 Key48=198:198 Key49=190:190 Key50=65505:0 Key51=215:215 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=78:78 Key58=186:186 Key59=65116:731 Key60=65110:729 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=160:160 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=167:167 Key50=65505:0 Key51=39:39 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=189:189 Key50=65505:0 Key51=42:42 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000816.ini000644 001751 000000 00000025174 14652432047 016652 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=171:171 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=43:43 Key35=65105:180 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=231:231 Key48=186:186 Key49=92:92 Key50=65505:0 Key51=65107:126 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=187:187 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=42:42 Key35=65104:96 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=199:199 Key48=170:170 Key49=124:124 Key50=65505:0 Key51=65106:94 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=64:64 Key12=163:163 Key13=167:167 Key14=189:189 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65121:0 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=65106:94 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=2755:8539 Key12=163:163 Key13=36:36 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=176:176 Key20=191:191 Key21=65116:731 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=162:162 Key27=174:174 Key28=940:358 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=216:216 Key33=222:222 Key34=65112:176 Key35=65108:175 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=167:167 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65122:0 Key45=38:38 Key46=419:321 Key47=65113:733 Key48=65114:711 Key49=172:172 Key50=65505:0 Key51=65109:728 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=78:78 Key58=186:186 Key59=215:215 Key60=247:247 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=171:171 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=43:43 Key35=65105:180 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=199:199 Key48=186:186 Key49=92:92 Key50=65505:0 Key51=65107:126 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=187:187 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=42:42 Key35=65104:96 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=231:231 Key48=170:170 Key49=124:124 Key50=65505:0 Key51=65106:94 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000411.ini000644 001751 000000 00000034026 14652432047 016635 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=94:94 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=64:64 Key35=91:91 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=58:58 Key49=65322:0 Key50=65505:0 Key51=93:93 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65328:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=92:92 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=165:165 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=39:39 Key17=40:40 Key18=41:41 Key19=48:48 Key20=61:61 Key21=126:126 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=96:96 Key35=123:123 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=43:43 Key48=42:42 Key49=65322:0 Key50=65505:0 Key51=125:125 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=95:95 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=124:124 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=94:94 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=64:64 Key35=91:91 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=58:58 Key49=65322:0 Key50=65505:0 Key51=93:93 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65328:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=165:165 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=39:39 Key17=40:40 Key18=41:41 Key19=48:48 Key20=61:61 Key21=126:126 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=96:96 Key35=123:123 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=43:43 Key48=42:42 Key49=65322:0 Key50=65505:0 Key51=125:125 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=124:124 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=94:94 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=64:64 Key35=91:91 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=58:58 Key49=65322:0 Key50=65505:0 Key51=93:93 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65328:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=165:165 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslockaltgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=94:94 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=64:64 Key35=91:91 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=58:58 Key49=65322:0 Key50=65505:0 Key51=93:93 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65328:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=165:165 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=39:39 Key17=40:40 Key18=41:41 Key19=48:48 Key20=61:61 Key21=126:126 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=96:96 Key35=123:123 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=43:43 Key48=42:42 Key49=65322:0 Key50=65505:0 Key51=125:125 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=124:124 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslockaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=39:39 Key17=40:40 Key18=41:41 Key19=48:48 Key20=61:61 Key21=126:126 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=96:96 Key35=123:123 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=43:43 Key48=42:42 Key49=65322:0 Key50=65505:0 Key51=125:125 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=65315:0 Key130=0:0 Key131=65314:0 Key132=0:0 Key133=124:124 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000416.ini000644 001751 000000 00000021720 14652432047 016637 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65105:180 Key35=91:91 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=231:231 Key48=65107:126 Key49=39:39 Key50=65505:0 Key51=93:93 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=59:59 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65027:0 Key93=0:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=47:47 Key98=65318:0 Key99=65317:0 Key100=65315:0 Key101=65319:0 Key102=65314:0 Key103=0:0 Key104=65421:13 Key105=65508:0 Key106=65455:47 Key107=65377:0 Key108=65027:0 Key109=65290:10 Key110=65360:0 Key111=65362:0 Key112=65365:0 Key113=65361:0 Key114=65363:0 Key115=65367:0 Key116=65364:0 Key117=65366:0 Key118=65379:0 Key119=65535:127 Key120=0:0 Key121=269025042:0 Key122=269025041:0 Key123=269025043:0 Key124=269025066:0 Key125=65469:61 Key126=177:177 Key127=65299:0 Key128=269025098:0 Key129=65454:46 Key130=65329:0 Key131=65332:0 Key132=0:0 Key133=65515:0 Key134=65516:0 Key135=65383:0 Key136=65385:0 Key137=65382:0 [shift] Key8=0:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=65111:168 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65104:96 Key35=123:123 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=199:199 Key48=65106:94 Key49=34:34 Key50=65505:0 Key51=125:125 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=58:58 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65027:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=63:63 Key98=65318:0 Key99=65317:0 Key100=65315:0 Key101=65319:0 Key102=65314:0 Key103=0:0 Key104=65421:13 Key105=65508:0 Key106=65455:47 Key107=65377:0 Key108=65027:0 Key109=65290:10 Key110=65360:0 Key111=65362:0 Key112=65365:0 Key113=65361:0 Key114=65363:0 Key115=65367:0 Key116=65364:0 Key117=65366:0 Key118=65379:0 Key119=65535:127 Key120=0:0 Key121=269025042:0 Key122=269025041:0 Key123=269025043:0 Key124=269025066:0 Key125=65469:61 Key126=177:177 Key127=65299:0 Key128=269025098:0 Key129=65454:46 Key130=65329:0 Key131=65332:0 Key132=0:0 Key133=65515:0 Key134=65516:0 Key135=65383:0 Key136=65385:0 Key137=65382:0 [altgr] Key8=0:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=163:163 Key14=162:162 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=167:167 Key22=65288:8 Key23=65289:9 Key24=47:47 Key25=63:63 Key26=8364:8364 Key27=174:174 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=180:180 Key35=170:170 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=126:126 Key49=172:172 Key50=65505:0 Key51=186:186 Key52=171:171 Key53=187:187 Key54=169:169 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65027:0 Key93=0:0 Key94=186:186 Key95=65480:0 Key96=65481:0 Key97=176:176 Key98=65318:0 Key99=65317:0 Key100=65315:0 Key101=65319:0 Key102=65314:0 Key103=0:0 Key104=65421:13 Key105=65508:0 Key106=65455:47 Key107=65377:0 Key108=65027:0 Key109=65290:10 Key110=65360:0 Key111=65362:0 Key112=65365:0 Key113=65361:0 Key114=65363:0 Key115=65367:0 Key116=65364:0 Key117=65366:0 Key118=65379:0 Key119=65535:127 Key120=0:0 Key121=269025042:0 Key122=269025041:0 Key123=269025043:0 Key124=269025066:0 Key125=65469:61 Key126=177:177 Key127=65299:0 Key128=269025098:0 Key129=65454:46 Key130=65329:0 Key131=65332:0 Key132=0:0 Key133=65515:0 Key134=65516:0 Key135=65383:0 Key136=65385:0 Key137=65382:0 [capslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65105:180 Key35=91:91 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=199:199 Key48=65107:126 Key49=39:39 Key50=65505:0 Key51=93:93 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=59:59 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65027:0 Key93=0:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=47:47 Key98=65318:0 Key99=65317:0 Key100=65315:0 Key101=65319:0 Key102=65314:0 Key103=0:0 Key104=65421:13 Key105=65508:0 Key106=65455:47 Key107=65377:0 Key108=65027:0 Key109=65290:10 Key110=65360:0 Key111=65362:0 Key112=65365:0 Key113=65361:0 Key114=65363:0 Key115=65367:0 Key116=65364:0 Key117=65366:0 Key118=65379:0 Key119=65535:127 Key120=0:0 Key121=269025042:0 Key122=269025041:0 Key123=269025043:0 Key124=269025066:0 Key125=65469:61 Key126=177:177 Key127=65299:0 Key128=269025098:0 Key129=65454:46 Key130=65329:0 Key131=65332:0 Key132=0:0 Key133=65515:0 Key134=65516:0 Key135=65383:0 Key136=65385:0 Key137=65382:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=65111:168 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65104:96 Key35=123:123 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=231:231 Key48=65106:94 Key49=34:34 Key50=65505:0 Key51=125:125 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=58:58 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65027:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=63:63 Key98=65318:0 Key99=65317:0 Key100=65315:0 Key101=65319:0 Key102=65314:0 Key103=0:0 Key104=65421:13 Key105=65508:0 Key106=65455:47 Key107=65377:0 Key108=65027:0 Key109=65290:10 Key110=65360:0 Key111=65362:0 Key112=65365:0 Key113=65361:0 Key114=65363:0 Key115=65367:0 Key116=65364:0 Key117=65366:0 Key118=65379:0 Key119=65535:127 Key120=0:0 Key121=269025042:0 Key122=269025041:0 Key123=269025043:0 Key124=269025066:0 Key125=65469:61 Key126=177:177 Key127=65299:0 Key128=269025098:0 Key129=65454:46 Key130=65329:0 Key131=65332:0 Key132=0:0 Key133=65515:0 Key134=65516:0 Key135=65383:0 Key136=65385:0 Key137=65382:0 xrdp-0.10.1/instfiles/default/000755 001751 000000 00000000000 14652432105 016254 5ustar00metawheel000000 000000 xrdp-0.10.1/instfiles/km-0000080c.ini000644 001751 000000 00000021060 14652432047 016714 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=38:38 Key11=233:233 Key12=34:34 Key13=39:39 Key14=40:40 Key15=167:167 Key16=232:232 Key17=33:33 Key18=231:231 Key19=224:224 Key20=41:41 Key21=45:45 Key22=65288:8 Key23=65289:9 Key24=97:97 Key25=122:122 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65106:94 Key35=36:36 Key36=65293:13 Key37=65507:0 Key38=113:113 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=109:109 Key48=249:249 Key49=178:178 Key50=65505:0 Key51=181:181 Key52=119:119 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=44:44 Key59=59:59 Key60=58:58 Key61=61:61 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=176:176 Key21=95:95 Key22=65288:8 Key23=65056:0 Key24=65:65 Key25=90:90 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65111:168 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=81:81 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=77:77 Key48=37:37 Key49=179:179 Key50=65505:0 Key51=163:163 Key52=87:87 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=63:63 Key59=46:46 Key60=47:47 Key61=43:43 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=35:35 Key13=188:188 Key14=189:189 Key15=94:94 Key16=123:123 Key17=91:91 Key18=123:123 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=5053:339 Key33=254:254 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=65105:180 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=65115:184 Key59=2211:0 Key60=183:183 Key61=65107:126 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=38:38 Key11=201:201 Key12=34:34 Key13=39:39 Key14=40:40 Key15=167:167 Key16=200:200 Key17=33:33 Key18=199:199 Key19=192:192 Key20=41:41 Key21=45:45 Key22=65288:8 Key23=65289:9 Key24=65:65 Key25=90:90 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65106:94 Key35=36:36 Key36=65293:13 Key37=65507:0 Key38=81:81 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=77:77 Key48=217:217 Key49=178:178 Key50=65505:0 Key51=924:0 Key52=87:87 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=44:44 Key59=59:59 Key60=58:58 Key61=61:61 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=176:176 Key21=95:95 Key22=65288:8 Key23=65056:0 Key24=97:97 Key25=122:122 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65111:168 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=113:113 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=109:109 Key48=37:37 Key49=179:179 Key50=65505:0 Key51=163:163 Key52=119:119 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=63:63 Key59=46:46 Key60=47:47 Key61=43:43 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/Makefile.in000644 001751 000000 00000063106 14652432075 016711 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @LINUX_TRUE@am__append_1 = \ @LINUX_TRUE@ pam.d \ @LINUX_TRUE@ pulse @HAVE_SYSTEMD_FALSE@@LINUX_TRUE@am__append_2 = \ @HAVE_SYSTEMD_FALSE@@LINUX_TRUE@ default \ @HAVE_SYSTEMD_FALSE@@LINUX_TRUE@ init.d @FREEBSD_TRUE@am__append_3 = \ @FREEBSD_TRUE@ pam.d \ @FREEBSD_TRUE@ rc.d \ @FREEBSD_TRUE@ pulse @MACOS_TRUE@am__append_4 = pam.d subdir = instfiles ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_startscript_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(startscriptdir)" \ "$(DESTDIR)$(systemdsystemunitdir)" DATA = $(dist_startscript_DATA) $(systemdsystemunit_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = pam.d pulse default init.d rc.d am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ keymap-names.txt \ xrdp-sesman.service.in \ xrdp.service.in # # substitute directories in service file # CLEANFILES = \ xrdp-sesman.service \ xrdp.service SUBST_VARS = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in # # files for all platforms # startscriptdir = $(sysconfdir)/xrdp dist_startscript_DATA = \ km-00000406.ini \ km-00000407.ini \ km-00000409.ini \ km-0000040a.ini \ km-0000040b.ini \ km-0000040c.ini \ km-00000410.ini \ km-00000411.ini \ km-00000412.ini \ km-00000414.ini \ km-00000415.ini \ km-00000416.ini \ km-00000419.ini \ km-0000041d.ini \ km-00000807.ini \ km-00000809.ini \ km-0000080a.ini \ km-0000080c.ini \ km-00000813.ini \ km-00000816.ini \ km-0000100c.ini \ km-00010409.ini \ km-19360409.ini # # platform specific files # SUBDIRS = $(am__append_1) $(am__append_2) $(am__append_3) \ $(am__append_4) @HAVE_SYSTEMD_TRUE@@LINUX_TRUE@systemdsystemunit_DATA = \ @HAVE_SYSTEMD_TRUE@@LINUX_TRUE@ xrdp-sesman.service \ @HAVE_SYSTEMD_TRUE@@LINUX_TRUE@ xrdp.service all: all-recursive .SUFFIXES: .SUFFIXES: .in $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign instfiles/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign instfiles/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_startscriptDATA: $(dist_startscript_DATA) @$(NORMAL_INSTALL) @list='$(dist_startscript_DATA)'; test -n "$(startscriptdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(startscriptdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(startscriptdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(startscriptdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(startscriptdir)" || exit $$?; \ done uninstall-dist_startscriptDATA: @$(NORMAL_UNINSTALL) @list='$(dist_startscript_DATA)'; test -n "$(startscriptdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(startscriptdir)'; $(am__uninstall_files_from_dir) install-systemdsystemunitDATA: $(systemdsystemunit_DATA) @$(NORMAL_INSTALL) @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \ done uninstall-systemdsystemunitDATA: @$(NORMAL_UNINSTALL) @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(startscriptdir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @FREEBSD_FALSE@@LINUX_FALSE@install-data-hook: clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_startscriptDATA \ install-systemdsystemunitDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_startscriptDATA \ uninstall-systemdsystemunitDATA .MAKE: $(am__recursive_targets) install-am install-data-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dist_startscriptDATA 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 install-systemdsystemunitDATA installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-dist_startscriptDATA \ uninstall-systemdsystemunitDATA .PRECIOUS: Makefile .in: $(subst_verbose)$(SUBST_VARS) $< > $@ # # install-data-hook for each platform # TODO: subst these directories as well as service files # # must be tab below @LINUX_TRUE@install-data-hook: @LINUX_TRUE@ if [ -f $(DESTDIR)$(sysconfdir)/init.d/xrdp ]; then \ @LINUX_TRUE@ sed -i 's|__BASE__|$(prefix)|' $(DESTDIR)$(sysconfdir)/init.d/xrdp; \ @LINUX_TRUE@ fi # must be tab below @FREEBSD_TRUE@install-data-hook: @FREEBSD_TRUE@ sed -i '' 's|%%PREFIX%%|$(prefix)|g' $(DESTDIR)$(sysconfdir)/rc.d/xrdp \ @FREEBSD_TRUE@ $(DESTDIR)$(sysconfdir)/rc.d/xrdp-sesman # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/instfiles/km-0000040c.ini000644 001751 000000 00000021050 14652432047 016707 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=38:38 Key11=233:233 Key12=34:34 Key13=39:39 Key14=40:40 Key15=45:45 Key16=232:232 Key17=95:95 Key18=231:231 Key19=224:224 Key20=41:41 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=97:97 Key25=122:122 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65106:94 Key35=36:36 Key36=65293:13 Key37=65507:0 Key38=113:113 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=109:109 Key48=249:249 Key49=178:178 Key50=65505:0 Key51=42:42 Key52=119:119 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=44:44 Key59=59:59 Key60=58:58 Key61=33:33 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=176:176 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=65:65 Key25=90:90 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65111:168 Key35=163:163 Key36=65293:13 Key37=65507:0 Key38=81:81 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=77:77 Key48=37:37 Key49=126:126 Key50=65505:0 Key51=181:181 Key52=87:87 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=63:63 Key59=46:46 Key60=47:47 Key61=167:167 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=185:185 Key11=126:126 Key12=35:35 Key13=123:123 Key14=91:91 Key15=124:124 Key16=96:96 Key17=92:92 Key18=94:94 Key19=64:64 Key20=93:93 Key21=125:125 Key22=65288:8 Key23=65289:9 Key24=230:230 Key25=171:171 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=65111:168 Key35=164:164 Key36=65293:13 Key37=65507:0 Key38=64:64 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=181:181 Key48=65106:94 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=435:322 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=65105:180 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=0:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=38:38 Key11=201:201 Key12=34:34 Key13=39:39 Key14=40:40 Key15=45:45 Key16=200:200 Key17=95:95 Key18=199:199 Key19=192:192 Key20=41:41 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=65:65 Key25=90:90 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65106:94 Key35=36:36 Key36=65293:13 Key37=65507:0 Key38=81:81 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=77:77 Key48=217:217 Key49=178:178 Key50=65505:0 Key51=42:42 Key52=87:87 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=44:44 Key59=59:59 Key60=58:58 Key61=33:33 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=176:176 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=97:97 Key25=122:122 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65111:168 Key35=163:163 Key36=65293:13 Key37=65507:0 Key38=113:113 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=109:109 Key48=37:37 Key49=126:126 Key50=65505:0 Key51=924:0 Key52=119:119 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=63:63 Key59=46:46 Key60=47:47 Key61=167:167 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000406.ini000644 001751 000000 00000021057 14652432047 016641 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=168:168 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=230:230 Key48=248:248 Key49=189:189 Key50=65505:0 Key51=39:39 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=94:94 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=198:198 Key48=216:216 Key49=167:167 Key50=65505:0 Key51=42:42 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=161:161 Key11=64:64 Key12=163:163 Key13=36:36 Key14=8364:8364 Key15=165:165 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=124:124 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=174:174 Key28=254:254 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=5053:339 Key33=254:254 Key34=65111:168 Key35=126:126 Key36=65293:13 Key37=65507:0 Key38=170:170 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=248:248 Key48=230:230 Key49=182:182 Key50=65505:0 Key51=180:180 Key52=171:171 Key53=187:187 Key54=169:169 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=65115:184 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=0:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=214:214 Key48=196:196 Key49=167:167 Key50=65505:0 Key51=39:39 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=246:246 Key48=228:228 Key49=189:189 Key50=65505:0 Key51=42:42 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000410.ini000644 001751 000000 00000025157 14652432047 016641 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=236:236 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=232:232 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=242:242 Key48=224:224 Key49=92:92 Key50=65505:0 Key51=249:249 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=163:163 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=94:94 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=233:233 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=231:231 Key48=176:176 Key49=124:124 Key50=65505:0 Key51=167:167 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=185:185 Key11=178:178 Key12=179:179 Key13=188:188 Key14=189:189 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=96:96 Key21=126:126 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65121:0 Key45=930:312 Key46=435:322 Key47=64:64 Key48=35:35 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=241:241 Key58=181:181 Key59=65105:180 Key60=183:183 Key61=65108:175 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=171:171 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=65113:733 Key12=65107:126 Key13=2755:8539 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=65116:731 Key20=191:191 Key21=65106:94 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=162:162 Key27=174:174 Key28=940:358 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=216:216 Key33=222:222 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=167:167 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65122:0 Key45=38:38 Key46=419:321 Key47=65115:184 Key48=65112:176 Key49=166:166 Key50=65505:0 Key51=65109:728 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=209:209 Key58=186:186 Key59=215:215 Key60=65111:168 Key61=247:247 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=187:187 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=204:204 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=200:200 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=210:210 Key48=192:192 Key49=92:92 Key50=65505:0 Key51=217:217 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=163:163 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=94:94 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=201:201 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=199:199 Key48=176:176 Key49=124:124 Key50=65505:0 Key51=167:167 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00010409.ini000644 001751 000000 00000033246 14652432047 016650 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=91:91 Key21=93:93 Key22=65288:8 Key23=65289:9 Key24=39:39 Key25=44:44 Key26=46:46 Key27=112:112 Key28=121:121 Key29=102:102 Key30=103:103 Key31=99:99 Key32=114:114 Key33=108:108 Key34=47:47 Key35=61:61 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=111:111 Key40=101:101 Key41=117:117 Key42=105:105 Key43=100:100 Key44=104:104 Key45=116:116 Key46=110:110 Key47=115:115 Key48=45:45 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=59:59 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65514:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=123:123 Key21=125:125 Key22=65288:8 Key23=65056:0 Key24=34:34 Key25=60:60 Key26=62:62 Key27=80:80 Key28=89:89 Key29=70:70 Key30=71:71 Key31=67:67 Key32=82:82 Key33=76:76 Key34=63:63 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=79:79 Key40=69:69 Key41=85:85 Key42=73:73 Key43=68:68 Key44=72:72 Key45=84:84 Key46=78:78 Key47=83:83 Key48=95:95 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=58:58 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65512:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=65106:94 Key16=55:55 Key17=56:56 Key18=65104:96 Key19=48:48 Key20=91:91 Key21=65107:126 Key22=65288:8 Key23=65289:9 Key24=65105:180 Key25=65115:184 Key26=65110:729 Key27=112:112 Key28=121:121 Key29=102:102 Key30=103:103 Key31=99:99 Key32=114:114 Key33=108:108 Key34=47:47 Key35=61:61 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=111:111 Key40=101:101 Key41=117:117 Key42=105:105 Key43=100:100 Key44=104:104 Key45=116:116 Key46=110:110 Key47=115:115 Key48=45:45 Key49=65104:96 Key50=65505:0 Key51=92:92 Key52=65116:731 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65514:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=65106:94 Key16=38:38 Key17=42:42 Key18=0:0 Key19=41:41 Key20=123:123 Key21=0:0 Key22=65288:8 Key23=65056:0 Key24=65111:168 Key25=65114:711 Key26=183:183 Key27=80:80 Key28=89:89 Key29=70:70 Key30=71:71 Key31=67:67 Key32=82:82 Key33=76:76 Key34=63:63 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=79:79 Key40=69:69 Key41=85:85 Key42=73:73 Key43=68:68 Key44=72:72 Key45=84:84 Key46=78:78 Key47=83:83 Key48=95:95 Key49=65107:126 Key50=65505:0 Key51=124:124 Key52=65113:733 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65512:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=91:91 Key21=93:93 Key22=65288:8 Key23=65289:9 Key24=39:39 Key25=44:44 Key26=46:46 Key27=80:80 Key28=89:89 Key29=70:70 Key30=71:71 Key31=67:67 Key32=82:82 Key33=76:76 Key34=47:47 Key35=61:61 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=79:79 Key40=69:69 Key41=85:85 Key42=73:73 Key43=68:68 Key44=72:72 Key45=84:84 Key46=78:78 Key47=83:83 Key48=45:45 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=59:59 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65514:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [capslockaltgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=65106:94 Key16=55:55 Key17=56:56 Key18=65104:96 Key19=48:48 Key20=91:91 Key21=65107:126 Key22=65288:8 Key23=65289:9 Key24=65105:180 Key25=65115:184 Key26=65110:729 Key27=80:80 Key28=89:89 Key29=70:70 Key30=71:71 Key31=67:67 Key32=82:82 Key33=76:76 Key34=47:47 Key35=61:61 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=79:79 Key40=69:69 Key41=85:85 Key42=73:73 Key43=68:68 Key44=72:72 Key45=84:84 Key46=78:78 Key47=83:83 Key48=45:45 Key49=65104:96 Key50=65505:0 Key51=92:92 Key52=65116:731 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65514:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=123:123 Key21=125:125 Key22=65288:8 Key23=65056:0 Key24=34:34 Key25=60:60 Key26=62:62 Key27=112:112 Key28=121:121 Key29=102:102 Key30=103:103 Key31=99:99 Key32=114:114 Key33=108:108 Key34=63:63 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=111:111 Key40=101:101 Key41=117:117 Key42=105:105 Key43=100:100 Key44=104:104 Key45=116:116 Key46=110:110 Key47=115:115 Key48=95:95 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=58:58 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65512:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslockaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=65106:94 Key16=38:38 Key17=42:42 Key18=0:0 Key19=41:41 Key20=123:123 Key21=0:0 Key22=65288:8 Key23=65056:0 Key24=65111:168 Key25=65114:711 Key26=183:183 Key27=112:112 Key28=121:121 Key29=102:102 Key30=103:103 Key31=99:99 Key32=114:114 Key33=108:108 Key34=63:63 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=111:111 Key40=101:101 Key41=117:117 Key42=105:105 Key43=100:100 Key44=104:104 Key45=116:116 Key46=110:110 Key47=115:115 Key48=95:95 Key49=65107:126 Key50=65505:0 Key51=124:124 Key52=65113:733 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65516:0 Key114=0:0 Key115=65515:0 Key116=65512:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/init.d/000755 001751 000000 00000000000 14652432105 016015 5ustar00metawheel000000 000000 xrdp-0.10.1/instfiles/keymap-names.txt000644 001751 000000 00000007147 14652432047 017776 0ustar00metawheel000000 000000 0x00000436 af Afrikaans 0x0000041C sq Albanian 0x00000001 ar Arabic 0x00000401 ar-sa Arabic (Saudi Arabia) 0x00000801 ar-iq Arabic (Iraq) 0x00000C01 ar-eg Arabic (Egypt) 0x00001001 ar-ly Arabic (Libya) 0x00001401 ar-dz Arabic (Algeria) 0x00001801 ar-ma Arabic (Morocco) 0x00001C01 ar-tn Arabic (Tunisia) 0x00002001 ar-om Arabic (Oman) 0x00002401 ar-ye Arabic (Yemen) 0x00002801 ar-sy Arabic (Syria) 0x00002C01 ar-jo Arabic (Jordan) 0x00003001 ar-lb Arabic (Lebanon) 0x00003401 ar-kw Arabic (Kuwait) 0x00003801 ar-ae Arabic (U.A.E.) 0x00003C01 ar-bh Arabic (Bahrain) 0x00004001 ar-qa Arabic (Qatar) 0x0000042D eu Basque 0x00000402 bg Bulgarian 0x00000423 be Belarusian 0x00000403 ca Catalan 0x00000004 zh Chinese 0x00000404 zh-tw Chinese (Taiwan) 0x00000804 zh-cn Chinese (China) 0x00000C04 zh-hk Chinese (Hong Kong SAR) 0x00001004 zh-sg Chinese (Singapore) 0x0000041A hr Croatian 0x00000405 cs Czech 0x00000406 da Danish 0x00000413 nl Dutch (Netherlands) 0x00000813 nl-be Dutch (Belgium) 0x00000009 en English 0x00000409 en-us English (United States) 0x00000809 en-gb English (United Kingdom) 0x00000C09 en-au English (Australia) 0x00001009 en-ca English (Canada) 0x00001409 en-nz English (New Zealand) 0x00001809 en-ie English (Ireland) 0x00001C09 en-za English (South Africa) 0x00002009 en-jm English (Jamaica) 0x00002809 en-bz English (Belize) 0x00002C09 en-tt English (Trinidad) 0x00000425 et Estonian 0x00000438 fo Faeroese 0x00000429 fa Farsi 0x0000040B fi Finnish 0x0000040C fr French (France) 0x0000080C fr-be French (Belgium) 0x00000C0C fr-ca French (Canada) 0x0000100C fr-ch French (Switzerland) 0x0000140C fr-lu French (Luxembourg) 0x0000043C gd Gaelic 0x00000407 de German (Germany) 0x00000807 de-ch German (Switzerland) 0x00000C07 de-at German (Austria) 0x00001007 de-lu German (Luxembourg) 0x00001407 de-li German (Liechtenstein) 0x00000408 el Greek 0x0000040D he Hebrew 0x00000439 hi Hindi 0x0000040E hu Hungarian 0x0000040F is Icelandic 0x00000421 in Indonesian 0x00000410 it Italian (Italy) 0x00000810 it-ch Italian (Switzerland) 0x00000411 ja Japanese 0x00000412 ko Korean 0x00000426 lv Latvian 0x00000427 lt Lithuanian 0x0000042F mk FYRO Macedonian 0x0000043E ms Malay (Malaysia) 0x0000043A mt Maltese 0x00000414 no Norwegian (Bokmal) 0x00000814 no Norwegian (Nynorsk) 0x00000415 pl Polish 0x00000416 pt-br Portuguese (Brazil) 0x00000816 pt Portuguese (Portugal) 0x00000417 rm Rhaeto-Romanic 0x00000418 ro Romanian 0x00000818 ro-mo Romanian (Moldova) 0x00000419 ru Russian 0x00000819 ru-mo Russian (Moldova) 0x00000C1A sr Serbian (Cyrillic) 0x0000081A sr Serbian (Latin) 0x0000041B sk Slovak 0x00000424 sl Slovenian 0x0000042E sb Sorbian 0x0000040A es Spanish (Traditional Sort) 0x0000080A es-mx Spanish (Mexico) 0x00000C0A es Spanish (International Sort) 0x0000100A es-gt Spanish (Guatemala) 0x0000140A es-cr Spanish (Costa Rica) 0x0000180A es-pa Spanish (Panama) 0x00001C0A es-do Spanish (Dominican Republic) 0x0000200A es-ve Spanish (Venezuela) 0x0000240A es-co Spanish (Colombia) 0x0000280A es-pe Spanish (Peru) 0x00002C0A es-ar Spanish (Argentina) 0x0000300A es-ec Spanish (Ecuador) 0x0000340A es-cl Spanish (Chile) 0x0000380A es-uy Spanish (Uruguay) 0x00003C0A es-py Spanish (Paraguay) 0x0000400A es-bo Spanish (Bolivia) 0x0000440A es-sv Spanish (El Salvador) 0x0000480A es-hn Spanish (Honduras) 0x00004C0A es-ni Spanish (Nicaragua) 0x0000500A es-pr Spanish (Puerto Rico) 0x00000430 sx Sutu 0x0000041D sv Swedish 0x0000081D sv-fi Swedish (Finland) 0x0000041E th Thai 0x00000431 ts Tsonga 0x00000432 tn Tswana 0x0000041F tr Turkish 0x00000422 uk Ukrainian 0x00000420 ur Urdu 0x0000042A vi Vietnamese 0x00000434 xh Xhosa 0x0000043D ji Yiddish 0x00000435 zu Zulu xrdp-0.10.1/instfiles/km-00000419.ini000644 001751 000000 00000026070 14652432047 016645 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=1738:1081 Key25=1731:1094 Key26=1749:1091 Key27=1739:1082 Key28=1733:1077 Key29=1742:1085 Key30=1735:1075 Key31=1755:1096 Key32=1757:1097 Key33=1754:1079 Key34=1736:1093 Key35=1759:1098 Key36=65293:13 Key37=65507:0 Key38=1734:1092 Key39=1753:1099 Key40=1751:1074 Key41=1729:1072 Key42=1744:1087 Key43=1746:1088 Key44=1743:1086 Key45=1740:1083 Key46=1732:1076 Key47=1750:1078 Key48=1756:1101 Key49=1699:1105 Key50=65505:0 Key51=92:92 Key52=1745:1103 Key53=1758:1095 Key54=1747:1089 Key55=1741:1084 Key56=1737:1080 Key57=1748:1090 Key58=1752:1100 Key59=1730:1073 Key60=1728:1102 Key61=46:46 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=47:47 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=1712:8470 Key13=59:59 Key14=37:37 Key15=58:58 Key16=63:63 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=1770:1049 Key25=1763:1062 Key26=1781:1059 Key27=1771:1050 Key28=1765:1045 Key29=1774:1053 Key30=1767:1043 Key31=1787:1064 Key32=1789:1065 Key33=1786:1047 Key34=1768:1061 Key35=1791:1066 Key36=65293:13 Key37=65507:0 Key38=1766:1060 Key39=1785:1067 Key40=1783:1042 Key41=1761:1040 Key42=1776:1055 Key43=1778:1056 Key44=1775:1054 Key45=1772:1051 Key46=1764:1044 Key47=1782:1046 Key48=1788:1069 Key49=1715:1025 Key50=65505:0 Key51=47:47 Key52=1777:1071 Key53=1790:1063 Key54=1779:1057 Key55=1773:1052 Key56=1769:1048 Key57=1780:1058 Key58=1784:1068 Key59=1762:1041 Key60=1760:1070 Key61=44:44 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65032:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=1738:1081 Key25=1731:1094 Key26=1749:1091 Key27=1739:1082 Key28=1733:1077 Key29=1742:1085 Key30=1735:1075 Key31=1755:1096 Key32=1757:1097 Key33=1754:1079 Key34=1736:1093 Key35=1759:1098 Key36=65293:13 Key37=65507:0 Key38=1734:1092 Key39=1753:1099 Key40=1751:1074 Key41=1729:1072 Key42=1744:1087 Key43=1746:1088 Key44=1743:1086 Key45=1740:1083 Key46=1732:1076 Key47=1750:1078 Key48=1756:1101 Key49=1699:1105 Key50=65505:0 Key51=92:92 Key52=1745:1103 Key53=1758:1095 Key54=1747:1089 Key55=1741:1084 Key56=1737:1080 Key57=1748:1090 Key58=1752:1100 Key59=1730:1073 Key60=1728:1102 Key61=46:46 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=1712:8470 Key13=59:59 Key14=37:37 Key15=58:58 Key16=63:63 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=1770:1049 Key25=1763:1062 Key26=1781:1059 Key27=1771:1050 Key28=1765:1045 Key29=1774:1053 Key30=1767:1043 Key31=1787:1064 Key32=1789:1065 Key33=1786:1047 Key34=1768:1061 Key35=1791:1066 Key36=65293:13 Key37=65507:0 Key38=1766:1060 Key39=1785:1067 Key40=1783:1042 Key41=1761:1040 Key42=1776:1055 Key43=1778:1056 Key44=1775:1054 Key45=1772:1051 Key46=1764:1044 Key47=1782:1046 Key48=1788:1069 Key49=1715:1025 Key50=65505:0 Key51=47:47 Key52=1777:1071 Key53=1790:1063 Key54=1779:1057 Key55=1773:1052 Key56=1769:1048 Key57=1780:1058 Key58=1784:1068 Key59=1762:1041 Key60=1760:1070 Key61=44:44 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65032:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=1770:1049 Key25=1763:1062 Key26=1781:1059 Key27=1771:1050 Key28=1765:1045 Key29=1774:1053 Key30=1767:1043 Key31=1787:1064 Key32=1789:1065 Key33=1786:1047 Key34=1768:1061 Key35=1791:1066 Key36=65293:13 Key37=65507:0 Key38=1766:1060 Key39=1785:1067 Key40=1783:1042 Key41=1761:1040 Key42=1776:1055 Key43=1778:1056 Key44=1775:1054 Key45=1772:1051 Key46=1764:1044 Key47=1782:1046 Key48=1788:1069 Key49=1715:1025 Key50=65505:0 Key51=92:92 Key52=1777:1071 Key53=1790:1063 Key54=1779:1057 Key55=1773:1052 Key56=1769:1048 Key57=1780:1058 Key58=1784:1068 Key59=1762:1041 Key60=1760:1070 Key61=46:46 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=47:47 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=1712:8470 Key13=59:59 Key14=37:37 Key15=58:58 Key16=63:63 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=1738:1081 Key25=1731:1094 Key26=1749:1091 Key27=1739:1082 Key28=1733:1077 Key29=1742:1085 Key30=1735:1075 Key31=1755:1096 Key32=1757:1097 Key33=1754:1079 Key34=1736:1093 Key35=1759:1098 Key36=65293:13 Key37=65507:0 Key38=1734:1092 Key39=1753:1099 Key40=1751:1074 Key41=1729:1072 Key42=1744:1087 Key43=1746:1088 Key44=1743:1086 Key45=1740:1083 Key46=1732:1076 Key47=1750:1078 Key48=1756:1101 Key49=1699:1105 Key50=65505:0 Key51=47:47 Key52=1745:1103 Key53=1758:1095 Key54=1747:1089 Key55=1741:1084 Key56=1737:1080 Key57=1748:1090 Key58=1752:1100 Key59=1730:1073 Key60=1728:1102 Key61=44:44 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65032:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/pulse/000755 001751 000000 00000000000 14652432105 015760 5ustar00metawheel000000 000000 xrdp-0.10.1/instfiles/km-00000414.ini000644 001751 000000 00000021225 14652432047 016635 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=92:92 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=248:248 Key48=230:230 Key49=124:124 Key50=65505:0 Key51=39:39 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=269025074:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=216:216 Key48=198:198 Key49=167:167 Key50=65505:0 Key51=42:42 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65032:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=269025074:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=64:64 Key12=163:163 Key13=36:36 Key14=189:189 Key15=165:165 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=177:177 Key21=65105:180 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=174:174 Key28=254:254 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=5053:339 Key33=2032:960 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=170:170 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=65106:94 Key49=166:166 Key50=65505:0 Key51=65113:733 Key52=171:171 Key53=187:187 Key54=169:169 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=65115:184 Key60=2734:8230 Key61=2730:8211 Key62=65506:0 Key63=16786117:8901 Key64=65513:0 Key65=160:160 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=16785938:8722 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=16777259:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=189:189 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=16785941:8725 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=269025074:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=43:43 Key21=92:92 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=197:197 Key35=65111:168 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=216:216 Key48=198:198 Key49=124:124 Key50=65505:0 Key51=39:39 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=269025074:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=164:164 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=65104:96 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=229:229 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=248:248 Key48=230:230 Key49=167:167 Key50=65505:0 Key51=42:42 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65032:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=269025074:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000813.ini000644 001751 000000 00000021060 14652432047 016635 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=38:38 Key11=233:233 Key12=34:34 Key13=39:39 Key14=40:40 Key15=167:167 Key16=232:232 Key17=33:33 Key18=231:231 Key19=224:224 Key20=41:41 Key21=45:45 Key22=65288:8 Key23=65289:9 Key24=97:97 Key25=122:122 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65106:94 Key35=36:36 Key36=65293:13 Key37=65507:0 Key38=113:113 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=109:109 Key48=249:249 Key49=178:178 Key50=65505:0 Key51=181:181 Key52=119:119 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=44:44 Key59=59:59 Key60=58:58 Key61=61:61 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=176:176 Key21=95:95 Key22=65288:8 Key23=65056:0 Key24=65:65 Key25=90:90 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65111:168 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=81:81 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=77:77 Key48=37:37 Key49=179:179 Key50=65505:0 Key51=163:163 Key52=87:87 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=63:63 Key59=46:46 Key60=47:47 Key61=43:43 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=35:35 Key13=188:188 Key14=189:189 Key15=94:94 Key16=123:123 Key17=91:91 Key18=123:123 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=5053:339 Key33=254:254 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=65105:180 Key48=65105:180 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=65115:184 Key59=2211:0 Key60=183:183 Key61=65107:126 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=92:92 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=38:38 Key11=201:201 Key12=34:34 Key13=39:39 Key14=40:40 Key15=167:167 Key16=200:200 Key17=33:33 Key18=199:199 Key19=192:192 Key20=41:41 Key21=45:45 Key22=65288:8 Key23=65289:9 Key24=65:65 Key25=90:90 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65106:94 Key35=36:36 Key36=65293:13 Key37=65507:0 Key38=81:81 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=77:77 Key48=217:217 Key49=178:178 Key50=65505:0 Key51=924:0 Key52=87:87 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=44:44 Key59=59:59 Key60=58:58 Key61=61:61 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=65406:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=176:176 Key21=95:95 Key22=65288:8 Key23=65056:0 Key24=97:97 Key25=122:122 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65111:168 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=113:113 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=109:109 Key48=37:37 Key49=179:179 Key50=65505:0 Key51=163:163 Key52=119:119 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=63:63 Key59=46:46 Key60=47:47 Key61=43:43 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=65406:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-19360409.ini000644 001751 000000 00000033220 14652432047 016662 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=38:38 Key11=91:91 Key12=123:123 Key13=125:125 Key14=40:40 Key15=61:61 Key16=42:42 Key17=41:41 Key18=43:43 Key19=93:93 Key20=33:33 Key21=35:35 Key22=65288:8 Key23=65289:9 Key24=59:59 Key25=44:44 Key26=46:46 Key27=112:112 Key28=121:121 Key29=102:102 Key30=103:103 Key31=99:99 Key32=114:114 Key33=108:108 Key34=47:47 Key35=64:64 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=111:111 Key40=101:101 Key41=117:117 Key42=105:105 Key43=100:100 Key44=104:104 Key45=116:116 Key46=110:110 Key47=115:115 Key48=45:45 Key49=36:36 Key50=65505:0 Key51=92:92 Key52=39:39 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=37:37 Key11=55:55 Key12=53:53 Key13=51:51 Key14=49:49 Key15=57:57 Key16=48:48 Key17=50:50 Key18=52:52 Key19=54:54 Key20=56:56 Key21=96:96 Key22=65288:8 Key23=65056:0 Key24=58:58 Key25=60:60 Key26=62:62 Key27=80:80 Key28=89:89 Key29=70:70 Key30=71:71 Key31=67:67 Key32=82:82 Key33=76:76 Key34=63:63 Key35=94:94 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=79:79 Key40=69:69 Key41=85:85 Key42=73:73 Key43=68:68 Key44=72:72 Key45=84:84 Key46=78:78 Key47=83:83 Key48=95:95 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=34:34 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=61:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=38:38 Key11=164:164 Key12=162:162 Key13=165:165 Key14=8364:8364 Key15=163:163 Key16=0:0 Key17=189:189 Key18=65104:96 Key19=0:0 Key20=161:161 Key21=65104:96 Key22=65288:8 Key23=65289:9 Key24=65111:168 Key25=171:171 Key26=187:187 Key27=182:182 Key28=252:252 Key29=102:102 Key30=103:103 Key31=231:231 Key32=174:174 Key33=108:108 Key34=191:191 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=229:229 Key39=248:248 Key40=230:230 Key41=233:233 Key42=105:105 Key43=240:240 Key44=65105:180 Key45=254:254 Key46=241:241 Key47=223:223 Key48=173:173 Key49=65107:126 Key50=65505:0 Key51=92:92 Key52=65105:180 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=37:37 Key11=0:0 Key12=0:0 Key13=0:0 Key14=0:0 Key15=65106:94 Key16=0:0 Key17=0:0 Key18=0:0 Key19=0:0 Key20=16789016:11800 Key21=0:0 Key22=65288:8 Key23=65056:0 Key24=65111:168 Key25=16785436:8220 Key26=16785437:8221 Key27=167:167 Key28=220:220 Key29=70:70 Key30=71:71 Key31=199:199 Key32=2761:8482 Key33=76:76 Key34=16785469:8253 Key35=65114:711 Key36=65293:13 Key37=65507:0 Key38=197:197 Key39=216:216 Key40=198:198 Key41=201:201 Key42=73:73 Key43=208:208 Key44=0:0 Key45=222:222 Key46=209:209 Key47=0:0 Key48=2730:8211 Key49=65107:126 Key50=65505:0 Key51=124:124 Key52=65113:733 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=61:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=38:38 Key11=55:55 Key12=53:53 Key13=51:51 Key14=49:49 Key15=57:57 Key16=48:48 Key17=50:50 Key18=52:52 Key19=54:54 Key20=56:56 Key21=35:35 Key22=65288:8 Key23=65289:9 Key24=59:59 Key25=44:44 Key26=46:46 Key27=80:80 Key28=89:89 Key29=70:70 Key30=71:71 Key31=67:67 Key32=82:82 Key33=76:76 Key34=47:47 Key35=64:64 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=79:79 Key40=69:69 Key41=85:85 Key42=73:73 Key43=68:68 Key44=72:72 Key45=84:84 Key46=78:78 Key47=83:83 Key48=95:95 Key49=36:36 Key50=65505:0 Key51=92:92 Key52=39:39 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [capslockaltgr] Key8=65406:0 Key9=65307:27 Key10=38:38 Key11=0:0 Key12=0:0 Key13=0:0 Key14=0:0 Key15=65106:94 Key16=0:0 Key17=0:0 Key18=0:0 Key19=0:0 Key20=16789016:11800 Key21=65104:96 Key22=65288:8 Key23=65289:9 Key24=65111:168 Key25=171:171 Key26=187:187 Key27=182:182 Key28=220:220 Key29=70:70 Key30=71:71 Key31=199:199 Key32=174:174 Key33=76:76 Key34=191:191 Key35=65106:94 Key36=65293:13 Key37=65507:0 Key38=197:197 Key39=216:216 Key40=198:198 Key41=201:201 Key42=73:73 Key43=208:208 Key44=65105:180 Key45=222:222 Key46=209:209 Key47=223:223 Key48=2730:8211 Key49=65107:126 Key50=65505:0 Key51=92:92 Key52=65105:180 Key53=81:81 Key54=74:74 Key55=75:75 Key56=88:88 Key57=66:66 Key58=77:77 Key59=87:87 Key60=86:86 Key61=90:90 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=37:37 Key11=91:91 Key12=123:123 Key13=125:125 Key14=40:40 Key15=61:61 Key16=42:42 Key17=41:41 Key18=43:43 Key19=93:93 Key20=33:33 Key21=96:96 Key22=65288:8 Key23=65056:0 Key24=58:58 Key25=60:60 Key26=62:62 Key27=112:112 Key28=121:121 Key29=102:102 Key30=103:103 Key31=99:99 Key32=114:114 Key33=108:108 Key34=63:63 Key35=94:94 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=111:111 Key40=101:101 Key41=117:117 Key42=105:105 Key43=100:100 Key44=104:104 Key45=116:116 Key46=110:110 Key47=115:115 Key48=45:45 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=34:34 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=61:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 [shiftcapslockaltgr] Key8=65406:0 Key9=65307:27 Key10=37:37 Key11=164:164 Key12=162:162 Key13=165:165 Key14=8364:8364 Key15=163:163 Key16=0:0 Key17=189:189 Key18=65104:96 Key19=0:0 Key20=161:161 Key21=0:0 Key22=65288:8 Key23=65056:0 Key24=65111:168 Key25=16785436:8220 Key26=16785437:8221 Key27=167:167 Key28=252:252 Key29=102:102 Key30=103:103 Key31=231:231 Key32=2761:8482 Key33=108:108 Key34=16785469:8253 Key35=65114:711 Key36=65293:13 Key37=65507:0 Key38=229:229 Key39=248:248 Key40=230:230 Key41=233:233 Key42=105:105 Key43=240:240 Key44=0:0 Key45=254:254 Key46=241:241 Key47=0:0 Key48=173:173 Key49=65107:126 Key50=65505:0 Key51=124:124 Key52=65113:733 Key53=113:113 Key54=106:106 Key55=107:107 Key56=120:120 Key57=98:98 Key58=109:109 Key59=119:119 Key60=118:118 Key61=122:122 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=65312:0 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=61:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 xrdp-0.10.1/instfiles/km-00000415.ini000644 001751 000000 00000025242 14652432047 016641 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=2237:8800 Key11=178:178 Key12=179:179 Key13=162:162 Key14=8364:8364 Key15=189:189 Key16=167:167 Key17=183:183 Key18=171:171 Key19=187:187 Key20=2730:8211 Key21=65115:184 Key22=65288:8 Key23=65289:9 Key24=2032:960 Key25=5053:339 Key26=490:281 Key27=169:169 Key28=223:223 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=243:243 Key33=254:254 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=433:261 Key39=438:347 Key40=240:240 Key41=230:230 Key42=959:331 Key43=2769:8217 Key44=16777817:601 Key45=2734:8230 Key46=435:322 Key47=65105:180 Key48=65106:94 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=447:380 Key53=444:378 Key54=486:263 Key55=2814:8222 Key56=2771:8221 Key57=497:324 Key58=181:181 Key59=2236:8804 Key60=2238:8805 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=160:160 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=191:191 Key12=163:163 Key13=188:188 Key14=16785456:8240 Key15=2270:8743 Key16=16785992:8776 Key17=190:190 Key18=177:177 Key19=176:176 Key20=2729:8212 Key21=65116:731 Key22=65288:8 Key23=65056:0 Key24=2009:937 Key25=5052:338 Key26=458:280 Key27=174:174 Key28=2761:8482 Key29=165:165 Key30=2300:8593 Key31=16785812:8596 Key32=211:211 Key33=222:222 Key34=65112:176 Key35=65108:175 Key36=65293:13 Key37=65507:0 Key38=417:260 Key39=422:346 Key40=208:208 Key41=198:198 Key42=957:330 Key43=16785442:8226 Key44=16777615:399 Key45=65123:0 Key46=419:321 Key47=65113:733 Key48=65114:711 Key49=2271:8744 Key50=65505:0 Key51=65109:728 Key52=431:379 Key53=428:377 Key54=454:262 Key55=2768:8216 Key56=2770:8220 Key57=465:323 Key58=2242:8734 Key59=215:215 Key60=247:247 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=160:160 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65032:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65452:44 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65312:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-00000412.ini000644 001751 000000 00000035221 14652432047 016634 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [capslockaltgr] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=45:45 Key21=61:61 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=59:59 Key48=39:39 Key49=96:96 Key50=65505:0 Key51=92:92 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=47:47 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslockaltgr] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=64:64 Key12=35:35 Key13=36:36 Key14=37:37 Key15=94:94 Key16=38:38 Key17=42:42 Key18=40:40 Key19=41:41 Key20=95:95 Key21=43:43 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=123:123 Key35=125:125 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=58:58 Key48=34:34 Key49=126:126 Key50=65505:0 Key51=124:124 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=60:60 Key60=62:62 Key61=63:63 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=65454:46 Key135=0:0 Key136=0:0 Key137=0:0 Key209=65329:0 Key210=65332:0 xrdp-0.10.1/instfiles/km-0000040a.ini000644 001751 000000 00000021024 14652432047 016706 0ustar00metawheel000000 000000 [noshift] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=161:161 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65104:96 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=241:241 Key48=65105:180 Key49=186:186 Key50=65505:0 Key51=231:231 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65364:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=0:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=183:183 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=191:191 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65106:94 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=209:209 Key48=65111:168 Key49=170:170 Key50=65505:0 Key51=199:199 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65364:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=0:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=35:35 Key13=126:126 Key14=189:189 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=126:126 Key22=65288:8 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=91:91 Key35=93:93 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=106:106 Key45=930:312 Key46=435:322 Key47=126:126 Key48=123:123 Key49=92:92 Key50=65505:0 Key51=125:125 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65364:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=0:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=0:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=161:161 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65104:96 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=209:209 Key48=65105:180 Key49=186:186 Key50=65505:0 Key51=199:199 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65364:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=0:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65514:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=0:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=183:183 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=191:191 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65106:94 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=241:241 Key48=65111:168 Key49=170:170 Key50=65505:0 Key51=231:231 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65364:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65273:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=0:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65512:0 Key114=0:0 Key115=65515:0 Key116=65516:0 Key117=65383:0 Key118=0:0 Key119=0:0 Key120=0:0 Key121=0:0 Key122=0:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/km-0000080a.ini000644 001751 000000 00000034370 14652432047 016722 0ustar00metawheel000000 000000 [noshift] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=191:191 Key22=65288:8 Key23=65289:9 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65105:180 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=241:241 Key48=123:123 Key49=124:124 Key50=65505:0 Key51=125:125 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shift] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=161:161 Key22=65288:8 Key23=65056:0 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65111:168 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=209:209 Key48=91:91 Key49=176:176 Key50=65505:0 Key51=93:93 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [altgr] Key8=65406:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=183:183 Key13=126:126 Key14=189:189 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=0:0 Key23=65289:9 Key24=64:64 Key25=435:322 Key26=8364:8364 Key27=182:182 Key28=956:359 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=248:248 Key33=254:254 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=223:223 Key40=240:240 Key41=496:273 Key42=959:331 Key43=689:295 Key44=65121:0 Key45=930:312 Key46=435:322 Key47=126:126 Key48=65106:94 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=110:110 Key58=181:181 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=2755:8539 Key12=163:163 Key13=36:36 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=176:176 Key20=191:191 Key21=65116:731 Key22=0:0 Key23=65056:0 Key24=2009:937 Key25=419:321 Key26=162:162 Key27=174:174 Key28=940:358 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=216:216 Key33=222:222 Key34=65112:176 Key35=65108:175 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=167:167 Key40=208:208 Key41=170:170 Key42=957:330 Key43=673:294 Key44=65122:0 Key45=38:38 Key46=419:321 Key47=65113:733 Key48=123:123 Key49=172:172 Key50=65505:0 Key51=125:125 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=78:78 Key58=186:186 Key59=215:215 Key60=247:247 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslock] Key8=65406:0 Key9=65307:27 Key10=49:49 Key11=50:50 Key12=51:51 Key13=52:52 Key14=53:53 Key15=54:54 Key16=55:55 Key17=56:56 Key18=57:57 Key19=48:48 Key20=39:39 Key21=191:191 Key22=65288:8 Key23=65289:9 Key24=81:81 Key25=87:87 Key26=69:69 Key27=82:82 Key28=84:84 Key29=89:89 Key30=85:85 Key31=73:73 Key32=79:79 Key33=80:80 Key34=65105:180 Key35=43:43 Key36=65293:13 Key37=65507:0 Key38=65:65 Key39=83:83 Key40=68:68 Key41=70:70 Key42=71:71 Key43=72:72 Key44=74:74 Key45=75:75 Key46=76:76 Key47=209:209 Key48=123:123 Key49=124:124 Key50=65505:0 Key51=125:125 Key52=90:90 Key53=88:88 Key54=67:67 Key55=86:86 Key56=66:66 Key57=78:78 Key58=77:77 Key59=44:44 Key60=46:46 Key61=45:45 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=60:60 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [capslockaltgr] Key8=65406:0 Key9=65307:27 Key10=124:124 Key11=64:64 Key12=183:183 Key13=126:126 Key14=189:189 Key15=172:172 Key16=123:123 Key17=91:91 Key18=93:93 Key19=125:125 Key20=92:92 Key21=65115:184 Key22=0:0 Key23=65289:9 Key24=64:64 Key25=419:321 Key26=8364:8364 Key27=182:182 Key28=940:358 Key29=2299:8592 Key30=2302:8595 Key31=2301:8594 Key32=216:216 Key33=222:222 Key34=65111:168 Key35=65107:126 Key36=65293:13 Key37=65507:0 Key38=198:198 Key39=223:223 Key40=208:208 Key41=464:272 Key42=957:330 Key43=673:294 Key44=65121:0 Key45=930:312 Key46=419:321 Key47=126:126 Key48=65106:94 Key49=172:172 Key50=65505:0 Key51=65104:96 Key52=171:171 Key53=187:187 Key54=162:162 Key55=2770:8220 Key56=2771:8221 Key57=78:78 Key58=924:0 Key59=2211:0 Key60=183:183 Key61=65120:0 Key62=65506:0 Key63=65450:42 Key64=65513:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65429:0 Key80=65431:0 Key81=65434:0 Key82=65453:45 Key83=65430:0 Key84=65437:0 Key85=65432:0 Key86=65451:43 Key87=65436:0 Key88=65433:0 Key89=65435:0 Key90=65438:0 Key91=65439:0 Key92=65377:0 Key93=0:0 Key94=124:124 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=0:0 Key126=65469:61 Key127=0:0 Key128=0:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslock] Key8=65406:0 Key9=65307:27 Key10=33:33 Key11=34:34 Key12=35:35 Key13=36:36 Key14=37:37 Key15=38:38 Key16=47:47 Key17=40:40 Key18=41:41 Key19=61:61 Key20=63:63 Key21=161:161 Key22=65288:8 Key23=65056:0 Key24=113:113 Key25=119:119 Key26=101:101 Key27=114:114 Key28=116:116 Key29=121:121 Key30=117:117 Key31=105:105 Key32=111:111 Key33=112:112 Key34=65111:168 Key35=42:42 Key36=65293:13 Key37=65507:0 Key38=97:97 Key39=115:115 Key40=100:100 Key41=102:102 Key42=103:103 Key43=104:104 Key44=106:106 Key45=107:107 Key46=108:108 Key47=241:241 Key48=91:91 Key49=176:176 Key50=65505:0 Key51=93:93 Key52=122:122 Key53=120:120 Key54=99:99 Key55=118:118 Key56=98:98 Key57=110:110 Key58=109:109 Key59=59:59 Key60=58:58 Key61=95:95 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=62:62 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 [shiftcapslockaltgr] Key8=65406:0 Key9=65307:27 Key10=161:161 Key11=2755:8539 Key12=163:163 Key13=36:36 Key14=2756:8540 Key15=2757:8541 Key16=2758:8542 Key17=2761:8482 Key18=177:177 Key19=176:176 Key20=191:191 Key21=65116:731 Key22=0:0 Key23=65056:0 Key24=2009:937 Key25=435:322 Key26=162:162 Key27=174:174 Key28=956:359 Key29=165:165 Key30=2300:8593 Key31=697:305 Key32=248:248 Key33=254:254 Key34=65112:176 Key35=65108:175 Key36=65293:13 Key37=65507:0 Key38=230:230 Key39=167:167 Key40=240:240 Key41=170:170 Key42=959:331 Key43=689:295 Key44=65122:0 Key45=38:38 Key46=435:322 Key47=65113:733 Key48=123:123 Key49=172:172 Key50=65505:0 Key51=125:125 Key52=60:60 Key53=62:62 Key54=169:169 Key55=2768:8216 Key56=2769:8217 Key57=110:110 Key58=186:186 Key59=215:215 Key60=247:247 Key61=65110:729 Key62=65506:0 Key63=65450:42 Key64=65511:0 Key65=32:32 Key66=65509:0 Key67=65470:0 Key68=65471:0 Key69=65472:0 Key70=65473:0 Key71=65474:0 Key72=65475:0 Key73=65476:0 Key74=65477:0 Key75=65478:0 Key76=65479:0 Key77=65407:0 Key78=65300:0 Key79=65463:55 Key80=65464:56 Key81=65465:57 Key82=65453:45 Key83=65460:52 Key84=65461:53 Key85=65462:54 Key86=65451:43 Key87=65457:49 Key88=65458:50 Key89=65459:51 Key90=65456:48 Key91=65454:46 Key92=65377:0 Key93=0:0 Key94=166:166 Key95=65480:0 Key96=65481:0 Key97=65360:0 Key98=65362:0 Key99=65365:0 Key100=65361:0 Key101=0:0 Key102=65363:0 Key103=65367:0 Key104=65364:0 Key105=65366:0 Key106=65379:0 Key107=65535:127 Key108=65421:13 Key109=65508:0 Key110=65299:0 Key111=65377:0 Key112=65455:47 Key113=65027:0 Key114=269025049:0 Key115=65515:0 Key116=65516:0 Key117=0:0 Key118=269025153:0 Key119=269025093:0 Key120=269025094:0 Key121=269025095:0 Key122=269025096:0 Key123=0:0 Key124=65027:0 Key125=65513:0 Key126=65469:61 Key127=65515:0 Key128=65517:0 Key129=0:0 Key130=0:0 Key131=0:0 Key132=0:0 Key133=0:0 Key134=0:0 Key135=0:0 Key136=0:0 Key137=0:0 xrdp-0.10.1/instfiles/pulse/default.pa000644 001751 000000 00000000404 14652432047 017731 0ustar00metawheel000000 000000 .nofail .fail load-module module-augment-properties load-module module-always-sink .ifexists module-xrdp-sink.so load-module module-xrdp-sink .endif .ifexists module-xrdp-source.so load-module module-xrdp-source .endif load-module module-native-protocol-unix xrdp-0.10.1/instfiles/pulse/Makefile.in000644 001751 000000 00000037472 14652432075 020050 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = instfiles/pulse ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_pulse_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pulsedir)" DATA = $(dist_pulse_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pulsedir = $(sysconfdir)/xrdp/pulse dist_pulse_DATA = default.pa all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign instfiles/pulse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign instfiles/pulse/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_pulseDATA: $(dist_pulse_DATA) @$(NORMAL_INSTALL) @list='$(dist_pulse_DATA)'; test -n "$(pulsedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pulsedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pulsedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pulsedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pulsedir)" || exit $$?; \ done uninstall-dist_pulseDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pulse_DATA)'; test -n "$(pulsedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pulsedir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pulsedir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_pulseDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_pulseDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_pulseDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_pulseDATA .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/instfiles/pulse/Makefile.am000644 001751 000000 00000000101 14652432047 020011 0ustar00metawheel000000 000000 pulsedir = $(sysconfdir)/xrdp/pulse dist_pulse_DATA = default.pa xrdp-0.10.1/instfiles/init.d/xrdp000644 001751 000000 00000012057 14652432047 016727 0ustar00metawheel000000 000000 #!/bin/sh -e # # start/stop xrdp and sesman daemons # ### BEGIN INIT INFO # Provides: xrdp # Required-Start: $network $remote_fs # Required-Stop: $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start xrdp and sesman daemons # Description: XRDP uses the Remote Desktop Protocol to present a # graphical login to a remote client allowing connection # to a VNC server or another RDP server. ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin BASE=__BASE__ DAEMON=${BASE}/sbin/xrdp SDAEMON=${BASE}/sbin/xrdp-sesman PIDDIR=/var/run/ SESMAN_START=yes #USERID=xrdp # the X11rdp backend only works as root at the moment - GH 20/03/2013 USERID=root NAME=xrdp DESC="Remote Desktop Protocol server" test -x $DAEMON || exit 0 . /lib/lsb/init-functions check_root() { if [ "$(id -u)" != "0" ]; then log_failure_msg "You must be root to start, stop or restart $NAME." exit 4 fi } force_stop() { DELAY=1 PROCLIST="xrdp-sesman xrdp-sessvc xrdp-chansrv X11rdp Xvnc" for p in $PROCLIST; do pgrep -x $p >/dev/null && pkill -x $p sleep $DELAY pgrep -x $p >/dev/null && pkill -9 -x $p done # let's not kill ourselves - the init script is called xrdp as well pgrep -fx $DAEMON >/dev/null && pkill -fx $DAEMON sleep $DELAY pgrep -fx $DAEMON >/dev/null && pkill -9 -fx $DAEMON rm -f $PIDDIR/xrdp*.pid } if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME fi # Tasks that can only be run as root if [ "$(id -u)" = "0" ]; then # Check for pid dir if [ ! -d $PIDDIR ] ; then mkdir $PIDDIR fi chown $USERID:$USERID $PIDDIR fi case "$1" in start) check_root exitval=0 log_daemon_msg "Starting $DESC " if pidofproc -p $PIDDIR/$NAME.pid $DAEMON > /dev/null; then log_progress_msg "$NAME apparently already running" log_end_msg 0 exit 0 fi log_progress_msg $NAME start-stop-daemon --start --quiet --oknodo --pidfile $PIDDIR/$NAME.pid \ --chuid $USERID:$USERID --exec $DAEMON >/dev/null exitval=$? if [ "$SESMAN_START" = "yes" ] ; then log_progress_msg "sesman" start-stop-daemon --start --quiet --oknodo --pidfile $PIDDIR/xrdp-sesman.pid \ --exec $SDAEMON >/dev/null value=$? [ $value -gt 0 ] && exitval=$value fi # Make pidfile readable for all users (for status to work) [ -e $PIDDIR/xrdp-sesman.pid ] && chmod 0644 $PIDDIR/xrdp-sesman.pid [ -e $PIDDIR/$NAME.pid ] && chmod 0644 $PIDDIR/$NAME.pid # Note: Unfortunately, xrdp currently takes too long to create # the pidfile unless properly patched log_end_msg $exitval ;; stop) check_root [ -n "$XRDP_UPGRADE" -a "$RESTART_ON_UPGRADE" = "no" ] && { echo "Upgrade in progress, no restart of xrdp." exit 0 } exitval=0 log_daemon_msg "Stopping RDP Session manager " log_progress_msg "sesman" if pidofproc -p $PIDDIR/xrdp-sesman.pid $SDAEMON > /dev/null; then start-stop-daemon --stop --quiet --oknodo --pidfile $PIDDIR/xrdp-sesman.pid \ --chuid $USERID:$USERID --exec $SDAEMON exitval=$? else log_progress_msg "apparently not running" fi log_progress_msg $NAME if pidofproc -p $PIDDIR/$NAME.pid $DAEMON > /dev/null; then start-stop-daemon --stop --quiet --oknodo --pidfile $PIDDIR/$NAME.pid \ --exec $DAEMON value=$? [ $value -gt 0 ] && exitval=$value else log_progress_msg "apparently not running" fi log_end_msg $exitval ;; force-stop) $0 stop # because it doesn't always die the right way force_stop ;; restart|force-reload) check_root $0 stop # Wait for things to settle down sleep 1 $0 start ;; reload) log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" log_warning_msg "cannot re-read the config file (use restart)." ;; status) exitval=0 log_daemon_msg "Checking status of $DESC" "$NAME" if pidofproc -p $PIDDIR/$NAME.pid $DAEMON > /dev/null; then log_progress_msg "running" log_end_msg 0 else log_progress_msg "apparently not running" log_end_msg 1 || true exitval=1 fi if [ "$SESMAN_START" = "yes" ] ; then log_daemon_msg "Checking status of RDP Session Manager" "sesman" if pidofproc -p $PIDDIR/xrdp-sesman.pid $SDAEMON > /dev/null; then log_progress_msg "running" log_end_msg 0 else log_progress_msg "apparently not running" log_end_msg 1 || true exitval=1 fi fi exit $exitval ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0 xrdp-0.10.1/instfiles/init.d/Makefile.in000644 001751 000000 00000041200 14652432075 020065 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = instfiles/init.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_startscript_SCRIPTS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(startscriptdir)" SCRIPTS = $(dist_startscript_SCRIPTS) 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 = SOURCES = DIST_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) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ startscriptdir = $(sysconfdir)/init.d dist_startscript_SCRIPTS = xrdp all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign instfiles/init.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign instfiles/init.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_startscriptSCRIPTS: $(dist_startscript_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_startscript_SCRIPTS)'; test -n "$(startscriptdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(startscriptdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(startscriptdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(startscriptdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(startscriptdir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_startscriptSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_startscript_SCRIPTS)'; test -n "$(startscriptdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(startscriptdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(startscriptdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_startscriptSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_startscriptSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_startscriptSCRIPTS 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_startscriptSCRIPTS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/instfiles/init.d/Makefile.am000644 001751 000000 00000000106 14652432047 020053 0ustar00metawheel000000 000000 startscriptdir = $(sysconfdir)/init.d dist_startscript_SCRIPTS = xrdp xrdp-0.10.1/instfiles/default/xrdp000644 001751 000000 00000000254 14652432047 017162 0ustar00metawheel000000 000000 # Do we need to start sesman ? SESMAN_START=yes # Do we restart xrdp on upgrade ? If not set to no, any xrdp session will # be shutdown on upgrade. # RESTART_ON_UPGRADE=no xrdp-0.10.1/instfiles/default/Makefile.in000644 001751 000000 00000037673 14652432075 020347 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = instfiles/default ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_startscript_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(startscriptdir)" DATA = $(dist_startscript_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ startscriptdir = $(sysconfdir)/default dist_startscript_DATA = xrdp all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign instfiles/default/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign instfiles/default/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_startscriptDATA: $(dist_startscript_DATA) @$(NORMAL_INSTALL) @list='$(dist_startscript_DATA)'; test -n "$(startscriptdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(startscriptdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(startscriptdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(startscriptdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(startscriptdir)" || exit $$?; \ done uninstall-dist_startscriptDATA: @$(NORMAL_UNINSTALL) @list='$(dist_startscript_DATA)'; test -n "$(startscriptdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(startscriptdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(startscriptdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_startscriptDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_startscriptDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_startscriptDATA 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_startscriptDATA .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/instfiles/default/Makefile.am000644 001751 000000 00000000104 14652432047 020310 0ustar00metawheel000000 000000 startscriptdir = $(sysconfdir)/default dist_startscript_DATA = xrdp xrdp-0.10.1/instfiles/rc.d/xrdp-sesman000644 001751 000000 00000003177 14652432047 017657 0ustar00metawheel000000 000000 #!/bin/sh # # Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved. # Copyright (c) 2015-2018 Koichiro Iwao # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # # REQUIRE: LOGIN # PROVIDE: xrdp_sesman # . /etc/rc.subr name="xrdp_sesman" rcvar="xrdp_sesman_enable" load_rc_config "$name" : ${xrdp_sesman_enable="NO"} extra_commands="status" command="%%PREFIX%%/sbin/xrdp-sesman" run_rc_command "$1" xrdp-0.10.1/instfiles/rc.d/Makefile.in000644 001751 000000 00000041204 14652432075 017532 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = instfiles/rc.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_startscript_SCRIPTS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(startscriptdir)" SCRIPTS = $(dist_startscript_SCRIPTS) 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 = SOURCES = DIST_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) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ startscriptdir = $(sysconfdir)/rc.d dist_startscript_SCRIPTS = xrdp xrdp-sesman all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign instfiles/rc.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign instfiles/rc.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_startscriptSCRIPTS: $(dist_startscript_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_startscript_SCRIPTS)'; test -n "$(startscriptdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(startscriptdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(startscriptdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(startscriptdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(startscriptdir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_startscriptSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_startscript_SCRIPTS)'; test -n "$(startscriptdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(startscriptdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(startscriptdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_startscriptSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_startscriptSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_startscriptSCRIPTS 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_startscriptSCRIPTS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/instfiles/rc.d/xrdp000644 001751 000000 00000005000 14652432047 016356 0ustar00metawheel000000 000000 #!/bin/sh # # Copyright (c) 1992-2018 The FreeBSD Project. All rights reserved. # Copyright (c) 2015-2018 Koichiro Iwao # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # # REQUIRE: DAEMON # PROVIDE: xrdp # # Add the following line to /etc/rc.conf to enable xrdp: # # xrdp_enable="YES" # xrdp_sesman_enable="YES" . /etc/rc.subr name="xrdp" rcvar="xrdp_enable" load_rc_config "$name" : ${xrdp_enable="NO"} extra_commands="status allstart allstop allrestart" command="%%PREFIX%%/sbin/xrdp" allstart_cmd="xrdp_allstart" allstop_cmd="xrdp_allstop" allrestart_cmd="xrdp_allrestart" xrdp_allstart() { run_rc_command "start" if checkyesno "xrdp_sesman_enable" && \ ! %%PREFIX%%/etc/rc.d/xrdp-sesman forcestatus 1>/dev/null 2>&1; then %%PREFIX%%/etc/rc.d/xrdp-sesman start || return 1 fi } xrdp_allstop() { if checkyesno "xrdp_sesman_enable" && \ %%PREFIX%%/etc/rc.d/xrdp-sesman forcestatus 1>/dev/null 2>&1; then %%PREFIX%%/etc/rc.d/xrdp-sesman stop || return 1 fi run_rc_command "stop" } xrdp_allrestart() { if checkyesno "xrdp_sesman_enable" && \ %%PREFIX%%/etc/rc.d/xrdp-sesman forcestatus 1>/dev/null 2>&1; then %%PREFIX%%/etc/rc.d/xrdp-sesman restart || return 1 fi run_rc_command "restart" } run_rc_command "$1" xrdp-0.10.1/instfiles/rc.d/Makefile.am000644 001751 000000 00000000120 14652432047 017510 0ustar00metawheel000000 000000 startscriptdir = $(sysconfdir)/rc.d dist_startscript_SCRIPTS = xrdp xrdp-sesman xrdp-0.10.1/instfiles/pam.d/mkpamrules000755 001751 000000 00000004112 14652432047 017740 0ustar00metawheel000000 000000 #!/bin/sh # Find suitable PAM config file rules="$1" srcdir="$2" outfile="$3" service="xrdp-sesman" pamdir="/etc/pam.d" pamdir_suse="/usr/lib/pam.d" if [ ! -d $pamdir_suse ]; then # Older SUSE distros uses /usr/etc/pam.d pamdir_suse="/usr/etc/pam.d" fi # Modules needed by xrdp-sesman.unix, if we get to that unix_modules_needed="pam_unix.so pam_env.so pam_nologin.so" # Directories where pam modules might be installed # Add to this list as platforms are added pam_module_dir_searchpath="/lib*/security /usr/lib*/security /lib/*/security /usr/lib/*/security" find_pam_module_dir() { # Looks for the pam security module directory set -- $pam_module_dir_searchpath for d in "$@"; do if [ -s "$d/pam_unix.so" ]; then echo "$d" break fi done } can_apply_unix_config() { result=0 module_dir="$1" for m in $unix_modules_needed; do if [ ! -s "$module_dir/$m" ]; then echo " ** $m not found" >&2 result=1 fi done return $result } guess_rules () { rules= if [ -s "$pamdir/password-auth" ]; then rules="redhat" elif [ -s "$pamdir_suse/common-account" ]; then rules="suse" elif [ -s "$pamdir/common-account" ]; then if grep "^@include" "$pamdir/passwd" >/dev/null 2>&1; then rules="debian" else rules="suse" fi elif [ ! -f "$pamdir/system-auth" -a -s "$pamdir/system" ]; then rules="freebsd" elif [ -s "$pamdir/authorization" ]; then rules="macos" elif [ -s "$pamdir/system-remote-login" ]; then rules="arch" elif [ -s "$pamdir/system-auth" ]; then rules="system" else module_dir=`find_pam_module_dir` if [ -d "$module_dir" ]; then #echo "- Found pam modules in $module_dir" >&2 if can_apply_unix_config "$module_dir" ; then rules="unix" fi fi fi } if [ "$rules" = "auto" ]; then guess_rules if [ -z "$rules" ]; then echo "** Can't guess PAM rules for this system" exit 1 fi fi if [ -s "$srcdir/$service.$rules" ]; then ln -nsf "$srcdir/$service.$rules" "$outfile" else echo "Cannot find $srcdir/$service.$rules" exit 1 fi xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.suse000644 001751 000000 00000000244 14652432047 020776 0ustar00metawheel000000 000000 #%PAM-1.0 auth include common-auth account include common-account session include common-session password include common-password xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.freebsd000644 001751 000000 00000000206 14652432047 021427 0ustar00metawheel000000 000000 #%PAM-1.0 auth include system account include system password include system session include system xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.redhat000644 001751 000000 00000000242 14652432047 021264 0ustar00metawheel000000 000000 #%PAM-1.0 auth include password-auth account include password-auth session include password-auth password include password-auth xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.unix000644 001751 000000 00000000620 14652432047 021000 0ustar00metawheel000000 000000 #%PAM-1.0 # # Really basic authentication set when nothing else is available # # You may need to edit this to suit your system depending on the # required functionality. # auth required pam_unix.so shadow auth required pam_env.so password required pam_unix.so account required pam_unix.so account required pam_nologin.so session required pam_unix.so xrdp-0.10.1/instfiles/pam.d/Makefile.in000644 001751 000000 00000040461 14652432075 017707 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = instfiles/pam.d ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pamddir)" DATA = $(pamd_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ PAM_FILES = \ xrdp-sesman.arch \ xrdp-sesman.debian \ xrdp-sesman.freebsd \ xrdp-sesman.macos \ xrdp-sesman.redhat \ xrdp-sesman.suse \ xrdp-sesman.system \ xrdp-sesman.unix EXTRA_DIST = $(PAM_FILES) mkpamrules CLEANFILES = xrdp-sesman @SESMAN_KERBEROS_FALSE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@PAMFILE = xrdp-sesman @SESMAN_KERBEROS_TRUE@@SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_FALSE@PAMFILE = @SESMAN_NOPAM_FALSE@@SESMAN_PAMUSERPASS_TRUE@PAMFILE = @SESMAN_NOPAM_TRUE@PAMFILE = pamddir = $(pamconfdir) pamd_DATA = \ $(PAMFILE) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign instfiles/pam.d/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign instfiles/pam.d/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pamdDATA: $(pamd_DATA) @$(NORMAL_INSTALL) @list='$(pamd_DATA)'; test -n "$(pamddir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pamddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pamddir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pamddir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pamddir)" || exit $$?; \ done uninstall-pamdDATA: @$(NORMAL_UNINSTALL) @list='$(pamd_DATA)'; test -n "$(pamddir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pamddir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pamddir)"; 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: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pamdDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pamdDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pamdDATA install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-pamdDATA .PRECIOUS: Makefile xrdp-sesman: mkpamrules $(srcdir)/mkpamrules $(PAM_RULES) $(srcdir) $@ # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.system000644 001751 000000 00000000232 14652432047 021340 0ustar00metawheel000000 000000 #%PAM-1.0 auth include system-auth account include system-auth password include system-auth session include system-auth xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.debian000644 001751 000000 00000000603 14652432047 021240 0ustar00metawheel000000 000000 #%PAM-1.0 auth required pam_env.so readenv=1 auth required pam_env.so readenv=1 envfile=/etc/default/locale @include common-auth -auth optional pam_gnome_keyring.so -auth optional pam_kwallet5.so @include common-account @include common-password @include common-session -session optional pam_gnome_keyring.so auto_start -session optional pam_kwallet5.so auto_start xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.arch000644 001751 000000 00000000545 14652432047 020740 0ustar00metawheel000000 000000 #%PAM-1.0 auth include system-remote-login -auth optional pam_gnome_keyring.so -auth optional pam_kwallet5.so account include system-remote-login password include system-remote-login session include system-remote-login -session optional pam_gnome_keyring.so auto_start -session optional pam_kwallet5.so auto_start xrdp-0.10.1/instfiles/pam.d/Makefile.am000644 001751 000000 00000001013 14652432047 017663 0ustar00metawheel000000 000000 PAM_FILES = \ xrdp-sesman.arch \ xrdp-sesman.debian \ xrdp-sesman.freebsd \ xrdp-sesman.macos \ xrdp-sesman.redhat \ xrdp-sesman.suse \ xrdp-sesman.system \ xrdp-sesman.unix EXTRA_DIST = $(PAM_FILES) mkpamrules CLEANFILES = xrdp-sesman if SESMAN_NOPAM PAMFILE = else if SESMAN_PAMUSERPASS PAMFILE = else if SESMAN_KERBEROS PAMFILE = else PAMFILE = xrdp-sesman endif endif endif pamddir = $(pamconfdir) pamd_DATA = \ $(PAMFILE) xrdp-sesman: mkpamrules $(srcdir)/mkpamrules $(PAM_RULES) $(srcdir) $@ xrdp-0.10.1/instfiles/pam.d/xrdp-sesman.macos000644 001751 000000 00000001100 14652432047 021111 0ustar00metawheel000000 000000 # xrdp-sesman: auth account password session # based on Apple's sshd PAM configuration auth optional pam_krb5.so use_kcminit auth optional pam_ntlm.so try_first_pass auth optional pam_mount.so try_first_pass auth required pam_opendirectory.so try_first_pass account required pam_nologin.so account required pam_sacl.so sacl_service=ssh account required pam_opendirectory.so password required pam_opendirectory.so session required pam_launchd.so session optional pam_mount.so xrdp-0.10.1/xrdpvr/Makefile.in000644 001751 000000 00000052725 14652432076 016244 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = xrdpvr ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libxrdpvr_la_LIBADD = am_libxrdpvr_la_OBJECTS = xrdpvr.lo libxrdpvr_la_OBJECTS = $(am_libxrdpvr_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/xrdpvr.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libxrdpvr_la_SOURCES) DIST_SOURCES = $(libxrdpvr_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ module_LTLIBRARIES = \ libxrdpvr.la libxrdpvr_la_SOURCES = \ xrdpvr.c \ xrdpvr.h \ xrdpvr_internal.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign xrdpvr/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign xrdpvr/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libxrdpvr.la: $(libxrdpvr_la_OBJECTS) $(libxrdpvr_la_DEPENDENCIES) $(EXTRA_libxrdpvr_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libxrdpvr_la_OBJECTS) $(libxrdpvr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdpvr.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/xrdpvr.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/xrdpvr.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/xrdpvr/Makefile.am000644 001751 000000 00000000156 14652432047 016220 0ustar00metawheel000000 000000 module_LTLIBRARIES = \ libxrdpvr.la libxrdpvr_la_SOURCES = \ xrdpvr.c \ xrdpvr.h \ xrdpvr_internal.h xrdp-0.10.1/xrdpvr/xrdpvr.h000644 001751 000000 00000005156 14652432047 015667 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2012-2013 LK.Rashinkar@gmail.com * Copyright (C) Jay Sorg 2013 jay.sorg@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * a program that uses xrdpapi and ffmpeg to redirect media streams * to a FreeRDP client where it is decompressed and played locally * */ #ifndef __XRDPVR_H__ #define __XRDPVR_H__ #include #ifdef __cplusplus extern "C" { #endif int xrdpvr_init_player(void *channel, int stream_id, char *filename); int xrdpvr_deinit_player(void *channel, int stream_id); int xrdpvr_play_media(void *channel, int stream_id, char *filename); int xrdpvr_set_geometry(void *channel, int stream_id, int xpos, int ypos, int width, int height); int xrdpvr_set_video_format(void *channel, uint32_t stream_id, int format, int width, int height); int xrdpvr_set_audio_format(void *channel, uint32_t stream_id, int format, char *extradata, int extradata_size, int sample_rate, int bit_rate, int channels, int block_align); int xrdpvr_send_video_data(void *channel, uint32_t stream_id, uint32_t data_len, uint8_t *data); int xrdpvr_send_audio_data(void *channel, uint32_t stream_id, uint32_t data_len, uint8_t *data); int xrdpvr_create_metadata_file(void *channel, char *filename); int xrdpvr_play_frame(void *channel, int stream_id, int *vdoTimeout, int *audioTimeout); void xrdpvr_get_media_duration(int64_t *start_time, int64_t *duration); int xrdpvr_seek_media(int64_t pos, int backward); int xrdpvr_get_frame(void **av_pkt_ret, int *is_video_frame, int *delay_in_us); int send_audio_pkt(void *channel, int stream_id, void *pkt_p); int send_video_pkt(void *channel, int stream_id, void *pkt_p); int xrdpvr_set_volume(void *channel, int volume); int xrdpvr_send_init(void *channel); int xrdpvr_read_ack(void *channel, int *frame); #ifdef __cplusplus } #endif #endif /* __XRDPVR_H__ */ xrdp-0.10.1/xrdpvr/xrdpvr.c000644 001751 000000 00000065520 14652432047 015663 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2012-2013 LK.Rashinkar@gmail.com * Copyright (C) Jay Sorg 2013 jay.sorg@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * a program that uses xrdpapi and ffmpeg to redirect media streams * to a FreeRDP client where it is decompressed and played locally * */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdpvr.h" #include "xrdpvr_internal.h" /* globals */ PLAYER_STATE_INFO g_psi; int g_video_index = -1; int g_audio_index = -1; /*****************************************************************************/ /* produce a hex dump */ void hexdump(char *p, int len) { unsigned char *line; int i; int thisline; int offset; line = (unsigned char *)p; offset = 0; while (offset < len) { printf("%04x ", offset); thisline = len - offset; if (thisline > 16) { thisline = 16; } for (i = 0; i < thisline; i++) { printf("%02x ", line[i]); } for (; i < 16; i++) { printf(" "); } for (i = 0; i < thisline; i++) { printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); } printf("\n"); offset += thisline; line += thisline; } } /** * initialize the media player * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * @param filename media file to play * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_init_player(void *channel, int stream_id, char *filename) { printf("xrdpvr_init_player:\n"); if ((channel == NULL) || (stream_id <= 0) || (filename == NULL)) { return -1; } xrdpvr_send_init(channel); } /** * de-initialize the media player * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_deinit_player(void *channel, int stream_id) { STREAM *s; char *cptr; int rv; int len; if ((channel == NULL) || (stream_id <= 0)) { return -1; } /* do local clean up */ if (g_psi.frame != 0) { av_free(g_psi.frame); g_psi.frame = 0; } if (g_psi.p_audio_codec_ctx != 0) { avcodec_close(g_psi.p_audio_codec_ctx); g_psi.p_audio_codec_ctx = 0; } if (g_psi.p_video_codec_ctx != 0) { avcodec_close(g_psi.p_video_codec_ctx); g_psi.p_video_codec_ctx = 0; } //avformat_close_input(&g_psi.p_format_ctx); if (g_psi.p_format_ctx != 0) { av_close_input_file(g_psi.p_format_ctx); g_psi.p_format_ctx = 0; } /* do remote cleanup */ stream_new(s, MAX_PDU_SIZE); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_DEINIT_XRDPVR); stream_ins_u32_le(s, stream_id); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return 0; } /** * play the media * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * @param filename media file to play * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_play_media(void *channel, int stream_id, char *filename) { int i; printf("$$$$$$ xrdpvr_play_media: setting audioTimeout & " "videoTimeout to -1\n"); g_psi.videoTimeout = -1; g_psi.audioTimeout = -1; /* register all available fileformats and codecs */ av_register_all(); /* open media file - this will read just the header */ //if (avformat_open_input(&g_psi.p_format_ctx, filename, NULL, NULL)) if (av_open_input_file(&g_psi.p_format_ctx, filename, NULL, 0, NULL)) { printf("ERROR opening %s\n", filename); return -1; } /* now get the real stream info */ //if (avformat_find_stream_info(g_psi.p_format_ctx, NULL) < 0) if (av_find_stream_info(g_psi.p_format_ctx) < 0) { printf("ERROR reading stream info\n"); return -1; } #if 1 /* print media info to standard out */ av_dump_format(g_psi.p_format_ctx, 0, filename, 0); #endif printf("nb_streams %d\n", g_psi.p_format_ctx->nb_streams); g_audio_index = -1; g_video_index = -1; /* find first audio / video stream */ for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++) { if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO && g_psi.p_format_ctx->streams[i]->codec->codec_id == CODEC_ID_H264 && g_video_index < 0) { g_video_index = i; } if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO && g_psi.p_format_ctx->streams[i]->codec->codec_id == CODEC_ID_AAC && g_audio_index < 0) { g_audio_index = i; } } if ((g_audio_index < 0) || (g_video_index < 0)) { /* close file and return with error */ printf("ERROR: no audio/video stream found in %s\n", filename); //avformat_close_input(&g_psi.p_format_ctx); av_close_input_file(g_psi.p_format_ctx); return -1; } g_psi.audio_stream_index = g_audio_index; g_psi.video_stream_index = g_video_index; /* get pointers to codex contexts for both streams */ g_psi.p_audio_codec_ctx = g_psi.p_format_ctx->streams[g_audio_index]->codec; g_psi.p_video_codec_ctx = g_psi.p_format_ctx->streams[g_video_index]->codec; /* find decoder for audio stream */ g_psi.p_audio_codec = avcodec_find_decoder(g_psi.p_audio_codec_ctx->codec_id); if (g_psi.p_audio_codec == NULL) { printf("ERROR: audio codec not supported\n"); } /* find decoder for video stream */ g_psi.p_video_codec = avcodec_find_decoder(g_psi.p_video_codec_ctx->codec_id); if (g_psi.p_video_codec == NULL) { printf("ERROR: video codec not supported\n"); } /* open decoder for audio stream */ //if (avcodec_open2(g_psi.p_audio_codec_ctx, g_psi.p_audio_codec, // NULL) < 0) if (avcodec_open(g_psi.p_audio_codec_ctx, g_psi.p_audio_codec) < 0) { printf("ERROR: could not open audio decoder\n"); return -1; } printf("%d\n", g_psi.p_audio_codec_ctx->extradata_size); hexdump(g_psi.p_audio_codec_ctx->extradata, g_psi.p_audio_codec_ctx->extradata_size); printf("%d %d %d %d\n", g_psi.p_audio_codec_ctx->sample_rate, g_psi.p_audio_codec_ctx->bit_rate, g_psi.p_audio_codec_ctx->channels, g_psi.p_audio_codec_ctx->block_align); /* open decoder for video stream */ //if (avcodec_open2(g_psi.p_video_codec_ctx, g_psi.p_video_codec, // NULL) < 0) if (avcodec_open(g_psi.p_video_codec_ctx, g_psi.p_video_codec) < 0) { printf("ERROR: could not open video decoder\n"); return -1; } g_psi.bsfc = av_bitstream_filter_init("h264_mp4toannexb"); printf("g_psi.bsfc %p\n", g_psi.bsfc); if (xrdpvr_set_video_format(channel, 101, 0, g_psi.p_video_codec_ctx->width, g_psi.p_video_codec_ctx->height)) { printf("xrdpvr_set_video_format() failed\n"); return -1; } printf("xrdpvr_play_media: calling xrdpvr_set_audio_format\n"); if (xrdpvr_set_audio_format(channel, 101, 0, g_psi.p_audio_codec_ctx->extradata, g_psi.p_audio_codec_ctx->extradata_size, g_psi.p_audio_codec_ctx->sample_rate, g_psi.p_audio_codec_ctx->bit_rate, g_psi.p_audio_codec_ctx->channels, g_psi.p_audio_codec_ctx->block_align)) { printf("xrdpvr_set_audio_format() failed\n"); return 1; } return 0; } static int firstAudioPkt = 1; static int firstVideoPkt = 1; /******************************************************************************/ int xrdpvr_get_frame(void **av_pkt_ret, int *is_video_frame, int *delay_in_us) { AVPacket *av_pkt; double dts; int error; AVBitStreamFilterContext *bsfc; AVPacket new_pkt; //printf("xrdpvr_get_frame:\n"); /* alloc an AVPacket */ if ((av_pkt = (AVPacket *) malloc(sizeof(AVPacket))) == NULL) { return -1; } /* read one frame into AVPacket */ if (av_read_frame(g_psi.p_format_ctx, av_pkt) < 0) { free(av_pkt); return -1; } if (av_pkt->stream_index == g_audio_index) { /* got an audio packet */ dts = av_pkt->dts; dts *= av_q2d(g_psi.p_format_ctx->streams[g_audio_index]->time_base); if (g_psi.audioTimeout < 0) { *delay_in_us = 1000 * 5; g_psi.audioTimeout = dts; } else { *delay_in_us = (int) ((dts - g_psi.audioTimeout) * 1000000); g_psi.audioTimeout = dts; } *is_video_frame = 0; if (firstAudioPkt) { firstAudioPkt = 0; } } else if (av_pkt->stream_index == g_video_index) { bsfc = g_psi.bsfc; while (bsfc != 0) { new_pkt = *av_pkt; error = av_bitstream_filter_filter(bsfc, g_psi.p_video_codec_ctx, 0, &new_pkt.data, &new_pkt.size, av_pkt->data, av_pkt->size, av_pkt->flags & PKT_FLAG_KEY); if (error > 0) { av_free_packet(av_pkt); new_pkt.destruct = av_destruct_packet; } else if (error < 0) { printf("bitstream filter error\n"); } *av_pkt = new_pkt; bsfc = bsfc->next; } dts = av_pkt->dts; dts *= av_q2d(g_psi.p_format_ctx->streams[g_video_index]->time_base); if (g_psi.videoTimeout < 0) { *delay_in_us = 1000 * 5; g_psi.videoTimeout = dts; } else { *delay_in_us = (int) ((dts - g_psi.videoTimeout) * 1000000); g_psi.videoTimeout = dts; } *is_video_frame = 1; if (firstVideoPkt) { firstVideoPkt = 0; } } *av_pkt_ret = av_pkt; return 0; } /******************************************************************************/ int send_audio_pkt(void *channel, int stream_id, void *pkt_p) { AVPacket *av_pkt = (AVPacket *) pkt_p; xrdpvr_send_audio_data(channel, stream_id, av_pkt->size, av_pkt->data); av_free_packet(av_pkt); free(av_pkt); } /******************************************************************************/ int send_video_pkt(void *channel, int stream_id, void *pkt_p) { AVPacket *av_pkt = (AVPacket *) pkt_p; xrdpvr_send_video_data(channel, stream_id, av_pkt->size, av_pkt->data); av_free_packet(av_pkt); free(av_pkt); } /******************************************************************************/ int xrdpvr_play_frame(void *channel, int stream_id, int *videoTimeout, int *audioTimeout) { AVPacket av_pkt; double dts; int delay_in_us; int error; AVBitStreamFilterContext *bsfc; AVPacket new_pkt; //printf("xrdpvr_play_frame:\n"); if (av_read_frame(g_psi.p_format_ctx, &av_pkt) < 0) { printf("xrdpvr_play_frame: av_read_frame failed\n"); return -1; } if (av_pkt.stream_index == g_audio_index) { xrdpvr_send_audio_data(channel, stream_id, av_pkt.size, av_pkt.data); dts = av_pkt.dts; dts *= av_q2d(g_psi.p_format_ctx->streams[g_audio_index]->time_base); *audioTimeout = (int) ((dts - g_psi.audioTimeout) * 1000000); *videoTimeout = -1; if (g_psi.audioTimeout > dts) { g_psi.audioTimeout = dts; delay_in_us = 1000 * 40; } else { delay_in_us = (int) ((dts - g_psi.audioTimeout) * 1000000); g_psi.audioTimeout = dts; } printf("audio delay: %d\n", delay_in_us); usleep(delay_in_us); //usleep(1000 * 1); } else if (av_pkt.stream_index == g_video_index) { bsfc = g_psi.bsfc; while (bsfc != 0) { new_pkt = av_pkt; error = av_bitstream_filter_filter(bsfc, g_psi.p_video_codec_ctx, 0, &new_pkt.data, &new_pkt.size, av_pkt.data, av_pkt.size, av_pkt.flags & PKT_FLAG_KEY); if (error > 0) { av_free_packet(&av_pkt); new_pkt.destruct = av_destruct_packet; } else if (error < 0) { printf("bitstream filter error\n"); } av_pkt = new_pkt; bsfc = bsfc->next; } xrdpvr_send_video_data(channel, stream_id, av_pkt.size, av_pkt.data); dts = av_pkt.dts; dts *= av_q2d(g_psi.p_format_ctx->streams[g_video_index]->time_base); *videoTimeout = (int) ((dts - g_psi.videoTimeout) * 1000000); *audioTimeout = -1; if (g_psi.videoTimeout > dts) { g_psi.videoTimeout = dts; delay_in_us = 1000 * 40; } else { delay_in_us = (int) ((dts - g_psi.videoTimeout) * 1000000); g_psi.videoTimeout = dts; } printf("video delay: %d\n", delay_in_us); usleep(delay_in_us); } av_free_packet(&av_pkt); return 0; } /******************************************************************************/ int xrdpvr_seek_media(int64_t pos, int backward) { int64_t seek_target; int seek_flag; printf("xrdpvr_seek_media() entered\n"); g_psi.audioTimeout = -1; g_psi.videoTimeout = -1; seek_flag = (backward) ? AVSEEK_FLAG_BACKWARD : 0; seek_target = av_rescale_q(pos * AV_TIME_BASE, AV_TIME_BASE_Q, g_psi.p_format_ctx->streams[g_video_index]->time_base); if (av_seek_frame(g_psi.p_format_ctx, g_video_index, seek_target, seek_flag) < 0) { printf("media seek error\n"); return -1; } printf("xrdpvr_seek_media: success\n"); return 0; } /******************************************************************************/ void xrdpvr_get_media_duration(int64_t *start_time, int64_t *duration) { *start_time = g_psi.p_format_ctx->start_time / AV_TIME_BASE; *duration = g_psi.p_format_ctx->duration / AV_TIME_BASE; } /******************************************************************************/ int xrdpvr_set_geometry(void *channel, int stream_id, int xpos, int ypos, int width, int height) { STREAM *s; char *cptr; int rv; int len; printf("xrdpvr_set_geometry: entered; x=%d y=%d\n", xpos, ypos); stream_new(s, MAX_PDU_SIZE); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_SET_GEOMETRY); stream_ins_u32_le(s, stream_id); stream_ins_u32_le(s, xpos); stream_ins_u32_le(s, ypos); stream_ins_u32_le(s, width); stream_ins_u32_le(s, height); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return rv; } /** * set video format * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_set_video_format(void *channel, uint32_t stream_id, int format, int width, int height) { STREAM *s; char *cptr; int rv; int len; width = (width + 15) & ~15; stream_new(s, MAX_PDU_SIZE); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_SET_VIDEO_FORMAT); stream_ins_u32_le(s, stream_id); stream_ins_u32_le(s, format); stream_ins_u32_le(s, width); stream_ins_u32_le(s, height); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return rv; } /** * set audio format * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_set_audio_format(void *channel, uint32_t stream_id, int format, char *extradata, int extradata_size, int sample_rate, int bit_rate, int channels, int block_align) { STREAM *s; char *cptr; int rv; int len; stream_new(s, MAX_PDU_SIZE); printf("extradata_size %d sample_rate %d bit_rate %d channels %d " "block_align %d\n", extradata_size, sample_rate, bit_rate, channels, block_align); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_SET_AUDIO_FORMAT); stream_ins_u32_le(s, stream_id); stream_ins_u32_le(s, format); stream_ins_u32_le(s, extradata_size); memcpy(s->p, extradata, extradata_size); s->p += extradata_size; stream_ins_u32_le(s, sample_rate); stream_ins_u32_le(s, bit_rate); stream_ins_u32_le(s, channels); stream_ins_u32_le(s, block_align); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return rv; } /** * send video data to client * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * @param data_len number of bytes to send * @param data video data to send * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_send_video_data(void *channel, uint32_t stream_id, uint32_t data_len, uint8_t *data) { STREAM *s; char *cptr; int rv; int len; //printf("xrdpvr_send_video_data:\n"); stream_new(s, MAX_PDU_SIZE + data_len); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_SEND_VIDEO_DATA); stream_ins_u32_le(s, stream_id); stream_ins_u32_le(s, data_len); stream_ins_byte_array(s, data, data_len); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); #ifdef DEBUG_FRAGMENTS printf("### sent %d + 4 bytes video data to client\n", len); #endif return rv; } /** * send audio data to client * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param stream_id unique identification number for this stream * @param data_len number of bytes to send * @param data audio data to send * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_send_audio_data(void *channel, uint32_t stream_id, uint32_t data_len, uint8_t *data) { STREAM *s; char *cptr; int rv; int len; //printf("xrdpvr_send_audio_data:\n"); stream_new(s, MAX_PDU_SIZE + data_len); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_SEND_AUDIO_DATA); stream_ins_u32_le(s, stream_id); stream_ins_u32_le(s, data_len); stream_ins_byte_array(s, data, data_len); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return rv; } /** * send media meta-data to client * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param filename media file * * @return 0 on success, -1 on error *****************************************************************************/ int xrdpvr_create_metadata_file(void *channel, char *filename) { STREAM *s; char *cptr; int rv; int len; int fd; if ((fd = open(filename, O_RDONLY)) < 0) { return -1; } stream_new(s, MAX_PDU_SIZE + 1048576); /* send CMD_CREATE_META_DATA_FILE */ stream_ins_u32_le(s, 4); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_CREATE_META_DATA_FILE); if (xrdpvr_write_to_client(channel, s)) { close(fd); return -1; } /* read first 1MB of file and send to client */ s->p = s->data; stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_WRITE_META_DATA); stream_ins_u32_le(s, 0); /* number of bytes to follow */ if ((rv = read(fd, s->p, 1048576)) <= 0) { close(fd); return -1; } s->p += rv; /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); /* number of bytes in this cmd */ s->p += 4; stream_ins_u32_le(s, rv); /* number of metadata bytes */ s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); /* send CMD_CLOSE_META_DATA_FILE */ s->p = s->data; stream_ins_u32_le(s, 4); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_CLOSE_META_DATA_FILE); if (xrdpvr_write_to_client(channel, s)) { close(fd); return -1; } stream_free(s); return rv; } /** ******************************************************************************/ static int xrdpvr_read_from_client(void *channel, STREAM *s, int bytes, int timeout) { unsigned int bytes_read; int total_read; int ok; //printf("xrdpvr_read_from_client:\n"); total_read = 0; while (total_read < bytes) { //printf("xrdpvr_read_from_client: loop\n"); bytes_read = bytes - total_read; ok = WTSVirtualChannelRead(channel, timeout, s->p, bytes_read, &bytes_read); //printf("xrdpvr_read_from_client: loop ok %d\n", ok); if (ok) { //printf("xrdpvr_read_from_client: bytes_read %d\n", bytes_read); total_read += bytes_read; s->p += bytes_read; } } return 0; } /** * write data to a xrdpvr client * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param s structure containing data to write * * @return 0 on success, -1 on failure ******************************************************************************/ static int xrdpvr_write_to_client(void *channel, STREAM *s) { int bytes_to_send; int bytes_written; int index = 0; int rv; if ((channel == NULL) || (s == NULL)) { return -1; } bytes_to_send = stream_length(s); while (1) { rv = WTSVirtualChannelWrite(channel, &s->data[index], bytes_to_send, &bytes_written); if (rv == 0) { return -1; } index += bytes_written; bytes_to_send -= bytes_written; usleep(1000 * 3); } } /** * write set volume to a xrdpvr client * * @param channel opaque handle returned by WTSVirtualChannelOpenEx * @param volume volume 0x0000 to 0xffff * * @return 0 on success, -1 on failure ******************************************************************************/ int xrdpvr_set_volume(void *channel, int volume) { STREAM *s; char *cptr; int rv; int len; stream_new(s, MAX_BUFSIZE); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_SET_VOLUME); stream_ins_u32_le(s, volume); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return rv; } int xrdpvr_send_init(void *channel) { STREAM *s; char *cptr; int rv; int len; printf("xrdpvr_send_init:\n"); stream_new(s, MAX_BUFSIZE); stream_ins_u32_le(s, 0); /* number of bytes to follow */ stream_ins_u32_le(s, CMD_INIT_XRDPVR); /* insert number of bytes in stream */ len = stream_length(s) - 4; cptr = s->p; s->p = s->data; stream_ins_u32_le(s, len); s->p = cptr; /* write data to virtual channel */ rv = xrdpvr_write_to_client(channel, s); stream_free(s); return rv; } int xrdpvr_read_ack(void *channel, int *frame) { STREAM *s; stream_new(s, MAX_PDU_SIZE); xrdpvr_read_from_client(channel, s, 4, 1000); s->p = s->data; stream_ext_u32_le(s, *frame); stream_free(s); return 0; } xrdp-0.10.1/xrdpvr/xrdpvr_internal.h000644 001751 000000 00000020320 14652432047 017551 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2012-2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * a program that uses xrdpapi and ffmpeg to redirect media streams * to a FreeRDP client where it is decompressed and played locally * */ #ifndef __XRDPVR_INTERNAL_H__ #define __XRDPVR_INTERNAL_H__ #include #include #include #include #include #if LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 20 #define DISTRO_DEBIAN6 #endif #if LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 72 #define DISTRO_UBUNTU1104 #endif #if LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR == 35 #define DISTRO_UBUNTU1204 #endif #if !defined(DISTRO_DEBIAN6) && !defined(DISTRO_UBUNTU1104) && !defined(DISTRO_UBUNTU1204) #warning unsupported distro #endif #ifdef DISTRO_UBUNTU1204 #define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO #define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO #define PKT_FLAG_KEY AV_PKT_FLAG_KEY #endif #define MAX_BUFSIZE (1024 * 1024 * 8) #define CMD_SET_VIDEO_FORMAT 1 #define CMD_SET_AUDIO_FORMAT 2 #define CMD_SEND_VIDEO_DATA 3 #define CMD_SEND_AUDIO_DATA 4 #define CMD_CREATE_META_DATA_FILE 5 #define CMD_CLOSE_META_DATA_FILE 6 #define CMD_WRITE_META_DATA 7 #define CMD_DEINIT_XRDPVR 8 #define CMD_SET_GEOMETRY 9 #define CMD_SET_VOLUME 10 #define CMD_INIT_XRDPVR 11 /* max number of bytes we can send in one pkt */ #define MAX_PDU_SIZE 1600 typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef struct stream { u8 *data; u8 *p; u32 size; int from_buf; } STREAM; /** * create and init a new stream * * @param _s stream to create and init * @param _len number of bytes to store in stream ******************************************************************************/ #define stream_new(_s, _len) \ do \ { \ (_s) = (STREAM *) calloc(1, sizeof(STREAM)); \ (_s)->data = (u8 *) calloc(1, (_len)); \ (_s)->p = (_s)->data; \ (_s)->size = (_len); \ (_s)->from_buf = 0; \ } while (0) /** * create a stream from an existing buffer ******************************************************************************/ #define stream_from_buffer(_s, _buf, _buf_len) \ do \ { \ (_s) = (STREAM *) calloc(1, sizeof(STREAM)); \ (_s)->data = (u8 *) (_buf); \ (_s)->p = (_s)->data; \ (_s)->size = (_buf_len); \ (_s)->from_buf = 1; \ } while (0) /** * release stream resources, including stream itself * note: release _s->data only if we allocated it * * @param _s the stream whose resources are to be released ******************************************************************************/ #define stream_free(_s) \ do \ { \ if (!(_s)->from_buf) \ { \ free((_s)->data); \ } \ free((_s)); \ (_s) = NULL; \ } while (0) /** return number of bytes in stream */ #define stream_length(_s) (int) ((_s)->p - (_s)->data) /** insert a 8 bit value into stream */ #define stream_ins_u8(_s, _val) \ do \ { \ *(_s)->p++ = (unsigned char) (_val); \ } while(0) /** insert a 16 bit value into stream */ #define stream_ins_u16_le(_s, _val) \ do \ { \ *(_s)->p++ = (unsigned char) ((_val) >> 0); \ *(_s)->p++ = (unsigned char) ((_val) >> 8); \ } while (0) /** insert a 32 bit value into stream */ #define stream_ins_u32_le(_s, _val) \ do \ { \ *(_s)->p++ = (unsigned char) ((_val) >> 0); \ *(_s)->p++ = (unsigned char) ((_val) >> 8); \ *(_s)->p++ = (unsigned char) ((_val) >> 16); \ *(_s)->p++ = (unsigned char) ((_val) >> 24); \ } while (0) /** insert a 64 bit value into stream */ #define stream_ins_u64_le(_s, _val) \ do \ { \ *(_s)->p++ = (unsigned char) ((_val) >> 0); \ *(_s)->p++ = (unsigned char) ((_val) >> 8); \ *(_s)->p++ = (unsigned char) ((_val) >> 16); \ *(_s)->p++ = (unsigned char) ((_val) >> 24); \ *(_s)->p++ = (unsigned char) ((_val) >> 32); \ *(_s)->p++ = (unsigned char) ((_val) >> 40); \ *(_s)->p++ = (unsigned char) ((_val) >> 48); \ *(_s)->p++ = (unsigned char) ((_val) >> 56); \ } while (0) /** insert array of chars into stream */ #define stream_ins_byte_array(_s, _ba, _count) \ do \ { \ memcpy((_s)->p, (_ba), (_count)); \ (_s)->p += (_count); \ } while (0) /** extract a 8 bit value from stream */ #define stream_ext_u8(_s, _v) \ do \ { \ (_v) = (u8) *(_s)->p++; \ } while (0) /** extract a 16 bit value from stream */ #define stream_ext_u16_le(_s, _v) \ do \ { \ (_v) = (u16) ((_s)->p[1] << 8 | (_s)->p[0]); \ (_s)->p += 2; \ } while (0) /** extract a 32 bit value from stream */ #define stream_ext_u32_le(_s, _v) \ do \ { \ (_v) = (u32) ((_s)->p[3] << 24 | \ (_s)->p[2] << 16 | \ (_s)->p[1] << 8 | \ (_s)->p[0]); \ (_s)->p += 4; \ } while (0) typedef struct _player_state_info { AVFormatContext *p_format_ctx; AVCodecContext *p_audio_codec_ctx; AVCodecContext *p_video_codec_ctx; AVCodec *p_audio_codec; AVCodec *p_video_codec; int audio_stream_index; int video_stream_index; double audioTimeout; double videoTimeout; /* LK_TODO delete this after we fix the problem */ AVFrame *frame; AVPacket avpkt; AVBitStreamFilterContext *bsfc; } PLAYER_STATE_INFO; static int xrdpvr_read_from_client(void *channel, STREAM *s, int bytes, int timeout); static int xrdpvr_write_to_client(void *channel, STREAM *s); #endif /* __XRDPVR_INTERNAL_H__ */ xrdp-0.10.1/genkeymap/evdev-map.c000644 001751 000000 00000006544 14652432047 016656 0ustar00metawheel000000 000000 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * evdev-map.c * Copyright (C) Michał Górny 2014 * * You may 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. * * main.cc 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 main.cc. If not, write to: * The Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301, USA * * xfree86(base)->evdev keycode mapping */ #if defined(HAVE_CONFIG_H) #include #endif int xfree86_to_evdev[137 - 8 + 1] = { /* MDSW */ 203, /* ESC */ 9, /* AE01 */ 10, /* AE02 */ 11, /* AE03 */ 12, /* AE04 */ 13, /* AE05 */ 14, /* AE06 */ 15, /* AE07 */ 16, /* AE08 */ 17, /* AE09 */ 18, /* AE10 */ 19, /* AE11 */ 20, /* AE12 */ 21, /* BKSP */ 22, /* TAB */ 23, /* AD01 */ 24, /* AD02 */ 25, /* AD03 */ 26, /* AD04 */ 27, /* AD05 */ 28, /* AD06 */ 29, /* AD07 */ 30, /* AD08 */ 31, /* AD09 */ 32, /* AD10 */ 33, /* AD11 */ 34, /* AD12 */ 35, /* RTRN */ 36, /* LCTL */ 37, /* AC01 */ 38, /* AC02 */ 39, /* AC03 */ 40, /* AC04 */ 41, /* AC05 */ 42, /* AC06 */ 43, /* AC07 */ 44, /* AC08 */ 45, /* AC09 */ 46, /* AC10 */ 47, /* AC11 */ 48, /* TLDE */ 49, /* LFSH */ 50, /* BKSL */ 51, /* AB01 */ 52, /* AB02 */ 53, /* AB03 */ 54, /* AB04 */ 55, /* AB05 */ 56, /* AB06 */ 57, /* AB07 */ 58, /* AB08 */ 59, /* AB09 */ 60, /* AB10 */ 61, /* RTSH */ 62, /* KPMU */ 63, /* LALT */ 64, /* SPCE */ 65, /* CAPS */ 66, /* FK01 */ 67, /* FK02 */ 68, /* FK03 */ 69, /* FK04 */ 70, /* FK05 */ 71, /* FK06 */ 72, /* FK07 */ 73, /* FK08 */ 74, /* FK09 */ 75, /* FK10 */ 76, /* NMLK */ 77, /* SCLK */ 78, /* KP7 */ 79, /* KP8 */ 80, /* KP9 */ 81, /* KPSU */ 82, /* KP4 */ 83, /* KP5 */ 84, /* KP6 */ 85, /* KPAD */ 86, /* KP1 */ 87, /* KP2 */ 88, /* KP3 */ 89, /* KP0 */ 90, /* KPDL */ 91, /* SYRQ */ 107, /* II5D */ 0, /* LSGT */ 94, /* FK11 */ 95, /* FK12 */ 96, /* HOME */ 110, /* UP */ 111, /* PGUP */ 112, /* LEFT */ 113, /* II65 */ 0, /* RGHT */ 114, /* END */ 115, /* DOWN */ 116, /* PGDN */ 117, /* INS */ 118, /* DELE */ 119, /* KPEN */ 104, /* RCTL */ 105, /* PAUS */ 127, /* PRSC */ 107, /* KPDV */ 106, /* RALT */ 108, /* BRK */ 419, /* LWIN */ 133, /* RWIN */ 134, /* MENU */ 0, /* FK13 */ 191, /* FK14 */ 192, /* FK15 */ 193, /* FK16 */ 194, /* FK17 */ 195, /* KPDC */ 0, /* LVL3 */ 92, /* ALT */ 204, /* KPEQ */ 125, /* SUPR */ 206, /* HYPR */ 207, /* XFER */ 0, /* I02 */ 0, /* NFER */ 0, /* I04 */ 0, /* AE13 */ 132, /* I06 */ 0, /* I07 */ 0, 0, 0 }; xrdp-0.10.1/genkeymap/readme.txt000644 001751 000000 00000002202 14652432047 016607 0ustar00metawheel000000 000000 Creating a new keymap file. --------------------------- The names of the files are of the format; km-xxxxxxxx.ini where the xxxxxxxx is replaced by the hex number of the layout of interest. The files have 8 sections; [noshift], [shift], [altgr], [shiftaltgr], [capslock], [capslockaltgr], [shiftcapslock], [shiftcapslockaltgr] In each section there are multiple lines for each key. An example line looks like; Key10=49:49 In this line, 10 is the X11 scancode, the first 49 is the keysym value, the second 49 if the unicode value of the key. This is the definition for the 'noshift' '1' key on a en-us keyboard. In this case, the keysym and the unicode value are the same. Here is an example where they are not; This is the definition for the backspace key; Key22=65288:8 And this is the star on the keypad; Key63=65450:42 To create a new file run "xrdp-genkeymap " Example: ./xrdp-genkeymap /etc/xrdp/km-00000409.ini Note: You need to have enough rights to be able to write to the /etc/xrdp directory. Alternatively, create the keymap file in a directory of your choice, then copy or move it over to /etc/xrdp using sudo/su. xrdp-0.10.1/genkeymap/Makefile.in000644 001751 000000 00000052616 14652432075 016675 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xrdp-genkeymap$(EXEEXT) subdir = genkeymap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_xrdp_genkeymap_OBJECTS = genkeymap.$(OBJEXT) evdev-map.$(OBJEXT) xrdp_genkeymap_OBJECTS = $(am_xrdp_genkeymap_OBJECTS) am__DEPENDENCIES_1 = xrdp_genkeymap_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = xrdp_genkeymap_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(xrdp_genkeymap_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/evdev-map.Po \ ./$(DEPDIR)/genkeymap.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_genkeymap_SOURCES) DIST_SOURCES = $(xrdp_genkeymap_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ dump-keymaps.sh \ readme.txt AM_CFLAGS = $(X_CFLAGS) xrdp_genkeymap_SOURCES = genkeymap.c evdev-map.c xrdp_genkeymap_LDFLAGS = \ $(X_LIBS) xrdp_genkeymap_LDADD = \ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign genkeymap/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign genkeymap/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) xrdp-genkeymap$(EXEEXT): $(xrdp_genkeymap_OBJECTS) $(xrdp_genkeymap_DEPENDENCIES) $(EXTRA_xrdp_genkeymap_DEPENDENCIES) @rm -f xrdp-genkeymap$(EXEEXT) $(AM_V_CCLD)$(xrdp_genkeymap_LINK) $(xrdp_genkeymap_OBJECTS) $(xrdp_genkeymap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evdev-map.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genkeymap.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/evdev-map.Po -rm -f ./$(DEPDIR)/genkeymap.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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 ./$(DEPDIR)/evdev-map.Po -rm -f ./$(DEPDIR)/genkeymap.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/genkeymap/genkeymap.c000644 001751 000000 00000010270 14652432047 016741 0ustar00metawheel000000 000000 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ /* * genkeymap.c * Copyright (C) Ádám Wallner 2008 * * You may 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. * * main.cc 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 main.cc. If not, write to: * The Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301, USA Updated Jay Sorg 2009 cs Czech 0x405 de German 0x407 en-us US English 0x409 fr French 0x40c it Italian 0x410 br Portuguese (Brazil) 0x416 ru Russian 0x419 se Swedish 0x41d en-uk UK English 0x809 */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include extern int xfree86_to_evdev[137 - 8 + 1]; int main(int argc, char **argv) { const char *programname; char text[256]; char *displayname = NULL; char *outfname; const char *sections[8] = { "noshift", "shift", "altgr", "shiftaltgr", "capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr" }; int states[8] = {0, 1, 0x80, 0x81, 2, 0x82, 3, 0x83}; int i; int idx; int char_count; int nbytes = 0; int unicode; Display *dpy; KeySym ks; FILE *outf; XKeyPressedEvent e; wchar_t wtext[256]; XkbDescPtr kbdesc; char *symatom; int is_evdev; setlocale(LC_CTYPE, ""); programname = argv[0]; if (argc != 2) { fprintf(stderr, "Usage: %s out_filename\n", programname); fprintf(stderr, "Example: %s /etc/xrdp/km-00000409.ini\n", programname); return 1; } outfname = argv[1]; dpy = XOpenDisplay(displayname); if (!dpy) { fprintf(stderr, "%s: unable to open display '%s'\n", programname, XDisplayName(displayname)); return 1; } /* check whether evdev is used */ kbdesc = XkbAllocKeyboard(); if (!kbdesc) { fprintf(stderr, "%s: unable to allocate keyboard desc\n", programname); XCloseDisplay(dpy); return 1; } if (XkbGetNames(dpy, XkbKeycodesNameMask, kbdesc) != Success) { fprintf(stderr, "%s: unable to obtain keycode name for keyboard\n", programname); XkbFreeKeyboard(kbdesc, 0, True); XCloseDisplay(dpy); return 1; } symatom = XGetAtomName(dpy, kbdesc->names->keycodes); is_evdev = !strncmp(symatom, "evdev", 5); XFree(symatom); XkbFreeKeyboard(kbdesc, 0, True); outf = fopen(outfname, "w"); if (outf == NULL) { fprintf(stderr, "%s: unable to create file '%s'\n", programname, outfname); XCloseDisplay(dpy); return 1; } memset(&e, 0, sizeof(e)); e.type = KeyPress; e.serial = 16; e.send_event = True; e.display = dpy; e.same_screen = True; for (idx = 0; idx < 8; idx++) /* Sections and states */ { fprintf(outf, "[%s]\n", sections[idx]); e.state = states[idx]; for (i = 8; i < 137; i++) /* Keycodes */ { if (is_evdev) { e.keycode = xfree86_to_evdev[i - 8]; } else { e.keycode = i; } nbytes = XLookupString(&e, text, 255, &ks, NULL); text[nbytes] = 0; char_count = mbstowcs(wtext, text, 255); unicode = 0; if (char_count == 1) { unicode = wtext[0]; } fprintf(outf, "Key%d=%d:%d\n", i, (int) ks, unicode); } if (idx != 7) { fprintf(outf, "\n"); } } XCloseDisplay(dpy); fclose(outf); return 0; } xrdp-0.10.1/genkeymap/dump-keymaps.sh000755 001751 000000 00000003345 14652432047 017575 0ustar00metawheel000000 000000 #!/bin/sh if ! command -v setxkbmap >/dev/null then echo "error, setxkbmap not found" exit 1 fi # English - US 'en-us' 0x00000409 setxkbmap -model pc104 -layout us ./xrdp-genkeymap ../instfiles/km-00000409.ini # English - US 'dvorak' 0x00010409 setxkbmap -model pc104 -layout dvorak ./xrdp-genkeymap ../instfiles/km-00010409.ini # English - US 'dvp' 0x19360409 OLD_SETTINGS=$(setxkbmap -query -verbose 4 | sed "s/^\([a-z]\+\):\s*\(.*\)$/-\1 \2/;s/^-options/-option \"\" -option/;s/,/ -option /g" | xargs -d \\n) setxkbmap -rules xfree86 -model pc105 -layout us -variant dvp -option "" -option compose:102 -option caps:shift -option numpad:sg -option numpad:shift3 -option keypad:hex -option keypad:atm -option kpdl:semi -option lv3:ralt_alt ./xrdp-genkeymap ../instfiles/km-19360409.ini setxkbmap ${OLD_SETTINGS} # English - UK 'en-GB' 0x00000809 setxkbmap -model pc105 -layout gb ./xrdp-genkeymap ../instfiles/km-00000809.ini # German 'de' 0x00000407 setxkbmap -model pc104 -layout de ./xrdp-genkeymap ../instfiles/km-00000407.ini # Italian 'it' 0x00000410 setxkbmap -model pc104 -layout it ./xrdp-genkeymap ../instfiles/km-00000410.ini # Japanese 'jp' 0x00000411 setxkbmap -model pc105 -layout jp -variant OADG109A ./xrdp-genkeymap ../instfiles/km-00000411.ini # Polish 'pl' 0x00000415 setxkbmap -model pc104 -layout pl ./xrdp-genkeymap ../instfiles/km-00000415.ini # Russia 'ru' 0x00000419 setxkbmap -model pc104 -layout ru ./xrdp-genkeymap ../instfiles/km-00000419.ini # Sweden 'se' 0x0000041d setxkbmap -model pc104 -layout se ./xrdp-genkeymap ../instfiles/km-0000041d.ini # Portuguese -PT 'pt-pt' 0x00000816 setxkbmap -model pc104 -layout pt ./xrdp-genkeymap ../instfiles/km-00000816.ini # set back to en-us setxkbmap -model pc104 -layout us xrdp-0.10.1/genkeymap/Makefile.am000644 001751 000000 00000000406 14652432047 016651 0ustar00metawheel000000 000000 EXTRA_DIST = \ dump-keymaps.sh \ readme.txt AM_CFLAGS = $(X_CFLAGS) bin_PROGRAMS = \ xrdp-genkeymap xrdp_genkeymap_SOURCES = genkeymap.c evdev-map.c xrdp_genkeymap_LDFLAGS = \ $(X_LIBS) xrdp_genkeymap_LDADD = \ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) xrdp-0.10.1/fontutils/fv1.c000644 001751 000000 00000023334 14652432047 015531 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file fontutils/fv1.c * @brief Definitions relating to fv1 font files */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include "list.h" #include "os_calls.h" #include "parse.h" #include "string_calls.h" #include "fv1.h" const static char FV1_SIGNATURE[] = {'F', 'N', 'T', '1'}; /*****************************************************************************/ struct fv1_glyph * fv1_alloc_glyph(int ucode, unsigned short width, unsigned short height) { int datasize = FONT_DATASIZE_FROM_GEOMETRY(width, height); struct fv1_glyph *glyph = NULL; char ucode_str[16] = {'\0'}; if (ucode < 0) { g_snprintf(ucode_str, sizeof(ucode_str), "Glyph"); } else { g_snprintf(ucode_str, sizeof(ucode_str), "Glyph:U+%04X", ucode); } if (datasize < 0 || datasize > FV1_MAX_GLYPH_DATASIZE) { /* shouldn't happen */ LOG(LOG_LEVEL_ERROR, "%s - datasize %d out of bounds", ucode_str, datasize); } else { glyph = (struct fv1_glyph *) g_malloc( offsetof(struct fv1_glyph, data) + datasize, 1); if (glyph == NULL) { LOG(LOG_LEVEL_ERROR, "%s - out of memory", ucode_str); } else { glyph->width = width; glyph->height = height; } } return glyph; } /*****************************************************************************/ struct fv1_file * fv1_file_create(void) { struct fv1_file *fv1 = (struct fv1_file *)g_new0(struct fv1_file, 1); if (fv1 == NULL) { LOG(LOG_LEVEL_ERROR, "fv1_file_create - out of memory"); } else { fv1->style = 1; /* Unused at present - compatibility value */ fv1->glyphs = list_create(); fv1->glyphs->auto_free = 1; } return fv1; } /*****************************************************************************/ static void add_glyphs_from_stream(struct fv1_file *fv1, struct stream *s) { unsigned short width; unsigned short height; int datasize; struct fv1_glyph *glyph; while (s_check_rem(s, 4)) { in_sint16_le(s, width); in_sint16_le(s, height); datasize = FONT_DATASIZE_FROM_GEOMETRY(width, height); if (datasize < 0 || datasize > FV1_MAX_GLYPH_DATASIZE) { LOG(LOG_LEVEL_ERROR, "Font:%s Glyph:%d - datasize %d out of bounds", fv1->font_name, FV1_GLYPH_END(fv1), datasize); break; } if (!s_check_rem(s, 6 + 6 + datasize)) { LOG(LOG_LEVEL_ERROR, "Font:%s Glyph:%d - not enough data for glyph", fv1->font_name, FV1_GLYPH_END(fv1)); break; } if ((glyph = fv1_alloc_glyph(FV1_GLYPH_END(fv1), width, height)) == NULL) { break; } in_sint16_le(s, glyph->baseline); in_sint16_le(s, glyph->offset); in_sint16_le(s, glyph->inc_by); in_uint8s(s, 6); in_uint8a(s, glyph->data, datasize); list_add_item(fv1->glyphs, (tintptr)glyph); } } /*****************************************************************************/ struct fv1_file * fv1_file_load(const char *filename) { struct fv1_file *fv1 = NULL; if (!g_file_exist(filename)) { LOG(LOG_LEVEL_ERROR, "Can't find font file %s", filename); } else { int file_size = g_file_get_size(filename); if (file_size < FV1_MIN_FILE_SIZE || file_size > FV1_MAX_FILE_SIZE) { LOG(LOG_LEVEL_ERROR, "Font file %s has bad size %d", filename, file_size); } else { struct stream *s; int fd; make_stream(s); init_stream(s, file_size + 1024); fd = g_file_open_ro(filename); if (fd < 0) { LOG(LOG_LEVEL_ERROR, "Can't open font file %s", filename); } else { int b = g_file_read(fd, s->data, file_size + 1024); g_file_close(fd); if (b < FV1_MIN_FILE_SIZE) { LOG(LOG_LEVEL_ERROR, "Font file %s is too small", filename); } else { char sig[sizeof(FV1_SIGNATURE)]; s->end = s->data + b; in_uint8a(s, sig, sizeof(FV1_SIGNATURE)); if (g_memcmp(sig, FV1_SIGNATURE, sizeof(sig)) != 0) { LOG(LOG_LEVEL_ERROR, "Font file %s has wrong signature", filename); } else if ((fv1 = fv1_file_create()) != NULL) { in_uint8a(s, fv1->font_name, FV1_MAX_FONT_NAME_SIZE); fv1->font_name[FV1_MAX_FONT_NAME_SIZE] = '\0'; in_uint16_le(s, fv1->point_size); in_uint16_le(s, fv1->style); in_uint16_le(s, fv1->body_height); in_uint16_le(s, fv1->min_descender); in_uint8s(s, 4); add_glyphs_from_stream(fv1, s); } } } free_stream(s); } } return fv1; } /*****************************************************************************/ void fv1_file_free(struct fv1_file *fv1) { if (fv1 != NULL) { list_delete(fv1->glyphs); g_free(fv1); } } /*****************************************************************************/ int write_stream(int fd, struct stream *s) { const char *p = s->data; int rv = 1; while (p < s->end) { int len = g_file_write(fd, p, s->end - p); if (len <= 0) { rv = 0; break; } p += len; } return rv; } /*****************************************************************************/ int fv1_file_save(const struct fv1_file *fv1, const char *filename) { int fd; struct fv1_glyph *blank_glyph; /* Needed for bad characters */ fd = g_file_open_ex(filename, 0, 1, 1, 1); int rv = 1; if (fd < 0) { LOG(LOG_LEVEL_ERROR, "Unable to open %s for writing [%s]", filename, g_get_strerror()); } else { struct stream *s; make_stream(s); init_stream(s, 1024); /* Write the header */ out_uint8a(s, FV1_SIGNATURE, sizeof(FV1_SIGNATURE)); int len = g_strlen(fv1->font_name); if (len > FV1_MAX_FONT_NAME_SIZE) { len = FV1_MAX_FONT_NAME_SIZE; } out_uint8a(s, fv1->font_name, len); while (len++ < FV1_MAX_FONT_NAME_SIZE) { out_uint8(s, '\0'); } out_uint16_le(s, fv1->point_size); out_uint16_le(s, fv1->style); out_uint16_le(s, fv1->body_height); out_uint16_le(s, fv1->min_descender); out_uint8a(s, "\0\0\0\0", 4); s_mark_end(s); if (!write_stream(fd, s)) { LOG(LOG_LEVEL_ERROR, "Unable to write file header [%s]", g_get_strerror()); } else if ((blank_glyph = fv1_alloc_glyph(-1, 0, 0)) == NULL) { LOG(LOG_LEVEL_ERROR, "Unable to allocate blank glyph"); } else { int u; for (u = FV1_MIN_CHAR; u < FV1_GLYPH_END(fv1); ++u) { const struct fv1_glyph *g = FV1_GET_GLYPH(fv1, u); int datasize; if (g == NULL) { LOG(LOG_LEVEL_WARNING, "Glyph %d is not set", u); g = blank_glyph; } else { datasize = FONT_DATASIZE(g); if (datasize > FV1_MAX_GLYPH_DATASIZE) { LOG(LOG_LEVEL_WARNING, "glyph %d datasize %d exceeds max of %d" " - glyph will be blank", u, datasize, FV1_MAX_GLYPH_DATASIZE); g = blank_glyph; } } init_stream(s, 16 + FONT_DATASIZE(g)); out_uint16_le(s, g->width); out_uint16_le(s, g->height); out_uint16_le(s, g->baseline); out_uint16_le(s, g->offset); out_uint16_le(s, g->inc_by); out_uint8a(s, "\0\0\0\0\0\0", 6); out_uint8a(s, g->data, FONT_DATASIZE(g)); s_mark_end(s); if (!write_stream(fd, s)) { LOG(LOG_LEVEL_ERROR, "Unable to write glyph %d [%s]", u, g_get_strerror()); break; } } g_free(blank_glyph); rv = (u == FV1_GLYPH_END(fv1)) ? 0 : 1; } free_stream(s); g_file_close(fd); } return rv; } xrdp-0.10.1/fontutils/windows/000755 001751 000000 00000000000 14652432047 016356 5ustar00metawheel000000 000000 xrdp-0.10.1/fontutils/fv1.h000644 001751 000000 00000005035 14652432047 015534 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file fontutils/fv1.h * @brief Definitions relating to fv1 font files */ #if !defined(FV1_H) #define FV1_H struct list; #define FV1_DEVICE_DPI 96 #define FV1_MIN_CHAR 0x20 /* First character value in file */ #define FV1_MIN_FILE_SIZE 48 #define FV1_MAX_FILE_SIZE (10 * 1024 * 1024) #define FV1_MAX_FONT_NAME_SIZE 32 #define FV1_MAX_GLYPH_DATASIZE 512 struct fv1_glyph { unsigned short width; /* Width of glyph */ unsigned short height; /* Height of glyph */ short baseline; /* Offset from cursor pos to 1st row of glyph */ short offset; /* Space before glyph (can be -ve) */ unsigned short inc_by; /* Total width of glyph + spacing */ /* Standard C++ does not yet support C99 flexible array members */ #ifdef __cplusplus unsigned char data[1]; #else unsigned char data[]; #endif }; struct fv1_file { char font_name[FV1_MAX_FONT_NAME_SIZE + 1]; short point_size; /* Input point size (for reference) */ short style; short body_height; /* Body height (pixels) */ short min_descender; /* Min descender of the glyphs in the font */ struct list *glyphs; /* Glyphs are struct fv1_glyph * */ }; /** * Get a glyph pointer for a unicode character */ #define FV1_GET_GLYPH(fv1,ucode) \ (((ucode) < FV1_MIN_CHAR) \ ? NULL \ : (struct fv1_glyph *)list_get_item(fv1->glyphs, (ucode) - FV1_MIN_CHAR)) /** * First glyph not in file */ #define FV1_GLYPH_END(fv1) (fv1->glyphs->count + FV1_MIN_CHAR) struct fv1_file * fv1_file_load(const char *filename); void fv1_file_free(struct fv1_file *); struct fv1_file * fv1_file_create(void); struct fv1_glyph * fv1_alloc_glyph(int ucode, /* Unicode character for error reporting if known */ unsigned short width, unsigned short height); enum fv1_realloc_mode { FV1_AT_TOP, FV1_AT_BOTTOM }; int fv1_file_save(const struct fv1_file *fv1, const char *filename); #endif xrdp-0.10.1/fontutils/Makefile.am000644 001751 000000 00000001000 14652432047 016707 0ustar00metawheel000000 000000 EXTRA_DIST = windows # Some programs need freetype2 to build if USE_FREETYPE2 MKFV1 = xrdp-mkfv1 else MKFV1 = endif AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/common \ $(FREETYPE2_CFLAGS) bin_PROGRAMS = \ $(MKFV1) \ xrdp-dumpfv1 xrdp_mkfv1_SOURCES = \ mkfv1.c \ fv1.c \ fv1.h xrdp_mkfv1_LDADD = \ $(top_builddir)/common/libcommon.la \ $(FREETYPE2_LIBS) xrdp_dumpfv1_SOURCES = \ dumpfv1.c \ fv1.c \ fv1.h xrdp_dumpfv1_LDADD = \ $(top_builddir)/common/libcommon.la xrdp-0.10.1/fontutils/dumpfv1.c000644 001751 000000 00000026546 14652432047 016427 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * fonts */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "list.h" #include "os_calls.h" #include "parse.h" #include "string_calls.h" #include "fv1.h" /** * What the program is doing */ enum program_mode { PM_UNSPECIFIED = 0, PM_INFO, PM_GLYPH_INFO_TABLE, PM_SHOW_CHAR }; /** * Parsed program arguments */ struct program_args { const char *font_file; enum program_mode mode; int ucode; /* Unicode character to display in 'c' mode */ }; /**************************************************************************//** * Parses the program args * * @param argc Passed to main * @param @argv Passed to main * @param pa program_pargs structure for resulting values * @return !=0 for success */ static int parse_program_args(int argc, char *argv[], struct program_args *pa) { int params_ok = 1; int opt; pa->font_file = NULL; pa->mode = PM_UNSPECIFIED; pa->ucode = 0; while ((opt = getopt(argc, argv, "c:it")) != -1) { switch (opt) { case 'i': if (pa->mode == PM_UNSPECIFIED) { pa->mode = PM_INFO; } else { LOG(LOG_LEVEL_ERROR, "Can't have two modes set"); params_ok = 0; } break; case 't': if (pa->mode == PM_UNSPECIFIED) { pa->mode = PM_GLYPH_INFO_TABLE; } else { LOG(LOG_LEVEL_ERROR, "Can't have two modes set"); params_ok = 0; } break; case 'c': if (pa->mode == PM_UNSPECIFIED) { pa->mode = PM_SHOW_CHAR; if (toupper(optarg[0]) == 'U' && optarg[1] == '+') { char *hex = g_strdup(optarg); hex[0] = '0'; hex[1] = 'x'; pa->ucode = g_atoix(hex); g_free(hex); } else if (optarg[0] == '@') { pa->ucode = optarg[1]; } else { pa->ucode = g_atoix(optarg); } } else { LOG(LOG_LEVEL_ERROR, "Can't have two modes set"); params_ok = 0; } break; default: LOG(LOG_LEVEL_ERROR, "Unrecognised switch '%c'", (char)opt); params_ok = 0; } } if (argc <= optind) { LOG(LOG_LEVEL_ERROR, "No font file specified"); params_ok = 0; } else if ((argc - optind) > 1) { LOG(LOG_LEVEL_ERROR, "Unexpected arguments after font file"); params_ok = 0; } else { pa->font_file = argv[optind]; } return params_ok; } /**************************************************************************//** * Displays information about a font file * * @param fv1 loaded font file */ static void display_font_file_info(const struct fv1_file *fv1) { g_printf("Font name : %s\n", fv1->font_name); g_printf("Point size (%d DPI) : %d\n", FV1_DEVICE_DPI, fv1->point_size); g_printf("Style : %d\n", fv1->style); if (fv1->body_height == 0 && fv1->glyphs->count > 0) { const struct fv1_glyph *g = (const struct fv1_glyph *)fv1->glyphs->items[0]; g_printf("Body height : %d (from 1st glyph)\n", -g->baseline + 1); } else { g_printf("Body height : %d\n", fv1->body_height); } g_printf("Descender : %d\n", fv1->min_descender); if (fv1->glyphs->count == 0) { g_printf("\nFile contains no glyphs\n"); } else { g_printf("Min glyph index : U+%04X\n", FV1_MIN_CHAR); g_printf("Max glyph index : U+%04X\n", FV1_GLYPH_END(fv1) - 1); /* Work out the statistics */ unsigned short max_width = 0; int max_width_ucode = 0; unsigned short max_height = 0; int max_height_ucode = 0; short min_baseline = 0; int min_baseline_ucode = 0; short min_offset = 0; int min_offset_ucode = 0; short max_offset = 0; int max_offset_ucode = 0; unsigned short max_inc_by = 0; int max_inc_by_ucode = 0; /* Derived quantities */ short min_y_descender = SHRT_MAX; int min_y_descender_ucode = 0; int max_datasize = -1; int max_datasize_ucode = 0; /* Loop and output macros */ #define SET_MIN(ucode,field,val) \ if ((field) < (val)) \ { \ val = (field); \ val##_ucode = (ucode); \ } #define SET_MAX(ucode,field,val) \ if ((field) > (val)) \ { \ val = (field); \ val##_ucode = (ucode); \ } #define OUTPUT_INFO(string, val) \ if (val##_ucode > 0) \ { \ g_printf(string, val, val##_ucode); \ } int u; for (u = FV1_MIN_CHAR ; u < FV1_GLYPH_END(fv1); ++u) { const struct fv1_glyph *g = FV1_GET_GLYPH(fv1, u); if (g != NULL) { short y_descender = - (g->baseline + g->height); int datasize = FONT_DATASIZE(g); SET_MAX(u, g->width, max_width); SET_MAX(u, g->height, max_height); SET_MIN(u, g->baseline, min_baseline); SET_MIN(u, g->offset, min_offset); SET_MAX(u, g->offset, max_offset); SET_MAX(u, g->inc_by, max_inc_by); SET_MIN(u, y_descender, min_y_descender); SET_MAX(u, datasize, max_datasize); } } OUTPUT_INFO("Max glyph width : %d (U+%04X)\n", max_width); OUTPUT_INFO("Max glyph height : %d (U+%04X)\n", max_height); OUTPUT_INFO("Min glyph y-baseline : %d (U+%04X)\n", min_baseline); OUTPUT_INFO("Min glyph y-descender : %d (U+%04X)\n", min_y_descender); OUTPUT_INFO("Min glyph x-offset : %d (U+%04X)\n", min_offset); OUTPUT_INFO("Max glyph x-offset : %d (U+%04X)\n", max_offset); OUTPUT_INFO("Max glyph x-inc_by : %d (U+%04X)\n", max_inc_by); OUTPUT_INFO("Max glyph datasize : %d (U+%04X)\n", max_datasize); #undef SET_MIN #undef SET_MAX #undef OUTPUT_INFO } } /**************************************************************************//** * Display info in a table about all the glyphs * @param fv1 font file */ static void display_glyph_info_table(const struct fv1_file *fv1) { int u; g_printf("character,width,height,baseline,offset,inc_by,datasize\n"); for (u = FV1_MIN_CHAR; u < FV1_GLYPH_END(fv1); ++u) { const struct fv1_glyph *g = FV1_GET_GLYPH(fv1, u); if (g != NULL) { int datasize = FONT_DATASIZE(g); g_printf("%d,%hu,%hu,%hd,%hd,%hu,%d\n", u, g->width, g->height, g->baseline, g->offset, g->inc_by, datasize); } } } /**************************************************************************//** * Converts a font data row to a printable string * * @param rowdata Pointer to the first byte of the row data * @param width Number of pixels in the row * @param out Output buffer. Must be sized by the caller to be at * least width+1 bytes */ static void row_to_str(const unsigned char *rowdata, int width, char *out) { int x; int mask = 1 << 7; for (x = 0 ; x < width ; ++x) { out[x] = ((*rowdata & mask) != 0) ? 'X' : '.'; mask >>= 1; if (mask == 0) { mask = 1 << 7; ++rowdata; } } out[width] = '\0'; } /**************************************************************************//** * Display info about a specific glyph * @param ucode Unicode character value * @param g Glyph */ static void display_glyph_info(int ucode, const struct fv1_glyph *g) { char *row_buffer = (char *)g_malloc(g->width + 1, 0); if (row_buffer == NULL) { g_printf("\n"); } else { g_printf("Glyph : U+%04X\n", ucode); g_printf(" Width : %d\n", g->width); g_printf(" Height : %d\n", g->height); g_printf(" Baseline : %d\n", g->baseline); g_printf(" Offset : %d\n", g->offset); g_printf(" Inc By : %d\n", g->inc_by); g_printf(" Data :\n"); int y; const unsigned char *dataptr = g->data; for (y = 0 ; y < g->height; ++y) { row_to_str(dataptr, g->width, row_buffer); g_printf(" %+3d: %s\n", y + g->baseline, row_buffer); dataptr += (g->width + 7) / 8; } g_free(row_buffer); } } /**************************************************************************//** * Main * * @param argc Argument count * @param argv Arguments */ int main(int argc, char *argv[]) { struct fv1_file *fv1 = NULL; struct log_config *logging; struct program_args pa; int rv = 1; logging = log_config_init_for_console(LOG_LEVEL_WARNING, g_getenv("DUMPFV1_LOG_LEVEL")); log_start_from_param(logging); log_config_free(logging); if (parse_program_args(argc, argv, &pa) && (fv1 = fv1_file_load(pa.font_file)) != NULL) { switch (pa.mode) { case PM_INFO: display_font_file_info(fv1); rv = 0; break; case PM_GLYPH_INFO_TABLE: display_glyph_info_table(fv1); rv = 0; break; case PM_SHOW_CHAR: if (pa.ucode < FV1_MIN_CHAR) { LOG(LOG_LEVEL_ERROR, "Value for -c must be at least U+%04X", FV1_MIN_CHAR); } else if (pa.ucode >= FV1_GLYPH_END(fv1)) { LOG(LOG_LEVEL_ERROR, "Value for -c must be less than U+%04X", FV1_GLYPH_END(fv1)); } else { const struct fv1_glyph *g = (const struct fv1_glyph *) list_get_item(fv1->glyphs, pa.ucode - FV1_MIN_CHAR); display_glyph_info(pa.ucode, g); rv = 0; } break; default: LOG(LOG_LEVEL_ERROR, "Specify one of '-i' or '-c'"); break; } } fv1_file_free(fv1); log_end(); return rv; } xrdp-0.10.1/fontutils/mkfv1.c000644 001751 000000 00000042115 14652432047 016057 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include FT_FREETYPE_H /* See the FT2 documentation - this builds an error table */ #undef FTERRORS_H_ #define FT_ERRORDEF( e, v, s ) { e, s }, #define FT_ERROR_START_LIST { #define FT_ERROR_END_LIST { 0, NULL } }; static const struct { int err_code; const char *err_msg; } ft_errors[] = #include #ifdef __cppcheck__ // avoid syntaxError by providing the array contents {}; #endif #include "arch.h" #include "defines.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" #include "fv1.h" #define DEFAULT_POINT_SIZE 10 #define DEFAULT_MAX_CHAR 0x4dff /** * sans10 compatibility choices */ enum sans10_compat { S10_OFF = 0, S10_ON, S10_AUTO }; /** * Parsed program arguments */ struct program_args { const char *input_file; const char *output_file; char font_name[FV1_MAX_FONT_NAME_SIZE + 1]; unsigned short point_size; /** Last character value in file */ unsigned int max_ucode; /** Are we generating san10 in compatibility mode? */ enum sans10_compat sans10_compatibility; }; struct x_dimensions { unsigned short width; short offset; unsigned short inc_by; }; /** * Table of some character settings in the original sans-10.fv1 font */ static const struct x_dimensions original_sans10_data[] = { /* 0x20 - 0x3f */ {1, 0, 4}, {1, 2, 5}, {3, 1, 5}, {9, 1, 11}, {7, 1, 8}, {11, 0, 12}, {9, 1, 11}, {1, 1, 3}, {3, 1, 5}, {3, 1, 5}, {7, 0, 7}, {9, 1, 11}, {2, 1, 4}, {3, 1, 5}, {1, 2, 4}, {4, 0, 4}, {6, 1, 8}, {5, 2, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {1, 2, 4}, {2, 1, 4}, {8, 1, 11}, {8, 1, 11}, {8, 1, 11}, {5, 1, 7}, /* 0x40 - 0x5f */ {11, 1, 13}, {9, 0, 9}, {7, 1, 9}, {7, 1, 9}, {8, 1, 10}, {6, 1, 8}, {5, 1, 7}, {8, 1, 10}, {8, 1, 10}, {1, 1, 3}, {3, -1, 3}, {7, 1, 8}, {6, 1, 7}, {9, 1, 11}, {8, 1, 10}, {8, 1, 10}, {6, 1, 8}, {8, 1, 10}, {7, 1, 8}, {7, 1, 9}, {7, 0, 7}, {8, 1, 10}, {9, 0, 9}, {11, 0, 11}, {8, 0, 8}, {7, 0, 7}, {8, 1, 10}, {3, 1, 5}, {4, 0, 4}, {3, 1, 5}, {8, 1, 11}, {7, 0, 7}, /* 0x60 - 0x7f */ {3, 1, 7}, {6, 1, 8}, {6, 1, 8}, {5, 1, 7}, {6, 1, 8}, {6, 1, 8}, {4, 0, 4}, {6, 1, 8}, {6, 1, 8}, {1, 1, 3}, {2, 0, 3}, {6, 1, 7}, {1, 1, 3}, {11, 1, 13}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {4, 1, 5}, {5, 1, 7}, {4, 0, 5}, {6, 1, 8}, {7, 0, 7}, {9, 0, 9}, {7, 0, 7}, {7, 0, 7}, {5, 1, 7}, {5, 2, 8}, {1, 2, 4}, {5, 2, 8}, {8, 1, 11}, {7, 1, 8}, /* 0x80 - 0x9f */ {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, {7, 1, 8}, /* 0xa0 - 0xbf */ {1, 0, 4}, {1, 2, 5}, {6, 1, 8}, {7, 0, 8}, {7, 0, 8}, {7, 1, 8}, {1, 2, 4}, {5, 1, 7}, {3, 2, 7}, {9, 2, 13}, {5, 1, 6}, {6, 1, 8}, {8, 1, 11}, {3, 1, 5}, {9, 2, 13}, {4, 1, 7}, {4, 1, 7}, {9, 1, 11}, {4, 1, 5}, {4, 1, 5}, {3, 2, 7}, {7, 1, 8}, {6, 1, 8}, {1, 1, 4}, {3, 2, 7}, {3, 1, 5}, {5, 1, 6}, {6, 1, 8}, {12, 1, 13}, {11, 1, 13}, {12, 1, 13}, {5, 1, 7}, /* 0xc0 - 0xdf */ {9, 0, 9}, {9, 0, 9}, {9, 0, 9}, {9, 0, 9}, {9, 0, 9}, {9, 0, 9}, {12, 0, 13}, {7, 1, 9}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {2, 0, 3}, {2, 1, 3}, {5, -1, 3}, {3, 0, 3}, {9, 0, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {7, 2, 11}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {8, 1, 10}, {7, 0, 7}, {6, 1, 8}, {6, 1, 8}, /* 0xe0 - 0xff */ {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {11, 1, 13}, {5, 1, 7}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {3, 0, 3}, {3, 1, 3}, {5, -1, 3}, {3, 0, 3}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {8, 1, 11}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {6, 1, 8}, {7, 0, 7}, {6, 1, 8}, {7, 0, 7} }; /**************************************************************************//** * Parses a unicode character value * * @param str String containing value * @return Resulting character value */ static unsigned int parse_ucode_name(const char *str) { unsigned int rv; if (toupper(str[0]) == 'U' && str[1] == '+') { char *hex = g_strdup(str); hex[0] = '0'; hex[1] = 'x'; rv = g_atoix(hex); g_free(hex); } else if (str[0] == '@') { rv = str[1]; } else { rv = g_atoix(str); } return rv; } /**************************************************************************//** * Parses the program args * * @param argc Passed to main * @param @argv Passed to main * @param pa program_pargs structure for resulting values * @return !=0 for success */ static int parse_program_args(int argc, char *argv[], struct program_args *pa) { int params_ok = 1; int opt; pa->input_file = NULL; pa->output_file = NULL; pa->font_name[0] = '\0'; pa->point_size = DEFAULT_POINT_SIZE; pa->max_ucode = DEFAULT_MAX_CHAR; pa->sans10_compatibility = S10_AUTO; while ((opt = getopt(argc, argv, "n:p:m:C:")) != -1) { switch (opt) { case 'n': g_snprintf(pa->font_name, FV1_MAX_FONT_NAME_SIZE + 1, "%s", optarg); break; case 'p': pa->point_size = g_atoi(optarg); break; case 'm': pa->max_ucode = parse_ucode_name(optarg); break; case 'C': if (toupper(optarg[0]) == 'A') { pa->sans10_compatibility = S10_AUTO; } else if (g_text2bool(optarg)) { pa->sans10_compatibility = S10_ON; } else { pa->sans10_compatibility = S10_OFF; } break; default: LOG(LOG_LEVEL_ERROR, "Unrecognised switch '%c'", (char)opt); params_ok = 0; } } if (pa->max_ucode < FV1_MIN_CHAR) { LOG(LOG_LEVEL_ERROR, "-m argument must be at least %d", FV1_MIN_CHAR); params_ok = 0; } switch (argc - optind) { case 0: LOG(LOG_LEVEL_ERROR, "No input file specified"); params_ok = 0; break; case 1: LOG(LOG_LEVEL_ERROR, "No output file specified"); params_ok = 0; break; case 2: pa->input_file = argv[optind]; pa->output_file = argv[optind + 1]; break; default: LOG(LOG_LEVEL_ERROR, "Unexpected arguments after output file"); params_ok = 0; } return params_ok; } /**************************************************************************//** * Checks whether the specified glyph row is blank * @param g Glyph * @param row Row number between 0 and g->height - 1 * @result Boolean */ static int is_blank_glyph_row(const struct fv1_glyph *g, unsigned int row) { if (g->width == 0 || row >= g->height) { return 1; } const unsigned int glyph_row_size = ((g->width + 7) / 8); const unsigned char *dataptr = g->data + (row * glyph_row_size); const unsigned int masks[] = { 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; /* Check for set pixels in all the leading bytes */ unsigned int x; for (x = g->width ; x > 8 ; x -= 8) { if (*dataptr++ != 0) { return 0; } } /* Use a single test to check the pixels in the last byte */ return ((*dataptr & masks[x - 1]) == 0); } /**************************************************************************//** * Returns a string for a freetype2 error * @param error Freetype2 error code * @param buff Pointer to buffer for error string * @param bufflen Length of above */ static void get_ft_error(FT_Error error, char *buff, unsigned int bufflen) { const char *errstr = NULL; unsigned int i; for (i = 0 ; i < (sizeof(ft_errors) / sizeof(ft_errors[0])); ++i) { if (ft_errors[i].err_code == error) { errstr = ft_errors[i].err_msg; break; } } if (errstr != NULL) { g_snprintf(buff, bufflen, "[%s]", errstr); } else { g_snprintf(buff, bufflen, "[errorcode %d (no description)]", (int)error); } } /**************************************************************************//** * Implement sans10 compatibility for a glyph * * The original Windows font generator made a few different choices for the * character x offset than freetype2 does. These are particularly noticeable * with a small font. * * This routine checks the glyph, and implements the original offset size * for popular English characters, which are all that the user will probably * be displaying with xrdp v0.9.x * * @param g Glyph to check */ static void implement_sans10_compatibility(struct fv1_glyph *g, unsigned int ucode) { const unsigned int max_index = sizeof(original_sans10_data) / sizeof(original_sans10_data[0]); if (ucode < FV1_MIN_CHAR || ucode >= max_index + FV1_MIN_CHAR) { return; } const struct x_dimensions *d = &original_sans10_data[ucode - FV1_MIN_CHAR]; if (g->offset != d->offset) { if (g->width != d->width) { LOG(LOG_LEVEL_WARNING, "Can't set compatibility offset for U+%04X: width %d != %d", ucode, g->width, d->width); } else if (g->inc_by != d->inc_by) { LOG(LOG_LEVEL_WARNING, "Can't set compatibility offset for U+%04X: inc_by %d != %d", ucode, g->inc_by, d->inc_by); } else { LOG(LOG_LEVEL_INFO, "Changing compatibility offset for U+%04X: from %d to %d", ucode, g->offset, d->offset); } g->offset = d->offset; } } /**************************************************************************//** * Converts a freetype 2 bitmap to a fv1 glyph * @param ft_glyph Freetype2 glyph. Must be a monochrome bitmap * @param ucode Unicode character for error reporting * @param pa Program args * @return fv1 glyph, or NULL for error */ static struct fv1_glyph * convert_mono_glyph(FT_GlyphSlot ft_glyph, unsigned int ucode, const struct program_args *pa) { short width = ft_glyph->bitmap.width; short height = ft_glyph->bitmap.rows; struct fv1_glyph *g; /* Number of bytes in a glyph row */ const unsigned int glyph_row_size = ((width + 7) / 8); if ((g = fv1_alloc_glyph(ucode, width, height)) != NULL) { g->baseline = -(ft_glyph->metrics.horiBearingY / 64); g->offset = ft_glyph->metrics.horiBearingX / 64; g->inc_by = ft_glyph->metrics.horiAdvance / 64; if (FONT_DATASIZE(g) > 0) { const unsigned char *srcptr = ft_glyph->bitmap.buffer; unsigned char *dstptr = g->data; unsigned int y; for (y = 0; y < g->height; ++y) { g_memcpy(dstptr, srcptr, glyph_row_size); dstptr += glyph_row_size; srcptr += ft_glyph->bitmap.pitch; } /* Optimise the glyph by removing any blank lines at the bottom * and top */ if (g->width > 0) { while (g->height > 0 && is_blank_glyph_row(g, g->height - 1)) { --g->height; } y = 0; while (y < g->height && is_blank_glyph_row(g, y)) { ++y; } if (y > 0) { g->baseline += y; g->height -= y; g_memmove(g->data, g->data + (y * glyph_row_size), g->height * glyph_row_size); } } } } if (pa->sans10_compatibility != S10_OFF) { implement_sans10_compatibility(g, ucode); } return g; } /**************************************************************************//** * Main * * @param argc Argument count * @param argv Arguments */ int main(int argc, char *argv[]) { FT_Library library = NULL; /* handle to library */ FT_Face face = NULL; /* handle to face object */ FT_Error error; struct fv1_glyph *g; struct program_args pa; struct log_config *logging; int rv = 1; logging = log_config_init_for_console(LOG_LEVEL_WARNING, g_getenv("MKFV1_LOG_LEVEL")); log_start_from_param(logging); log_config_free(logging); struct fv1_file *fv1 = fv1_file_create(); if (fv1 == NULL) { LOG(LOG_LEVEL_ERROR, "Memory allocation failure"); } else if (parse_program_args(argc, argv, &pa)) { char errstr[128]; if ((error = FT_Init_FreeType(&library)) != 0) { get_ft_error(error, errstr, sizeof(errstr)); LOG(LOG_LEVEL_ERROR, "Error initializing freetype library %s", errstr); } else if ((error = FT_New_Face(library, pa.input_file, 0, &face)) != 0) { get_ft_error(error, errstr, sizeof(errstr)); LOG(LOG_LEVEL_ERROR, "Error loading font file %s %s", pa.input_file, errstr); } else if ((error = FT_Set_Char_Size(face, 0, pa.point_size * 64, FV1_DEVICE_DPI, 0)) != 0) { get_ft_error(error, errstr, sizeof(errstr)); LOG(LOG_LEVEL_ERROR, "Error setting point size to %u %s", pa.point_size, errstr); } else { const char *fname = (pa.font_name[0] != '\0') ? pa.font_name : (face->family_name != NULL) ? face->family_name : /* Default */ ""; g_snprintf(fv1->font_name, FV1_MAX_FONT_NAME_SIZE + 1, "%s", fname); fv1->point_size = pa.point_size; fv1->body_height = face->size->metrics.height / 64; fv1->min_descender = face->size->metrics.descender / 64; if (pa.sans10_compatibility == S10_AUTO) { if (g_strcmp(fv1->font_name, "DejaVu Sans") == 0 && fv1->point_size == 10) { pa.sans10_compatibility = S10_ON; } else { pa.sans10_compatibility = S10_OFF; } } unsigned int u; for (u = FV1_MIN_CHAR; u <= pa.max_ucode; ++u) { /* retrieve glyph index from character code */ FT_UInt glyph_index = FT_Get_Char_Index(face, u); /* load glyph image into the slot (erase previous one) */ error = FT_Load_Glyph(face, glyph_index, FT_LOAD_RENDER | FT_LOAD_TARGET_MONO); if (error) { get_ft_error(error, errstr, sizeof(errstr)); LOG(LOG_LEVEL_WARNING, "Unable to get bitmap for U+%04X %s", u, errstr); g = NULL; } else if (face->glyph->format != FT_GLYPH_FORMAT_BITMAP || face->glyph->bitmap.pixel_mode != FT_PIXEL_MODE_MONO) { LOG(LOG_LEVEL_WARNING, "Internal error; U+%04X was not loaded as a bitmap", u); g = NULL; } else { g = convert_mono_glyph(face->glyph, u, &pa); } list_add_item(fv1->glyphs, (tintptr)g); } rv = fv1_file_save(fv1, pa.output_file); } } FT_Done_FreeType(library); fv1_file_free(fv1); log_end(); return rv; } xrdp-0.10.1/fontutils/Makefile.in000644 001751 000000 00000054025 14652432075 016740 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = $(am__EXEEXT_1) xrdp-dumpfv1$(EXEEXT) subdir = fontutils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @USE_FREETYPE2_TRUE@am__EXEEXT_1 = xrdp-mkfv1$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_xrdp_dumpfv1_OBJECTS = dumpfv1.$(OBJEXT) fv1.$(OBJEXT) xrdp_dumpfv1_OBJECTS = $(am_xrdp_dumpfv1_OBJECTS) xrdp_dumpfv1_DEPENDENCIES = $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_xrdp_mkfv1_OBJECTS = mkfv1.$(OBJEXT) fv1.$(OBJEXT) xrdp_mkfv1_OBJECTS = $(am_xrdp_mkfv1_OBJECTS) am__DEPENDENCIES_1 = xrdp_mkfv1_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/dumpfv1.Po ./$(DEPDIR)/fv1.Po \ ./$(DEPDIR)/mkfv1.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_dumpfv1_SOURCES) $(xrdp_mkfv1_SOURCES) DIST_SOURCES = $(xrdp_dumpfv1_SOURCES) $(xrdp_mkfv1_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = windows @USE_FREETYPE2_FALSE@MKFV1 = # Some programs need freetype2 to build @USE_FREETYPE2_TRUE@MKFV1 = xrdp-mkfv1 AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/common \ $(FREETYPE2_CFLAGS) xrdp_mkfv1_SOURCES = \ mkfv1.c \ fv1.c \ fv1.h xrdp_mkfv1_LDADD = \ $(top_builddir)/common/libcommon.la \ $(FREETYPE2_LIBS) xrdp_dumpfv1_SOURCES = \ dumpfv1.c \ fv1.c \ fv1.h xrdp_dumpfv1_LDADD = \ $(top_builddir)/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fontutils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign fontutils/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) xrdp-dumpfv1$(EXEEXT): $(xrdp_dumpfv1_OBJECTS) $(xrdp_dumpfv1_DEPENDENCIES) $(EXTRA_xrdp_dumpfv1_DEPENDENCIES) @rm -f xrdp-dumpfv1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_dumpfv1_OBJECTS) $(xrdp_dumpfv1_LDADD) $(LIBS) xrdp-mkfv1$(EXEEXT): $(xrdp_mkfv1_OBJECTS) $(xrdp_mkfv1_DEPENDENCIES) $(EXTRA_xrdp_mkfv1_DEPENDENCIES) @rm -f xrdp-mkfv1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_mkfv1_OBJECTS) $(xrdp_mkfv1_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dumpfv1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fv1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfv1.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/dumpfv1.Po -rm -f ./$(DEPDIR)/fv1.Po -rm -f ./$(DEPDIR)/mkfv1.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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 ./$(DEPDIR)/dumpfv1.Po -rm -f ./$(DEPDIR)/fv1.Po -rm -f ./$(DEPDIR)/mkfv1.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/fontutils/windows/fontdump.c000644 001751 000000 00000035072 14652432047 020365 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include "os_calls.h" #include "arch.h" static HINSTANCE g_instance = 0; static HWND g_wnd = 0; static HWND g_lb = 0; static HWND g_exit_button = 0; static HWND g_go_button = 0; static HWND g_font_list = 0; static char g_font_name[512] = ""; static int g_font_size = 10; static HFONT g_font = 0; static int g_running = 0; #define FONT_DATASIZE(_w, _h) (((_h * ((_w + 7) / 8)) + 3) & ~3) /*****************************************************************************/ int check_messages(void) { MSG msg; while (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { GetMessage(&msg, NULL, 0, 0); TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } /*****************************************************************************/ static int msg(char *msg1, ...) { va_list ap; char text1[512]; va_start(ap, msg1); vsnprintf(text1, 511, msg1, ap); SendMessageA(g_lb, LB_ADDSTRING, 0, (LPARAM)text1); va_end(ap); return 0; } /*****************************************************************************/ static int show_last_error(void) { LPVOID lpMsgBuf = NULL; DWORD len; len = FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&lpMsgBuf, 0, NULL); if (len > 0) { msg("GetLastError - %s", lpMsgBuf); LocalFree(lpMsgBuf); } return 0; } /*****************************************************************************/ static int font_dump(void) { HDC dc; HDC dc1; RECT rect; HBRUSH brush; HGDIOBJ saved; HBITMAP bitmap; BITMAPINFO bi; char *bits; ABC abc; SIZE sz; char filename[256]; TCHAR text[256]; char zero1; char *bmtext; int bmtextindex; int fd; int x1; int strlen1; int index1; int index2; int len; int pixel; int red; int green; int blue; int width; int height; int roller; int outlen; tui8 b1; short x2; if (g_running) { return 0; } g_running = 1; msg("starting"); g_font_name[0] = 0; SendMessageA(g_font_list, WM_GETTEXT, 255, (LPARAM)g_font_name); if (g_strlen(g_font_name) == 0) { msg("error font not set"); g_running = 0; return 1; } dc = GetDC(g_wnd); height = -MulDiv(g_font_size, GetDeviceCaps(dc, LOGPIXELSY), 72); g_font = CreateFontA(height, 0, 0, 0, FW_DONTCARE, 0, 0, 0, 0, 0, 0, 0, 0, g_font_name); ReleaseDC(g_wnd, dc); if (g_font == 0) { msg("error - Font creation failed"); } zero1 = 0; g_snprintf(filename, 255, "%s-%d.fv1", g_font_name, g_font_size); msg("creating file %s", filename); g_file_delete(filename); fd = g_file_open_rw(filename); g_file_write(fd, "FNT1", 4); strlen1 = g_strlen(g_font_name); g_file_write(fd, g_font_name, strlen1); x1 = strlen1; while (x1 < 32) { g_file_write(fd, &zero1, 1); x1++; } x2 = g_font_size; /* font size */ g_file_write(fd, (char *)&x2, 2); x2 = 1; /* style */ g_file_write(fd, (char *)&x2, 2); /* pad */ index1 = 0; while (index1 < 8) { g_file_write(fd, &zero1, 1); index1++; } for (x1 = 32; x1 < 0x4e00; x1++) { check_messages(); dc = GetWindowDC(g_wnd); saved = SelectObject(dc, g_font); if (!GetCharABCWidths(dc, x1, x1, &abc)) { show_last_error(); } text[0] = (TCHAR)x1; text[1] = 0; if (!GetTextExtentPoint32(dc, text, 1, &sz)) { show_last_error(); } SelectObject(dc, saved); ReleaseDC(g_wnd, dc); if ((sz.cx > 0) && (sz.cy > 0)) { dc = GetWindowDC(g_wnd); saved = SelectObject(dc, g_font); SetBkColor(dc, RGB(255, 255, 255)); if (!ExtTextOut(dc, 50, 50, ETO_OPAQUE, 0, text, 1, 0)) { show_last_error(); } SelectObject(dc, saved); ReleaseDC(g_wnd, dc); Sleep(10); /* width */ x2 = abc.abcB; g_file_write(fd, (char *)&x2, 2); /* height */ x2 = sz.cy; g_file_write(fd, (char *)&x2, 2); /* baseline */ x2 = -sz.cy; g_file_write(fd, (char *)&x2, 2); /* offset */ x2 = abc.abcA; g_file_write(fd, (char *)&x2, 2); /* incby */ x2 = sz.cx; g_file_write(fd, (char *)&x2, 2); /* pad */ index1 = 0; while (index1 < 6) { g_file_write(fd, &zero1, 1); index1++; } dc = GetWindowDC(g_wnd); rect.left = 50 + abc.abcA; rect.top = 50; rect.right = rect.left + abc.abcB; rect.bottom = rect.top + sz.cy; memset(&bi, 0, sizeof(bi)); width = (abc.abcB + 7) & (~7); height = sz.cy; bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = width; bi.bmiHeader.biHeight = height; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bitmap = CreateDIBSection(dc, &bi, DIB_RGB_COLORS, (void *)&bits, 0, 0); if (bitmap == 0) { msg("error - CreateDIBSection failed"); } else { memset(bits, 0, width * height * 4); dc1 = CreateCompatibleDC(dc); SelectObject(dc1, bitmap); if (!BitBlt(dc1, 0, 0, width, height, dc, rect.left, rect.top, SRCCOPY)) { show_last_error(); } bmtext = (char *)g_malloc(width * height + 16, 1); bmtextindex = 0; for (index1 = (height - 1); index1 >= 0; index1--) { for (index2 = 0; index2 < width; index2++) { pixel = ((int *)bits)[index1 * width + index2]; red = (pixel >> 16) & 0xff; green = (pixel >> 8) & 0xff; blue = (pixel >> 0) & 0xff; if (red == 0 && green == 0 && blue == 0) { bmtext[bmtextindex] = '1'; bmtextindex++; } else { bmtext[bmtextindex] = '0'; bmtextindex++; } } } outlen = 0; b1 = 0; roller = 0; len = g_strlen(bmtext); for (index2 = 0; index2 < len; index2++) { if (bmtext[index2] == '1') { switch (roller) { case 0: b1 = b1 | 0x80; break; case 1: b1 = b1 | 0x40; break; case 2: b1 = b1 | 0x20; break; case 3: b1 = b1 | 0x10; break; case 4: b1 = b1 | 0x08; break; case 5: b1 = b1 | 0x04; break; case 6: b1 = b1 | 0x02; break; case 7: b1 = b1 | 0x01; break; } } roller++; if (roller == 8) { roller = 0; g_file_write(fd, &b1, 1); outlen++; b1 = 0; } } while ((outlen % 4) != 0) { g_file_write(fd, &zero1, 1); outlen++; } free(bmtext); DeleteDC(dc1); DeleteObject(bitmap); } if (sz.cx != (long)(abc.abcA + abc.abcB + abc.abcC)) { msg("error - width not right 1"); } brush = CreateSolidBrush(RGB(255, 255, 255)); FillRect(dc, &rect, brush); DeleteObject(brush); ReleaseDC(g_wnd, dc); } else { /* write out a blank glyph here */ /* width */ x2 = 1; g_file_write(fd, (char *)&x2, 2); /* height */ x2 = 1; g_file_write(fd, (char *)&x2, 2); /* baseline */ x2 = 0; g_file_write(fd, (char *)&x2, 2); /* offset */ x2 = 0; g_file_write(fd, (char *)&x2, 2); /* incby */ x2 = 1; g_file_write(fd, (char *)&x2, 2); /* pad */ index1 = 0; while (index1 < 6) { g_file_write(fd, &zero1, 1); index1++; } /* blank bitmap */ index1 = 0; while (index1 < 4) { g_file_write(fd, &zero1, 1); index1++; } } } g_file_close(fd); msg("done"); g_running = 0; return 0; } /*****************************************************************************/ static LRESULT CALLBACK wnd_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HBRUSH brush; RECT rect; switch (message) { case WM_PAINT: BeginPaint(hWnd, &ps); brush = CreateSolidBrush(RGB(255, 255, 255)); rect = ps.rcPaint; FillRect(ps.hdc, &rect, brush); DeleteObject(brush); EndPaint(hWnd, &ps); break; case WM_CLOSE: DestroyWindow(g_wnd); g_wnd = 0; break; case WM_DESTROY: PostQuitMessage(0); break; case WM_TIMER: KillTimer(g_wnd, 1); font_dump(); break; case WM_COMMAND: if ((HWND)lParam == g_exit_button) { PostMessage(g_wnd, WM_CLOSE, 0, 0); } else if ((HWND)lParam == g_go_button) { while (SendMessage(g_lb, LB_GETCOUNT, 0, 0) > 0) { SendMessage(g_lb, LB_DELETESTRING, 0, 0); } SetTimer(g_wnd, 1, 1000, 0); } break; } return DefWindowProc(hWnd, message, wParam, lParam); } /*****************************************************************************/ static int create_window(void) { WNDCLASS wc; DWORD style; int left; int top; ZeroMemory(&wc, sizeof(wc)); wc.lpfnWndProc = wnd_proc; /* points to window procedure */ /* name of window class */ wc.lpszClassName = _T("fontdump"); wc.hCursor = LoadCursor(0, IDC_ARROW); /* Register the window class. */ if (!RegisterClass(&wc)) { return 0; /* Failed to register window class */ } style = WS_OVERLAPPED | WS_CAPTION | WS_POPUP | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX | WS_MAXIMIZEBOX; left = GetSystemMetrics(SM_CXSCREEN) / 2 - 640 / 2; top = GetSystemMetrics(SM_CYSCREEN) / 2 - 480 / 2; g_wnd = CreateWindow(wc.lpszClassName, _T("fontdump"), style, left, top, 640, 480, (HWND) NULL, (HMENU) NULL, g_instance, (LPVOID) NULL); style = WS_CHILD | WS_VISIBLE | WS_BORDER; g_lb = CreateWindow(_T("LISTBOX"), _T("LISTBOX1"), style, 200, 10, 400, 400, g_wnd, 0, g_instance, 0); style = WS_CHILD | WS_VISIBLE; g_exit_button = CreateWindow(_T("BUTTON"), _T("Exit"), style, 540, 410, 75, 25, g_wnd, 0, g_instance, 0); g_go_button = CreateWindow(_T("BUTTON"), _T("Go"), style, 440, 410, 75, 25, g_wnd, 0, g_instance, 0); style = WS_CHILD | WS_VISIBLE | CBS_DROPDOWN; g_font_list = CreateWindow(_T("COMBOBOX"), _T("COMBOBOX1"), style, 50, 250, 125, 125, g_wnd, 0, g_instance, 0); ShowWindow(g_wnd, SW_SHOWNORMAL); PostMessage(g_wnd, WM_SETFONT, (WPARAM)g_font, 0); SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"Tahoma"); SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"DejaVu Serif"); SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"DejaVu Sans"); SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"Arial"); SendMessageA(g_font_list, CB_ADDSTRING, 0, (LPARAM)"Comic Sans MS"); return 0; } /*****************************************************************************/ static int main_loop(void) { MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return (int)(msg.wParam); } /*****************************************************************************/ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { g_instance = hInstance; create_window(); return main_loop(); } xrdp-0.10.1/fontutils/windows/.gitignore000644 001751 000000 00000000012 14652432047 020337 0ustar00metawheel000000 000000 !Makefile xrdp-0.10.1/fontutils/windows/Makefile000644 001751 000000 00000000472 14652432047 020021 0ustar00metawheel000000 000000 OBJS = fontdump.obj os_calls.obj #CFLAGS = -O2 -I../common CFLAGS = -O2 -I../common -DUNICODE -D_UNICODE LDFLAGS = -W -efontdump.exe all: fontdump1 fontdump1: $(OBJS) $(CC) $(LDFLAGS) $(OBJS) clean: del $(OBJS) fontdump.exe *.tds os_calls.obj: ../common/os_calls.c $(CC) $(CFLAGS) -c ../common/os_calls.c xrdp-0.10.1/libpainter/config.guess000755 001751 000000 00000126014 14652432063 017310 0ustar00metawheel000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-08-29' # 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 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 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -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 1992-2018 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 # 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. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 set_cc_for_build() { : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { 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" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" 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 } # 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 ; 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 case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # 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 tuples: *-*-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=`(uname -p 2>/dev/null || \ "/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 ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-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) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) 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 # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; 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/[-_].*//' | cut -d. -f1,2` ;; 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}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$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 ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 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`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" case `isainfo -b` in 32) echo i386-pc-solaris2"$UNAME_REL" ;; 64) echo x86_64-pc-solaris2"$UNAME_REL" ;; esac 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) 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 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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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:4.4BSD:*) 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 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 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:*:*) 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 ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-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-$LIBC`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 "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) 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-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) 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 | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" 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-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" 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.*:*) 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 configure 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 ;; x86_64:Haiku:*:*) echo x86_64-unknown-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 ;; SX-ACE:SUPER-UX:*:*) echo sxace-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 set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-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. # shellcheck disable=SC2154 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 ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xrdp-0.10.1/libpainter/configure000755 001751 000000 00001600043 14652432063 016677 0ustar00metawheel000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for libpainter 0.1.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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="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 case e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac 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 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) 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 case e in #( e) 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 ;; esac 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: xrdp-devel@googlegroups.com about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi ;; esac 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_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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac fi # as_fn_arith # 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 ' t clear :clear 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} 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='libpainter' PACKAGE_TARNAME='libpainter' PACKAGE_VERSION='0.1.1' PACKAGE_STRING='libpainter 0.1.1' PACKAGE_BUGREPORT='xrdp-devel@googlegroups.com' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS PT_TESTS_FALSE PT_TESTS_TRUE pkgconfigdir LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__xargs_n am__rm_f_notfound 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_pkgconfigdir enable_tests ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH' # 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 libpainter 0.1.1 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/libpainter] --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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libpainter 0.1.1:";; 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-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-tests Build install tests (default: no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-pkgconfigdir pkg-config installation directory ['${libdir}/pkgconfig'] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. 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 libpainter configure 0.1.1 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext 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>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_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (void); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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 libpainter $as_me 0.1.1, which was generated by GNU Autoconf 2.72. 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 C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub ltmain.sh compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # 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 case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac 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 config_ac.h:config_ac-h.in" am__api_version='1.17' # 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 case e in #( e) 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 ;; esac 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 sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&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 $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # 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 test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi 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 case e in #( e) 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 ;; esac 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; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi 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='libpainter' VERSION='0.1.1' 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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}gcc" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&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_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="gcc" 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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}cc" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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 if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" 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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="$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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="${ac_tool_prefix}clang" 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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&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_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; 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_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_CC="clang" 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 ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { 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 $? "no acceptable C compiler found in \$PATH See 'config.log' for more details" "$LINENO" 5; } # 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 -version; 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 case e in #( e) ac_file='' ;; esac 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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac 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 case e in #( e) { { 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; } ;; esac 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"); if (!f) return 1; 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.o conftest.obj 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 case e in #( e) 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 case e in #( e) 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; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac 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_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac 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=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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else case e in #( e) ac_cv_c_const=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then printf "%s\n" "#define const /**/" >>confdefs.h fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify 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' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; #( *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } 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 yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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 ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 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 ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; 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_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # 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_FILECMD="${ac_tool_prefix}file" 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 ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&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_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; 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_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # 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_FILECMD="file" 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 ;; esac fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" 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 FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" 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 ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&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_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" 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 ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 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* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" 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 ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&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_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" 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 ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="$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 ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="$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 ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 case e in #( e) 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 ;; esac 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 case e in #( e) 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 ;; esac 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 test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { 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_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_RANLIB="${ac_tool_prefix}ranlib" 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 ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&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_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { 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_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS 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_RANLIB="ranlib" 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 ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # 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 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #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. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" 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 ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&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_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" 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 ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" 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 ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&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_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" 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 ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" 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 ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&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_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" 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 ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" 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 ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&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_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" 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 ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" 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 ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&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_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" 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 ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" 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 ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&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_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" 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 ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) 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" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } 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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; 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 else case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; 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 else case e in #( e) enable_static=yes ;; esac fi # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else case e in #( e) pic_mode=default ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; 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 else case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi with_aix_soname=$lt_cv_with_aix_soname ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.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 func_cc_basename $compiler cc_basename=$func_cc_basename_result # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$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);}' # 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 # 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 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* 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* ## 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_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-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_prog_compiler_pic='-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 lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; 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_prog_compiler_pic='-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_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; 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). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-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_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_c_o=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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 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 "$_lt_compiler_boilerplate" | $SED '/^$/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_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # 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'. exclude_expsyms='_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. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$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 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 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 ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$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. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='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 tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ld_shlibs=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 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** 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 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$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. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 hardcode_direct=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 hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$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. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_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 "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$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. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$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)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=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. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$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" module_expsym_cmds="$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" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" 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>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='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 "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $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='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='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' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='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 hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=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 yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT 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. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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`' 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 # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[23].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else case e in #( e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } 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 striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check whether --with-pkgconfigdir was given. if test ${with_pkgconfigdir+y} then : withval=$with_pkgconfigdir; else case e in #( e) with_pkgconfigdir='${libdir}/pkgconfig' ;; esac fi pkgconfigdir=$with_pkgconfigdir # Use silent rules by default if supported by Automake AM_DEFAULT_VERBOSITY=0 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 printf %s "checking CFLAGS for maximum warnings... " >&6; } if test ${ac_cv_cflags_warn_all+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_cflags_warn_all="no, unknown" ac_save_CFLAGS="$CFLAGS" for ac_arg in "-warn all % -warn all" "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS="$ac_save_CFLAGS" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 printf "%s\n" "$ac_cv_cflags_warn_all" >&6; } case ".$ac_cv_cflags_warn_all" in .ok|.ok,*) ;; .|.no|.no,*) ;; *) if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$ac_cv_cflags_warn_all"; } >&5 (: CFLAGS already contains $ac_cv_cflags_warn_all) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $ac_cv_cflags_warn_all" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$ac_cv_cflags_warn_all { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi ;; esac 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 for flag in -Wwrite-strings; do as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 printf %s "checking whether C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else case e in #( e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else case e in #( e) eval "$as_CACHEVAR=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags ;; esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : if test ${CFLAGS+y} then : case " $CFLAGS " in #( *" $flag "*) : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append CFLAGS " $flag" { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac else case e in #( e) CFLAGS=$flag { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac fi else case e in #( e) : ;; esac fi done # Check whether --enable-tests was given. if test ${enable_tests+y} then : enableval=$enable_tests; else case e in #( e) enable_tests=no ;; esac fi if test x$enable_tests = xyes; then PT_TESTS_TRUE= PT_TESTS_FALSE='#' else PT_TESTS_TRUE='#' PT_TESTS_FALSE= fi ac_config_files="$ac_config_files Makefile include/Makefile pkgconfig/libpainter.pc pkgconfig/libpainter-uninstalled.pc pkgconfig/Makefile src/Makefile tests/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; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PT_TESTS_TRUE}" && test -z "${PT_TESTS_FALSE}"; then as_fn_error $? "conditional \"PT_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 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 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 case e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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 libpainter $as_me 0.1.1, which was generated by GNU Autoconf 2.72. 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" config_commands="$ac_config_commands" _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 Configuration commands: $config_commands 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="\\ libpainter config.status 0.1.1 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # 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' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _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 "config_ac.h") CONFIG_HEADERS="$CONFIG_HEADERS config_ac.h:config_ac-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "pkgconfig/libpainter.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/libpainter.pc" ;; "pkgconfig/libpainter-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES pkgconfig/libpainter-uninstalled.pc" ;; "pkgconfig/Makefile") CONFIG_FILES="$CONFIG_FILES pkgconfig/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/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 test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` 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 :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`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 ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { 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 $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # 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 library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # 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. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # 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 '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 xrdp-0.10.1/libpainter/install-sh000755 001751 000000 00000036115 14652432063 016776 0ustar00metawheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2024-06-19.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. Report bugs to . GNU Automake home page: . General help using GNU software: ." 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 (GNU Automake) $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-writable /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 incompatibility 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: xrdp-0.10.1/libpainter/src/000755 001751 000000 00000000000 14652432104 015547 5ustar00metawheel000000 000000 xrdp-0.10.1/libpainter/tests/000755 001751 000000 00000000000 14652432104 016122 5ustar00metawheel000000 000000 xrdp-0.10.1/libpainter/aclocal.m4000644 001751 000000 00000137570 14652432062 016640 0ustar00metawheel000000 000000 # generated automatically by aclocal 1.17 -*- Autoconf -*- # Copyright (C) 1996-2024 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.72],, [m4_warning([this file was generated for autoconf 2.72. 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-2024 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.17' 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.17], [], [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.17])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-2024 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-2024 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])]) # Copyright (C) 1999-2024 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thus: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2024 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2024 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 AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) 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-2024 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-2024 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2024 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_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2024 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-2024 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])]) # Copyright (C) 1999-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2022-2024 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_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2024 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2024 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_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[]*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) 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-2024 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 # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 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 ]) 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]) 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 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) # Copyright (C) 2001-2024 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-2024 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-2024 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 x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif 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 x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif 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 # Copyright (C) 2022-2024 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_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) m4_include([m4/ax_append_compile_flags.m4]) m4_include([m4/ax_append_flag.m4]) m4_include([m4/ax_cflags_warn_all.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_require_defined.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/pkg.m4]) xrdp-0.10.1/libpainter/bootstrap000755 001751 000000 00000000636 14652432052 016732 0ustar00metawheel000000 000000 #!/bin/sh command -v autoconf if ! test $? -eq 0 then echo "error, install autoconf" exit 1 fi command -v automake if ! test $? -eq 0 then echo "error, install automake" exit 1 fi command -v libtool || command -v libtoolize if ! test $? -eq 0 then echo "error, install libtool" exit 1 fi command -v pkg-config if ! test $? -eq 0 then echo "error, install pkg-config" exit 1 fi autoreconf -fvi xrdp-0.10.1/libpainter/config_ac-h.in000644 001751 000000 00000003452 14652432063 017455 0ustar00metawheel000000 000000 /* config_ac-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* 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 /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if 'const' does not conform to ANSI C. */ #undef const xrdp-0.10.1/libpainter/pkgconfig/000755 001751 000000 00000000000 14652432104 016727 5ustar00metawheel000000 000000 xrdp-0.10.1/libpainter/Makefile.in000644 001751 000000 00000063526 14652432063 017045 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @PT_TESTS_TRUE@am__append_1 = tests subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.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 = config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config_ac-h.in # 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)` DIST_SUBDIRS = src include pkgconfig tests am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config_ac-h.in \ compile config.guess config.sub install-sh ltmain.sh 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 -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = -9 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 -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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 EXTRA_DIST = bootstrap EXTRA_DIRS = $(am__append_1) SUBDIRS = \ src \ include \ pkgconfig \ $(EXTRA_DIRS) all: config_ac.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile 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): config_ac.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config_ac-h.in $(top_builddir)/config.status $(AM_V_at)rm -f stamp-h1 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config_ac.h $(srcdir)/config_ac-h.in: $(am__configure_deps) $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) $(AM_V_at)rm -f stamp-h1 $(AM_V_at)touch $@ distclean-hdr: -rm -f config_ac.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -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 -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 -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-recursive all-am: Makefile config_ac.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool 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-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libpainter/missing000755 001751 000000 00000017060 14652432063 016367 0ustar00metawheel000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. scriptversion=2024-06-07.14; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells # Copyright (C) 1996-2024 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 autogen autoheader autom4te automake autoreconf bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Report bugs to . GNU Automake home page: . General help using GNU software: ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing (GNU Automake) $scriptversion" 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|autoreconf) 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'" autoheader_deps="'acconfig.h'" automake_deps="'Makefile.am'" aclocal_deps="'acinclude.m4'" case $normalized_program in aclocal*) echo "You should only need it if you modified $aclocal_deps or" echo "$configure_deps." ;; autoconf*) echo "You should only need it if you modified $configure_deps." ;; autogen*) echo "You should only need it if you modified a '.def' or '.tpl' file." echo "You may want to install the GNU AutoGen package:" echo "<$gnu_software_URL/autogen/>" ;; autoheader*) echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." ;; automake*) echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." ;; autoreconf*) echo "You should only need it if you modified $aclocal_deps or" echo "$automake_deps or $autoheader_deps or $automake_deps or" echo "$configure_deps." ;; 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/>" ;; 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/>" ;; 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>" ;; 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/>" ;; perl*) echo "You should only need it to run GNU Autoconf, GNU Automake, " echo " assorted other tools, or if you modified a Perl source file." echo "You may want to install the Perl 5 language interpreter:" echo "<$perl_URL>" ;; *) 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 program_details "$normalized_program" } 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: xrdp-0.10.1/libpainter/depcomp000755 001751 000000 00000056217 14652432063 016354 0ustar00metawheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "depcomp (GNU Automake) $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interference from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. ## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: xrdp-0.10.1/libpainter/include/000755 001751 000000 00000000000 14652432104 016403 5ustar00metawheel000000 000000 xrdp-0.10.1/libpainter/ltmain.sh000644 001751 000000 00001212353 14652432060 016610 0ustar00metawheel000000 000000 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.7 package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # 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. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. 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. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution 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_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --no-warnings equivalent to '-Wnone' --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 more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$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. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. 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) version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/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 } # 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 } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # 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 ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 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 $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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 yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # 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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs 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 () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$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 () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # 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_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # 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 yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # 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. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # 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_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # 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_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; 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 func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && 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 yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && 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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_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 build PIC objects only -prefer-non-pic try to build 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 -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler 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-dir 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 -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 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 '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # 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 $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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 func_append 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 -* | *.la | *.lo ) ;; *) # 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_append_quoted args "$file" done if $opt_dry_run; then # 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 else 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 fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 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" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" 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 "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_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_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_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 -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi 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=: if $isdir; 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. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # 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 "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -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 "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "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_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) 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" && func_append 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 yes = "$build_old_libs"; 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=: 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 "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_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 "$file$stripped_ext" | $SED "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_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_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 install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; 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 "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $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 case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac 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 func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append 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" "${nlist}I"' # 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "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 "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # 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. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd 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 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac 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_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi 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 () { $debug_cmd 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` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result 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 "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $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 | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # 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 where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $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. 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 file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_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 \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; 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" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${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\ " } # 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 #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #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 /* path handling portability macros */ #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 */ #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 (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ 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_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); 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_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 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; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); 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]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); 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 = (size_t) (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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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) { lt_debugprintf (__FILE__, __LINE__, "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 { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "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 (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t 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) { size_t orig_value_len = strlen (orig_value); size_t 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; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (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 #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (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 case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd 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 # what 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 that 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 bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false 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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && 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_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_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 bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append 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 "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append 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 none = "$pic_object" && test none = "$non_pic_object"; 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 none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 ;; os2dllname) os2dllname=$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 rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append 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 ;; -bindir) prev=bindir 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-export-symbols = "X$arg"; 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" if test -z "$func_stripname_result"; 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 func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # 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 "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm 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|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append 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 ;; -os2dllname) prev=os2dllname 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_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append 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_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_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_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append 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 none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" 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_arg pretty "$arg" arg=$func_quote_arg_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 yes = "$export_dynamic" && 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 \"\$$shlibpath_var\" \| \$SED \'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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # 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_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; 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 "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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=false 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; 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=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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 "$inherited_linker_flags" | $SED '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 "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; 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. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi 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 dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && 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 func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append 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 dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append 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" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; 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_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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:"*) ;; *) func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append 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 yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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* | *os2*) 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 cannot # 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 no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; 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 "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result 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 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append 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 link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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 "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 func_append 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 no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|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 ;; 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" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; 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) # correct to gnu/linux during the next big refactor 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 0 -ne "$loop"; 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. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 "*) ;; *) func_append 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 "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # 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 yes = "$build_libtool_need_lc"; then func_append 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` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi 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 "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append 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. func_append 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 yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append 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 \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append 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. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; 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 ;; esac ;; 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 " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED '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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append 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 relink = "$opt_mode" || 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 func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$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 func_append 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 func_dll_def_p "$export_symbols" || { # 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 ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || 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 cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs 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 : != "$skipped_export"; 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && 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 func_append 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 "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && 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 func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && 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 func_basename "$output" output_la=$func_basename_result # 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" 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 -z "$objlist" || 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 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$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~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { 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 } 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_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; 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 ${skipped_export-false} && { 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 "$include_expsyms" | $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 func_append 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 } 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 yes = "$module" && 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 func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs 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 test yes = "$build_libtool_libs" || { 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 } if test -n "$pic_flag" || test default != "$pic_mode"; 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" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && 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 " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED '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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED '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=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # 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 } 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 func_append 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 func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; 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 "$link_command" | $SED '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 $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # 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" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED '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 $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # 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_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result 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 case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; 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 func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append 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 func_append 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" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result 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 elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" 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 -z "$oldobjs"; 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 yes = "$build_old_libs" && 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_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; 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 func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append 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" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append 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" func_append newdlprefiles " ${lt_sysroot:+=}$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 func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; 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 $rmforce; 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 func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; 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 func_append 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 func_append 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 func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # 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 } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_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 # where 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: xrdp-0.10.1/libpainter/config.sub000755 001751 000000 00000105526 14652432063 016760 0ustar00metawheel000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-05-24' # 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 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 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # 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. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # 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 or ALIAS Canonicalize a configuration name. Options: -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 1992-2018 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 # Split fields of configuration type IFS="-" read -r field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers 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 | microblaze* \ | sim | cisco | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; 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 ;; cegcc) basic_machine=arm-unknown os=cegcc ;; cray) basic_machine=j90-cray os=unicos ;; craynv) basic_machine=craynv-cray os=unicosmp ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; 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 ;; hp300bsd) basic_machine=m68k-hp os=bsd ;; hp300hpux) basic_machine=m68k-hp os=hpux ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; vsta) basic_machine=i386-unknown os=vsta ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-pc os=msys ;; mvs) basic_machine=i370-ibm os=mvs ;; nacl) basic_machine=le32-unknown os=nacl ;; 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 ;; necv70) basic_machine=v70-nec os=sysv ;; 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 ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; pw32) basic_machine=i586-unknown os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=rdos ;; rdos32) basic_machine=i386-pc os=rdos ;; rom68k) basic_machine=m68k-rom68k os=coff ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sps7) basic_machine=m68k-bull os=sysv2 ;; stratus) basic_machine=i860-stratus os=sysv4 ;; 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 ;; 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 ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; 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 ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; 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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper | csky \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | 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 \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=${os:-none} ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; m9s12z | m68hcs12z | hcs12z | s12z) basic_machine=s12z-unknown os=${os:-none} ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=${os:-none} ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | 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-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | powerpcspe-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | 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-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | 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. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; abacus) basic_machine=abacus-unknown ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; amiga | amiga-*) basic_machine=m68k-unknown ;; asmjs) basic_machine=asmjs-unknown ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; bluegene*) basic_machine=powerpc-ibm os=cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=${os:-unicos} ;; 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 ;; cr16 | cr16-*) basic_machine=cr16-unknown os=${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=${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 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=${os:-bosx} ;; dpx2*) basic_machine=m68k-bull os=sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; encore | umax | mmax) basic_machine=ns32k-encore ;; elxsi) basic_machine=elxsi-elxsi os=${os:-bsd} ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=hiuxwe2 ;; hp300-*) basic_machine=m68k-hp ;; 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 ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; 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 ;; j90 | j90-cray) basic_machine=j90-cray os=${os:-unicos} ;; iris | iris4d) basic_machine=mips-sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; microblaze*) basic_machine=microblaze-xilinx ;; 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 ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; news-3600 | risc-news) basic_machine=mips-sony os=newsos ;; next | m*-next) basic_machine=m68k-next case $os in nextstep* ) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=hiuxwe2 ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) 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) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; 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 ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=${os:-elf} ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=vxworks ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; tile*) basic_machine=$basic_machine-unknown os=linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; w65*) basic_machine=w65-wdc os=none ;; w89k-*) basic_machine=hppa1.1-winbond os=proelf ;; x64) basic_machine=x86_64-pc ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; none) basic_machine=none-none os=${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 ;; 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 ;; 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. auroraux) os=auroraux ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; 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 ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; none) ;; *-eabi) ;; *) 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 ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; hexagon-*) os=elf ;; tic54x-*) os=coff ;; tic55x-*) os=coff ;; tic6x-*) 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 ;; 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 ;; pru-*) os=elf ;; *-be) os=beos ;; *-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 ;; *-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 ;; *-wrs) os=vxworks ;; *) 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 ;; clix*) vendor=intergraph ;; 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 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xrdp-0.10.1/libpainter/compile000755 001751 000000 00000016705 14652432063 016353 0ustar00metawheel000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.lo | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "compile (GNU Automake) $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook '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: xrdp-0.10.1/libpainter/m4/000755 001751 000000 00000000000 14652432104 015300 5ustar00metawheel000000 000000 xrdp-0.10.1/libpainter/Makefile.am000644 001751 000000 00000000245 14652432052 017017 0ustar00metawheel000000 000000 ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap EXTRA_DIRS = if PT_TESTS EXTRA_DIRS += tests endif SUBDIRS = \ src \ include \ pkgconfig \ $(EXTRA_DIRS) xrdp-0.10.1/libpainter/configure.ac000644 001751 000000 00000001514 14652432052 017251 0ustar00metawheel000000 000000 # Process this file with autoconf to produce a configure script AC_PREREQ(2.69) AC_INIT([libpainter], [0.1.1], [xrdp-devel@googlegroups.com]) AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in) AM_INIT_AUTOMAKE([1.6 foreign]) AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC AC_C_CONST LT_INIT PKG_INSTALLDIR # Use silent rules by default if supported by Automake m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AX_CFLAGS_WARN_ALL AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [Build install tests (default: no)]), [], [enable_tests=no]) AM_CONDITIONAL(PT_TESTS, [test x$enable_tests = xyes]) AC_CONFIG_FILES([ Makefile include/Makefile pkgconfig/libpainter.pc pkgconfig/libpainter-uninstalled.pc pkgconfig/Makefile src/Makefile tests/Makefile ]) AC_OUTPUT xrdp-0.10.1/libpainter/m4/ax_append_compile_flags.m4000644 001751 000000 00000005660 14652432052 022376 0ustar00metawheel000000 000000 # ============================================================================ # https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # ============================================================================ # # SYNOPSIS # # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # For every FLAG1, FLAG2 it is checked whether the compiler works with the # flag. If it does, the flag is added FLAGS-VARIABLE # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. During the check the flag is always added to the # current language's flags. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: This macro depends on the AX_APPEND_FLAG and # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with # AX_APPEND_LINK_FLAGS. # # LICENSE # # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) done ])dnl AX_APPEND_COMPILE_FLAGS xrdp-0.10.1/libpainter/m4/ax_append_flag.m4000644 001751 000000 00000005333 14652432052 020500 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AC_DEFUN([AX_APPEND_FLAG], [dnl AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) AS_VAR_SET_IF(FLAGS,[ AS_CASE([" AS_VAR_GET(FLAGS) "], [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], [ AS_VAR_APPEND(FLAGS,[" $1"]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) ], [ AS_VAR_SET(FLAGS,[$1]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG xrdp-0.10.1/libpainter/m4/ltversion.m4000644 001751 000000 00000001312 14652432060 017565 0ustar00metawheel000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2022 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. # @configure_input@ # serial 4245 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.7' macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xrdp-0.10.1/libpainter/m4/ax_check_compile_flag.m4000644 001751 000000 00000006403 14652432052 022015 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 5 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS xrdp-0.10.1/libpainter/m4/pkg.m4000644 001751 000000 00000024011 14652432052 016323 0ustar00metawheel000000 000000 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR xrdp-0.10.1/libpainter/m4/ltsugar.m4000644 001751 000000 00000010453 14652432060 017227 0ustar00metawheel000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 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 ]) xrdp-0.10.1/libpainter/m4/ltoptions.m4000644 001751 000000 00000034275 14652432060 017611 0ustar00metawheel000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _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], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [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_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _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@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [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])]) xrdp-0.10.1/libpainter/m4/libtool.m4000644 001751 000000 00001127551 14652432060 017223 0ustar00metawheel000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2022 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) 2014 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 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 this program. If not, see . ]) # serial 59 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 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 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) 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_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _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 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl 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_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that 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 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.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_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify 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' ]) # _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 "$][$1" | $SED "$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 "$" | $SED "$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' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_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]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false 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) 2011 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. lt_cl_success=: test yes = "$silent" && 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) ])# 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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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 '$q' "$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' 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)], [Go], [_LT_LANG(GO)], [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 m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _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([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) 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)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) 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], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _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 there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; 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 ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) 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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # 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 if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _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 yes != "$lt_cv_apple_cc_single_mod"; 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([TAGNAME]) # ---------------------------------- # 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. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _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 no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _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_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _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" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 yes = "[$]$2"; 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 "$_lt_linker_boilerplate" | $SED '/^$/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 yes = "[$]$2"; 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 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 yes = "$cross_compiling"; 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 $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* 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 yes != "$enable_dlopen"; 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 ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; 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:$LINENO: $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:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; 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 -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _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 m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 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 AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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 # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[[23]].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no 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], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _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([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _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], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that 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 that 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 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 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* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi 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_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi 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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $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:$LINENO: 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_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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 yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _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([AC_PROG_AWK])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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # 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 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #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. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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_globsym_save_LIBS=$LIBS lt_globsym_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 yes = "$pipe_works"; 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' 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_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _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_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _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)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $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 ia64 = "$host_cpu"; 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 ;; 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; 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* | midnightbsd*) # 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 ia64 != "$host_cpu"; 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 | 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* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _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*) ;; *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* | sunCC*) # 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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 case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; 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 ia64 = "$host_cpu"; 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 ;; 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' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 | 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' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny 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)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _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\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # 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)='' ;; *Sun\ F* | *Sun*Fortran*) _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 ' ;; *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,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; 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* | sunf77* | sunf90* | sunf95*) _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 that 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_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # 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]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # 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_PATH_MANIFEST_TOOL])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' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ 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_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++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([[^)]]\+)\s\+//' 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 ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _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(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _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/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] 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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; 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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; 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; func_echo_all \"$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 yes = "$supports_anon_versioning"; 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 tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # 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)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; 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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 cannot *** 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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([$1]) _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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([$1]) _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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _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' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _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 `func_echo_all "$deplibs" | $SED '\''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(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; 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 ;; # 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* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -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 yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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 no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$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 yes,no = "$GCC,$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_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 no = "$with_gnu_ld"; 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 yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) 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* | bitrig*) 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__`"; 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 _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' 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 shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $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" && func_echo_all "-set_version $verstring"` -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 yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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 yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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 $pic_flag $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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; 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_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$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_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_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* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_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_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([], [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([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _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], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi 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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_caught_CXX_error"; 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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS 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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -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 -v "^Configured with:" | $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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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([$1]) _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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # 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 _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _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(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $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 ;; freebsd2.*) # 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* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; 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 "x$output_objdir/$soname" = "x$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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $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" && func_echo_all "-set_version $verstring"` -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 yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -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 | 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; func_echo_all "$list"' _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 | sort | $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 | sort | $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 | sort | $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 | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above 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; func_echo_all \"$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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # 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 yes = "$supports_anon_versioning"; 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; func_echo_all \"$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='func_echo_all' # 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 ;; openbsd* | bitrig*) 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__`"; 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=func_echo_all 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" && func_echo_all "$wl-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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 -v "^Configured with:" | $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* | sunCC*) # 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='func_echo_all' # 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 yes,no = "$GXX,$with_gnu_ld"; 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 $pic_flag -nostdlib $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 $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $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 $wl-h $wl$soname -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 -v "^Configured with:" | $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 CANNOT 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(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 CFLAGS=$lt_save_CFLAGS 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 yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf 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). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _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 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])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 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac 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 $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 no = "$pre_test_object_deps_done"; 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 CFLAGS=$_lt_libdeps_save_CFLAGS # 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)= ;; 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_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_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_disable_F77"; 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 lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _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_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_disable_FC"; 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 lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" 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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS 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 _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # 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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go 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 _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= 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 CFLAGS=$lt_save_CFLAGS ])# _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 set = "${GCJFLAGS+set}" || 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_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # 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_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_TOOL([FILECMD], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _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 10 -lt "$lt_ac_count" && 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], [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_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS xrdp-0.10.1/libpainter/m4/ax_cflags_warn_all.m4000644 001751 000000 00000011703 14652432052 021354 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html # =========================================================================== # # SYNOPSIS # # AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # # DESCRIPTION # # Try to find a compiler option that enables most reasonable warnings. # # For the GNU compiler it will be -Wall (and -ansi -pedantic) The result # is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default. # # Currently this macro knows about the GCC, Solaris, Digital Unix, AIX, # HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and # Intel compilers. For a given compiler, the Fortran flags are much more # experimental than their C equivalents. # # - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS # - $2 add-value-if-not-found : nothing # - $3 action-if-found : add value to shellvariable # - $4 action-if-not-found : nothing # # NOTE: These macros depend on AX_APPEND_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2010 Rhys Ulerich # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 16 AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], VAR,[VAR="no, unknown" ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-warn all % -warn all" dnl Intel "-pedantic % -Wall" dnl GCC "-xstrconst % -v" dnl Solaris C "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX "-ansi -ansiE % -fullwarn" dnl IRIX "+ESlit % +w1" dnl HP-UX C "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) "-h conform % -h msglevel 2" dnl Cray C (Unicos) # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" ]) AS_VAR_POPDEF([FLAGS])dnl AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; esac AS_VAR_POPDEF([VAR])dnl ])dnl AX_FLAGS_WARN_ALL dnl implementation tactics: dnl the for-argument contains a list of options. The first part of dnl these does only exist to detect the compiler - usually it is dnl a global option to enable -ansi or -extrawarnings. All other dnl compilers will fail about it. That was needed since a lot of dnl compilers will give false positives for some option-syntax dnl like -Woption or -Xoption as they think of it is a pass-through dnl to later compile stages or something. The "%" is used as a dnl delimiter. A non-option comment can be given after "%%" marks dnl which will be shown but not added to the respective C/CXXFLAGS. AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([C]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([C]) ]) AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([C++]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([C++]) ]) AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([Fortran]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([Fortran]) ]) xrdp-0.10.1/libpainter/m4/ax_require_defined.m4000644 001751 000000 00000002302 14652432052 021363 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html # =========================================================================== # # SYNOPSIS # # AX_REQUIRE_DEFINED(MACRO) # # DESCRIPTION # # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have # been defined and thus are available for use. This avoids random issues # where a macro isn't expanded. Instead the configure script emits a # non-fatal: # # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found # # It's like AC_REQUIRE except it doesn't expand the required macro. # # Here's an example: # # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) # # LICENSE # # Copyright (c) 2014 Mike Frysinger # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 2 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) ])dnl AX_REQUIRE_DEFINED xrdp-0.10.1/libpainter/m4/lt~obsolete.m4000644 001751 000000 00000014007 14652432061 020120 0ustar00metawheel000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 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 5 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_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])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) xrdp-0.10.1/libpainter/include/painter.h000644 001751 000000 00000007664 14652432052 020235 0ustar00metawheel000000 000000 /** * painter main header * * Copyright 2015-2016 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(__PAINTER_H) #define __PAINTER_H #define LIBPAINTER_VERSION_MAJOR 0 #define LIBPAINTER_VERSION_MINOR 1 #define LIBPAINTER_VERSION_MICRO 0 #define PT_FORMAT_a8b8g8r8 \ ((32 << 24) | (3 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8) #define PT_FORMAT_a8r8g8b8 \ ((32 << 24) | (2 << 16) | (8 << 12) | (8 << 8) | (8 << 4) | 8) #define PT_FORMAT_r5g6b5 \ ((16 << 24) | (2 << 16) | (0 << 12) | (5 << 8) | (6 << 4) | 5) #define PT_FORMAT_a1r5g5b5 \ ((16 << 24) | (2 << 16) | (1 << 12) | (5 << 8) | (5 << 4) | 5) #define PT_FORMAT_r3g3b2 \ ((8 << 24) | (2 << 16) | (0 << 12) | (3 << 8) | (3 << 4) | 2) #define PT_FORMAT_c1 \ ((1 << 24) | (4 << 16) | (0 << 12) | (0 << 8) | (0 << 4) | 0) #define PT_FORMAT_c8 \ ((8 << 24) | (4 << 16) | (0 << 12) | (0 << 8) | (0 << 4) | 0) struct painter_bitmap { int format; int width; int stride_bytes; int height; char *data; }; #define PT_ERROR_NONE 0 #define PT_ERROR_OUT_OF_MEM 1 #define PT_ERROR_PARAM 2 #define PT_ERROR_NOT_IMP 3 #define PT_PATTERN_MODE_NORMAL 0 #define PT_PATTERN_MODE_OPAQUE 1 #define PT_LINE_FLAGS_NONE 0 /* reverse Windows X11 */ /* polish */ #define PT_ROP_0 0x00 /* 0 BLACKNESS GXclear */ #define PT_ROP_DSon 0x11 /* DSon NOTSRCERASE GXnor */ #define PT_ROP_DSna 0x22 /* DSna GXandInverted */ #define PT_ROP_Sn 0x33 /* Sn NOTSRCCOPY GXcopyInverted */ #define PT_ROP_SDna 0x44 /* SDna SRCERASE GXandReverse */ #define PT_ROP_Dn 0x55 /* Dn DSTINVERT GXinvert */ #define PT_ROP_DSx 0x66 /* DSx SRCINVERT GXxor */ #define PT_ROP_DSan 0x77 /* DSan GXnand */ #define PT_ROP_DSa 0x88 /* DSa SRCAND GXand */ #define PT_ROP_DSxn 0x99 /* DSxn GXequiv */ #define PT_ROP_D 0xAA /* D GXnoop */ #define PT_ROP_DSno 0xBB /* DSno MERGEPAINT GXorInverted */ #define PT_ROP_S 0xCC /* S SRCCOPY GXcopy */ #define PT_ROP_SDno 0xDD /* SDno GXorReverse */ #define PT_ROP_DSo 0xEE /* DSo GXor */ #define PT_ROP_1 0xFF /* 1 WHITENESS GXset */ int painter_create(void **handle); int painter_delete(void *handle); int painter_set_fgcolor(void *handle, int color); int painter_set_bgcolor(void *handle, int color); int painter_set_rop(void *handle, int rop); int painter_set_pattern_mode(void *handle, int mode); int painter_set_pattern_origin(void *handle, int x, int y); int painter_set_clip(void *handle, int x, int y, int cx, int cy); int painter_clear_clip(void *handle); int painter_fill_rect(void *handle, struct painter_bitmap *dst, int x, int y, int cx, int cy); int painter_fill_pattern(void *handle, struct painter_bitmap *dst, struct painter_bitmap *pat, int patx, int paty, int x, int y, int cx, int cy); int painter_copy(void *handle, struct painter_bitmap *dst, int x, int y, int cx, int cy, struct painter_bitmap *src, int srcx, int srcy); int painter_line(void *handle, struct painter_bitmap *dst, int x1, int y1, int x2, int y2, int width, int flags); int painter_get_version(int *major, int *minor, int *micro); #endif xrdp-0.10.1/libpainter/include/Makefile.in000644 001751 000000 00000040772 14652432063 020466 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) 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__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ EXTRA_DIST = include_HEADERS = painter.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS 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-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libpainter/include/Makefile.am000644 001751 000000 00000000053 14652432052 020437 0ustar00metawheel000000 000000 EXTRA_DIST = include_HEADERS = painter.h xrdp-0.10.1/libpainter/pkgconfig/libpainter-uninstalled.pc.in000644 001751 000000 00000000437 14652432052 024337 0ustar00metawheel000000 000000 abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ includedir=${abs_top_srcdir}/include libdir=${abs_top_builddir}/src Name: libpainter Description: Library for manipulating memory bitmaps. Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lpainter Cflags: -I${includedir} xrdp-0.10.1/libpainter/pkgconfig/libpainter.pc.in000644 001751 000000 00000000351 14652432052 022012 0ustar00metawheel000000 000000 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libpainter Description: Library for manipulating memory bitmaps. Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lpainter Cflags: -I${includedir} xrdp-0.10.1/libpainter/pkgconfig/Makefile.in000644 001751 000000 00000035606 14652432063 021012 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = pkgconfig ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = libpainter.pc libpainter-uninstalled.pc CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/libpainter-uninstalled.pc.in \ $(srcdir)/libpainter.pc.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ pkgconfig_DATA = libpainter.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign pkgconfig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign pkgconfig/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libpainter.pc: $(top_builddir)/config.status $(srcdir)/libpainter.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ libpainter-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/libpainter-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgconfigdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am \ uninstall-pkgconfigDATA .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libpainter/pkgconfig/Makefile.am000644 001751 000000 00000000037 14652432052 020765 0ustar00metawheel000000 000000 pkgconfig_DATA = libpainter.pc xrdp-0.10.1/libpainter/tests/paintertest.c000644 001751 000000 00000000250 14652432052 020627 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include int main(int argc, char **argv) { return 0; } xrdp-0.10.1/libpainter/tests/Makefile.am000644 001751 000000 00000000454 14652432052 020163 0ustar00metawheel000000 000000 EXTRA_DIST = EXTRA_INCLUDES = EXTRA_LIBS = EXTRA_FLAGS = AM_CPPFLAGS = \ -I$(top_srcdir)/include \ $(EXTRA_INCLUDES) bin_PROGRAMS = paintertest paintertest_SOURCES = paintertest.c paintertest_LDADD = \ $(top_builddir)/src/libpainter.la $(EXTRA_LIBS) paintertest_LDFLAGS = $(EXTRA_FLAGS) xrdp-0.10.1/libpainter/tests/Makefile.in000644 001751 000000 00000047652 14652432063 020211 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = paintertest$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_paintertest_OBJECTS = paintertest.$(OBJEXT) paintertest_OBJECTS = $(am_paintertest_OBJECTS) am__DEPENDENCIES_1 = paintertest_DEPENDENCIES = $(top_builddir)/src/libpainter.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = paintertest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(paintertest_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/paintertest.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(paintertest_SOURCES) DIST_SOURCES = $(paintertest_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ EXTRA_DIST = EXTRA_INCLUDES = EXTRA_LIBS = EXTRA_FLAGS = AM_CPPFLAGS = \ -I$(top_srcdir)/include \ $(EXTRA_INCLUDES) paintertest_SOURCES = paintertest.c paintertest_LDADD = \ $(top_builddir)/src/libpainter.la $(EXTRA_LIBS) paintertest_LDFLAGS = $(EXTRA_FLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) paintertest$(EXEEXT): $(paintertest_OBJECTS) $(paintertest_DEPENDENCIES) $(EXTRA_paintertest_DEPENDENCIES) @rm -f paintertest$(EXEEXT) $(AM_V_CCLD)$(paintertest_LINK) $(paintertest_OBJECTS) $(paintertest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paintertest.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/paintertest.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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 ./$(DEPDIR)/paintertest.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libpainter/src/painter_utils.h000644 001751 000000 00000006717 14652432052 020617 0ustar00metawheel000000 000000 /** * painter utils header * * Copyright 2015-2016 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(__PAINTER_UTILS_H) #define __PAINTER_UTILS_H #define SPLIT_a8r8g8b8(_c, _a, _r, _g, _b) \ do { \ _a = ((_c) & 0xff000000) >> 24; \ _r = ((_c) & 0x00ff0000) >> 16; \ _g = ((_c) & 0x0000ff00) >> 8; \ _b = ((_c) & 0x000000ff) >> 0; \ } while (0) #define SPLIT_a8b8g8r8(_c, _a, _r, _g, _b) \ do { \ _a = ((_c) & 0xff000000) >> 24; \ _b = ((_c) & 0x00ff0000) >> 16; \ _g = ((_c) & 0x0000ff00) >> 8; \ _r = ((_c) & 0x000000ff) >> 0; \ } while (0) #define SPLIT_a1r5g5b5(_c, _a, _r, _g, _b) \ do { \ _a = (((_c) >> 15) & 1) * 0xff; \ _r = (((_c) >> 7) & 0xf8) | (((_c) >> 12) & 0x7); \ _g = (((_c) >> 2) & 0xf8) | (((_c) >> 8) & 0x7); \ _b = (((_c) << 3) & 0xf8) | (((_c) >> 2) & 0x7); \ } while (0) #define SPLIT_r5g6b5(_c, _a, _r, _g, _b) \ do { \ _a = 0xff; \ _r = (((_c) >> 8) & 0xf8) | (((_c) >> 13) & 0x7); \ _g = (((_c) >> 3) & 0xfc) | (((_c) >> 9) & 0x3); \ _b = (((_c) << 3) & 0xf8) | (((_c) >> 2) & 0x7); \ } while (0) #define SPLIT_r3g3b2(_c, _a, _r, _g, _b) \ do { \ _a = 0xff; \ _r = 0; \ _g = 0; \ _b = 0; \ } while (0) #define MAKE_a1r5g5b5(_c, _a, _r, _g, _b) \ do { \ _c = (((_a) & 0xff) >> 7) << 15 | \ (((_r) & 0xff) >> 3) << 10 | \ (((_g) & 0xff) >> 3) << 5 | \ (((_b) & 0xff) >> 3) << 0; \ } while (0) #define MAKE_r5g6b5(_c, _a, _r, _g, _b) \ do { \ _c = \ (((_r) & 0xff) >> 3) << 11 | \ (((_g) & 0xff) >> 2) << 5 | \ (((_b) & 0xff) >> 3) << 0; \ } while (0) #define MAKE_a8r8g8b8(_c, _a, _r, _g, _b) \ do { \ _c = ((_a) & 0xff) << 24 | \ ((_r) & 0xff) << 16 | \ ((_g) & 0xff) << 8 | \ ((_b) & 0xff) << 0; \ } while (0) #define MAKE_a8b8g8r8(_c, _a, _r, _g, _b) \ do { \ _c = ((_a) & 0xff) << 24 | \ ((_b) & 0xff) << 16 | \ ((_g) & 0xff) << 8 | \ ((_r) & 0xff) << 0; \ } while (0) struct painter_rect { short x1; short y1; short x2; short y2; }; struct painter { int rop; int fgcolor; int bgcolor; int pattern_mode; int clip_valid; int pad0; struct painter_rect clip; int origin_x; int origin_y; int palette[256]; }; int painter_rop(int rop, int src, int dst); int painter_get_pixel(struct painter *painter, struct painter_bitmap *bitmap, int x, int y); int painter_set_pixel(struct painter *painter, struct painter_bitmap *dst, int x, int y, int pixel, int pixel_format); int painter_warp_coords(struct painter *painter, int *x, int *y, int *cx, int *cy, int *srcx, int *srcy); char * bitmap_get_ptr(struct painter_bitmap *bitmap, int x, int y); int bitmap_get_pixel(struct painter_bitmap *bitmap, int x, int y); int bitmap_set_pixel(struct painter_bitmap *bitmap, int x, int y, int pixel); #endif xrdp-0.10.1/libpainter/src/Makefile.in000644 001751 000000 00000051433 14652432063 017626 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libpainter_la_DEPENDENCIES = am_libpainter_la_OBJECTS = painter.lo painter_utils.lo libpainter_la_OBJECTS = $(am_libpainter_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libpainter_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libpainter_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/painter.Plo \ ./$(DEPDIR)/painter_utils.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libpainter_la_SOURCES) DIST_SOURCES = $(libpainter_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ 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@ pkgconfigdir = @pkgconfigdir@ 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@ EXTRA_DIST = EXTRA_PAINTER_DEFINES = EXTRA_PAINTER_INCLUDES = EXTRA_PAINTER_LIBS = EXTRA_PAINTER_FLAGS = AM_CFLAGS = \ -I$(top_srcdir)/include \ $(EXTRA_PAINTER_FLAGS) lib_LTLIBRARIES = libpainter.la libpainter_la_LDFLAGS = -all-static libpainter_ladir = $(moduledir) libpainter_la_SOURCES = painter.c painter_utils.c painter_utils.h libpainter_la_LIBADD = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -$(am__rm_f) $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libpainter.la: $(libpainter_la_OBJECTS) $(libpainter_la_DEPENDENCIES) $(EXTRA_libpainter_la_DEPENDENCIES) $(AM_V_CCLD)$(libpainter_la_LINK) -rpath $(libdir) $(libpainter_la_OBJECTS) $(libpainter_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/painter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/painter_utils.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/painter.Plo -rm -f ./$(DEPDIR)/painter_utils.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-libLTLIBRARIES 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 ./$(DEPDIR)/painter.Plo -rm -f ./$(DEPDIR)/painter_utils.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libpainter/src/painter.c000644 001751 000000 00000026426 14652432052 017371 0ustar00metawheel000000 000000 /** * painter main * * Copyright 2015-2016 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "painter.h" #include "painter_utils.h" /*****************************************************************************/ int painter_create(void **handle) { struct painter *pt; if (handle == NULL) { return PT_ERROR_PARAM; } *handle = calloc(1, sizeof(struct painter)); if (*handle == NULL) { return PT_ERROR_OUT_OF_MEM; } pt = (struct painter *) *handle; pt->rop = PT_ROP_S; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_delete(void *handle) { if (handle == NULL) { return PT_ERROR_NONE; } free(handle); return PT_ERROR_NONE; } /*****************************************************************************/ int painter_set_fgcolor(void *handle, int color) { struct painter *pt; pt = (struct painter *) handle; pt->fgcolor = color; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_set_bgcolor(void *handle, int color) { struct painter *pt; pt = (struct painter *) handle; pt->bgcolor = color; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_set_rop(void *handle, int rop) { struct painter *pt; pt = (struct painter *) handle; pt->rop = rop; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_set_pattern_mode(void *handle, int mode) { struct painter *pt; pt = (struct painter *) handle; pt->pattern_mode = mode; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_set_pattern_origin(void *handle, int x, int y) { struct painter *pt; pt = (struct painter *) handle; pt->origin_x = x; pt->origin_y = y; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_set_clip(void *handle, int x, int y, int cx, int cy) { struct painter *pt; pt = (struct painter *) handle; pt->clip.x1 = x; pt->clip.y1 = y; pt->clip.x2 = x + cx; pt->clip.y2 = y + cy; pt->clip_valid = 1; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_clear_clip(void *handle) { struct painter *pt; pt = (struct painter *) handle; pt->clip_valid = 0; return PT_ERROR_NONE; } /*****************************************************************************/ int painter_fill_rect(void *handle, struct painter_bitmap *dst, int x, int y, int cx, int cy) { int index; int jndex; int bpp; int *dst32; short *dst16; struct painter *pt; pt = (struct painter *) handle; if (pt->rop == PT_ROP_S) { if (painter_warp_coords(pt, &x, &y, &cx, &cy, NULL, NULL)) { bpp = dst->format >> 24; if (bpp == 32) { for (jndex = 0; jndex < cy; jndex++) { dst32 = (int *) bitmap_get_ptr(dst, x, y + jndex); if (dst32 != NULL) { for (index = 0; index < cx; index++) { *(dst32++) = pt->fgcolor; } } } return PT_ERROR_NONE; } else if (bpp == 16) { for (jndex = 0; jndex < cy; jndex++) { dst16 = (short *) bitmap_get_ptr(dst, x, y + jndex); if (dst16 != NULL) { for (index = 0; index < cx; index++) { *(dst16++) = pt->fgcolor; } } } return PT_ERROR_NONE; } } } for (jndex = 0; jndex < cy; jndex++) { for (index = 0; index < cx; index++) { painter_set_pixel(pt, dst, x + index, y + jndex, pt->fgcolor, dst->format); } } return PT_ERROR_NONE; } /*****************************************************************************/ int painter_fill_pattern(void *handle, struct painter_bitmap *dst, struct painter_bitmap *pat, int patx, int paty, int x, int y, int cx, int cy) { int index; int jndex; int pixel; int lx; int ly; struct painter *pt; pt = (struct painter *) handle; if (pt->pattern_mode == PT_PATTERN_MODE_OPAQUE) { for (jndex = 0; jndex < cy; jndex++) { for (index = 0; index < cx; index++) { lx = (patx + index + pt->origin_x) % pat->width; ly = (paty + jndex + pt->origin_y) % pat->height; pixel = bitmap_get_pixel(pat, lx, ly); if (pixel != 0) { painter_set_pixel(pt, dst, x + index, y + jndex, pt->fgcolor, dst->format); } else { painter_set_pixel(pt, dst, x + index, y + jndex, pt->bgcolor, dst->format); } } } } else { for (jndex = 0; jndex < cy; jndex++) { for (index = 0; index < cx; index++) { lx = (patx + index + pt->origin_x) % pat->width; ly = (paty + jndex + pt->origin_y) % pat->height; pixel = bitmap_get_pixel(pat, lx, ly); if (pixel != 0) { painter_set_pixel(pt, dst, x + index, y + jndex, pt->fgcolor, dst->format); } } } } return PT_ERROR_NONE; } /*****************************************************************************/ int painter_copy(void *handle, struct painter_bitmap *dst, int x, int y, int cx, int cy, struct painter_bitmap *src, int srcx, int srcy) { int index; int jndex; int pixel; int bpp; struct painter *pt; char *src_ptr; char *dst_ptr; pt = (struct painter *) handle; if (pt->rop == PT_ROP_S) { if (src->format == dst->format) { bpp = src->format >> 24; if (painter_warp_coords(pt, &x, &y, &cx, &cy, &srcx, &srcy)) { /* straight right or down */ if ((srcy < y) || ((srcy == y) && (srcx < x))) { for (jndex = cy - 1; jndex >= 0; jndex--) { dst_ptr = bitmap_get_ptr(dst, x, y + jndex); src_ptr = bitmap_get_ptr(src, srcx, srcy + jndex); if ((src_ptr != NULL) && (dst_ptr != NULL)) { memmove(dst_ptr, src_ptr, cx * (bpp / 8)); } } } else { for (jndex = 0; jndex < cy; jndex++) { dst_ptr = bitmap_get_ptr(dst, x, y + jndex); src_ptr = bitmap_get_ptr(src, srcx, srcy + jndex); if ((src_ptr != NULL) && (dst_ptr != NULL)) { memcpy(dst_ptr, src_ptr, cx * (bpp / 8)); } } } } return PT_ERROR_NONE; } } /* straight right or down */ if ((srcy < y) || ((srcy == y) && (srcx < x))) { for (jndex = cy - 1; jndex >= 0; jndex--) { for (index = cx - 1; index >= 0; index--) { pixel = painter_get_pixel(pt, src, srcx + index, srcy + jndex); painter_set_pixel(pt, dst, x + index, y + jndex, pixel, src->format); } } } else { for (jndex = 0; jndex < cy; jndex++) { for (index = 0; index < cx; index++) { pixel = painter_get_pixel(pt, src, srcx + index, srcy + jndex); painter_set_pixel(pt, dst, x + index, y + jndex, pixel, src->format); } } } return PT_ERROR_NONE; } /*****************************************************************************/ /* Bresenham's line drawing algorithm */ int painter_line(void *handle, struct painter_bitmap *dst, int x1, int y1, int x2, int y2, int width, int flags) { int dx; int dy; int incx; int incy; int dpr; int dpru; int p; struct painter *pt; pt = (struct painter *) handle; if (x1 > x2) { dx = x1 - x2; incx = -1; } else { dx = x2 - x1; incx = 1; } if (y1 > y2) { dy = y1 - y2; incy = -1; } else { dy = y2 - y1; incy = 1; } if (dx >= dy) { dpr = dy << 1; dpru = dpr - (dx << 1); p = dpr - dx; for (; dx >= 0; dx--) { if (x1 != x2 || y1 != y2) { painter_set_pixel(pt, dst, x1, y1, pt->fgcolor, dst->format); } if (p > 0) { x1 += incx; y1 += incy; p += dpru; } else { x1 += incx; p += dpr; } } } else { dpr = dx << 1; dpru = dpr - (dy << 1); p = dpr - dy; for (; dy >= 0; dy--) { if (x1 != x2 || y1 != y2) { painter_set_pixel(pt, dst, x1, y1, pt->fgcolor, dst->format); } if (p > 0) { x1 += incx; y1 += incy; p += dpru; } else { y1 += incy; p += dpr; } } } return PT_ERROR_NONE; } /*****************************************************************************/ int painter_get_version(int *major, int *minor, int *micro) { *major = LIBPAINTER_VERSION_MAJOR; *minor = LIBPAINTER_VERSION_MINOR; *micro = LIBPAINTER_VERSION_MICRO; return 0; } xrdp-0.10.1/libpainter/src/Makefile.am000644 001751 000000 00000000561 14652432052 017607 0ustar00metawheel000000 000000 EXTRA_DIST = EXTRA_PAINTER_DEFINES = EXTRA_PAINTER_INCLUDES = EXTRA_PAINTER_LIBS = EXTRA_PAINTER_FLAGS = AM_CFLAGS = \ -I$(top_srcdir)/include \ $(EXTRA_PAINTER_FLAGS) lib_LTLIBRARIES = libpainter.la libpainter_la_LDFLAGS = -all-static libpainter_ladir = $(moduledir) libpainter_la_SOURCES = painter.c painter_utils.c painter_utils.h libpainter_la_LIBADD = xrdp-0.10.1/libpainter/src/painter_utils.c000644 001751 000000 00000020174 14652432052 020603 0ustar00metawheel000000 000000 /** * painter utils * * Copyright 2015-2016 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "painter.h" #include "painter_utils.h" /*****************************************************************************/ /* do a raster op */ int do_rop(int rop, int src, int dst) { switch (rop) { case PT_ROP_0: return 0; case PT_ROP_DSon: return ~(src | dst); case PT_ROP_DSna: return (~src) & dst; case PT_ROP_Sn: return ~src; case PT_ROP_SDna: return src & (~dst); case PT_ROP_Dn: return ~(dst); case PT_ROP_DSx: return src ^ dst; case PT_ROP_DSan: return ~(src & dst); case PT_ROP_DSa: return src & dst; case PT_ROP_DSxn: return ~(src) ^ dst; case PT_ROP_D: return dst; case PT_ROP_DSno: return (~src) | dst; case PT_ROP_S: return src; case PT_ROP_SDno: return src | (~dst); case PT_ROP_DSo: return src | dst; case PT_ROP_1: return ~0; } return dst; } /*****************************************************************************/ char * bitmap_get_ptr(struct painter_bitmap *bitmap, int x, int y) { char *p; int bpp; int Bpp; if ((x >= 0) && (x < bitmap->width) && (y >= 0) && (y < bitmap->height)) { bpp = bitmap->format >> 24; if (bpp < 8) { p = bitmap->data + (y * bitmap->stride_bytes) + (x / 8); return p; } else { Bpp = (bpp + 7) / 8; p = bitmap->data + (y * bitmap->stride_bytes) + (x * Bpp); return p; } } else { return NULL; } } /*****************************************************************************/ int bitmap_get_pixel(struct painter_bitmap *bitmap, int x, int y) { char *ptr; int rv; ptr = bitmap_get_ptr(bitmap, x, y); if (ptr == NULL) { return 0; } switch (bitmap->format) { case PT_FORMAT_c1: rv = *((unsigned char *) ptr); rv = (rv & (0x80 >> (x % 8))) != 0; return rv; case PT_FORMAT_c8: return *((unsigned char *) ptr); case PT_FORMAT_r3g3b2: return *((unsigned char *) ptr); case PT_FORMAT_a1r5g5b5: return *((unsigned short *) ptr); case PT_FORMAT_r5g6b5: return *((unsigned short *) ptr); case PT_FORMAT_a8r8g8b8: return *((unsigned int *) ptr); case PT_FORMAT_a8b8g8r8: return *((unsigned int *) ptr); } return 0; } /*****************************************************************************/ int bitmap_set_pixel(struct painter_bitmap *bitmap, int x, int y, int pixel) { char *ptr; ptr = bitmap_get_ptr(bitmap, x, y); if (ptr == NULL) { return 0; } switch (bitmap->format) { case PT_FORMAT_r3g3b2: *((unsigned char *) ptr) = pixel; break; case PT_FORMAT_a1r5g5b5: *((unsigned short *) ptr) = pixel; break; case PT_FORMAT_r5g6b5: *((unsigned short *) ptr) = pixel; break; case PT_FORMAT_a8r8g8b8: *((unsigned int *) ptr) = pixel; break; case PT_FORMAT_a8b8g8r8: *((unsigned int *) ptr) = pixel; break; } return 0; } /*****************************************************************************/ int pixel_convert(int pixel, int src_format, int dst_format, int *palette) { int a; int r; int g; int b; int rv; if (src_format == dst_format) { return pixel; } a = 0; r = 0; g = 0; b = 0; switch (src_format) { case PT_FORMAT_r3g3b2: SPLIT_r3g3b2(pixel, a, r, g, b); break; case PT_FORMAT_a1r5g5b5: SPLIT_a1r5g5b5(pixel, a, r, g, b); break; case PT_FORMAT_r5g6b5: SPLIT_r5g6b5(pixel, a, r, g, b); break; case PT_FORMAT_a8r8g8b8: SPLIT_a8r8g8b8(pixel, a, r, g, b); break; case PT_FORMAT_a8b8g8r8: SPLIT_a8b8g8r8(pixel, a, r, g, b); break; } rv = 0; switch (dst_format) { case PT_FORMAT_a1r5g5b5: MAKE_a1r5g5b5(rv, a, r, g, b); break; case PT_FORMAT_r5g6b5: MAKE_r5g6b5(rv, a, r, g, b); break; case PT_FORMAT_a8r8g8b8: MAKE_a8r8g8b8(rv, a, r, g, b); break; case PT_FORMAT_a8b8g8r8: MAKE_a8b8g8r8(rv, a, r, g, b); break; } return rv; } /*****************************************************************************/ int painter_get_pixel(struct painter *painter, struct painter_bitmap *bitmap, int x, int y) { int rv; rv = 0; if ((x >= 0) && (x < bitmap->width) && (y >= 0) && (y < bitmap->height)) { switch (bitmap->format) { case PT_FORMAT_c1: rv = bitmap_get_pixel(bitmap, x, y); rv = rv ? painter->fgcolor : painter->bgcolor; break; case PT_FORMAT_c8: rv = bitmap_get_pixel(bitmap, x, y); rv = painter->palette[rv & 0xff]; break; default: rv = bitmap_get_pixel(bitmap, x, y); break; } } return rv; } /*****************************************************************************/ int painter_set_pixel(struct painter *painter, struct painter_bitmap *bitmap, int x, int y, int pixel, int pixel_format) { if ((painter->clip_valid == 0) || ((x >= painter->clip.x1) && (x < painter->clip.x2) && (y >= painter->clip.y1) && (y < painter->clip.y2))) { if ((x >= 0) && (x < bitmap->width) && (y >= 0) && (y < bitmap->height)) { pixel = pixel_convert(pixel, pixel_format, bitmap->format, painter->palette); if (painter->rop != PT_ROP_S) { pixel = do_rop(painter->rop, pixel, bitmap_get_pixel(bitmap, x, y)); } bitmap_set_pixel(bitmap, x, y, pixel); } } return 0; } /*****************************************************************************/ /* return true if there is something to draw */ int painter_warp_coords(struct painter *painter, int *x, int *y, int *cx, int *cy, int *srcx, int *srcy) { int dx; int dy; int lx; int ly; int lcx; int lcy; lx = *x; ly = *y; lcx = *cx; lcy = *cy; dx = 0; dy = 0; if (painter->clip_valid) { if (painter->clip.x1 > lx) { dx = painter->clip.x1 - lx; } if (painter->clip.y1 > ly) { dy = painter->clip.y1 - ly; } if (lx + lcx > painter->clip.x2) { lcx = (lcx - ((lx + lcx) - painter->clip.x2)); } if (*y + lcy > painter->clip.y2) { lcy = (lcy - ((ly + lcy) - painter->clip.y2)); } } lcx = lcx - dx; lcy = lcy - dy; if (lcx <= 0) { return 0; } if (lcy <= 0) { return 0; } lx = lx + dx; ly = ly + dy; if (srcx != 0) { *srcx = *srcx + dx; } if (srcy != 0) { *srcy = *srcy + dy; } *x = lx; *y = ly; *cx = lcx; *cy = lcy; return 1; } xrdp-0.10.1/keygen/Makefile.in000644 001751 000000 00000053543 14652432075 016177 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xrdp-keygen$(EXEEXT) subdir = keygen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_xrdp_keygen_OBJECTS = keygen.$(OBJEXT) xrdp_keygen_OBJECTS = $(am_xrdp_keygen_OBJECTS) xrdp_keygen_DEPENDENCIES = $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/keygen.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_keygen_SOURCES) DIST_SOURCES = $(xrdp_keygen_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = openssl.conf AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common xrdp_keygen_SOURCES = keygen.c xrdp_keygen_LDADD = \ $(top_builddir)/common/libcommon.la xrdpsysconfdir = $(sysconfdir)/xrdp all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign keygen/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign keygen/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) xrdp-keygen$(EXEEXT): $(xrdp_keygen_OBJECTS) $(xrdp_keygen_DEPENDENCIES) $(EXTRA_xrdp_keygen_DEPENDENCIES) @rm -f xrdp-keygen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_keygen_OBJECTS) $(xrdp_keygen_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keygen.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/keygen.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook 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 ./$(DEPDIR)/keygen.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-data-hook 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-hook .PRECIOUS: Makefile install-data-hook: umask 077 && \ if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini ]; then \ ./xrdp-keygen xrdp $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini; \ fi && \ if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem ]; then \ $(OPENSSL) req -x509 -newkey rsa:2048 -sha256 -nodes \ -keyout $(DESTDIR)$(xrdpsysconfdir)/key.pem -out \ $(DESTDIR)$(xrdpsysconfdir)/cert.pem -days 365 \ -subj /C=US/ST=CA/L=Sunnyvale/O=xrdp/CN=www.xrdp.org \ -config $(srcdir)/openssl.conf; \ fi uninstall-hook: rm -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini rm -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem rm -f $(DESTDIR)$(xrdpsysconfdir)/key.pem # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/keygen/Makefile.am000644 001751 000000 00000002027 14652432047 016154 0ustar00metawheel000000 000000 EXTRA_DIST = openssl.conf AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common bin_PROGRAMS = \ xrdp-keygen xrdp_keygen_SOURCES = keygen.c xrdp_keygen_LDADD = \ $(top_builddir)/common/libcommon.la xrdpsysconfdir = $(sysconfdir)/xrdp install-data-hook: umask 077 && \ if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini ]; then \ ./xrdp-keygen xrdp $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini; \ fi && \ if [ ! -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem ]; then \ $(OPENSSL) req -x509 -newkey rsa:2048 -sha256 -nodes \ -keyout $(DESTDIR)$(xrdpsysconfdir)/key.pem -out \ $(DESTDIR)$(xrdpsysconfdir)/cert.pem -days 365 \ -subj /C=US/ST=CA/L=Sunnyvale/O=xrdp/CN=www.xrdp.org \ -config $(srcdir)/openssl.conf; \ fi uninstall-hook: rm -f $(DESTDIR)$(xrdpsysconfdir)/rsakeys.ini rm -f $(DESTDIR)$(xrdpsysconfdir)/cert.pem rm -f $(DESTDIR)$(xrdpsysconfdir)/key.pem xrdp-0.10.1/keygen/keygen.c000644 001751 000000 00000046067 14652432047 015562 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * rsa key generator for xrdp */ /* references: http://www.securiteam.com/windowsntfocus/5EP010KG0G.html */ #if defined(HAVE_CONFIG_H) #include #endif #include "os_calls.h" #include "string_calls.h" #include "ssl_calls.h" #include "arch.h" #include "list.h" #include "file.h" /* this is the signature size in bytes */ #define TSSK_KEY_LENGTH 64 /* default to 2048 bit key size, can set changed, set */ static int g_key_size_bits = 2048; static tui8 g_exponent[4] = { 0x01, 0x00, 0x01, 0x00 }; /* 4 bytes public exponent */ static tui8 g_ppk_e[4] = { 0x5B, 0x7B, 0x88, 0xC0 }; /* 64 byte modulus */ static tui8 g_ppk_n[72] = /* 64 bytes + 8 bytes pad */ { 0x3D, 0x3A, 0x5E, 0xBD, 0x72, 0x43, 0x3E, 0xC9, 0x4D, 0xBB, 0xC1, 0x1E, 0x4A, 0xBA, 0x5F, 0xCB, 0x3E, 0x88, 0x20, 0x87, 0xEF, 0xF5, 0xC1, 0xE2, 0xD7, 0xB7, 0x6B, 0x9A, 0xF2, 0x52, 0x45, 0x95, 0xCE, 0x63, 0x65, 0x6B, 0x58, 0x3A, 0xFE, 0xEF, 0x7C, 0xE7, 0xBF, 0xFE, 0x3D, 0xF6, 0x5C, 0x7D, 0x6C, 0x5E, 0x06, 0x09, 0x1A, 0xF5, 0x61, 0xBB, 0x20, 0x93, 0x09, 0x5F, 0x05, 0x6D, 0xEA, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 64 bytes private exponent */ static tui8 g_ppk_d[108] = /* 64 bytes + 44 bytes pad */ { 0x87, 0xA7, 0x19, 0x32, 0xDA, 0x11, 0x87, 0x55, 0x58, 0x00, 0x16, 0x16, 0x25, 0x65, 0x68, 0xF8, 0x24, 0x3E, 0xE6, 0xFA, 0xE9, 0x67, 0x49, 0x94, 0xCF, 0x92, 0xCC, 0x33, 0x99, 0xE8, 0x08, 0x60, 0x17, 0x9A, 0x12, 0x9F, 0x24, 0xDD, 0xB1, 0x24, 0x99, 0xC7, 0x3A, 0xB8, 0x0A, 0x7B, 0x0D, 0xDD, 0x35, 0x07, 0x79, 0x17, 0x0B, 0x51, 0x9B, 0xB3, 0xC7, 0x10, 0x01, 0x13, 0xE7, 0x3F, 0xF3, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 512 bit proprietary certificate dwVersion 0 4 bytes always 0x00000001 dwSigAlgId 4 4 bytes always 0x00000001 dwKeyAlgId 8 4 bytes always 0x00000001 wPublicKeyBlobType 12 2 bytes always 0x0006 wPublicKeyBlobLen 14 2 bytes 0x005C 92 bytes magic 16 4 bytes always 0x31415352 keylen 20 4 bytes 0x0048 72 bytes bitlen 24 4 bytes 0x0200 512 bits datalen 28 4 bytes 0x003F 63 bytes pubExp 32 4 bytes 0x00010001 modulus 36 72 bytes wSignatureBlobType 108 2 bytes always 0x0008 wSignatureBlobLen 110 2 bytes 0x0048 72 bytes SignatureBlob 112 72 bytes */ static tui8 g_testkey512[184] = /* 512 bit test key */ { 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* 0 */ 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5c, 0x00, 0x52, 0x53, 0x41, 0x31, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x79, 0x6f, 0xb4, 0xdf, /* 32 */ 0xa6, 0x95, 0xb9, 0xa9, 0x61, 0xe3, 0xc4, 0x5e, 0xff, 0x6b, 0xd8, 0x81, 0x8a, 0x12, 0x4a, 0x93, 0x42, 0x97, 0x18, 0x93, 0xac, 0xd1, 0x3a, 0x38, 0x3c, 0x68, 0x50, 0x19, 0x31, 0xb6, 0x84, 0x51, /* 64 */ 0x79, 0xfb, 0x1c, 0xe7, 0xe3, 0x99, 0x20, 0xc7, 0x84, 0xdf, 0xd1, 0xaa, 0xb5, 0x15, 0xef, 0x47, 0x7e, 0xfc, 0x88, 0xeb, 0x29, 0xc3, 0x27, 0x5a, 0x35, 0xf8, 0xfd, 0xaa, 0x00, 0x00, 0x00, 0x00, /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x48, 0x00, 0x32, 0x3b, 0xde, 0x6f, 0x18, 0x97, 0x1e, 0xc3, 0x6b, 0x2b, 0x2d, 0xe4, 0xfc, 0x2d, 0xa2, 0x8e, 0x32, 0x3c, 0xf3, 0x1b, 0x24, 0x90, 0x57, 0x4d, /* 128 */ 0x8e, 0xe4, 0x69, 0xfc, 0x16, 0x8d, 0x41, 0x92, 0x78, 0xc7, 0x9c, 0xb4, 0x26, 0xff, 0xe8, 0x3e, 0xa1, 0x8a, 0xf5, 0x57, 0xc0, 0x7f, 0x3e, 0x21, 0x17, 0x32, 0x30, 0x6f, 0x79, 0xe1, 0x36, 0xcd, /* 160 */ 0xb6, 0x8e, 0xbe, 0x57, 0x57, 0xd2, 0xa9, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* 2048 bit proprietary certificate dwVersion 0 4 bytes always 0x00000001 dwSigAlgId 4 4 bytes always 0x00000001 dwKeyAlgId 8 4 bytes always 0x00000001 wPublicKeyBlobType 12 2 bytes always 0x0006 wPublicKeyBlobLen 14 2 bytes 0x011C 284 bytes magic 16 4 bytes always 0x31415352 keylen 20 4 bytes 0x0108 264 bytes bitlen 24 4 bytes 0x0800 2048 bits datalen 28 4 bytes 0x00FF 255 bytes pubExp 32 4 bytes 0x00010001 modulus 36 264 bytes wSignatureBlobType 300 2 bytes always 0x0008 wSignatureBlobLen 302 2 bytes 0x0048 72 bytes SignatureBlob 304 72 bytes */ static tui8 g_testkey2048[376] = /* 2048 bit test key */ { 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* 0 */ 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x1c, 0x01, 0x52, 0x53, 0x41, 0x31, 0x08, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x13, 0x77, 0x6d, 0xd8, /* 32 */ 0x7b, 0x6e, 0x6f, 0xb4, 0x27, 0x6d, 0x70, 0x3a, 0x97, 0x5f, 0xcb, 0x50, 0x9b, 0x13, 0x6b, 0xc7, 0xba, 0xdf, 0x73, 0x54, 0x17, 0x35, 0xf0, 0x09, 0x9e, 0x9d, 0x0b, 0x6a, 0x2c, 0x9f, 0xd1, 0x0c, /* 64 */ 0xc6, 0x47, 0x83, 0xde, 0xca, 0x90, 0x20, 0xac, 0x70, 0x63, 0x9b, 0xb7, 0x49, 0x07, 0x0b, 0xf5, 0xf2, 0x38, 0x2a, 0x40, 0xff, 0xf1, 0xba, 0x97, 0x79, 0x3e, 0xd4, 0xd1, 0xf3, 0x41, 0x0f, 0x91, /* 96 */ 0xfe, 0x1a, 0x86, 0xf4, 0x1b, 0xef, 0xcc, 0x29, 0xa3, 0x35, 0x6f, 0x60, 0xfa, 0x98, 0x53, 0x51, 0x80, 0x57, 0x15, 0x2f, 0xe1, 0x8b, 0xd7, 0x86, 0x15, 0x2d, 0xb5, 0xec, 0x7a, 0xdd, 0xc5, 0x1d, /* 128 */ 0x1b, 0x88, 0x53, 0x67, 0x86, 0xe1, 0x6e, 0xcd, 0x4e, 0x2e, 0xfd, 0xd2, 0x49, 0x04, 0xfb, 0x1d, 0x95, 0xf0, 0xe9, 0x7f, 0x97, 0xa3, 0x1b, 0xb2, 0x92, 0x2e, 0x62, 0x2a, 0x96, 0xd4, 0xea, 0x18, /* 160 */ 0x8e, 0x99, 0x41, 0xea, 0x83, 0xb5, 0xf1, 0x0e, 0xea, 0x53, 0x70, 0x99, 0xd7, 0x9e, 0x0c, 0x65, 0x2b, 0xf4, 0xdc, 0x0e, 0xe7, 0x9e, 0xce, 0x04, 0x25, 0x01, 0x88, 0xc4, 0xc1, 0xd2, 0xa4, 0x18, /* 192 */ 0xc2, 0x8a, 0x52, 0x0f, 0x01, 0xb2, 0x71, 0x30, 0x44, 0x3f, 0x5b, 0x11, 0x2e, 0xe7, 0x53, 0xa0, 0xc8, 0x1f, 0x77, 0xaf, 0xb5, 0xbb, 0xaf, 0x12, 0xe8, 0x19, 0x0c, 0xf6, 0x1f, 0xa8, 0x3e, 0x11, /* 224 */ 0x34, 0xe4, 0xac, 0x1c, 0x1c, 0x00, 0xbb, 0xb9, 0x2f, 0xbb, 0x81, 0x76, 0x4e, 0x46, 0xda, 0x73, 0x00, 0x82, 0x71, 0xa4, 0x62, 0xc3, 0xd4, 0x3f, 0xda, 0x34, 0x54, 0x27, 0xe3, 0xd0, 0x3a, 0x73, /* 256 */ 0x2f, 0x99, 0xc4, 0x91, 0x56, 0x12, 0x98, 0xa8, 0x3b, 0x8d, 0x61, 0x83, 0x62, 0xb7, 0x20, 0x61, 0x4d, 0xc9, 0x41, 0xd1, 0x40, 0x02, 0x11, 0x4b, 0x63, 0x46, 0xc7, 0xc1, 0x00, 0x00, 0x00, 0x00, /* 288 */ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x48, 0x00, 0x00, 0x50, 0xb7, 0x75, 0xf3, 0x77, 0x99, 0xb2, 0xd3, 0xdd, 0xcd, 0x83, 0x6e, 0xdb, 0x0a, 0x29, 0x88, 0x05, 0xb5, 0x8a, 0x49, 0xd5, 0xa8, 0x5a, /* 320 */ 0xc3, 0xb7, 0x18, 0xc2, 0x3c, 0x1e, 0xde, 0xd3, 0x8f, 0xdd, 0x21, 0x27, 0x84, 0xa0, 0xc8, 0x8d, 0x65, 0xce, 0x5d, 0x3d, 0x46, 0x65, 0x88, 0xfc, 0x35, 0x0a, 0x04, 0xa0, 0xda, 0xc1, 0xab, 0xbf, /* 352 */ 0xcd, 0xf1, 0x7e, 0x71, 0x7b, 0xf8, 0x4a, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*****************************************************************************/ static int out_params(void) { g_writeln("%s", ""); g_writeln("xrdp rsa key gen utility examples"); g_writeln(" xrdp-keygen xrdp ['path and file name' | auto] [512 or 2048]"); g_writeln(" xrdp-keygen test"); g_writeln("%s", ""); return 0; } /*****************************************************************************/ /* this is the special key signing algorithm */ static int sign_key(const char *e_data, int e_len, const char *n_data, int n_len, char *sign_data, int sign_len) { char *key; char *md5_final; void *md5; if ((e_len != 4) || ((n_len != 64) && (n_len != 256)) || (sign_len != 64)) { return 1; } if (n_len == 64) { key = (char *)g_malloc(184, 0); md5_final = (char *)g_malloc(64, 0); md5 = ssl_md5_info_create(); /* copy the test key */ g_memcpy(key, g_testkey512, 184); /* replace e and n */ g_memcpy(key + 32, e_data, e_len); g_memcpy(key + 36, n_data, n_len); ssl_md5_clear(md5); /* the first 108 bytes */ ssl_md5_transform(md5, key, 108); /* set the whole thing with 0xff */ g_memset(md5_final, 0xff, 64); /* digest 16 bytes */ ssl_md5_complete(md5, md5_final); /* set non 0xff array items */ md5_final[16] = 0; md5_final[62] = 1; md5_final[63] = 0; /* encrypt */ ssl_mod_exp(sign_data, sign_len, md5_final, 64, (char *)g_ppk_n, 64, (char *)g_ppk_d, 64); /* cleanup */ ssl_md5_info_delete(md5); g_free(key); g_free(md5_final); } else if (n_len == 256) { key = (char *)g_malloc(376, 0); md5_final = (char *)g_malloc(64, 0); md5 = ssl_md5_info_create(); /* copy the test key */ g_memcpy(key, g_testkey2048, 376); /* replace e and n */ g_memcpy(key + 32, e_data, e_len); g_memcpy(key + 36, n_data, n_len); ssl_md5_clear(md5); /* the first 300 bytes */ ssl_md5_transform(md5, key, 300); /* set the whole thing with 0xff */ g_memset(md5_final, 0xff, 64); /* digest 16 bytes */ ssl_md5_complete(md5, md5_final); /* set non 0xff array items */ md5_final[16] = 0; md5_final[62] = 1; md5_final[63] = 0; /* encrypt */ ssl_mod_exp(sign_data, sign_len, md5_final, 64, (char *)g_ppk_n, 64, (char *)g_ppk_d, 64); /* cleanup */ ssl_md5_info_delete(md5); g_free(key); g_free(md5_final); } return 0; } /*****************************************************************************/ static int write_out_line(int fd, const char *name, const char *data, int len) { int max; int error; int index; int data_item; int buf_pos; char *buf; char *text; text = (char *)g_malloc(256, 0); max = len; max = max * 10; buf_pos = g_strlen(name); max = max + buf_pos + 16; buf = (char *)g_malloc(max, 0); g_strncpy(buf, name, max - 1); buf[buf_pos] = '='; buf_pos++; for (index = 0; index < len; index++) { data_item = (tui8)(data[index]); g_snprintf(text, 255, "0x%2.2x", data_item); if (index != 0) { buf[buf_pos] = ','; buf_pos++; } buf[buf_pos] = text[0]; buf_pos++; buf[buf_pos] = text[1]; buf_pos++; buf[buf_pos] = text[2]; buf_pos++; buf[buf_pos] = text[3]; buf_pos++; } buf[buf_pos] = '\n'; buf_pos++; buf[buf_pos] = 0; error = g_file_write(fd, buf, buf_pos) == -1; g_free(buf); g_free(text); return error; } /*****************************************************************************/ static int save_all(const char *e_data, int e_len, const char *n_data, int n_len, const char *d_data, int d_len, const char *sign_data, int sign_len, const char *path_and_file_name) { int fd; char filename[256]; if (path_and_file_name == 0) { g_strncpy(filename, "rsakeys.ini", 255); } else { g_strncpy(filename, path_and_file_name, 255); } g_writeln("saving to %s", filename); g_writeln("%s", ""); if (g_file_exist(filename)) { if (g_file_delete(filename) == 0) { g_writeln("problem deleting %s, maybe no rights", filename); return 1; } } fd = g_file_open_rw(filename); if (fd != -1) { if (g_file_write(fd, "[keys]\n", 7) == -1) { g_writeln("problem writing to %s, maybe no rights", filename); g_file_close(fd); return 1; } write_out_line(fd, "pub_exp", e_data, e_len); write_out_line(fd, "pub_mod", n_data, n_len); write_out_line(fd, "pub_sig", sign_data, sign_len); write_out_line(fd, "pri_exp", d_data, d_len); } else { g_writeln("problem opening %s, maybe no rights", filename); return 1; } g_file_close(fd); return 0; } /*****************************************************************************/ static int key_gen(const char *path_and_file_name) { char *e_data; char *n_data; char *d_data; char *sign_data; int e_len; int n_len; int d_len; int sign_len; int error; e_data = (char *)g_exponent; n_data = (char *)g_malloc(256, 0); d_data = (char *)g_malloc(256, 0); sign_data = (char *)g_malloc(64, 0); e_len = 4; n_len = g_key_size_bits / 8; d_len = n_len; sign_len = 64; error = 0; g_writeln("%s", ""); g_writeln("Generating %d bit rsa key...", g_key_size_bits); g_writeln("%s", ""); if (error == 0) { error = ssl_gen_key_xrdp1(g_key_size_bits, e_data, e_len, n_data, n_len, d_data, d_len); if (error != 0) { g_writeln("error %d in key_gen, ssl_gen_key_xrdp1", error); } } if (error == 0) { g_writeln("ssl_gen_key_xrdp1 ok"); g_writeln("%s", ""); error = sign_key(e_data, e_len, n_data, n_len, sign_data, sign_len); if (error != 0) { g_writeln("error %d in key_gen, sign_key", error); } } if (error == 0) { error = save_all(e_data, e_len, n_data, n_len, d_data, d_len, sign_data, sign_len, path_and_file_name); if (error != 0) { g_writeln("error %d in key_gen, save_all", error); } } g_free(n_data); g_free(d_data); g_free(sign_data); return error; } /*****************************************************************************/ static int key_gen_auto(void) { return key_gen("/etc/xrdp/rsakeys.ini"); } /*****************************************************************************/ static int key_test512(void) { char *md5_final; char *sig; void *md5; md5_final = (char *)g_malloc(64, 0); sig = (char *)g_malloc(64, 0); md5 = ssl_md5_info_create(); g_writeln("original key is:"); g_hexdump((char *)g_testkey512, 184); g_writeln("original exponent is:"); g_hexdump((char *)g_testkey512 + 32, 4); g_writeln("original modulus is:"); g_hexdump((char *)g_testkey512 + 36, 64); g_writeln("original signature is:"); g_hexdump((char *)g_testkey512 + 112, 64); ssl_md5_clear(md5); ssl_md5_transform(md5, (char *)g_testkey512, 108); g_memset(md5_final, 0xff, 64); ssl_md5_complete(md5, md5_final); g_writeln("md5 hash of first 108 bytes of this key is:"); g_hexdump(md5_final, 16); md5_final[16] = 0; md5_final[62] = 1; md5_final[63] = 0; ssl_mod_exp(sig, 64, md5_final, 64, (char *)g_ppk_n, 64, (char *)g_ppk_d, 64); g_writeln("produced signature(this should match original " "signature above) is:"); g_hexdump(sig, 64); g_memset(md5_final, 0, 64); ssl_mod_exp(md5_final, 64, (char *)g_testkey512 + 112, 64, (char *)g_ppk_n, 64, (char *)g_ppk_e, 4); g_writeln("decrypted hash of first 108 bytes of this key is:"); g_hexdump(md5_final, 64); ssl_md5_info_delete(md5); g_free(md5_final); g_free(sig); return 0; } /*****************************************************************************/ static int key_test2048(void) { char *md5_final; char *sig; void *md5; md5_final = (char *)g_malloc(64, 0); sig = (char *)g_malloc(64, 0); md5 = ssl_md5_info_create(); g_writeln("original key is:"); g_hexdump((char *)g_testkey2048, 376); g_writeln("original exponent is:"); g_hexdump((char *)g_testkey2048 + 32, 4); g_writeln("original modulus is:"); g_hexdump((char *)g_testkey2048 + 36, 256); g_writeln("original signature is:"); g_hexdump((char *)g_testkey2048 + 304, 64); ssl_md5_clear(md5); ssl_md5_transform(md5, (char *)g_testkey2048, 300); g_memset(md5_final, 0xff, 64); ssl_md5_complete(md5, md5_final); g_writeln("md5 hash of first 300 bytes of this key is:"); g_hexdump(md5_final, 16); md5_final[16] = 0; md5_final[62] = 1; md5_final[63] = 0; ssl_mod_exp(sig, 64, md5_final, 64, (char *)g_ppk_n, 64, (char *)g_ppk_d, 64); g_writeln("produced signature(this should match original " "signature above) is:"); g_hexdump(sig, 64); g_memset(md5_final, 0, 64); ssl_mod_exp(md5_final, 64, (char *)g_testkey2048 + 304, 64, (char *)g_ppk_n, 64, (char *)g_ppk_e, 4); g_writeln("decrypted hash of first 108 bytes of this key is:"); g_hexdump(md5_final, 64); ssl_md5_info_delete(md5); g_free(md5_final); g_free(sig); return 0; } /*****************************************************************************/ int main(int argc, char **argv) { if (argc > 1) { if (g_strcasecmp(argv[1], "xrdp") == 0) { if (argc > 2) { if (argc > 3) { g_key_size_bits = g_atoi(argv[3]); if ((g_key_size_bits != 512) && (g_key_size_bits != 2048)) { out_params(); return 0; } } if (g_strcasecmp(argv[2], "auto") == 0) { if (g_getuid() != 0) { g_writeln("must run as root"); return 0; } return key_gen_auto(); } else { return key_gen(argv[2]); } } else { return key_gen(0); } } else if (g_strcasecmp(argv[1], "test") == 0) { g_writeln("%s", ""); g_writeln("testing 512 bit key"); key_test512(); g_writeln("%s", ""); g_writeln("testing 2048 bit key"); key_test2048(); return 0; } } out_params(); return 0; } xrdp-0.10.1/keygen/openssl.conf000644 001751 000000 00000002074 14652432047 016454 0ustar00metawheel000000 000000 [req] distinguished_name = req_distinguished_name # The extensions to add to the self signed cert x509_extensions = v3_ca [req_distinguished_name] [v3_ca] # Extensions for a typical CA - PKIX recommendation. subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always, issuer # This is what PKIX recommends but some broken software chokes on critical # extensions. #basicConstraints = critical, CA:true # So we do this instead. basicConstraints = CA:true # Key usage: this is typical for a CA certificate. However since it will # prevent it being used as an test self-signed certificate it is best # left out by default. #keyUsage = cRLSign, keyCertSign # Some might want this also #nsCertType = sslCA, emailCA # Include email address in subject alt name: another PKIX recommendation #subjectAltName = email:copy # Copy issuer details #issuerAltName = issuer:copy # DER hex encoding of an extension: experts only! #obj = DER:02:03 # Where 'obj' is a standard or added object # You can even override a supported extension: #basicConstraints = critical, DER:30:03:01:01:FF xrdp-0.10.1/tests/memtest/000755 001751 000000 00000000000 14652432105 015450 5ustar00metawheel000000 000000 xrdp-0.10.1/tests/Makefile.am000644 001751 000000 00000000137 14652432047 016034 0ustar00metawheel000000 000000 EXTRA_DIST = \ readme.txt SUBDIRS = \ common \ libipm \ libxrdp \ memtest \ xrdp xrdp-0.10.1/tests/libipm/000755 001751 000000 00000000000 14652432105 015246 5ustar00metawheel000000 000000 xrdp-0.10.1/tests/readme.txt000644 001751 000000 00000000052 14652432047 015772 0ustar00metawheel000000 000000 this directory contains different tests xrdp-0.10.1/tests/Makefile.in000644 001751 000000 00000047462 14652432075 016062 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ readme.txt SUBDIRS = \ common \ libipm \ libxrdp \ memtest \ xrdp all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tests/common/000755 001751 000000 00000000000 14652432105 015262 5ustar00metawheel000000 000000 xrdp-0.10.1/tests/xrdp/000755 001751 000000 00000000000 14652432105 014747 5ustar00metawheel000000 000000 xrdp-0.10.1/tests/libxrdp/000755 001751 000000 00000000000 14652432105 015436 5ustar00metawheel000000 000000 xrdp-0.10.1/tests/libxrdp/test_libxrdp_main.c000644 001751 000000 00000001572 14652432047 021323 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include "log.h" #include "test_libxrdp.h" int main (void) { int number_failed; SRunner *sr; sr = srunner_create(make_suite_test_xrdp_sec_process_mcs_data_monitors()); srunner_add_suite(sr, make_suite_test_monitor_processing()); srunner_set_tap(sr, "-"); /* * Set up console logging */ struct log_config *lc = log_config_init_for_console(LOG_LEVEL_INFO, NULL); log_start_from_param(lc); log_config_free(lc); /* Disable stdout buffering, as this can confuse the error * reporting when running in libcheck fork mode */ setvbuf(stdout, NULL, _IONBF, 0); srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed(sr); srunner_free(sr); log_end(); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } xrdp-0.10.1/tests/libxrdp/test_xrdp_sec_process_mcs_data_monitors.c000644 001751 000000 00000024260 14652432047 026004 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "libxrdp.h" #include "os_calls.h" #include "test_libxrdp.h" struct xrdp_sec *sec_layer; struct xrdp_rdp *rdp_layer; struct xrdp_session *session; void setup(void) { rdp_layer = (struct xrdp_rdp *)g_malloc(sizeof(struct xrdp_rdp), 1); session = (struct xrdp_session *)g_malloc(sizeof(struct xrdp_session), 1); session->rdp = rdp_layer; session->client_info = &(((struct xrdp_rdp *)session->rdp)->client_info); session->client_info->multimon = 1; sec_layer = (struct xrdp_sec *) g_malloc(sizeof(struct xrdp_sec), 1); sec_layer->rdp_layer = rdp_layer; } void teardown(void) { g_free(sec_layer); g_free(session); g_free(rdp_layer); } START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_flags_is_not_zero__fail) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 8); out_uint32_le(s, 1); out_uint32_le(s, 0); s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_monitor_count_is_greater_than_sixteen__fail) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 8); out_uint32_le(s, 0); out_uint32_le(s, 17); s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR_TOO_MANY_MONITORS); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__with_single_monitor_happy_path) { struct xrdp_client_info *client_info = &(rdp_layer->client_info); struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 28); out_uint32_le(s, 0); //flags out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 3840); //monitor right out_uint32_le(s, 2160); //monitor bottom out_uint32_le(s, 1); //is primary s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; //Verify function call passed. int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, 0); ck_assert_int_eq(client_info->display_sizes.monitorCount, 1); // Verify normal monitor ck_assert_int_eq(client_info->display_sizes.minfo[0].left, 0); ck_assert_int_eq(client_info->display_sizes.minfo[0].top, 0); ck_assert_int_eq(client_info->display_sizes.minfo[0].right, 3840); ck_assert_int_eq(client_info->display_sizes.minfo[0].bottom, 2160); ck_assert_int_eq(client_info->display_sizes.minfo[0].is_primary, 1); // Verify normalized monitor ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].left, 0); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].top, 0); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].right, 3840); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].bottom, 2160); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].is_primary, 1); // Verify geometry (+1 greater than ) ck_assert_int_eq(client_info->display_sizes.session_width, 3841); ck_assert_int_eq(client_info->display_sizes.session_height, 2161); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_no_primary_monitor_is_specified_one_is_selected) { struct xrdp_client_info *client_info = &(rdp_layer->client_info); struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 28); out_uint32_le(s, 0); //flags out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 3840); //monitor right out_uint32_le(s, 2160); //monitor bottom out_uint32_le(s, 0); //is primary s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; //Verify function call passed. int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, 0); ck_assert_int_eq(client_info->display_sizes.monitorCount, 1); // Verify normal monitor ck_assert_int_eq(client_info->display_sizes.minfo[0].left, 0); ck_assert_int_eq(client_info->display_sizes.minfo[0].top, 0); ck_assert_int_eq(client_info->display_sizes.minfo[0].right, 3840); ck_assert_int_eq(client_info->display_sizes.minfo[0].bottom, 2160); ck_assert_int_eq(client_info->display_sizes.minfo[0].is_primary, 1); // Verify normalized monitor ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].left, 0); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].top, 0); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].right, 3840); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].bottom, 2160); ck_assert_int_eq(client_info->display_sizes.minfo_wm[0].is_primary, 1); // Verify geometry (+1 greater than ) ck_assert_int_eq(client_info->display_sizes.session_width, 3841); ck_assert_int_eq(client_info->display_sizes.session_height, 2161); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_width_is_too_large) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 28); out_uint32_le(s, 0); //flags out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 33000); //monitor right out_uint32_le(s, 2160); //monitor bottom out_uint32_le(s, 1); //is primary s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; //Verify function call passed. int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_width_is_too_small) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 28); out_uint32_le(s, 0); //flags out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 100); //monitor right out_uint32_le(s, 2160); //monitor bottom out_uint32_le(s, 1); //is primary s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; //Verify function call passed. int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_height_is_too_large) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 28); out_uint32_le(s, 0); //flags out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 3840); //monitor right out_uint32_le(s, 33000); //monitor bottom out_uint32_le(s, 1); //is primary s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; //Verify function call passed. int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP); free_stream(s); } END_TEST START_TEST(test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_height_is_too_small) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 28); out_uint32_le(s, 0); //flags out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 3840); //monitor right out_uint32_le(s, 100); //monitor bottom out_uint32_le(s, 1); //is primary s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; //Verify function call passed. int error = xrdp_sec_process_mcs_data_monitors(sec_layer, s); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP); free_stream(s); } END_TEST /******************************************************************************/ Suite * make_suite_test_xrdp_sec_process_mcs_data_monitors(void) { Suite *s; TCase *tc_process_monitors; s = suite_create("test_xrdp_sec_process_mcs_data_monitors"); tc_process_monitors = tcase_create("xrdp_sec_process_mcs_data_monitors"); tcase_add_checked_fixture(tc_process_monitors, setup, teardown); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_flags_is_not_zero__fail); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_monitor_count_is_greater_than_sixteen__fail); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__with_single_monitor_happy_path); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_no_primary_monitor_is_specified_one_is_selected); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_width_is_too_large); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_width_is_too_small); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_height_is_too_large); tcase_add_test(tc_process_monitors, test_xrdp_sec_process_mcs_data_monitors__when_virtual_desktop_height_is_too_small); suite_add_tcase(s, tc_process_monitors); return s; } xrdp-0.10.1/tests/libxrdp/test_libxrdp_process_monitor_stream.c000644 001751 000000 00000043401 14652432047 025174 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "libxrdp.h" #include "os_calls.h" #include "test_libxrdp.h" START_TEST(test_libxrdp_process_monitor_stream__when_description_is_null__fail) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 4); //Dummy data. out_uint32_le(s, 0); s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; int error = libxrdp_process_monitor_stream(s, NULL, 1); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR); free_stream(s); } END_TEST START_TEST(test_libxrdp_process_monitor_stream__when_stream_is_too_small__fail) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 2); //Dummy data. out_uint16_le(s, 0); s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; struct display_size_description *description = (struct display_size_description *) g_malloc(sizeof(struct display_size_description), 1); int error = libxrdp_process_monitor_stream(s, description, 1); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR); free(description); free_stream(s); } END_TEST START_TEST(test_libxrdp_process_monitor_stream__when_monitor_count_is_greater_than_sixteen__fail) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 4); //Dummy data. out_uint32_le(s, 17); s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; struct display_size_description *description = (struct display_size_description *) g_malloc(sizeof(struct display_size_description), 1); int error = libxrdp_process_monitor_stream(s, description, 1); ck_assert_int_eq(error, SEC_PROCESS_MONITORS_ERR_TOO_MANY_MONITORS); free(description); free_stream(s); } END_TEST START_TEST(test_libxrdp_process_monitor_stream__with_single_monitor_happy_path) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 44); out_uint32_le(s, 1); //monitorCount // Pretend we have a 4k monitor out_uint32_le(s, TS_MONITOR_PRIMARY); //flags out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, 3840); //monitor width out_uint32_le(s, 2160); //monitor height out_uint32_le(s, 2000); //physical width out_uint32_le(s, 2000); //physical height out_uint32_le(s, 0); //orientation out_uint32_le(s, 100); //desktop scale factor out_uint32_le(s, 100); //device scale factor s_mark_end(s); //Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; struct display_size_description *description = (struct display_size_description *) g_malloc(sizeof(struct display_size_description), 1); int error = libxrdp_process_monitor_stream(s, description, 1); //Verify function call passed. ck_assert_int_eq(error, 0); ck_assert_int_eq(description->monitorCount, 1); // Verify normal monitor ck_assert_int_eq(description->minfo[0].left, 0); ck_assert_int_eq(description->minfo[0].top, 0); ck_assert_int_eq(description->minfo[0].right, 3839); ck_assert_int_eq(description->minfo[0].bottom, 2159); ck_assert_int_eq(description->minfo[0].physical_width, 2000); ck_assert_int_eq(description->minfo[0].physical_height, 2000); ck_assert_int_eq(description->minfo[0].orientation, 0); ck_assert_int_eq(description->minfo[0].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo[0].device_scale_factor, 100); ck_assert_int_eq(description->minfo[0].is_primary, 1); // Verify normalized monitor ck_assert_int_eq(description->minfo_wm[0].left, 0); ck_assert_int_eq(description->minfo_wm[0].top, 0); ck_assert_int_eq(description->minfo_wm[0].right, 3839); ck_assert_int_eq(description->minfo_wm[0].bottom, 2159); ck_assert_int_eq(description->minfo_wm[0].physical_width, 2000); ck_assert_int_eq(description->minfo_wm[0].physical_height, 2000); ck_assert_int_eq(description->minfo_wm[0].orientation, 0); ck_assert_int_eq(description->minfo_wm[0].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[0].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[0].is_primary, 1); // Verify geometry (+1 greater than ) ck_assert_int_eq(description->session_width, 3840); ck_assert_int_eq(description->session_height, 2160); free(description); free_stream(s); } END_TEST START_TEST(test_libxrdp_process_monitor_stream__with_sextuple_monitor_happy_path) { #define MONITOR_WIDTH 3840 #define MONITOR_HEIGHT 2160 struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 8192); out_uint32_le(s, 6); //monitorCount // 4k monitor at position (0, 0) out_uint32_le(s, 0); //flags out_uint32_le(s, 0); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, MONITOR_WIDTH); //monitor width out_uint32_le(s, MONITOR_HEIGHT); //monitor height out_uint32_le(s, 9); //physical width out_uint32_le(s, 9); //physical height out_uint32_le(s, -10); //orientation out_uint32_le(s, -100); //desktop scale factor out_uint32_le(s, 600); //device scale factor // 4k monitor at position (1, 0) out_uint32_le(s, TS_MONITOR_PRIMARY); //flags out_uint32_le(s, MONITOR_WIDTH); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, MONITOR_WIDTH); //monitor width out_uint32_le(s, MONITOR_HEIGHT); //monitor height out_uint32_le(s, 5); //physical width out_uint32_le(s, 11000); //physical height out_uint32_le(s, 10); //orientation (Expect to be reset to 0) out_uint32_le(s, 360); //desktop scale factor out_uint32_le(s, 720); //device scale factor // 4k monitor at position (2, 0) out_uint32_le(s, 0); //flags out_uint32_le(s, (2 * MONITOR_WIDTH)); //monitor left out_uint32_le(s, 0); //monitor top out_uint32_le(s, MONITOR_WIDTH); //monitor width out_uint32_le(s, MONITOR_HEIGHT); //monitor height out_uint32_le(s, 1000); //physical width out_uint32_le(s, 1000); //physical height out_uint32_le(s, 5000); //orientation out_uint32_le(s, 80); //desktop scale factor out_uint32_le(s, 140); //device scale factor // 4k monitor at position (0, 1) out_uint32_le(s, 0); //flags out_uint32_le(s, 0); //monitor left out_uint32_le(s, MONITOR_HEIGHT); //monitor top out_uint32_le(s, MONITOR_WIDTH); //monitor width out_uint32_le(s, MONITOR_HEIGHT); //monitor height out_uint32_le(s, 1000); //physical width out_uint32_le(s, 1000); //physical height out_uint32_le(s, 91); //orientation out_uint32_le(s, 180); //desktop scale factor out_uint32_le(s, 100); //device scale factor // 4k monitor at position (1, 1) out_uint32_le(s, 0); //flags out_uint32_le(s, MONITOR_WIDTH); //monitor left out_uint32_le(s, MONITOR_HEIGHT); //monitor top out_uint32_le(s, MONITOR_WIDTH); //monitor width out_uint32_le(s, MONITOR_HEIGHT); //monitor height out_uint32_le(s, 1000); //physical width out_uint32_le(s, 1000); //physical height out_uint32_le(s, 0); //orientation out_uint32_le(s, 20); //desktop scale factor out_uint32_le(s, 50); //device scale factor // 4k monitor at position (2, 1) out_uint32_le(s, 0); //flags out_uint32_le(s, (2 * MONITOR_WIDTH)); //monitor left out_uint32_le(s, MONITOR_HEIGHT); //monitor top out_uint32_le(s, MONITOR_WIDTH); //monitor width out_uint32_le(s, MONITOR_HEIGHT); //monitor height out_uint32_le(s, 1000); //physical width out_uint32_le(s, 1000); //physical height out_uint32_le(s, 0); //orientation out_uint32_le(s, 300); //desktop scale factor out_uint32_le(s, 400); //device scale factor s_mark_end(s); // Reset the read counter of the stream so the processing function handles it properly. s->p = s->data; struct display_size_description *description = (struct display_size_description *) g_malloc(sizeof(struct display_size_description), 1); int error = libxrdp_process_monitor_stream(s, description, 1); //Verify function call passed. ck_assert_int_eq(error, 0); ck_assert_int_eq(description->monitorCount, 6); /************************************************* * Verify standard monitors *************************************************/ ck_assert_int_eq(description->minfo[0].left, 0); ck_assert_int_eq(description->minfo[0].top, 0); ck_assert_int_eq(description->minfo[0].right, MONITOR_WIDTH - 1); ck_assert_int_eq(description->minfo[0].bottom, MONITOR_HEIGHT - 1); ck_assert_int_eq(description->minfo[0].physical_width, 0); ck_assert_int_eq(description->minfo[0].physical_height, 0); ck_assert_int_eq(description->minfo[0].orientation, 0); ck_assert_int_eq(description->minfo[0].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo[0].device_scale_factor, 100); ck_assert_int_eq(description->minfo[0].is_primary, 0); ck_assert_int_eq(description->minfo[1].left, MONITOR_WIDTH); ck_assert_int_eq(description->minfo[1].top, 0); ck_assert_int_eq(description->minfo[1].right, (2 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo[1].bottom, MONITOR_HEIGHT - 1); ck_assert_int_eq(description->minfo[1].physical_width, 0); ck_assert_int_eq(description->minfo[1].physical_height, 0); ck_assert_int_eq(description->minfo[1].orientation, 0); ck_assert_int_eq(description->minfo[1].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo[1].device_scale_factor, 100); ck_assert_int_eq(description->minfo[1].is_primary, 1); ck_assert_int_eq(description->minfo[2].left, (2 * MONITOR_WIDTH)); ck_assert_int_eq(description->minfo[2].top, 0); ck_assert_int_eq(description->minfo[2].right, (3 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo[2].bottom, MONITOR_HEIGHT - 1); ck_assert_int_eq(description->minfo[2].physical_width, 1000); ck_assert_int_eq(description->minfo[2].physical_height, 1000); ck_assert_int_eq(description->minfo[2].orientation, 0); ck_assert_int_eq(description->minfo[2].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo[2].device_scale_factor, 100); ck_assert_int_eq(description->minfo[2].is_primary, 0); ck_assert_int_eq(description->minfo[3].left, 0); ck_assert_int_eq(description->minfo[3].top, MONITOR_HEIGHT); ck_assert_int_eq(description->minfo[3].right, MONITOR_WIDTH - 1); ck_assert_int_eq(description->minfo[3].bottom, (2 * MONITOR_HEIGHT - 1)); ck_assert_int_eq(description->minfo[3].physical_width, 1000); ck_assert_int_eq(description->minfo[3].physical_height, 1000); ck_assert_int_eq(description->minfo[3].orientation, 0); ck_assert_int_eq(description->minfo[3].desktop_scale_factor, 180); ck_assert_int_eq(description->minfo[3].device_scale_factor, 100); ck_assert_int_eq(description->minfo[3].is_primary, 0); ck_assert_int_eq(description->minfo[4].left, MONITOR_WIDTH); ck_assert_int_eq(description->minfo[4].top, MONITOR_HEIGHT); ck_assert_int_eq(description->minfo[4].right, (2 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo[4].bottom, (2 * MONITOR_HEIGHT - 1)); ck_assert_int_eq(description->minfo[4].physical_width, 1000); ck_assert_int_eq(description->minfo[4].physical_height, 1000); ck_assert_int_eq(description->minfo[4].orientation, 0); ck_assert_int_eq(description->minfo[4].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo[4].device_scale_factor, 100); ck_assert_int_eq(description->minfo[4].is_primary, 0); ck_assert_int_eq(description->minfo[5].left, (2 * MONITOR_WIDTH)); ck_assert_int_eq(description->minfo[5].top, MONITOR_HEIGHT); ck_assert_int_eq(description->minfo[5].right, (3 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo[5].bottom, (2 * MONITOR_HEIGHT - 1)); ck_assert_int_eq(description->minfo[5].physical_width, 1000); ck_assert_int_eq(description->minfo[5].physical_height, 1000); ck_assert_int_eq(description->minfo[5].orientation, 0); ck_assert_int_eq(description->minfo[5].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo[5].device_scale_factor, 100); ck_assert_int_eq(description->minfo[5].is_primary, 0); /************************************************* * Verify normalized monitors *************************************************/ ck_assert_int_eq(description->minfo_wm[0].left, 0); ck_assert_int_eq(description->minfo_wm[0].top, 0); ck_assert_int_eq(description->minfo_wm[0].right, MONITOR_WIDTH - 1); ck_assert_int_eq(description->minfo_wm[0].bottom, MONITOR_HEIGHT - 1); ck_assert_int_eq(description->minfo_wm[0].physical_width, 0); ck_assert_int_eq(description->minfo_wm[0].physical_height, 0); ck_assert_int_eq(description->minfo_wm[0].orientation, 0); ck_assert_int_eq(description->minfo_wm[0].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[0].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[0].is_primary, 0); ck_assert_int_eq(description->minfo_wm[1].left, MONITOR_WIDTH); ck_assert_int_eq(description->minfo_wm[1].top, 0); ck_assert_int_eq(description->minfo_wm[1].right, (2 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo_wm[1].bottom, MONITOR_HEIGHT - 1); ck_assert_int_eq(description->minfo_wm[1].physical_width, 0); ck_assert_int_eq(description->minfo_wm[1].physical_height, 0); ck_assert_int_eq(description->minfo_wm[1].orientation, 0); ck_assert_int_eq(description->minfo_wm[1].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[1].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[1].is_primary, 1); ck_assert_int_eq(description->minfo_wm[2].left, (2 * MONITOR_WIDTH)); ck_assert_int_eq(description->minfo_wm[2].top, 0); ck_assert_int_eq(description->minfo_wm[2].right, (3 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo_wm[2].bottom, MONITOR_HEIGHT - 1); ck_assert_int_eq(description->minfo_wm[2].physical_width, 1000); ck_assert_int_eq(description->minfo_wm[2].physical_height, 1000); ck_assert_int_eq(description->minfo_wm[2].orientation, 0); ck_assert_int_eq(description->minfo_wm[2].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[2].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[2].is_primary, 0); ck_assert_int_eq(description->minfo_wm[3].left, 0); ck_assert_int_eq(description->minfo_wm[3].top, MONITOR_HEIGHT); ck_assert_int_eq(description->minfo_wm[3].right, MONITOR_WIDTH - 1); ck_assert_int_eq(description->minfo_wm[3].bottom, (2 * MONITOR_HEIGHT - 1)); ck_assert_int_eq(description->minfo_wm[3].physical_width, 1000); ck_assert_int_eq(description->minfo_wm[3].physical_height, 1000); ck_assert_int_eq(description->minfo_wm[3].orientation, 0); ck_assert_int_eq(description->minfo_wm[3].desktop_scale_factor, 180); ck_assert_int_eq(description->minfo_wm[3].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[3].is_primary, 0); ck_assert_int_eq(description->minfo_wm[4].left, MONITOR_WIDTH); ck_assert_int_eq(description->minfo_wm[4].top, MONITOR_HEIGHT); ck_assert_int_eq(description->minfo_wm[4].right, (2 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo_wm[4].bottom, (2 * MONITOR_HEIGHT - 1)); ck_assert_int_eq(description->minfo_wm[4].physical_width, 1000); ck_assert_int_eq(description->minfo_wm[4].physical_height, 1000); ck_assert_int_eq(description->minfo_wm[4].orientation, 0); ck_assert_int_eq(description->minfo_wm[4].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[4].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[4].is_primary, 0); ck_assert_int_eq(description->minfo_wm[5].left, (2 * MONITOR_WIDTH)); ck_assert_int_eq(description->minfo_wm[5].top, MONITOR_HEIGHT); ck_assert_int_eq(description->minfo_wm[5].right, (3 * MONITOR_WIDTH - 1)); ck_assert_int_eq(description->minfo_wm[5].bottom, (2 * MONITOR_HEIGHT - 1)); ck_assert_int_eq(description->minfo_wm[5].physical_width, 1000); ck_assert_int_eq(description->minfo_wm[5].physical_height, 1000); ck_assert_int_eq(description->minfo_wm[5].orientation, 0); ck_assert_int_eq(description->minfo_wm[5].desktop_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[5].device_scale_factor, 100); ck_assert_int_eq(description->minfo_wm[5].is_primary, 0); // Verify geometry ck_assert_int_eq(description->session_width, (3 * MONITOR_WIDTH)); ck_assert_int_eq(description->session_height, (2 * MONITOR_HEIGHT)); free(description); free_stream(s); #undef MONITOR_WIDTH #undef MONITOR_HEIGHT } END_TEST /******************************************************************************/ Suite * make_suite_test_monitor_processing(void) { Suite *s; TCase *tc_process_monitors; s = suite_create("test_libxrdp_process_monitor_stream"); tc_process_monitors = tcase_create("libxrdp_process_monitor_stream"); tcase_add_test(tc_process_monitors, test_libxrdp_process_monitor_stream__when_description_is_null__fail); tcase_add_test(tc_process_monitors, test_libxrdp_process_monitor_stream__when_stream_is_too_small__fail); tcase_add_test(tc_process_monitors, test_libxrdp_process_monitor_stream__when_monitor_count_is_greater_than_sixteen__fail); tcase_add_test(tc_process_monitors, test_libxrdp_process_monitor_stream__with_single_monitor_happy_path); tcase_add_test(tc_process_monitors, test_libxrdp_process_monitor_stream__with_sextuple_monitor_happy_path); suite_add_tcase(s, tc_process_monitors); return s; } xrdp-0.10.1/tests/libxrdp/Makefile.am000644 001751 000000 00000001125 14652432047 017476 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/libxrdp \ -I$(top_srcdir)/common LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh PACKAGE_STRING = "libxrdp" TESTS = test_libxrdp check_PROGRAMS = test_libxrdp test_libxrdp_SOURCES = \ test_libxrdp.h \ test_libxrdp_main.c \ test_libxrdp_process_monitor_stream.c \ test_xrdp_sec_process_mcs_data_monitors.c test_libxrdp_CFLAGS = \ @CHECK_CFLAGS@ test_libxrdp_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libxrdp/libxrdp.la \ @CHECK_LIBS@ xrdp-0.10.1/tests/libxrdp/test_libxrdp.h000644 001751 000000 00000000322 14652432047 020314 0ustar00metawheel000000 000000 #ifndef TEST_LIBXRDP_H #define TEST_LIBXRDP_H #include Suite *make_suite_test_xrdp_sec_process_mcs_data_monitors(void); Suite *make_suite_test_monitor_processing(void); #endif /* TEST_LIBXRDP_H */ xrdp-0.10.1/tests/libxrdp/Makefile.in000644 001751 000000 00000125416 14652432075 017522 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ TESTS = test_libxrdp$(EXEEXT) check_PROGRAMS = test_libxrdp$(EXEEXT) subdir = tests/libxrdp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_test_libxrdp_OBJECTS = test_libxrdp-test_libxrdp_main.$(OBJEXT) \ test_libxrdp-test_libxrdp_process_monitor_stream.$(OBJEXT) \ test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.$(OBJEXT) test_libxrdp_OBJECTS = $(am_test_libxrdp_OBJECTS) test_libxrdp_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/libxrdp/libxrdp.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_libxrdp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_libxrdp_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test_libxrdp-test_libxrdp_main.Po \ ./$(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Po \ ./$(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(test_libxrdp_SOURCES) DIST_SOURCES = $(test_libxrdp_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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = "libxrdp" PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/libxrdp \ -I$(top_srcdir)/common LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh test_libxrdp_SOURCES = \ test_libxrdp.h \ test_libxrdp_main.c \ test_libxrdp_process_monitor_stream.c \ test_xrdp_sec_process_mcs_data_monitors.c test_libxrdp_CFLAGS = \ @CHECK_CFLAGS@ test_libxrdp_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libxrdp/libxrdp.la \ @CHECK_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/libxrdp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/libxrdp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) test_libxrdp$(EXEEXT): $(test_libxrdp_OBJECTS) $(test_libxrdp_DEPENDENCIES) $(EXTRA_test_libxrdp_DEPENDENCIES) @rm -f test_libxrdp$(EXEEXT) $(AM_V_CCLD)$(test_libxrdp_LINK) $(test_libxrdp_OBJECTS) $(test_libxrdp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libxrdp-test_libxrdp_main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_libxrdp-test_libxrdp_main.o: test_libxrdp_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -MT test_libxrdp-test_libxrdp_main.o -MD -MP -MF $(DEPDIR)/test_libxrdp-test_libxrdp_main.Tpo -c -o test_libxrdp-test_libxrdp_main.o `test -f 'test_libxrdp_main.c' || echo '$(srcdir)/'`test_libxrdp_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libxrdp-test_libxrdp_main.Tpo $(DEPDIR)/test_libxrdp-test_libxrdp_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libxrdp_main.c' object='test_libxrdp-test_libxrdp_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -c -o test_libxrdp-test_libxrdp_main.o `test -f 'test_libxrdp_main.c' || echo '$(srcdir)/'`test_libxrdp_main.c test_libxrdp-test_libxrdp_main.obj: test_libxrdp_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -MT test_libxrdp-test_libxrdp_main.obj -MD -MP -MF $(DEPDIR)/test_libxrdp-test_libxrdp_main.Tpo -c -o test_libxrdp-test_libxrdp_main.obj `if test -f 'test_libxrdp_main.c'; then $(CYGPATH_W) 'test_libxrdp_main.c'; else $(CYGPATH_W) '$(srcdir)/test_libxrdp_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libxrdp-test_libxrdp_main.Tpo $(DEPDIR)/test_libxrdp-test_libxrdp_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libxrdp_main.c' object='test_libxrdp-test_libxrdp_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -c -o test_libxrdp-test_libxrdp_main.obj `if test -f 'test_libxrdp_main.c'; then $(CYGPATH_W) 'test_libxrdp_main.c'; else $(CYGPATH_W) '$(srcdir)/test_libxrdp_main.c'; fi` test_libxrdp-test_libxrdp_process_monitor_stream.o: test_libxrdp_process_monitor_stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -MT test_libxrdp-test_libxrdp_process_monitor_stream.o -MD -MP -MF $(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Tpo -c -o test_libxrdp-test_libxrdp_process_monitor_stream.o `test -f 'test_libxrdp_process_monitor_stream.c' || echo '$(srcdir)/'`test_libxrdp_process_monitor_stream.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Tpo $(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libxrdp_process_monitor_stream.c' object='test_libxrdp-test_libxrdp_process_monitor_stream.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -c -o test_libxrdp-test_libxrdp_process_monitor_stream.o `test -f 'test_libxrdp_process_monitor_stream.c' || echo '$(srcdir)/'`test_libxrdp_process_monitor_stream.c test_libxrdp-test_libxrdp_process_monitor_stream.obj: test_libxrdp_process_monitor_stream.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -MT test_libxrdp-test_libxrdp_process_monitor_stream.obj -MD -MP -MF $(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Tpo -c -o test_libxrdp-test_libxrdp_process_monitor_stream.obj `if test -f 'test_libxrdp_process_monitor_stream.c'; then $(CYGPATH_W) 'test_libxrdp_process_monitor_stream.c'; else $(CYGPATH_W) '$(srcdir)/test_libxrdp_process_monitor_stream.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Tpo $(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libxrdp_process_monitor_stream.c' object='test_libxrdp-test_libxrdp_process_monitor_stream.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -c -o test_libxrdp-test_libxrdp_process_monitor_stream.obj `if test -f 'test_libxrdp_process_monitor_stream.c'; then $(CYGPATH_W) 'test_libxrdp_process_monitor_stream.c'; else $(CYGPATH_W) '$(srcdir)/test_libxrdp_process_monitor_stream.c'; fi` test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.o: test_xrdp_sec_process_mcs_data_monitors.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -MT test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.o -MD -MP -MF $(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Tpo -c -o test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.o `test -f 'test_xrdp_sec_process_mcs_data_monitors.c' || echo '$(srcdir)/'`test_xrdp_sec_process_mcs_data_monitors.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Tpo $(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_sec_process_mcs_data_monitors.c' object='test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -c -o test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.o `test -f 'test_xrdp_sec_process_mcs_data_monitors.c' || echo '$(srcdir)/'`test_xrdp_sec_process_mcs_data_monitors.c test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.obj: test_xrdp_sec_process_mcs_data_monitors.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -MT test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.obj -MD -MP -MF $(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Tpo -c -o test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.obj `if test -f 'test_xrdp_sec_process_mcs_data_monitors.c'; then $(CYGPATH_W) 'test_xrdp_sec_process_mcs_data_monitors.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_sec_process_mcs_data_monitors.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Tpo $(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_sec_process_mcs_data_monitors.c' object='test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libxrdp_CFLAGS) $(CFLAGS) -c -o test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.obj `if test -f 'test_xrdp_sec_process_mcs_data_monitors.c'; then $(CYGPATH_W) 'test_xrdp_sec_process_mcs_data_monitors.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_sec_process_mcs_data_monitors.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_libxrdp.log: test_libxrdp$(EXEEXT) @p='test_libxrdp$(EXEEXT)'; \ b='test_libxrdp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test_libxrdp-test_libxrdp_main.Po -rm -f ./$(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Po -rm -f ./$(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/test_libxrdp-test_libxrdp_main.Po -rm -f ./$(DEPDIR)/test_libxrdp-test_libxrdp_process_monitor_stream.Po -rm -f ./$(DEPDIR)/test_libxrdp-test_xrdp_sec_process_mcs_data_monitors.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tests/xrdp/test_not4_8bit.bmp000644 001751 000000 00000011666 14652432047 020337 0ustar00metawheel000000 000000 BM6(>>#.#.ʦ @ ` @@ @@@`@@@@`` `@`````` @` @` @` @`@@ @@@`@@@@@ @ @ @@ `@ @ @ @ @@@@ @@@@@`@@@@@@@@@`@` @`@@``@`@`@`@`@@ @@@`@@@@@@ @@@`@@@@@@ @@@`@@@@@@ @@@`@@@@ @` @ ` @@ @@@`@@@@`` `@`````` @` @` @` @` @` @ ` @@ @@@`@@@@`` `@`````` @` @` @`xrdp-0.10.1/tests/xrdp/test_bitmap_load.c000644 001751 000000 00000022733 14652432047 020441 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "xrdp.h" #include "test_xrdp.h" /* Where the image files are located */ #ifndef IMAGEDIR #define IMAGEDIR "." #endif /* Handy color definitions. These are variables so they are displayed * in assert messages if tests fail */ static int RED = COLOR24RGB(255, 0, 0); static int GREEN = COLOR24RGB(0, 255, 0); static int BLUE = COLOR24RGB(0, 0, 255); static int WHITE = COLOR24RGB(255, 255, 255); /* Virtual desktop maxima and minima [MS-RDPBCGR] 2.2.1.3.6 */ #define MAX_VDESKTOP_WIDTH 32766 #define MAX_VDESKTOP_HEIGHT 32766 #define MIN_VDESKTOP_WIDTH 200 #define MIN_VDESKTOP_HEIGHT 200 /* Characteristics of the test bitmap(s) */ #define TEST_BM_WIDTH 256 #define TEST_BM_HEIGHT 256 #define TEST_NOT4_BM_WIDTH 62 #define TEST_NOT4_BM_HEIGHT 62 #define TEST_BM_TOP_LEFT_PIXEL RED #define TEST_BM_TOP_RIGHT_PIXEL GREEN #define TEST_BM_BOTTOM_LEFT_PIXEL BLUE #define TEST_BM_BOTTOM_RIGHT_PIXEL WHITE /* * Scaling bitmaps properly will introduce color changes with dithering. * Also some filetypes use compression, and these do not represent colors * perfectly. * * This is the Pythagorean distance we allow between two colors for them to * be considered close enough to each other */ #define MAX_SIMILAR_COLOR_DISTANCE 3 /* Time to allow some large bitmap test suites to run on slower platforms */ #define LARGE_BM_TEST_SUITE_TIMEOUT 10 void setup(void) { } void teardown(void) { } /* Tests an error is returned for a non-existent file */ START_TEST(test_bitmap_load__with_invalid_image__fail) { struct xrdp_wm *wm = NULL; int result; struct xrdp_bitmap *bm = xrdp_bitmap_create(4, 4, 32, WND_TYPE_IMAGE, wm); ck_assert_ptr_ne(bm, NULL); result = xrdp_bitmap_load(bm, "/dev/null", NULL, 0, XBLT_NONE, 0, 0); ck_assert_int_ne(result, 0); xrdp_bitmap_delete(bm); } END_TEST /* Checks a particular pixmap value is expected */ static void check_pixel(struct xrdp_bitmap *bm, int i, int j, int expected) { int pixel = xrdp_bitmap_get_pixel(bm, i, j); if (pixel != expected) { ck_abort_msg("Pixmap (%d,%d) expected 0x%06x, got 0x%06x", i, j, expected, pixel); } } /* Calculates whether two colors are close enough to be considered the same */ static void check_is_close_color(struct xrdp_bitmap *bm, int i, int j, int expected) { int pixel = xrdp_bitmap_get_pixel(bm, i, j); int r1; int g1; int b1; int r2; int g2; int b2; int variance; SPLITCOLOR32(r1, g1, b1, pixel); SPLITCOLOR32(r2, g2, b2, expected); variance = ((r1 - r2) * (r1 - r2) + (g1 - g2) * (g1 - g2) + (b1 - b2) * (b1 - b2)); if (variance > MAX_SIMILAR_COLOR_DISTANCE * MAX_SIMILAR_COLOR_DISTANCE) { ck_abort_msg("Pixmap (%d,%d) expected 0x%06x, got 0x%06x" " which exceeds distance of %d", i, j, expected, pixel, MAX_SIMILAR_COLOR_DISTANCE); } } /* Check we can load images of various depths with various transforms */ static void load_and_transform_img(const char *name, enum xrdp_bitmap_load_transform transform, int twidth, int theight) { struct xrdp_wm *wm = NULL; int result; int width; int height; char full_name[256]; struct xrdp_bitmap *bm = xrdp_bitmap_create(4, 4, 32, WND_TYPE_IMAGE, wm); ck_assert_ptr_ne(bm, NULL); g_snprintf(full_name, sizeof(full_name), IMAGEDIR "/%s", name); result = xrdp_bitmap_load(bm, full_name, NULL, HCOLOR(bm->bpp, WHITE), transform, twidth, theight); ck_assert_int_eq(result, 0); /* Bitmap right size? */ if (transform == XBLT_NONE) { width = TEST_BM_WIDTH; height = TEST_BM_HEIGHT; ck_assert_int_eq(bm->width, TEST_BM_WIDTH); ck_assert_int_eq(bm->height, TEST_BM_HEIGHT); } else { width = twidth; height = theight; ck_assert_int_eq(bm->width, twidth); ck_assert_int_eq(bm->height, theight); } /* Corners OK? Allow for dithering */ check_is_close_color(bm, 0, 0, TEST_BM_TOP_LEFT_PIXEL); check_is_close_color(bm, width - 1, 0, TEST_BM_TOP_RIGHT_PIXEL); check_is_close_color(bm, 0, height - 1, TEST_BM_BOTTOM_LEFT_PIXEL); check_is_close_color(bm, width - 1, height - 1, TEST_BM_BOTTOM_RIGHT_PIXEL); xrdp_bitmap_delete(bm); } /* Check we can load bitmaps that aren't a multiple of 4 pixels wide */ static void load_not4_img(const char *name) { struct xrdp_wm *wm = NULL; int result; const int width = TEST_NOT4_BM_WIDTH; const int height = TEST_NOT4_BM_HEIGHT; char full_name[256]; int i; int j; struct xrdp_bitmap *bm = xrdp_bitmap_create(4, 4, 32, WND_TYPE_IMAGE, wm); ck_assert_ptr_ne(bm, NULL); g_snprintf(full_name, sizeof(full_name), IMAGEDIR "/%s", name); result = xrdp_bitmap_load(bm, full_name, NULL, HCOLOR(bm->bpp, WHITE), XBLT_NONE, 0, 0); ck_assert_int_eq(result, 0); /* Bitmap right size? */ ck_assert_int_eq(bm->width, TEST_NOT4_BM_WIDTH); ck_assert_int_eq(bm->height, TEST_NOT4_BM_HEIGHT); /* Check all data */ for (i = 0 ; i < width / 2 ; ++i) { for (j = 0 ; j < height / 2 ; ++j) { check_pixel(bm, i, j, TEST_BM_TOP_LEFT_PIXEL); check_pixel(bm, i + width / 2, j, TEST_BM_TOP_RIGHT_PIXEL); check_pixel(bm, i, j + height / 2, TEST_BM_BOTTOM_LEFT_PIXEL); check_pixel(bm, i + width / 2, j + height / 2, TEST_BM_BOTTOM_RIGHT_PIXEL); } } xrdp_bitmap_delete(bm); } START_TEST(test_bitmap_load__4_bit__ok) { load_and_transform_img("test_4bit.bmp", XBLT_NONE, 0, 0); } END_TEST START_TEST(test_bitmap_load__8_bit__ok) { load_and_transform_img("test_8bit.bmp", XBLT_NONE, 0, 0); } END_TEST START_TEST(test_bitmap_load__24_bit__ok) { load_and_transform_img("test_24bit.bmp", XBLT_NONE, 0, 0); } END_TEST START_TEST(test_bitmap_load__max_width_zoom__ok) { load_and_transform_img("test_24bit.bmp", XBLT_ZOOM, MAX_VDESKTOP_WIDTH, MIN_VDESKTOP_HEIGHT); } END_TEST START_TEST(test_bitmap_load__max_height_zoom__ok) { load_and_transform_img("test_24bit.bmp", XBLT_ZOOM, MIN_VDESKTOP_WIDTH, MAX_VDESKTOP_HEIGHT); } END_TEST START_TEST(test_bitmap_load__min_zoom__ok) { load_and_transform_img("test_24bit.bmp", XBLT_ZOOM, MIN_VDESKTOP_WIDTH, MIN_VDESKTOP_HEIGHT); } END_TEST START_TEST(test_bitmap_load__max_width_scale__ok) { load_and_transform_img("test_24bit.bmp", XBLT_SCALE, MAX_VDESKTOP_WIDTH, MIN_VDESKTOP_HEIGHT); } END_TEST START_TEST(test_bitmap_load__max_height_scale__ok) { load_and_transform_img("test_24bit.bmp", XBLT_SCALE, MIN_VDESKTOP_WIDTH, MAX_VDESKTOP_HEIGHT); } END_TEST START_TEST(test_bitmap_load__min_scale__ok) { load_and_transform_img("test_24bit.bmp", XBLT_SCALE, MIN_VDESKTOP_WIDTH, MIN_VDESKTOP_HEIGHT); } END_TEST START_TEST(test_bitmap_load__not_4_pixels_wide_4_bit__ok) { load_not4_img("test_not4_4bit.bmp"); } END_TEST START_TEST(test_bitmap_load__not_4_pixels_wide_8_bit__ok) { load_not4_img("test_not4_8bit.bmp"); } END_TEST START_TEST(test_bitmap_load__not_4_pixels_wide_24_bit__ok) { load_not4_img("test_not4_24bit.bmp"); } END_TEST #ifdef USE_IMLIB2 START_TEST(test_png_load__blend_ok) { load_and_transform_img("test_alpha_blend.png", XBLT_NONE, 0, 0); } END_TEST START_TEST(test_jpg_load__ok) { load_and_transform_img("test1.jpg", XBLT_NONE, 0, 0); } END_TEST #endif /******************************************************************************/ Suite * make_suite_test_bitmap_load(void) { Suite *s; TCase *tc; s = suite_create("BitmapLoad"); tc = tcase_create("xrdp_bitmap_load_basic"); suite_add_tcase(s, tc); tcase_add_checked_fixture(tc, setup, teardown); tcase_add_test(tc, test_bitmap_load__with_invalid_image__fail); tcase_add_test(tc, test_bitmap_load__4_bit__ok); tcase_add_test(tc, test_bitmap_load__8_bit__ok); tcase_add_test(tc, test_bitmap_load__24_bit__ok); tc = tcase_create("xrdp_bitmap_load_zoom"); suite_add_tcase(s, tc); tcase_add_checked_fixture(tc, setup, teardown); tcase_set_timeout(tc, LARGE_BM_TEST_SUITE_TIMEOUT); tcase_add_test(tc, test_bitmap_load__max_width_zoom__ok); tcase_add_test(tc, test_bitmap_load__max_height_zoom__ok); tcase_add_test(tc, test_bitmap_load__min_zoom__ok); tc = tcase_create("xrdp_bitmap_load_scale"); suite_add_tcase(s, tc); tcase_add_checked_fixture(tc, setup, teardown); tcase_set_timeout(tc, LARGE_BM_TEST_SUITE_TIMEOUT); tcase_add_test(tc, test_bitmap_load__max_width_scale__ok); tcase_add_test(tc, test_bitmap_load__max_height_scale__ok); tcase_add_test(tc, test_bitmap_load__min_scale__ok); tc = tcase_create("xrdp_bitmap_load_not_mod_4"); suite_add_tcase(s, tc); tcase_add_checked_fixture(tc, setup, teardown); tcase_add_test(tc, test_bitmap_load__not_4_pixels_wide_4_bit__ok); tcase_add_test(tc, test_bitmap_load__not_4_pixels_wide_8_bit__ok); tcase_add_test(tc, test_bitmap_load__not_4_pixels_wide_24_bit__ok); #ifdef USE_IMLIB2 tc = tcase_create("xrdp_other_load"); suite_add_tcase(s, tc); tcase_add_checked_fixture(tc, setup, teardown); tcase_add_test(tc, test_png_load__blend_ok); tcase_add_test(tc, test_jpg_load__ok); #endif return s; } xrdp-0.10.1/tests/xrdp/test_4bit.bmp000644 001751 000000 00000100170 14652432047 017354 0ustar00metawheel000000 000000 BMvv(#.#.xrdp-0.10.1/tests/xrdp/test_xrdp_main.c000644 001751 000000 00000004035 14652432047 020142 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2021 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Test driver for XRDP routines * * If you want to run this driver under valgrind to check for memory leaks, * use the following command line:- * * CK_FORK=no valgrind --leak-check=full --show-leak-kinds=all \ * .libs/test_xrdp * * without the 'CK_FORK=no', memory still allocated by the test driver will * be logged */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "log.h" #include "os_calls.h" #include #include #include "test_xrdp.h" int main (void) { int number_failed; SRunner *sr; struct log_config *logging; /* Configure the logging sub-system so that functions can use * the log functions as appropriate */ logging = log_config_init_for_console(LOG_LEVEL_INFO, g_getenv("TEST_LOG_LEVEL")); log_start_from_param(logging); log_config_free(logging); /* Disable stdout buffering, as this can confuse the error * reporting when running in libcheck fork mode */ setvbuf(stdout, NULL, _IONBF, 0); sr = srunner_create (make_suite_test_bitmap_load()); srunner_add_suite(sr, make_suite_egfx_base_functions()); srunner_add_suite(sr, make_suite_region()); srunner_set_tap(sr, "-"); srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed(sr); srunner_free(sr); log_end(); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } xrdp-0.10.1/tests/xrdp/test_not4_24bit.bmp000644 001751 000000 00000026676 14652432047 020424 0ustar00metawheel000000 000000 BM-6(>>#.#.xrdp-0.10.1/tests/xrdp/test_xrdp.h000644 001751 000000 00000000316 14652432047 017141 0ustar00metawheel000000 000000 #ifndef TEST_XRDP_H #define TEST_XRDP_H #include Suite *make_suite_test_bitmap_load(void); Suite *make_suite_egfx_base_functions(void); Suite *make_suite_region(void); #endif /* TEST_XRDP_H */ xrdp-0.10.1/tests/xrdp/test_alpha_blend.png000644 001751 000000 00000002153 14652432047 020753 0ustar00metawheel000000 000000 PNG  IHDR\rfiCCPICC profile(}=H@_S"U8d.Zq*BZu0 4$).kŪ "%/)=B4mtLĢb**^@?z0YƜ$r|׻j}ѭf,DYf6mp'tAG+qι,̐L\+MF #if defined(XRDP_PIXMAN) #include #else #include "pixman-region.h" #endif #include "test_xrdp.h" #include "xrdp.h" #include #include #include #include #ifdef __cplusplus #error "cmocka is not supported with C++" #else #include #endif #define UNUSED(x) (void)(x) // Mock functions static pixman_box16_t test_box = { 0, 0, 100, 100 }; pixman_box16_t *__wrap_pixman_region_extents(pixman_region16_t *region) { check_expected_ptr(region); return mock_ptr_type(pixman_box16_t *); } static void test_xrdp_region_get_bounds__negligent_path(void **state) { struct xrdp_region *region = g_new0(struct xrdp_region, 1); struct xrdp_rect *rect = g_new0(struct xrdp_rect, 1); // Cmocka boilerplate UNUSED(state); expect_any(__wrap_pixman_region_extents, region); will_return(__wrap_pixman_region_extents, NULL); const int ret = xrdp_region_get_bounds(region, rect); assert_int_equal(1, ret); g_free(region); g_free(rect); } static void test_xrdp_region_get_bounds__happy_path(void **state) { struct xrdp_region *region = g_new0(struct xrdp_region, 1); struct xrdp_rect *rect = g_new0(struct xrdp_rect, 1); // Cmocka boilerplate UNUSED(state); expect_any(__wrap_pixman_region_extents, region); will_return(__wrap_pixman_region_extents, &test_box); const int ret = xrdp_region_get_bounds(region, rect); assert_int_equal(0, ret); assert_int_equal(0, rect->top); assert_int_equal(0, rect->left); assert_int_equal(100, rect->bottom); assert_int_equal(100, rect->right); g_free(region); g_free(rect); } pixman_bool_t __wrap_pixman_region_not_empty(pixman_region16_t *region) { check_expected_ptr(region); return mock_type(pixman_bool_t); } static void test_xrdp_region_not_empty__happy_path(void **state) { struct xrdp_region *region = g_new0(struct xrdp_region, 1); // Cmocka boilerplate UNUSED(state); expect_any(__wrap_pixman_region_not_empty, region); will_return(__wrap_pixman_region_not_empty, (pixman_bool_t)0); const int ret = xrdp_region_not_empty(region); assert_int_equal(0, ret); g_free(region); } START_TEST(execute_suite) { const struct CMUnitTest tests[] = { cmocka_unit_test(test_xrdp_region_get_bounds__negligent_path), cmocka_unit_test(test_xrdp_region_get_bounds__happy_path), cmocka_unit_test(test_xrdp_region_not_empty__happy_path) }; ck_assert_int_eq(cmocka_run_group_tests(tests, NULL, NULL), 0); } END_TEST /******************************************************************************/ /* For an example of how to use cmocka, see the following: https://gitlab.com/cmocka/cmocka/-/blob/master/example/mock/uptime/test_uptime.c */ Suite * make_suite_region(void) { Suite *s; TCase *tc_region; s = suite_create("test_xrdp_region"); tc_region = tcase_create("test_xrdp_region"); tcase_add_test(tc_region, execute_suite); suite_add_tcase(s, tc_region); return s; } xrdp-0.10.1/tests/xrdp/test1.jpg000644 001751 000000 00000004150 14652432047 016516 0ustar00metawheel000000 000000 JFIF++ICC_PROFILElcms0mntrRGB XYZ  5acspAPPL-lcms desc @cprt`6wtptchad,rXYZbXYZgXYZrTRC gTRC bTRC chrm4$dmndX$dmdd|$mluc enUS$GIMP built-in sRGBmluc enUSPublic DomainXYZ -sf32 B%nXYZ o8XYZ $XYZ bparaff Y [chrmT|L&g\mluc enUSGIMPmluc enUSsRGBC   (1#%(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egcC//cB8Bcccccccccccccccccccccccccccccccccccccccccccccccccc | Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq+n Qq懨0܀ 5 nhz }_r懨0܀ 5 nhz }_r懨0܀ 5 nhz }_r懨0܀ 5 nhz }????! I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$I$???xrdp-0.10.1/tests/xrdp/test_xrdp_egfx.c000644 001751 000000 00000004141 14652432047 020145 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2021 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Test driver for XRDP routines * * If you want to run this driver under valgrind to check for memory leaks, * use the following command line:- * * CK_FORK=no valgrind --leak-check=full --show-leak-kinds=all \ * .libs/test_xrdp * * without the 'CK_FORK=no', memory still allocated by the test driver will * be logged */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "log.h" #include "os_calls.h" #include #include "xrdp_egfx.h" #include "test_xrdp.h" START_TEST(test_xrdp_egfx_send_create_surface__happy_path) { struct xrdp_egfx_bulk *bulk = g_new0(struct xrdp_egfx_bulk, 1); const int surface_id = 0xFF; const int width = 640; const int height = 480; const int pixel_format = 32; struct stream *s = xrdp_egfx_create_surface( bulk, surface_id, width, height, pixel_format); s->p = s->data; unsigned char descriptor; in_uint8(s, descriptor); ck_assert_int_eq(0xE0, descriptor); g_free(bulk); } END_TEST /******************************************************************************/ Suite * make_suite_egfx_base_functions(void) { Suite *s; TCase *tc_process_monitors; s = suite_create("test_xrdp_egfx_base_functions"); tc_process_monitors = tcase_create("xrdp_egfx_base_functions"); tcase_add_test(tc_process_monitors, test_xrdp_egfx_send_create_surface__happy_path); suite_add_tcase(s, tc_process_monitors); return s; } xrdp-0.10.1/tests/xrdp/test_not4_4bit.bmp000644 001751 000000 00000004066 14652432047 020327 0ustar00metawheel000000 000000 BM6v(>>#.#.xrdp-0.10.1/tests/xrdp/Makefile.in000644 001751 000000 00000132353 14652432075 017031 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ TESTS = test_xrdp$(EXEEXT) check_PROGRAMS = test_xrdp$(EXEEXT) subdir = tests/xrdp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_test_xrdp_OBJECTS = test_xrdp-test_xrdp_main.$(OBJEXT) \ test_xrdp-test_xrdp_egfx.$(OBJEXT) \ test_xrdp-test_xrdp_region.$(OBJEXT) \ test_xrdp-test_bitmap_load.$(OBJEXT) test_xrdp_OBJECTS = $(am_test_xrdp_OBJECTS) am__DEPENDENCIES_1 = test_xrdp_DEPENDENCIES = $(top_builddir)/xrdp/xrdp_bitmap_load.o \ $(top_builddir)/xrdp/xrdp_bitmap_common.o \ $(top_builddir)/xrdp/funcs.o \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(top_builddir)/libpainter/src/libpainter.la \ $(top_builddir)/librfxcodec/src/librfxencode.la \ $(top_builddir)/xrdp/lang.o $(top_builddir)/xrdp/xrdp_mm.o \ $(top_builddir)/xrdp/xrdp_wm.o \ $(top_builddir)/xrdp/xrdp_font.o \ $(top_builddir)/xrdp/xrdp_egfx.o \ $(top_builddir)/xrdp/xrdp_cache.o \ $(top_builddir)/xrdp/xrdp_region.o \ $(top_builddir)/xrdp/xrdp_listen.o \ $(top_builddir)/xrdp/xrdp_bitmap.o \ $(top_builddir)/xrdp/xrdp_painter.o \ $(top_builddir)/xrdp/xrdp_encoder.o \ $(top_builddir)/xrdp/xrdp_process.o \ $(top_builddir)/xrdp/xrdp_login_wnd.o \ $(top_builddir)/xrdp/xrdp_main_utils.o $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_xrdp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_xrdp_CFLAGS) \ $(CFLAGS) $(test_xrdp_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test_xrdp-test_bitmap_load.Po \ ./$(DEPDIR)/test_xrdp-test_xrdp_egfx.Po \ ./$(DEPDIR)/test_xrdp-test_xrdp_main.Po \ ./$(DEPDIR)/test_xrdp-test_xrdp_region.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(test_xrdp_SOURCES) DIST_SOURCES = $(test_xrdp_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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = "XRDP daemon" PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/xrdp \ -I$(top_srcdir)/libxrdp \ -I$(top_srcdir)/common \ $(IMLIB2_CFLAGS) LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh EXTRA_DIST = \ test_4bit.bmp \ test_8bit.bmp \ test_24bit.bmp \ test_not4_4bit.bmp \ test_not4_8bit.bmp \ test_not4_24bit.bmp \ test1.jpg \ test_alpha_blend.png test_xrdp_SOURCES = \ test_xrdp.h \ test_xrdp_main.c \ test_xrdp_egfx.c \ test_xrdp_region.c \ test_bitmap_load.c test_xrdp_CFLAGS = \ -D IMAGEDIR=\"$(srcdir)\" \ @CHECK_CFLAGS@ \ @CMOCKA_CFLAGS@ test_xrdp_LDFLAGS = -Wl,--wrap=pixman_region_extents, \ -Wl,--wrap=pixman_region_not_empty test_xrdp_LDADD = \ $(top_builddir)/xrdp/xrdp_bitmap_load.o \ $(top_builddir)/xrdp/xrdp_bitmap_common.o \ $(top_builddir)/xrdp/funcs.o \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/libxrdp/libxrdp.la \ $(top_builddir)/libpainter/src/libpainter.la \ $(top_builddir)/librfxcodec/src/librfxencode.la \ $(top_builddir)/xrdp/lang.o \ $(top_builddir)/xrdp/xrdp_mm.o \ $(top_builddir)/xrdp/xrdp_wm.o \ $(top_builddir)/xrdp/xrdp_font.o \ $(top_builddir)/xrdp/xrdp_egfx.o \ $(top_builddir)/xrdp/xrdp_cache.o \ $(top_builddir)/xrdp/xrdp_region.o \ $(top_builddir)/xrdp/xrdp_listen.o \ $(top_builddir)/xrdp/xrdp_bitmap.o \ $(top_builddir)/xrdp/xrdp_painter.o \ $(top_builddir)/xrdp/xrdp_encoder.o \ $(top_builddir)/xrdp/xrdp_process.o \ $(top_builddir)/xrdp/xrdp_login_wnd.o \ $(top_builddir)/xrdp/xrdp_main_utils.o \ $(PIXMAN_LIBS) \ $(IMLIB2_LIBS) \ @CHECK_LIBS@ \ @CMOCKA_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/xrdp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/xrdp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) test_xrdp$(EXEEXT): $(test_xrdp_OBJECTS) $(test_xrdp_DEPENDENCIES) $(EXTRA_test_xrdp_DEPENDENCIES) @rm -f test_xrdp$(EXEEXT) $(AM_V_CCLD)$(test_xrdp_LINK) $(test_xrdp_OBJECTS) $(test_xrdp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_xrdp-test_bitmap_load.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_xrdp-test_xrdp_egfx.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_xrdp-test_xrdp_main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_xrdp-test_xrdp_region.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_xrdp-test_xrdp_main.o: test_xrdp_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_xrdp_main.o -MD -MP -MF $(DEPDIR)/test_xrdp-test_xrdp_main.Tpo -c -o test_xrdp-test_xrdp_main.o `test -f 'test_xrdp_main.c' || echo '$(srcdir)/'`test_xrdp_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_xrdp_main.Tpo $(DEPDIR)/test_xrdp-test_xrdp_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_main.c' object='test_xrdp-test_xrdp_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_xrdp_main.o `test -f 'test_xrdp_main.c' || echo '$(srcdir)/'`test_xrdp_main.c test_xrdp-test_xrdp_main.obj: test_xrdp_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_xrdp_main.obj -MD -MP -MF $(DEPDIR)/test_xrdp-test_xrdp_main.Tpo -c -o test_xrdp-test_xrdp_main.obj `if test -f 'test_xrdp_main.c'; then $(CYGPATH_W) 'test_xrdp_main.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_xrdp_main.Tpo $(DEPDIR)/test_xrdp-test_xrdp_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_main.c' object='test_xrdp-test_xrdp_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_xrdp_main.obj `if test -f 'test_xrdp_main.c'; then $(CYGPATH_W) 'test_xrdp_main.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_main.c'; fi` test_xrdp-test_xrdp_egfx.o: test_xrdp_egfx.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_xrdp_egfx.o -MD -MP -MF $(DEPDIR)/test_xrdp-test_xrdp_egfx.Tpo -c -o test_xrdp-test_xrdp_egfx.o `test -f 'test_xrdp_egfx.c' || echo '$(srcdir)/'`test_xrdp_egfx.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_xrdp_egfx.Tpo $(DEPDIR)/test_xrdp-test_xrdp_egfx.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_egfx.c' object='test_xrdp-test_xrdp_egfx.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_xrdp_egfx.o `test -f 'test_xrdp_egfx.c' || echo '$(srcdir)/'`test_xrdp_egfx.c test_xrdp-test_xrdp_egfx.obj: test_xrdp_egfx.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_xrdp_egfx.obj -MD -MP -MF $(DEPDIR)/test_xrdp-test_xrdp_egfx.Tpo -c -o test_xrdp-test_xrdp_egfx.obj `if test -f 'test_xrdp_egfx.c'; then $(CYGPATH_W) 'test_xrdp_egfx.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_egfx.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_xrdp_egfx.Tpo $(DEPDIR)/test_xrdp-test_xrdp_egfx.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_egfx.c' object='test_xrdp-test_xrdp_egfx.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_xrdp_egfx.obj `if test -f 'test_xrdp_egfx.c'; then $(CYGPATH_W) 'test_xrdp_egfx.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_egfx.c'; fi` test_xrdp-test_xrdp_region.o: test_xrdp_region.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_xrdp_region.o -MD -MP -MF $(DEPDIR)/test_xrdp-test_xrdp_region.Tpo -c -o test_xrdp-test_xrdp_region.o `test -f 'test_xrdp_region.c' || echo '$(srcdir)/'`test_xrdp_region.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_xrdp_region.Tpo $(DEPDIR)/test_xrdp-test_xrdp_region.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_region.c' object='test_xrdp-test_xrdp_region.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_xrdp_region.o `test -f 'test_xrdp_region.c' || echo '$(srcdir)/'`test_xrdp_region.c test_xrdp-test_xrdp_region.obj: test_xrdp_region.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_xrdp_region.obj -MD -MP -MF $(DEPDIR)/test_xrdp-test_xrdp_region.Tpo -c -o test_xrdp-test_xrdp_region.obj `if test -f 'test_xrdp_region.c'; then $(CYGPATH_W) 'test_xrdp_region.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_region.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_xrdp_region.Tpo $(DEPDIR)/test_xrdp-test_xrdp_region.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_xrdp_region.c' object='test_xrdp-test_xrdp_region.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_xrdp_region.obj `if test -f 'test_xrdp_region.c'; then $(CYGPATH_W) 'test_xrdp_region.c'; else $(CYGPATH_W) '$(srcdir)/test_xrdp_region.c'; fi` test_xrdp-test_bitmap_load.o: test_bitmap_load.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_bitmap_load.o -MD -MP -MF $(DEPDIR)/test_xrdp-test_bitmap_load.Tpo -c -o test_xrdp-test_bitmap_load.o `test -f 'test_bitmap_load.c' || echo '$(srcdir)/'`test_bitmap_load.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_bitmap_load.Tpo $(DEPDIR)/test_xrdp-test_bitmap_load.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_bitmap_load.c' object='test_xrdp-test_bitmap_load.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_bitmap_load.o `test -f 'test_bitmap_load.c' || echo '$(srcdir)/'`test_bitmap_load.c test_xrdp-test_bitmap_load.obj: test_bitmap_load.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -MT test_xrdp-test_bitmap_load.obj -MD -MP -MF $(DEPDIR)/test_xrdp-test_bitmap_load.Tpo -c -o test_xrdp-test_bitmap_load.obj `if test -f 'test_bitmap_load.c'; then $(CYGPATH_W) 'test_bitmap_load.c'; else $(CYGPATH_W) '$(srcdir)/test_bitmap_load.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_xrdp-test_bitmap_load.Tpo $(DEPDIR)/test_xrdp-test_bitmap_load.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_bitmap_load.c' object='test_xrdp-test_bitmap_load.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_xrdp_CFLAGS) $(CFLAGS) -c -o test_xrdp-test_bitmap_load.obj `if test -f 'test_bitmap_load.c'; then $(CYGPATH_W) 'test_bitmap_load.c'; else $(CYGPATH_W) '$(srcdir)/test_bitmap_load.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_xrdp.log: test_xrdp$(EXEEXT) @p='test_xrdp$(EXEEXT)'; \ b='test_xrdp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test_xrdp-test_bitmap_load.Po -rm -f ./$(DEPDIR)/test_xrdp-test_xrdp_egfx.Po -rm -f ./$(DEPDIR)/test_xrdp-test_xrdp_main.Po -rm -f ./$(DEPDIR)/test_xrdp-test_xrdp_region.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/test_xrdp-test_bitmap_load.Po -rm -f ./$(DEPDIR)/test_xrdp-test_xrdp_egfx.Po -rm -f ./$(DEPDIR)/test_xrdp-test_xrdp_main.Po -rm -f ./$(DEPDIR)/test_xrdp-test_xrdp_region.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tests/xrdp/test_8bit.bmp000644 001751 000000 00000202066 14652432047 017367 0ustar00metawheel000000 000000 BM66(#.#.ʦ @ ` @@ @@@`@@@@`` `@`````` @` @` @` @`@@ @@@`@@@@@ @ @ @@ `@ @ @ @ @@@@ @@@@@`@@@@@@@@@`@` @`@@``@`@`@`@`@@ @@@`@@@@@@ @@@`@@@@@@ @@@`@@@@@@ @@@`@@@@ @` @ ` @@ @@@`@@@@`` `@`````` @` @` @` @` @` @ ` @@ @@@`@@@@`` `@`````` @` @` @`xrdp-0.10.1/tests/xrdp/test_24bit.bmp000644 001751 000000 00000600066 14652432047 017447 0ustar00metawheel000000 000000 BM66(#.#.xrdp-0.10.1/tests/common/test_string_calls.c000644 001751 000000 00000071055 14652432047 021166 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include "os_calls.h" #include "string_calls.h" #include "ms-rdpbcgr.h" #include "test_common.h" #define RESULT_LEN 1024 /* Universal character names need a C99 compiler */ #if __STDC_VERSION__ >= 199901L # define CJK_UNIFIED_IDEOGRAPH_5E78 "\u5e78" # define CJK_UNIFIED_IDEOGRAPH_798F "\u798f" # define CJK_UNIFIED_IDEOGRAPH_5B89 "\u5b89" # define CJK_UNIFIED_IDEOGRAPH_5EB7 "\u5eb7" #else // Assume we're using UTF-8 # define CJK_UNIFIED_IDEOGRAPH_5E78 "\xe5\xb9\xb8" # define CJK_UNIFIED_IDEOGRAPH_798F "\xe7\xa6\x8f" # define CJK_UNIFIED_IDEOGRAPH_5B89 "\xe5\xae\x89" # define CJK_UNIFIED_IDEOGRAPH_5EB7 "\xe5\xba\xb7" #endif #define HAPPINESS_AND_WELL_BEING \ CJK_UNIFIED_IDEOGRAPH_5E78 CJK_UNIFIED_IDEOGRAPH_798F \ CJK_UNIFIED_IDEOGRAPH_5B89 CJK_UNIFIED_IDEOGRAPH_5EB7 START_TEST(test_strnjoin__when_src_is_null__returns_empty_string) { /* setup */ const char **src = NULL; char result[RESULT_LEN]; result[0] = '\0'; /* test */ g_strnjoin(result, RESULT_LEN, " ", src, 0); /* verify */ ck_assert_str_eq(result, ""); } END_TEST START_TEST(test_strnjoin__when_src_has_null_item__returns_joined_string) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value, NULL }; char result[RESULT_LEN]; result[0] = '\0'; /* test */ g_strnjoin(result, RESULT_LEN, " ", src, 2); /* verify */ ck_assert_str_eq(result, "test_value "); } END_TEST START_TEST(test_strnjoin__when_src_has_one_item__returns_copied_source_string) { /* setup */ const char *expected_value = "test_value"; const char *src[] = { expected_value }; char result[RESULT_LEN]; result[0] = '\0'; /* test */ g_strnjoin(result, RESULT_LEN, " ", src, 1); /* verify */ ck_assert_str_eq(result, expected_value); } END_TEST START_TEST(test_strnjoin__when_src_has_two_items__returns_joined_string) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value, test_value }; char result[RESULT_LEN]; result[0] = '\0'; /* test */ g_strnjoin(result, RESULT_LEN, " ", src, 2); /* verify */ ck_assert_str_eq(result, "test_value test_value"); } END_TEST START_TEST(test_strnjoin__when_joiner_is_empty_string__returns_joined_string) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value, test_value }; char result[RESULT_LEN]; result[0] = '\0'; /* test */ g_strnjoin(result, RESULT_LEN, "", src, 2); /* verify */ ck_assert_str_eq(result, "test_valuetest_value"); } END_TEST START_TEST(test_strnjoin__when_joiner_is_NULL__returns_joined_string) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value, test_value }; char result[RESULT_LEN]; result[0] = '\0'; /* test */ g_strnjoin(result, RESULT_LEN, NULL, src, 2); /* verify */ ck_assert_str_eq(result, "test_valuetest_value"); } END_TEST START_TEST(test_strnjoin__when_destination_is_NULL__returns_NULL) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value }; char *result = NULL; /* test */ g_strnjoin(result, 0, " ", src, 1); /* verify */ ck_assert_ptr_eq(result, NULL); } END_TEST START_TEST(test_strnjoin__when_destination_is_shorter_than_src__returns_partial_src_string) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value }; char result[5]; result[0] = '\0'; /* test */ g_strnjoin(result, 5, " ", src, 1); /* verify */ ck_assert_str_eq(result, "test"); } END_TEST START_TEST(test_strnjoin__when_destination_is_shorter_than_src_plus_joiner__returns_partial_joined_string) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value, test_value}; char result[16]; result[0] = '\0'; /* test */ g_strnjoin(result, 16, " joiner ", src, 2); /* verify */ ck_assert_str_eq(result, "test_value join"); } END_TEST START_TEST(test_strnjoin__when_destination_has_contents__returns_joined_string_with_content_overwritten) { /* setup */ const char *test_value = "test_value"; const char *src[] = { test_value, test_value}; char result[RESULT_LEN] = "1234567890"; /* test */ g_strnjoin(result, RESULT_LEN, " ", src, 2); /* verify */ ck_assert_str_eq(result, "test_value test_value"); } END_TEST START_TEST(test_strnjoin__when_always__then_doesnt_write_beyond_end_of_destination) { /* setup */ const char *src[] = { "a", "b", "c"}; char result[5 + 1 + 1]; /* a-b-c + term null + guard value */ /* test */ result[6] = '\x7f'; g_strnjoin(result, 5 + 1, "-", src, 3); /* verify */ ck_assert_int_eq(result[6], '\x7f'); } END_TEST /******************************************************************************/ START_TEST(test_bm2str__no_bits_defined) { int rv; char buff[64]; static const struct bitmask_string bits[] = { BITMASK_STRING_END_OF_LIST }; rv = g_bitmask_to_str(0xffff, bits, ',', buff, sizeof(buff)); ck_assert_str_eq(buff, "0xffff"); ck_assert_int_eq(rv, 6); } END_TEST START_TEST(test_bm2str__all_bits_defined) { int rv; char buff[64]; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 6, "BIT_6"}, {1 << 7, "BIT_7"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 6 | 1 << 7; rv = g_bitmask_to_str(bitmask, bits, '|', buff, sizeof(buff)); ck_assert_str_eq(buff, "BIT_0|BIT_1|BIT_6|BIT_7"); ck_assert_int_eq(rv, (6 * 4) - 1); } END_TEST START_TEST(test_bm2str__some_bits_undefined) { int rv; char buff[64]; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 6, "BIT_6"}, {1 << 7, "BIT_7"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 16; rv = g_bitmask_to_str(bitmask, bits, ':', buff, sizeof(buff)); ck_assert_str_eq(buff, "BIT_0:BIT_1:0x10000"); ck_assert_int_eq(rv, (6 * 2) + 7); } END_TEST START_TEST(test_bm2str__overflow_all_bits_defined) { int rv; char buff[10]; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 6, "BIT_6"}, {1 << 7, "BIT_7"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 6 | 1 << 7; rv = g_bitmask_to_str(bitmask, bits, '+', buff, sizeof(buff)); ck_assert_str_eq(buff, "BIT_0+BIT"); ck_assert_int_eq(rv, (4 * 6) - 1); } END_TEST START_TEST(test_bm2str__overflow_some_bits_undefined) { int rv; char buff[16]; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 6, "BIT_6"}, {1 << 7, "BIT_7"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 16; rv = g_bitmask_to_str(bitmask, bits, '#', buff, sizeof(buff)); ck_assert_str_eq(buff, "BIT_0#BIT_1#0x1"); ck_assert_int_eq(rv, (6 * 2) + 7); } END_TEST START_TEST(test_str2bm__null_string) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; rv = g_str_to_bitmask(NULL, bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__empty_string) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; rv = g_str_to_bitmask("", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__null_bitdefs) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; rv = g_str_to_bitmask("BIT_0", NULL, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__null_delim) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; rv = g_str_to_bitmask("BIT_0", bits, NULL, buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__null_buffer) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; rv = g_str_to_bitmask("BIT_0", bits, ",", NULL, sizeof(buff)); ck_assert_str_eq(buff, "dummy"); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__zero_buffer) { int rv; char buff[1]; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; rv = g_str_to_bitmask("BIT_0", bits, ",", buff, 0); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__zero_mask) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {0, "ZERO MASK"}, /* mask 0 should not be detected as end of list */ {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0; rv = g_str_to_bitmask("BIT_0", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__all_defined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1; rv = g_str_to_bitmask("BIT_0,BIT_1", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__no_defined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 0; rv = g_str_to_bitmask("BIT_2,BIT_3", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, "BIT_2,BIT_3"); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__some_defined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 2, "BIT_2"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 1; rv = g_str_to_bitmask("a,BIT_1,b", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, "a,b"); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__trim_space) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 2, "BIT_2"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 2; rv = g_str_to_bitmask("BIT_0 , BIT_1 , BIT_2", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__overflow_undefined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 2, "BIT_2"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 1; rv = g_str_to_bitmask("123456789,BIT_1,abcdef", bits, ",", buff, sizeof(buff)); /* abcdef is not filled */ ck_assert_str_eq(buff, "123456789"); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__delim_slash) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 2, "BIT_2"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 2; rv = g_str_to_bitmask("BIT_0/BIT_1/BIT_2", bits, "/", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__no_delim) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, BITMASK_STRING_END_OF_LIST }; rv = g_str_to_bitmask("BIT_0,BIT_1", bits, "", buff, sizeof(buff)); ck_assert_str_eq(buff, "BIT_0,BIT_1"); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_str2bm__multiple_delim) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, {1 << 2, "BIT_2"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 2; rv = g_str_to_bitmask("BIT_0/BIT_1,BIT_2", bits, ",/", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__first_delim_is_semicolon) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, {1 << 1, "BIT_1"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 1; rv = g_str_to_bitmask("a;b;BIT_1;c", bits, ";,", buff, sizeof(buff)); ck_assert_str_eq(buff, "a;b;c"); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_str2bm__empty_token) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_string bits[] = { {1 << 0, "BIT_0"}, BITMASK_STRING_END_OF_LIST }; int bitmask = 1 << 0; rv = g_str_to_bitmask(",BIT_0, ,", bits, ",", buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST /******************************************************************************/ START_TEST(test_bm2char__no_bits_defined) { int rv; char buff[64]; int rest; static const struct bitmask_char bits[] = { BITMASK_CHAR_END_OF_LIST }; rv = g_bitmask_to_charstr(0xffff, bits, buff, sizeof(buff), &rest); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); ck_assert_int_eq(rest, 0xffff); } END_TEST START_TEST(test_bm2char__all_bits_defined) { int rv; char buff[64]; int rest; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 6, 'C'}, {1 << 7, 'D'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 6 | 1 << 7; rv = g_bitmask_to_charstr(bitmask, bits, buff, sizeof(buff), &rest); ck_assert_str_eq(buff, "ABCD"); ck_assert_int_eq(rv, 4); ck_assert_int_eq(rest, 0); } END_TEST START_TEST(test_bm2char__some_bits_undefined) { int rv; char buff[64]; int rest; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 6, 'C'}, {1 << 7, 'D'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 16; rv = g_bitmask_to_charstr(bitmask, bits, buff, sizeof(buff), &rest); ck_assert_str_eq(buff, "AB"); ck_assert_int_eq(rv, 2); ck_assert_int_eq(rest, (1 << 16)); } END_TEST START_TEST(test_bm2char__overflow_all_bits_defined) { int rv; char buff[3]; int rest; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 6, 'C'}, {1 << 7, 'D'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 6 | 1 << 7; rv = g_bitmask_to_charstr(bitmask, bits, buff, sizeof(buff), &rest); ck_assert_str_eq(buff, "AB"); ck_assert_int_eq(rv, 4); ck_assert_int_eq(rest, 0); } END_TEST START_TEST(test_bm2char__overflow_some_bits_undefined) { int rv; char buff[2]; int rest; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 6, 'C'}, {1 << 7, 'D'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 16; rv = g_bitmask_to_charstr(bitmask, bits, buff, sizeof(buff), &rest); ck_assert_str_eq(buff, "A"); ck_assert_int_eq(rv, 2); ck_assert_int_eq(rest, (1 << 16)); } END_TEST START_TEST(test_bm2char__null_rest_param) { int rv; char buff[10]; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 6, 'C'}, {1 << 7, 'D'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1 | 1 << 16; rv = g_bitmask_to_charstr(bitmask, bits, buff, sizeof(buff), NULL); ck_assert_str_eq(buff, "AB"); ck_assert_int_eq(rv, 2); } END_TEST /******************************************************************************/ START_TEST(test_char2bm__null_string) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, BITMASK_CHAR_END_OF_LIST }; rv = g_charstr_to_bitmask(NULL, bits, buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_char2bm__empty_string) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, BITMASK_CHAR_END_OF_LIST }; rv = g_charstr_to_bitmask("", bits, buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_char2bm__null_bitdefs) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; rv = g_charstr_to_bitmask("A", NULL, buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_char2bm__null_buffer) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, BITMASK_CHAR_END_OF_LIST }; rv = g_charstr_to_bitmask("B", bits, NULL, sizeof(buff)); ck_assert_str_eq(buff, "dummy"); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_char2bm__zero_buffer) { int rv; char buff[1]; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, BITMASK_CHAR_END_OF_LIST }; rv = g_charstr_to_bitmask("B", bits, buff, 0); ck_assert_int_eq(rv, 0); } END_TEST START_TEST(test_char2bm__zero_mask) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {0, 'A'}, /* mask 0 should not be detected as end of list */ {1 << 0, 'B'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0; rv = g_charstr_to_bitmask("B", bits, buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_char2bm__all_defined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 0 | 1 << 1; rv = g_charstr_to_bitmask("AB", bits, buff, sizeof(buff)); ck_assert_str_eq(buff, ""); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_char2bm__no_defined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 0; rv = g_charstr_to_bitmask("CD", bits, buff, sizeof(buff)); ck_assert_str_eq(buff, "CD"); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_char2bm__some_defined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 2, 'C'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 1; rv = g_charstr_to_bitmask("0B1", bits, buff, sizeof(buff)); ck_assert_str_eq(buff, "01"); ck_assert_int_eq(rv, bitmask); } END_TEST START_TEST(test_char2bm__overflow_undefined) { int rv; char buff[16] = { 'd', 'u', 'm', 'm', 'y' }; static const struct bitmask_char bits[] = { {1 << 0, 'A'}, {1 << 1, 'B'}, {1 << 2, 'C'}, BITMASK_CHAR_END_OF_LIST }; int bitmask = 1 << 1; rv = g_charstr_to_bitmask("123456789Bvwxyz", bits, buff, 10); /* vwxyz is not filled */ ck_assert_str_eq(buff, "123456789"); ck_assert_int_eq(rv, bitmask); } END_TEST /******************************************************************************/ START_TEST(test_strtrim__trim_left) { /* setup */ char output[] = "\t\t \tDone is better than perfect.\t\t \n\n"; /* test */ g_strtrim(output, 1); /* verify */ ck_assert_str_eq(output, "Done is better than perfect.\t\t \n\n"); } END_TEST START_TEST(test_strtrim__trim_right) { /* setup */ char output[] = "\t\t \tDone is better than perfect.\t\t \n\n"; /* test */ g_strtrim(output, 2); /* verify */ ck_assert_str_eq(output, "\t\t \tDone is better than perfect."); } END_TEST START_TEST(test_strtrim__trim_both) { /* setup */ char output[] = "\t\t \tDone is better than perfect.\t\t \n\n"; /* test */ g_strtrim(output, 3); /* verify */ ck_assert_str_eq(output, "Done is better than perfect."); } END_TEST START_TEST(test_strtrim__trim_through) { /* setup */ char output[] = "\t\t \tDone is better than perfect.\t\t \n\n"; /* test */ g_strtrim(output, 4); /* verify */ ck_assert_str_eq(output, "Doneisbetterthanperfect."); } END_TEST START_TEST(test_strtrim__chinese_chars) { /* setup */ char output[] = "\t\t \t" HAPPINESS_AND_WELL_BEING "\t\t \n\n"; /* test */ g_strtrim(output, 4); /* verify */ ck_assert_str_eq(output, HAPPINESS_AND_WELL_BEING); } END_TEST /******************************************************************************/ START_TEST(test_sigs__common) { char name[MAXSTRSIGLEN]; char *res; // Check some common POSIX signals res = g_sig2text(SIGHUP, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIGHUP"); res = g_sig2text(SIGCHLD, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIGCHLD"); res = g_sig2text(SIGXFSZ, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIGXFSZ"); res = g_sig2text(SIGRTMIN, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIGRTMIN"); res = g_sig2text(SIGRTMIN + 2, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIGRTMIN+2"); res = g_sig2text(SIGRTMAX, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIGRTMAX"); // Should be invalid res = g_sig2text(0, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIG#0"); res = g_sig2text(65535, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIG#65535"); // POSIX defines signals as ints, but insists they are positive. So // we ought to trest we get sane behaviour for -ve numbers res = g_sig2text(-1, name); ck_assert_ptr_eq(res, name); ck_assert_str_eq(res, "SIG#-1"); } END_TEST START_TEST(test_sigs__bigint) { char name[MAXSTRSIGLEN]; char name2[1024]; // Check that big integers aren't being truncated by the definition // of MAXSTRSIGLEN int i = INT_MAX; g_sig2text(i, name); g_snprintf(name2, sizeof(name2), "SIG#%d", i); ck_assert_str_eq(name, name2); i = INT_MIN; g_sig2text(i, name); g_snprintf(name2, sizeof(name2), "SIG#%d", i); ck_assert_str_eq(name, name2); } END_TEST /******************************************************************************/ Suite * make_suite_test_string(void) { Suite *s; TCase *tc_strnjoin; TCase *tc_bm2str; TCase *tc_str2bm; TCase *tc_bm2char; TCase *tc_char2bm; TCase *tc_strtrim; TCase *tc_sigs; s = suite_create("String"); tc_strnjoin = tcase_create("strnjoin"); suite_add_tcase(s, tc_strnjoin); tcase_add_test(tc_strnjoin, test_strnjoin__when_src_is_null__returns_empty_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_src_has_null_item__returns_joined_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_src_has_one_item__returns_copied_source_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_src_has_two_items__returns_joined_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_joiner_is_empty_string__returns_joined_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_joiner_is_NULL__returns_joined_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_destination_is_NULL__returns_NULL); tcase_add_test(tc_strnjoin, test_strnjoin__when_destination_is_shorter_than_src__returns_partial_src_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_destination_is_shorter_than_src_plus_joiner__returns_partial_joined_string); tcase_add_test(tc_strnjoin, test_strnjoin__when_destination_has_contents__returns_joined_string_with_content_overwritten); tcase_add_test(tc_strnjoin, test_strnjoin__when_always__then_doesnt_write_beyond_end_of_destination); tc_bm2str = tcase_create("bm2str"); suite_add_tcase(s, tc_bm2str); tcase_add_test(tc_bm2str, test_bm2str__no_bits_defined); tcase_add_test(tc_bm2str, test_bm2str__all_bits_defined); tcase_add_test(tc_bm2str, test_bm2str__some_bits_undefined); tcase_add_test(tc_bm2str, test_bm2str__overflow_all_bits_defined); tcase_add_test(tc_bm2str, test_bm2str__overflow_some_bits_undefined); tc_str2bm = tcase_create("str2bm"); suite_add_tcase(s, tc_str2bm); tcase_add_test(tc_str2bm, test_str2bm__null_string); tcase_add_test(tc_str2bm, test_str2bm__empty_string); tcase_add_test(tc_str2bm, test_str2bm__null_bitdefs); tcase_add_test(tc_str2bm, test_str2bm__null_delim); tcase_add_test(tc_str2bm, test_str2bm__null_buffer); tcase_add_test(tc_str2bm, test_str2bm__zero_buffer); tcase_add_test(tc_str2bm, test_str2bm__zero_mask); tcase_add_test(tc_str2bm, test_str2bm__all_defined); tcase_add_test(tc_str2bm, test_str2bm__no_defined); tcase_add_test(tc_str2bm, test_str2bm__some_defined); tcase_add_test(tc_str2bm, test_str2bm__trim_space); tcase_add_test(tc_str2bm, test_str2bm__overflow_undefined); tcase_add_test(tc_str2bm, test_str2bm__no_delim); tcase_add_test(tc_str2bm, test_str2bm__delim_slash); tcase_add_test(tc_str2bm, test_str2bm__multiple_delim); tcase_add_test(tc_str2bm, test_str2bm__first_delim_is_semicolon); tcase_add_test(tc_str2bm, test_str2bm__empty_token); tc_bm2char = tcase_create("bm2char"); suite_add_tcase(s, tc_bm2char); tcase_add_test(tc_bm2char, test_bm2char__no_bits_defined); tcase_add_test(tc_bm2char, test_bm2char__all_bits_defined); tcase_add_test(tc_bm2char, test_bm2char__some_bits_undefined); tcase_add_test(tc_bm2char, test_bm2char__overflow_all_bits_defined); tcase_add_test(tc_bm2char, test_bm2char__overflow_some_bits_undefined); tcase_add_test(tc_bm2char, test_bm2char__null_rest_param); tc_char2bm = tcase_create("char2bm"); suite_add_tcase(s, tc_char2bm); tcase_add_test(tc_char2bm, test_char2bm__null_string); tcase_add_test(tc_char2bm, test_char2bm__empty_string); tcase_add_test(tc_char2bm, test_char2bm__null_bitdefs); tcase_add_test(tc_char2bm, test_char2bm__null_buffer); tcase_add_test(tc_char2bm, test_char2bm__zero_buffer); tcase_add_test(tc_char2bm, test_char2bm__zero_mask); tcase_add_test(tc_char2bm, test_char2bm__all_defined); tcase_add_test(tc_char2bm, test_char2bm__no_defined); tcase_add_test(tc_char2bm, test_char2bm__some_defined); tcase_add_test(tc_char2bm, test_char2bm__overflow_undefined); tc_strtrim = tcase_create("strtrim"); suite_add_tcase(s, tc_strtrim); tcase_add_test(tc_strtrim, test_strtrim__trim_left); tcase_add_test(tc_strtrim, test_strtrim__trim_right); tcase_add_test(tc_strtrim, test_strtrim__trim_both); tcase_add_test(tc_strtrim, test_strtrim__trim_through); tcase_add_test(tc_strtrim, test_strtrim__chinese_chars); tc_sigs = tcase_create("signals"); suite_add_tcase(s, tc_sigs); tcase_add_test(tc_sigs, test_sigs__common); tcase_add_test(tc_sigs, test_sigs__bigint); return s; } xrdp-0.10.1/tests/common/test_os_calls_signals.c000644 001751 000000 00000015445 14652432047 022022 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include "os_calls.h" #include "test_common.h" static tintptr g_wobj1 = 0; /******************************************************************************/ void os_calls_signals_init(void) { g_wobj1 = g_create_wait_obj(""); } /******************************************************************************/ void os_calls_signals_deinit(void) { g_delete_wait_obj(g_wobj1); g_wobj1 = 0; } /******************************************************************************/ /** * Set the global wait object g_wobj1 */ static void set_wobj1(int signum) { g_set_wait_obj(g_wobj1); } /******************************************************************************/ /** * Sends a number of signals to the process and checks they are all delivered * * @param sig Signal number * @param count Number of signals to send * * The caller is expected to establish a signal handler before this call * which sets the global g_wobj1 on signal delivery */ static void send_multiple_signals(int sig, unsigned int count) { while (count-- > 0) { g_reset_wait_obj(g_wobj1); ck_assert_int_eq(g_is_wait_obj_set(g_wobj1), 0); // Expect the signal to be delivered synchronously raise(sig); ck_assert_int_ne(g_is_wait_obj_set(g_wobj1), 0); } } /******************************************************************************/ START_TEST(test_g_set_alarm) { g_reset_wait_obj(g_wobj1); ck_assert_int_eq(g_is_wait_obj_set(g_wobj1), 0); g_set_alarm(set_wobj1, 1); g_obj_wait(&g_wobj1, 1, NULL, 0, 2000); ck_assert_int_ne(g_is_wait_obj_set(g_wobj1), 0); // Clean up g_set_alarm(NULL, 0); } END_TEST /******************************************************************************/ START_TEST(test_g_signal_child_stop_1) { struct exit_status e; g_reset_wait_obj(g_wobj1); ck_assert_int_eq(g_is_wait_obj_set(g_wobj1), 0); g_signal_child_stop(set_wobj1); int pid = g_fork(); if (pid == 0) { g_exit(45); } ck_assert_int_ne(pid, 0); g_obj_wait(&g_wobj1, 1, NULL, 0, 2000); ck_assert_int_ne(g_is_wait_obj_set(g_wobj1), 0); e = g_waitpid_status(pid); ck_assert_int_eq(e.reason, E_XR_STATUS_CODE); ck_assert_int_eq(e.val, 45); // Try another one to make sure the signal handler is still in place. // This one can generate a signal g_reset_wait_obj(g_wobj1); pid = g_fork(); if (pid == 0) { // Before raising the signal, change directory to a non-writeable // one to avoid generating a corefile. g_set_current_dir("/"); raise(SIGSEGV); } ck_assert_int_ne(pid, 0); g_obj_wait(&g_wobj1, 1, NULL, 0, 2000); ck_assert_int_ne(g_is_wait_obj_set(g_wobj1), 0); e = g_waitpid_status(pid); ck_assert_int_eq(e.reason, E_XR_SIGNAL); ck_assert_int_eq(e.val, SIGSEGV); // Clean up g_signal_child_stop(NULL); } END_TEST /******************************************************************************/ /* Checks that multiple children finishing do not interrupt * g_waitpid_status() */ START_TEST(test_g_signal_child_stop_2) { #define CHILD_COUNT 20 int pids[CHILD_COUNT]; unsigned int i; struct exit_status e; g_reset_wait_obj(g_wobj1); ck_assert_int_eq(g_is_wait_obj_set(g_wobj1), 0); g_signal_child_stop(set_wobj1); for (i = 0 ; i < CHILD_COUNT; ++i) { int pid = g_fork(); if (pid == 0) { g_sleep((i + 1) * 100); g_exit(i + 1); } ck_assert_int_ne(pid, 0); pids[i] = pid; } g_obj_wait(&g_wobj1, 1, NULL, 0, 2000); ck_assert_int_ne(g_is_wait_obj_set(g_wobj1), 0); for (i = 0 ; i < CHILD_COUNT; ++i) { e = g_waitpid_status(pids[i]); ck_assert_int_eq(e.reason, E_XR_STATUS_CODE); ck_assert_int_eq(e.val, (i + 1)); } // Clean up g_signal_child_stop(NULL); #undef CHILD_COUNT } END_TEST /******************************************************************************/ START_TEST(test_g_signal_segfault) { g_signal_segfault(set_wobj1); // Only one signal can be received in this way. After handling // the signal the handler should be automatically reset. send_multiple_signals(SIGSEGV, 1); g_signal_segfault(NULL); } END_TEST /******************************************************************************/ START_TEST(test_g_signal_hang_up) { g_signal_hang_up(set_wobj1); send_multiple_signals(SIGHUP, 5); g_signal_hang_up(NULL); } /******************************************************************************/ START_TEST(test_g_signal_user_interrupt) { g_signal_user_interrupt(set_wobj1); send_multiple_signals(SIGINT, 5); g_signal_user_interrupt(NULL); } /******************************************************************************/ START_TEST(test_g_signal_terminate) { g_signal_terminate(set_wobj1); send_multiple_signals(SIGTERM, 5); g_signal_terminate(NULL); } /******************************************************************************/ START_TEST(test_g_signal_pipe) { g_signal_pipe(set_wobj1); send_multiple_signals(SIGPIPE, 5); g_signal_pipe(NULL); } /******************************************************************************/ START_TEST(test_g_signal_usr1) { g_signal_usr1(set_wobj1); send_multiple_signals(SIGUSR1, 5); g_signal_usr1(NULL); } /******************************************************************************/ START_TEST(test_waitpid_not_interrupted_by_sig) { /* Start a child which waits 3 seconds and exits */ int child_pid = g_fork(); if (child_pid == 0) { g_sleep(3000); g_exit(42); } /* Set an alarm for 1 second's time */ g_reset_wait_obj(g_wobj1); g_set_alarm(set_wobj1, 1); struct exit_status e = g_waitpid_status(child_pid); // We should have had the alarm... ck_assert_int_ne(g_is_wait_obj_set(g_wobj1), 0); // ..and got the status of the child ck_assert_int_eq(e.reason, E_XR_STATUS_CODE); ck_assert_int_eq(e.val, 42); // Clean up g_set_alarm(NULL, 0); } /******************************************************************************/ TCase * make_tcase_test_os_calls_signals(void) { TCase *tc = tcase_create("oscalls-signals"); tcase_add_test(tc, test_g_set_alarm); tcase_add_test(tc, test_g_signal_child_stop_1); tcase_add_test(tc, test_g_signal_child_stop_2); tcase_add_test(tc, test_g_signal_segfault); tcase_add_test(tc, test_g_signal_hang_up); tcase_add_test(tc, test_g_signal_user_interrupt); tcase_add_test(tc, test_g_signal_terminate); tcase_add_test(tc, test_g_signal_pipe); tcase_add_test(tc, test_g_signal_usr1); tcase_add_test(tc, test_waitpid_not_interrupted_by_sig); return tc; } xrdp-0.10.1/tests/common/test_common_main.c000644 001751 000000 00000003712 14652432047 020771 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include "log.h" #include "ssl_calls.h" #include "test_common.h" /** * Converts a binary buffer to a hexadecimal representation * * Result must be free'd after use */ char * bin_to_hex(const char *input, int length) { int i; char *result = (char *)malloc(length * 2 + 1); if (result != NULL) { char *p = result; const char *hexdigit = "0123456789abcdef"; for (i = 0 ; i < length ; ++i) { int c = input[i]; if (c < 0) { c += 256; } *p++ = hexdigit[ c / 16]; *p++ = hexdigit[ c % 16]; } *p = '\0'; } return result; } int main (void) { int number_failed; SRunner *sr; sr = srunner_create (make_suite_test_fifo()); srunner_add_suite(sr, make_suite_test_list()); srunner_add_suite(sr, make_suite_test_parse()); srunner_add_suite(sr, make_suite_test_string()); srunner_add_suite(sr, make_suite_test_string_unicode()); srunner_add_suite(sr, make_suite_test_os_calls()); srunner_add_suite(sr, make_suite_test_ssl_calls()); srunner_add_suite(sr, make_suite_test_base64()); srunner_add_suite(sr, make_suite_test_guid()); srunner_set_tap(sr, "-"); /* * Set up console logging */ struct log_config *lc = log_config_init_for_console(LOG_LEVEL_INFO, NULL); log_start_from_param(lc); log_config_free(lc); /* Disable stdout buffering, as this can confuse the error * reporting when running in libcheck fork mode */ setvbuf(stdout, NULL, _IONBF, 0); /* Initialise modules */ ssl_init(); os_calls_signals_init(); srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed(sr); srunner_free(sr); ssl_finish(); os_calls_signals_deinit(); log_end(); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } xrdp-0.10.1/tests/common/test_fifo_calls.c000644 001751 000000 00000011360 14652432047 020574 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "fifo.h" #include "os_calls.h" #include "test_common.h" #include "string_calls.h" static const char *strings[] = { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", NULL }; #define LARGE_TEST_SIZE 10000 /******************************************************************************/ /* Item destructor function for fifo tests involving allocated strings */ static void string_item_destructor(void *item, void *closure) { free(item); if (closure != NULL) { /* Count the free operation */ int *c = (int *)closure; ++(*c); } } /******************************************************************************/ START_TEST(test_fifo__null) { struct fifo *f = NULL; void *vp; int status; // These calls should not crash! fifo_delete(f, NULL); fifo_clear(f, NULL); status = fifo_add_item(f, NULL); ck_assert_int_eq(status, 0); vp = fifo_remove_item(f); ck_assert_ptr_eq(vp, NULL); status = fifo_is_empty(f); ck_assert_int_eq(status, 1); } END_TEST START_TEST(test_fifo__simple) { struct fifo *f = fifo_create(NULL); ck_assert_ptr_ne(f, NULL); int empty = fifo_is_empty(f); ck_assert_int_eq(empty, 1); // Check we can't add NULL to the fifo int success = fifo_add_item(f, NULL); ck_assert_int_eq(success, 0); // Check we can't remove anything from an empty fifo void *vp = fifo_remove_item(f); ck_assert_ptr_eq(vp, NULL); // Add some static strings to the FIFO const char **s; unsigned int n = 0; for (s = &strings[0] ; *s != NULL; ++s) { fifo_add_item(f, (void *)*s); ++n; } empty = fifo_is_empty(f); ck_assert_int_eq(empty, 0); unsigned int i; for (i = 0 ; i < n ; ++i) { const char *p = (const char *)fifo_remove_item(f); ck_assert_ptr_eq(p, strings[i]); } empty = fifo_is_empty(f); ck_assert_int_eq(empty, 1); fifo_delete(f, NULL); } END_TEST START_TEST(test_fifo__strdup) { struct fifo *f = fifo_create(string_item_destructor); ck_assert_ptr_ne(f, NULL); // Add some dynamically allocated strings to the FIFO const char **s; unsigned int n = 0; for (s = &strings[0] ; *s != NULL; ++s) { int ok = fifo_add_item(f, (void *)strdup(*s)); ck_assert_int_eq(ok, 1); ++n; } // Delete the fifo, freeing the allocated strings. Check free() is called // the expected number of times. int c = 0; fifo_delete(f, &c); ck_assert_int_eq(c, n); } END_TEST START_TEST(test_fifo__large_test_1) { struct fifo *f = fifo_create(string_item_destructor); ck_assert_ptr_ne(f, NULL); // Fill the fifo with dynamically allocated strings int i; for (i = 0; i < LARGE_TEST_SIZE; ++i) { int ok = fifo_add_item(f, (void *)strdup("test item")); ck_assert_int_eq(ok, 1); } // Clear the fifo, checking free is called the expected number of times int c = 0; fifo_clear(f, &c); ck_assert_int_eq(c, LARGE_TEST_SIZE); int empty = fifo_is_empty(f); ck_assert_int_eq(empty, 1); // Finally delete the fifo, checking free is not called this time c = 0; fifo_delete(f, &c); ck_assert_int_eq(c, 0); } END_TEST START_TEST(test_fifo__large_test_2) { char buff[64]; struct fifo *f = fifo_create(string_item_destructor); ck_assert_ptr_ne(f, NULL); // Fill the fifo with dynamically allocated strings int i; for (i = 0; i < LARGE_TEST_SIZE; ++i) { g_snprintf(buff, sizeof(buff), "%d", i); int ok = fifo_add_item(f, (void *)strdup(buff)); ck_assert_int_eq(ok, 1); } // Extract all the strings from the fifo, making sure they're // as expected for (i = 0; i < LARGE_TEST_SIZE; ++i) { g_snprintf(buff, sizeof(buff), "%d", i); char *s = fifo_remove_item(f); ck_assert_ptr_ne(s, NULL); ck_assert_str_eq(s, buff); free(s); } int empty = fifo_is_empty(f); ck_assert_int_eq(empty, 1); int c = 0; fifo_delete(f, &c); ck_assert_int_eq(c, 0); } END_TEST /******************************************************************************/ Suite * make_suite_test_fifo(void) { Suite *s; TCase *tc_simple; s = suite_create("Fifo"); tc_simple = tcase_create("simple"); suite_add_tcase(s, tc_simple); tcase_add_test(tc_simple, test_fifo__null); tcase_add_test(tc_simple, test_fifo__simple); tcase_add_test(tc_simple, test_fifo__strdup); tcase_add_test(tc_simple, test_fifo__large_test_1); tcase_add_test(tc_simple, test_fifo__large_test_2); return s; } xrdp-0.10.1/tests/common/test_parse.c000644 001751 000000 00000026142 14652432047 017611 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "arch.h" #include "os_calls.h" #include "string_calls.h" #include "parse.h" #include "test_common.h" #define ELEMENTS(x) (sizeof(x) / sizeof(x[0])) const static char utf8_simple_test_with_emoji[] = "Simple Test." "\xf0\x9f\x98\xa5"; // U+1F625 Disappointed But Relieved Face const static char16_t utf16_simple_test_with_emoji[] = { 'S', 'i', 'm', 'p', 'l', 'e', ' ', 'T', 'e', 's', 't', '.', 0xd83d, 0xde25, // U+1F625 0 // terminator }; /******************************************************************************/ START_TEST(test_out_utf8_as_utf16_le) { struct stream *s; make_stream(s); init_stream(s, 8192); out_utf8_as_utf16_le(s, utf8_simple_test_with_emoji, sizeof(utf8_simple_test_with_emoji)); // Include term s_mark_end(s); // Rewind the stream s->p = s->data; unsigned int i; for (i = 0; i < ELEMENTS(utf16_simple_test_with_emoji); ++i) { char16_t val; in_uint16_le(s, val); if (val != utf16_simple_test_with_emoji[i]) { ck_abort_msg("test_out_utf8_as_utf16_le: " "Index %u expected %x, got %x", i, utf16_simple_test_with_emoji[i], val); } } ck_assert_int_eq(s_check_end(s), 1); free_stream(s); } END_TEST /******************************************************************************/ START_TEST(test_in_utf16_le_fixed_as_utf8) { struct stream *s; make_stream(s); init_stream(s, 8192); // Write the stream without a terminator unsigned int i; for (i = 0; i < ELEMENTS(utf16_simple_test_with_emoji) - 1; ++i) { out_uint16_le(s, utf16_simple_test_with_emoji[i]); } s_mark_end(s); // Rewind the stream s->p = s->data; char buff[256]; unsigned int len; // Check the length call len = in_utf16_le_fixed_as_utf8_length(s, i); ck_assert_int_eq(len, sizeof(utf8_simple_test_with_emoji)); // Now read the string, checking for the same length unsigned int read_len; read_len = in_utf16_le_fixed_as_utf8(s, i, buff, sizeof(buff)); ck_assert_int_eq(len, read_len); // Should be at the end of the buffer ck_assert_int_eq(s_check_end(s), 1); // Check the contents are as expected int cmp = memcmp(buff, utf8_simple_test_with_emoji, sizeof(utf8_simple_test_with_emoji)); ck_assert_int_eq(cmp, 0); free_stream(s); } END_TEST /******************************************************************************/ START_TEST(test_in_utf16_le_terminated_as_utf8) { struct stream *s; make_stream(s); init_stream(s, 8192); // Write the stream with the terminator unsigned int i; for (i = 0; i < ELEMENTS(utf16_simple_test_with_emoji); ++i) { out_uint16_le(s, utf16_simple_test_with_emoji[i]); } s_mark_end(s); // Rewind the stream s->p = s->data; char buff[256]; unsigned int len; // Check the length call len = in_utf16_le_terminated_as_utf8_length(s); ck_assert_int_eq(len, sizeof(utf8_simple_test_with_emoji)); // Now read the string, checking for the same length unsigned int read_len; read_len = in_utf16_le_terminated_as_utf8(s, buff, sizeof(buff)); ck_assert_int_eq(len, read_len); // Should be at the end of the buffer ck_assert_int_eq(s_check_end(s), 1); // Check the contents are as expected int cmp = memcmp(buff, utf8_simple_test_with_emoji, sizeof(utf8_simple_test_with_emoji)); ck_assert_int_eq(cmp, 0); free_stream(s); } END_TEST /******************************************************************************/ START_TEST(test_in_utf16_le_significant_chars) { struct stream *s; make_stream(s); init_stream(s, 8192); const struct { struct { char16_t high; // Set to 0 for a single UTF-16 word char16_t low; } pair; char32_t expected; } tests[] = { // Single high surrogates are bad { { 0, 0xd800 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xdbff }, UCS_REPLACEMENT_CHARACTER }, // Single low surrogates are bad { { 0, 0xdc00 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // Values before and after surrogate range { { 0, 0xd7ff }, 0xd7ff }, { { 0, 0xe000 }, 0xe000 }, // First and last non-surrogate pair values (don't use // 0xfffe and 0xffff for this test as they are non-characters, // and 0xfffd is the replacement character) { { 0, 0 }, 0 }, { { 0, 0xfffc }, 0xfffc }, { { 0, 0xfffd }, UCS_REPLACEMENT_CHARACTER }, // First and last surrogate pair values (don't use // 0x10fffe and 0x10ffff for this test as they are non-characters) { { 0xd800, 0xdc00 }, 0x10000 }, { { 0xdbff, 0xdffd }, 0x10fffd }, // End-of-plane non-characters (BMP) and the characters before them { { 0xd83f, 0xdffd }, 0x1fffd }, { { 0xd83f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+1FFFE { { 0xd83f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+1FFFF { { 0xd87f, 0xdffd }, 0x2fffd }, { { 0xd87f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+2FFFE { { 0xd87f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+2FFFF { { 0xd8bf, 0xdffd }, 0x3fffd }, { { 0xd8bf, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+3FFFE { { 0xd8bf, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+3FFFF { { 0xd8ff, 0xdffd }, 0x4fffd }, { { 0xd8ff, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+4FFFE { { 0xd8ff, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+4FFFF { { 0xd93f, 0xdffd }, 0x5fffd }, { { 0xd93f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+5FFFE { { 0xd93f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+5FFFF { { 0xd97f, 0xdffd }, 0x6fffd }, { { 0xd97f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+6FFFE { { 0xd97f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+6FFFF { { 0xd9bf, 0xdffd }, 0x7fffd }, { { 0xd9bf, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+7FFFE { { 0xd9bf, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+7FFFF { { 0xd9ff, 0xdffd }, 0x8fffd }, { { 0xd9ff, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+8FFFE { { 0xd9ff, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+8FFFF { { 0xda3f, 0xdffd }, 0x9fffd }, { { 0xda3f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+9FFFE { { 0xda3f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+9FFFF { { 0xda7f, 0xdffd }, 0xafffd }, { { 0xda7f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+AFFFE { { 0xda7f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+AFFFF { { 0xdabf, 0xdffd }, 0xbfffd }, { { 0xdabf, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+BFFFE { { 0xdabf, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+BFFFF { { 0xdaff, 0xdffd }, 0xcfffd }, { { 0xdaff, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+CFFFE { { 0xdaff, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+CFFFF { { 0xdb3f, 0xdffd }, 0xdfffd }, { { 0xdb3f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+DFFFE { { 0xdb3f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+DFFFF { { 0xdb7f, 0xdffd }, 0xefffd }, { { 0xdb7f, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+EFFFE { { 0xdb7f, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+EFFFF { { 0xdbbf, 0xdffd }, 0xffffd }, { { 0xdbbf, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+FFFFE { { 0xdbbf, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+FFFFF { { 0xdbff, 0xdffd }, 0x10fffd }, { { 0xdbff, 0xdffe }, UCS_REPLACEMENT_CHARACTER }, // U+10FFFE { { 0xdbff, 0xdfff }, UCS_REPLACEMENT_CHARACTER }, // U+10FFFF // Non-characters in "Arabic Presentation Forms-A" { { 0, 0xfdd0 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd1 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd2 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd3 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd4 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd5 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd6 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd7 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd8 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdd9 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdda }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfddb }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfddc }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfddd }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdde }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfddf }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde0 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde1 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde2 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde3 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde4 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde5 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde6 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde7 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde8 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfde9 }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdea }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdeb }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdec }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfded }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdee }, UCS_REPLACEMENT_CHARACTER }, { { 0, 0xfdef }, UCS_REPLACEMENT_CHARACTER } }; unsigned int i; for (i = 0; i < ELEMENTS(tests); ++i) { char buff[256]; unsigned int word_count; init_stream(s, 8192); word_count = 0; if (tests[i].pair.high != 0) { out_uint16_le(s, tests[i].pair.high); ++word_count; } out_uint16_le(s, tests[i].pair.low); ++word_count; s_mark_end(s); // Rewind the stream s->p = s->data; // Read in one UTF-16 LE character as UTF-32 in_utf16_le_fixed_as_utf8(s, word_count, buff, sizeof(buff)); const char *p = buff; char32_t c32 = utf8_get_next_char(&p, NULL); if (c32 != tests[i].expected) { ck_abort_msg("test_in_utf16_le_significant_chars: " "Index %u for {%x, %x}, expected %x, got %x", i, tests[i].pair.high, tests[i].pair.low, tests[i].expected, c32); } } free_stream(s); } END_TEST /******************************************************************************/ Suite * make_suite_test_parse(void) { Suite *s; TCase *tc_unicode; s = suite_create("Parse"); tc_unicode = tcase_create("Unicode"); suite_add_tcase(s, tc_unicode); tcase_add_test(tc_unicode, test_out_utf8_as_utf16_le); tcase_add_test(tc_unicode, test_in_utf16_le_fixed_as_utf8); tcase_add_test(tc_unicode, test_in_utf16_le_terminated_as_utf8); tcase_add_test(tc_unicode, test_in_utf16_le_significant_chars); return s; } xrdp-0.10.1/tests/common/test_string_calls_unicode.c000644 001751 000000 00000070373 14652432047 022676 0ustar00metawheel000000 000000 /* * The UTF-8 decoder tests are based on the UTF-8 decoder capability * and stress test" 2015-08-26 by Markus Kuhn. A copy of that file * named "UTF-8-test.txt" should be in the source directory for this file */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "string_calls.h" #include "test_common.h" // Abbreviate UCS_REPLACEMENT_CHARACTER for utf8_decode_sub_test arrays #define URC UCS_REPLACEMENT_CHARACTER struct utf8_decode_sub_test { const char *testref; const char *utf8str; // This array will contain 0 values after the initialised part const char32_t expected[65]; }; // Abbreviate UCS_REPLACEMENT_CHARACTER for utf8_encode_sub_test arrays #define E_URC { 0xef, 0xbf, 0xbd } struct utf8_encode_sub_test { const char *testref; char32_t c32; unsigned int expected_len; char expected_str[MAXLEN_UTF8_CHAR]; }; // Used as the simple test in UTF-8-test.txt const static char greek_kosme[] = "\xce\xba" // GREEK SMALL LETTER KAPPA "\xe1\xbd\xb9" // GREEK SMALL LETTER OMICRON WITH OXIA "\xcf\x83" // GREEK SMALL LETTER SIGMA "\xce\xbc" // GREEK SMALL LETTER MU "\xce\xb5"; // GREEK SMALL LETTER EPSILON // See Issue #2603 const static char simple_test_with_emoji[] = "Simple Test." "\xf0\x9f\x98\xa5"; // U+1F625 Disappointed But Relieved Face /******************************************************************************/ /** * Function to decode a UTF-8 string and check the expected result * * @param st Pointer to the sub-test to run */ static void run_utf8_decode_sub_test(const struct utf8_decode_sub_test *st) { char32_t c; const char *p = st->utf8str; unsigned int index = 0; do { c = utf8_get_next_char(&p, NULL); if (c != st->expected[index]) { ck_abort_msg("Sub-test section %s Index %u expected %x, got %x", st->testref, index, st->expected[index], c); } ++index; } while (c != 0); } /******************************************************************************/ /** * Function to run an array of decode sub-tests * * @param st Pointer to the first sub-test to run */ static void run_decode_sub_test_array(const struct utf8_decode_sub_test *st) { while (st->utf8str != NULL) { run_utf8_decode_sub_test(st++); } } /******************************************************************************/ /** * Function to encode a UTF-8 value and check the expected result * * @param st Pointer to the sub-test to run */ static void run_utf8_encode_sub_test(const struct utf8_encode_sub_test *st) { char actual_str[MAXLEN_UTF8_CHAR]; unsigned int index; unsigned int actual_len = utf_char32_to_utf8(st->c32, actual_str); if (actual_len != st->expected_len) { ck_abort_msg("Sub-test %s Expected length of %u, got %u", st->testref, st->expected_len, actual_len); } for (index = 0 ; index < actual_len; ++index) { if (actual_str[index] != st->expected_str[index]) { ck_abort_msg("Sub-test %s Character %u, expected %02x got %02x", st->testref, index, (int)(unsigned char)st->expected_str[index], (int)(unsigned char)actual_str[index]); } } } /******************************************************************************/ /** * Function to run an array of encode sub-tests * * @param st Pointer to the first sub-test to run */ static void run_encode_sub_test_array(const struct utf8_encode_sub_test *st) { while (st->expected_len > 0) { run_utf8_encode_sub_test(st++); } } /******************************************************************************/ START_TEST(test_get_next_char__section_1) { const struct utf8_decode_sub_test st = { "1", greek_kosme, { 0x03ba, // GREEK SMALL LETTER KAPPA 0x1f79, // GREEK SMALL LETTER OMICRON WITH OXIA 0x03c3, // GREEK SMALL LETTER SIGMA 0x03bc, // GREEK SMALL LETTER MU 0x03b5 // GREEK SMALL LETTER EPSILON } }; run_utf8_decode_sub_test(&st); } END_TEST /******************************************************************************/ START_TEST(test_get_next_char__section_2) { struct utf8_decode_sub_test tests[] = { // 2.1 First possible sequence of a certain length // // (2.1.1 Is tested separately) { "2.1.2", "\xc2\x80", { 0x80 } }, { "2.1.3", "\xe0\xa0\x80", { 0x800 } }, { "2.1.4", "\xf0\x90\x80\x80", { 0x10000 } }, { "2.1.5", "\xf8\x88\x80\x80\x80", { URC } }, { "2.1.6", "\xfc\x84\x80\x80\x80\x80", { URC } }, // 2.2 Last possible sequence of a certain length { "2.2.1", "\x7f", { 0x7f } }, { "2.2.2", "\xdf\xbf", { 0x7ff } }, // Use U+0000FFFC instead of U+0000FFFF as our decoder // treats non-characters as an input error { "2.2.3", "\xef\xbf\xbc", { 0xfffc } }, // U+001FFFFF is out-of-range { "2.2.4", "\xf7\xbf\xbf\xbf", { URC } }, { "2.2.5", "\xfb\xbf\xbf\xbf\xbf", { URC } }, { "2.2.6", "\xfd\xbf\xbf\xbf\xbf\xbf", { URC } }, // 2.3 Other boundary conditions { "2.3.1", "\xed\x9f\xbf", { 0xd7ff } }, { "2.3.2", "\xee\x80\x80", { 0xe000 } }, { "2.3.3", "\xef\xbf\xbd", { 0xfffd } }, // Don't use U+10FFFF (non-character) { "2.3.4", "\xf4\x8f\xbf\xbd", { 0x10fffd } }, { "2.3.5", "\xf4\x90\x80\x80", { URC } }, // Terminator { 0 } }; // 2.1.1 is a '\0' which we use to terminate our strings. Test // it separately { const char *p = ""; ck_assert_int_eq(utf8_get_next_char(&p, NULL), 0); } // Do the rest of the section 2 tests run_decode_sub_test_array(tests); } END_TEST /******************************************************************************/ START_TEST(test_get_next_char__section_3) { struct utf8_decode_sub_test tests[] = { // 3.1 Unexpected continuation bytes // // Each unexpected continuation byte should be separately // signalled as a malformed sequence of its own. { "3.1.1", "\x80", { URC } }, { "3.1.2", "\xbf", { URC } }, { "3.1.3", "\x80\xbf", { URC, URC } }, { "3.1.4", "\x80\xbf\x80", { URC, URC, URC } }, { "3.1.5", "\x80\xbf\x80\xbf", { URC, URC, URC, URC } }, { "3.1.6", "\x80\xbf\x80\xbf\x80", { URC, URC, URC, URC, URC } }, { "3.1.7", "\x80\xbf\x80\xbf\x80\xbf", { URC, URC, URC, URC, URC, URC } }, { "3.1.8", "\x80\xbf\x80\xbf\x80\xbf\x80", { URC, URC, URC, URC, URC, URC, URC } }, { "3.1.9", "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f" "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf", { URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC } }, // 3.2 Lonely start characters { "3.2.1", "\xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 " "\xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf " "\xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 " "\xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf ", { URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ' } }, { "3.2.2", "\xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 " "\xe8 \xe9 \xea \xeb \xec \xed \xee \xef ", { URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ' } }, { "3.2.3", "\xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 ", { URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ', URC, ' ' } }, { "3.2.4", "\xf8 \xf9 \xfa \xfb ", { URC, ' ', URC, ' ', URC, ' ', URC, ' ' } }, { "3.2.5", "\xfc \xfd ", { URC, ' ', URC, ' ' } }, // 3.3 Sequences with last continuation byte missing // // From UTF-8-test.txt:- // All bytes of an incomplete sequence should be signalled as // a single malformed sequence, i.e., you should see only a // single replacement character in each of the next 10 tests. { "3.3.1", "\xc0", { URC } }, { "3.3.2", "\xe0\x80", { URC } }, { "3.3.3", "\xf0\x80\x80", { URC } }, { "3.3.4", "\xf8\x80\x80\x80", { URC } }, { "3.3.5", "\xfc\x80\x80\x80\x80", { URC } }, { "3.3.6", "\xdf", { URC } }, { "3.3.7", "\xef\xbf", { URC } }, { "3.3.8", "\xf7\xbf\xbf", { URC} }, { "3.3.9", "\xfb\xbf\xbf\xbf", { URC } }, { "3.3.10", "\xfd\xbf\xbf\xbf\xbf", { URC } }, // 3.4 Concatenation of incomplete sequences { "3,4", "\xc0" "\xe0\x80" "\xf0\x80\x80" "\xf8\x80\x80\x80" "\xfc\x80\x80\x80\x80" "\xdf" "\xef\xbf" "\xf7\xbf\xbf" "\xfb\xbf\xbf\xbf" "\xfd\xbf\xbf\xbf\xbf", { URC, URC, URC, URC, URC, URC, URC, URC, URC, URC } }, // 3.5 Impossible bytes { "3.5.1", "\xfe", { URC } }, { "3.5.2", "\xff", { URC } }, { "3.5.3", "\xfe\xfe\xff\xff", { URC, URC, URC, URC } }, // Terminator { 0 } }; run_decode_sub_test_array(tests); } END_TEST /******************************************************************************/ START_TEST(test_get_next_char__section_4) { struct utf8_decode_sub_test tests[] = { // 4.1 Examples of an overlong ASCII character // // With a safe UTF-8 decoder, all of the following five // overlong representations of the ASCII character slash ("/") // should be rejected like a malformed UTF-8 sequence, for // instance by substituting it with a replacement character. If // you see a slash below, you do not have a safe UTF-8 decoder! { "4.1.1", "\xc0\xaf", { URC } }, { "4.1.2", "\xe0\x80\xaf", { URC } }, { "4.1.3", "\xf0\x80\x80\xaf", { URC } }, { "4.1.4", "\xf8\x80\x80\x80\xaf", { URC } }, { "4.1.5", "\xfc\x80\x80\x80\x80\xaf", { URC } }, // 4.2 Maximum overlong sequences // Below you see the highest Unicode value that is still resulting // in an overlong sequence if represented with the given number of // bytes. This is a boundary test for safe UTF-8 decoders. All // five characters should be rejected like malformed UTF-8 // sequences. { "4.2.1", "\xc1\xbf", { URC } }, { "4.2.2", "\xe0\x9f\xbf", { URC } }, { "4.2.3", "\xf0\x8f\xbf\xbf", { URC } }, { "4.2.4", "\xf8\x87\xbf\xbf\xbf", { URC } }, { "4.2.5", "\xfc\x83\xbf\xbf\xbf\xbf", { URC } }, // 4.3 Overlong representation of the NUL character // The following five sequences should also be rejected like // malformed UTF-8 sequences and should not be treated like the // ASCII NUL character. { "4.3.1", "\xc0\x80", { URC } }, { "4.3.2", "\xe0\x80\x80", { URC } }, { "4.3.3", "\xf0\x80\x80\x80", { URC } }, { "4.3.4", "\xf8\x80\x80\x80\x80", { URC } }, { "4.3.5", "\xfc\x80\x80\x80\x80\x80", { URC } }, // Terminator { 0 } }; run_decode_sub_test_array(tests); } END_TEST /******************************************************************************/ START_TEST(test_get_next_char__section_5) { struct utf8_decode_sub_test tests[] = { // 5 Illegal code positions // The following UTF-8 sequences should be rejected like // malformed sequences, because they never represent valid // ISO 10646 characters and a UTF-8 decoder that accepts them // might introduce security problems comparable to overlong // UTF-8 sequences. // 5.1 Single UTF-16 surrogates { "5.1.1", "\xed\xa0\x80", { URC } }, { "5.1.2", "\xed\xad\xbf", { URC } }, { "5.1.3", "\xed\xae\x80", { URC } }, { "5.1.4", "\xed\xaf\xbf", { URC } }, { "5.1.5", "\xed\xb0\x80", { URC } }, { "5.1.6", "\xed\xbe\x80", { URC } }, { "5.1.7", "\xed\xbf\xbf", { URC } }, // 5.2 Paired UTF-16 surrogates { "5.2.1", "\xed\xa0\x80\xed\xb0\x80", { URC, URC } }, { "5.2.2", "\xed\xa0\x80\xed\xbf\xbf", { URC, URC } }, { "5.2.3", "\xed\xad\xbf\xed\xb0\x80", { URC, URC } }, { "5.2.4", "\xed\xad\xbf\xed\xbf\xbf", { URC, URC } }, { "5.2.5", "\xed\xae\x80\xed\xb0\x80", { URC, URC } }, { "5.2.6", "\xed\xae\x80\xed\xbf\xbf", { URC, URC } }, { "5.2.7", "\xed\xaf\xbf\xed\xb0\x80", { URC, URC } }, { "5.2.8", "\xed\xaf\xbf\xed\xbf\xbf", { URC, URC } }, // 5.3 Noncharacter code positions // The following "noncharacters" are "reserved for internal // use" by applications, and according to older versions of // the Unicode Standard "should never be interchanged". Unicode // Corrigendum #9 dropped the latter restriction. Nevertheless, // their presence in incoming UTF-8 data can remain a potential // security risk, depending on what use is made of these codes // subsequently. Examples of such internal use: // // - Some file APIs with 16-bit characters may use the integer // value -1 = U+FFFF to signal an end-of-file (EOF) or error // condition. // // - In some UTF-16 receivers, code point U+FFFE might trigger // a byte-swap operation (to convert between UTF-16LE and // UTF-16BE). // With such internal use of noncharacters, it may be desirable // and safer to block those code points in UTF-8 decoders, as // they should never occur legitimately in incoming UTF-8 data, // and could trigger unsafe behaviour in subsequent processing. // Particularly problematic noncharacters in 16-bit applications: { "5.3.1", "\xef\xbf\xbe", { URC } }, { "5.3.2", "\xef\xbf\xbf", { URC } }, // Other noncharacters: { "5.3.3", // Non-characters in "Arabic Presentation Forms-A" (BMP) "\xef\xb7\x90" "\xef\xb7\x91" "\xef\xb7\x92" "\xef\xb7\x93" "\xef\xb7\x94" "\xef\xb7\x95" "\xef\xb7\x96" "\xef\xb7\x97" "\xef\xb7\x98" "\xef\xb7\x99" "\xef\xb7\x9a" "\xef\xb7\x9b" "\xef\xb7\x9c" "\xef\xb7\x9d" "\xef\xb7\x9e" "\xef\xb7\x9f" "\xef\xb7\xa0" "\xef\xb7\xa1" "\xef\xb7\xa2" "\xef\xb7\xa3" "\xef\xb7\xa4" "\xef\xb7\xa5" "\xef\xb7\xa6" "\xef\xb7\xa7" "\xef\xb7\xa8" "\xef\xb7\xa9" "\xef\xb7\xaa" "\xef\xb7\xab" "\xef\xb7\xac" "\xef\xb7\xad" "\xef\xb7\xae" "\xef\xb7\xaf", { URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC } }, { "5.3.4", "\xf0\x9f\xbf\xbe" "\xf0\x9f\xbf\xbf" // U+0001FFFE U+0001FFFF "\xf0\xaf\xbf\xbe" "\xf0\xaf\xbf\xbf" // U+0002FFFE U+0002FFFF "\xf0\xbf\xbf\xbe" "\xf0\xbf\xbf\xbf" // U+0003FFFE U+0003FFFF "\xf1\x8f\xbf\xbe" "\xf1\x8f\xbf\xbf" // U+0004FFFE U+0004FFFF "\xf1\x9f\xbf\xbe" "\xf1\x9f\xbf\xbf" // U+0005FFFE U+0005FFFF "\xf1\xaf\xbf\xbe" "\xf1\xaf\xbf\xbf" // U+0006FFFE U+0006FFFF "\xf1\xbf\xbf\xbe" "\xf1\xbf\xbf\xbf" // U+0007FFFE U+0007FFFF "\xf2\x8f\xbf\xbe" "\xf2\x8f\xbf\xbf" // U+0008FFFE U+0008FFFF "\xf2\x9f\xbf\xbe" "\xf2\x9f\xbf\xbf" // U+0009FFFE U+0009FFFF "\xf2\xaf\xbf\xbe" "\xf2\xaf\xbf\xbf" // U+000AFFFE U+000AFFFF "\xf2\xbf\xbf\xbe" "\xf2\xbf\xbf\xbf" // U+000BFFFE U+000BFFFF "\xf3\x8f\xbf\xbe" "\xf3\x8f\xbf\xbf" // U+000CFFFE U+000CFFFF "\xf3\x9f\xbf\xbe" "\xf3\x9f\xbf\xbf" // U+000DFFFE U+000DFFFF "\xf3\xaf\xbf\xbe" "\xf3\xaf\xbf\xbf" // U+000EFFFE U+000EFFFF "\xf3\xbf\xbf\xbe" "\xf3\xbf\xbf\xbf" // U+000FFFFE U+000FFFFF "\xf4\x8f\xbf\xbe" "\xf4\x8f\xbf\xbf",// U+0010FFFE U+0010FFFF { URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC, URC } }, // Last line of UTF8-test.txt { "TheEnd", "THE END\n", { 'T', 'H', 'E', ' ', 'E', 'N', 'D', '\n'} }, // Terminator { 0 } }; run_decode_sub_test_array(tests); } END_TEST /******************************************************************************/ START_TEST(test_utf_char32_to_utf8) { struct utf8_encode_sub_test tests[] = { // E2.1 First possible sequence of a certain length // { "E2.1.1", 0, 1, { 0 } }, { "E2.1.2", 0x80, 2, { 0xc2, 0x80 } }, { "E2.1.3", 0x800, 3, { 0xe0, 0xa0, 0x80 } }, { "E2.1.4", 0x10000, 4, { 0xf0, 0x90, 0x80, 0x80 } }, // E2.2 Last possible sequence of a certain length { "E2.2.1", 0x7f, 1, { 0x7f } }, { "E2.2.2", 0x7ff, 2, { 0xdf, 0xbf } }, { "E2.2.3", 0xfffc, 3, { 0xef, 0xbf, 0xbc } }, // See 2.1.3 above { "E2.2.4", 0x1FFFFF, 3, E_URC }, // out-of-range // E2.3 Other boundary conditions { "E2.3.1", 0xd7ff, 3, { 0xed, 0x9f, 0xbf } }, { "E2.3.2", 0xe000, 3, { 0xee, 0x80, 0x80 } }, { "E2.3.3", 0xfffd, 3, { 0xef, 0xbf, 0xbd } }, { "E2.3.4", 0x10fffd, 4, { 0xf4, 0x8f, 0xbf, 0xbd } }, // See 2.3.4 above // E2.3.5 - not tested // E5.1 Single UTF-16 surrogates { "E5.1.1", 0xd800, 3, E_URC }, { "E5.1.2", 0xdb7f, 3, E_URC }, { "E5.1.3", 0xdb80, 3, E_URC }, { "E5.1.4", 0xdbff, 3, E_URC }, { "E5.1.5", 0xdc00, 3, E_URC }, { "E5.1.6", 0xdf80, 3, E_URC }, { "E5.1.7", 0xdfff, 3, E_URC }, // E5.3 Non-character code positions { "E5.3.3(0)", 0xfdd0, 3, E_URC }, { "E5.3.3(1)", 0xfdd1, 3, E_URC }, { "E5.3.3(2)", 0xfdd2, 3, E_URC }, { "E5.3.3(3)", 0xfdd3, 3, E_URC }, { "E5.3.3(4)", 0xfdd4, 3, E_URC }, { "E5.3.3(5)", 0xfdd5, 3, E_URC }, { "E5.3.3(6)", 0xfdd6, 3, E_URC }, { "E5.3.3(7)", 0xfdd7, 3, E_URC }, { "E5.3.3(8)", 0xfdd8, 3, E_URC }, { "E5.3.3(9)", 0xfdd9, 3, E_URC }, { "E5.3.3(10)", 0xfdda, 3, E_URC }, { "E5.3.3(11)", 0xfddb, 3, E_URC }, { "E5.3.3(12)", 0xfddc, 3, E_URC }, { "E5.3.3(13)", 0xfddd, 3, E_URC }, { "E5.3.3(14)", 0xfdde, 3, E_URC }, { "E5.3.3(15)", 0xfddf, 3, E_URC }, { "E5.3.3(16)", 0xfde0, 3, E_URC }, { "E5.3.3(17)", 0xfde1, 3, E_URC }, { "E5.3.3(18)", 0xfde2, 3, E_URC }, { "E5.3.3(19)", 0xfde3, 3, E_URC }, { "E5.3.3(20)", 0xfde4, 3, E_URC }, { "E5.3.3(21)", 0xfde5, 3, E_URC }, { "E5.3.3(22)", 0xfde6, 3, E_URC }, { "E5.3.3(23)", 0xfde7, 3, E_URC }, { "E5.3.3(24)", 0xfde8, 3, E_URC }, { "E5.3.3(25)", 0xfde9, 3, E_URC }, { "E5.3.3(26)", 0xfdea, 3, E_URC }, { "E5.3.3(27)", 0xfdeb, 3, E_URC }, { "E5.3.3(28)", 0xfdec, 3, E_URC }, { "E5.3.3(29)", 0xfded, 3, E_URC }, { "E5.3.3(30)", 0xfdee, 3, E_URC }, { "E5.3.3(31)", 0xfdef, 3, E_URC }, { "E5.3.4(0)", 0x1fffe, 3, E_URC }, { "E5.3.4(1)", 0x1ffff, 3, E_URC }, { "E5.3.4(2)", 0x2fffe, 3, E_URC }, { "E5.3.4(3)", 0x2ffff, 3, E_URC }, { "E5.3.4(4)", 0x3fffe, 3, E_URC }, { "E5.3.4(5)", 0x3ffff, 3, E_URC }, { "E5.3.4(6)", 0x4fffe, 3, E_URC }, { "E5.3.4(7)", 0x4ffff, 3, E_URC }, { "E5.3.4(8)", 0x5fffe, 3, E_URC }, { "E5.3.4(9)", 0x5ffff, 3, E_URC }, { "E5.3.4(10)", 0x6fffe, 3, E_URC }, { "E5.3.4(11)", 0x6ffff, 3, E_URC }, { "E5.3.4(12)", 0x7fffe, 3, E_URC }, { "E5.3.4(13)", 0x7ffff, 3, E_URC }, { "E5.3.4(14)", 0x8fffe, 3, E_URC }, { "E5.3.4(15)", 0x8ffff, 3, E_URC }, { "E5.3.4(16)", 0x9fffe, 3, E_URC }, { "E5.3.4(17)", 0x9ffff, 3, E_URC }, { "E5.3.4(18)", 0xafffe, 3, E_URC }, { "E5.3.4(19)", 0xaffff, 3, E_URC }, { "E5.3.4(20)", 0xbfffe, 3, E_URC }, { "E5.3.4(21)", 0xbffff, 3, E_URC }, { "E5.3.4(22)", 0xcfffe, 3, E_URC }, { "E5.3.4(23)", 0xcffff, 3, E_URC }, { "E5.3.4(24)", 0xdfffe, 3, E_URC }, { "E5.3.4(25)", 0xdffff, 3, E_URC }, { "E5.3.4(26)", 0xefffe, 3, E_URC }, { "E5.3.4(27)", 0xeffff, 3, E_URC }, { "E5.3.4(28)", 0xffffe, 3, E_URC }, { "E5.3.4(29)", 0xfffff, 3, E_URC }, { "E5.3.4(30)", 0x10fffe, 3, E_URC }, { "E5.3.4(31)", 0x10ffff, 3, E_URC }, { "E5.99.0", 'T', 1, { 'T' } }, { "E5.99.1", 'H', 1, { 'H' } }, { "E5.99.2", 'E', 1, { 'E' } }, { "E5.99.3", ' ', 1, { ' ' } }, { "E5.99.4", 'E', 1, { 'E' } }, { "E5.99.5", 'N', 1, { 'N' } }, { "E5.99.6", 'D', 1, { 'D' } }, // Terminator { 0 } }; run_encode_sub_test_array(tests); } END_TEST /******************************************************************************/ START_TEST(test_utf8_char_count) { // Check function can cope with NULL argument ck_assert_int_eq(utf8_char_count(NULL), 0); unsigned int kosme_strlen = strlen(greek_kosme); unsigned int kosme_len = utf8_char_count(greek_kosme); // All characters map to two bytes except for the 'omicrom with oxia' // which maps to three ck_assert_int_eq(kosme_strlen, 2 + 3 + 2 + 2 + 2); ck_assert_int_eq(kosme_len, 5); unsigned int simple_test_strlen = strlen(simple_test_with_emoji); unsigned int simple_test_len = utf8_char_count(simple_test_with_emoji); ck_assert_int_eq(simple_test_strlen, (1 + 1 + 1 + 1 + 1 + 1 ) + // Simple 1 + (1 + 1 + 1 + 1 ) + // Test 1 + 4); // emoji // The emoji is 4 bytes - all others are 1 ck_assert_int_eq(simple_test_len, simple_test_strlen - 3); } END_TEST /******************************************************************************/ START_TEST(test_utf8_as_utf16_word_count) { unsigned int kosme_count = utf8_as_utf16_word_count(greek_kosme, strlen(greek_kosme)); ck_assert_int_eq(kosme_count, 5); // All characters in BMP unsigned int simple_test_count = utf8_as_utf16_word_count(simple_test_with_emoji, strlen(simple_test_with_emoji)); ck_assert_int_eq(simple_test_count, (1 + 1 + 1 + 1 + 1 + 1 ) + // Simple 1 + (1 + 1 + 1 + 1 ) + // Test 1 + 2); // emoji } END_TEST /******************************************************************************/ START_TEST(test_utf8_add_char_at) { #define TEST_SIZE sizeof(simple_test_with_emoji) // Type pairing a string position with a Unicode char struct pos_to_char_map { unsigned int pos; char32_t c32; }; // Buffer for constructing the string char buff[TEST_SIZE]; // A pseudo-random map of the characters in simple_test_with_emoji const struct pos_to_char_map map[] = { { 0, 'l' }, { 0, 'S' }, { 1, 'i' }, { 2, 'm' }, { 4, 0x1f625 }, { 4, '.' }, { 4, 'e' }, { 5, 'T' }, { 3, 'p' }, { 7, 't' }, { 7, 'e' }, { 8, 's' }, { 6, ' ' }, { 0 } }; buff[0] = '\0'; // Construct the string in a pseudo-random fashion const struct pos_to_char_map *p; for (p = map; p->c32 != 0 ; ++p) { if (!utf8_add_char_at(buff, TEST_SIZE, p->c32, p->pos)) { ck_abort_msg("test_utf8_add_char_at: " "Can't insert char %x at pos %u", p->c32, p->pos); } } // Should have reached the buffer size by now ck_assert_int_eq(strlen(buff), TEST_SIZE - 1); // Check the string is what we expect ck_assert_int_eq(strcmp(buff, simple_test_with_emoji), 0); // Try to insert another character if (utf8_add_char_at(buff, TEST_SIZE, ' ', 0)) { ck_abort_msg("test_utf8_add_char_at: " "Insert succeeded but should have failed"); } #undef TEST_SIZE } END_TEST /******************************************************************************/ START_TEST(test_utf8_remove_char_at) { #define TEST_SIZE sizeof(simple_test_with_emoji) // Type pairing a string position with a Unicode char struct pos_to_char_map { unsigned int pos; char32_t c32; }; // Buffer for deconstructing the string char buff[TEST_SIZE]; // A pseudo-random map of the characters in simple_test_with_emoji const struct pos_to_char_map map[] = { { 2, 'm' }, { 7, 'e' }, { 5, ' ' }, { 1, 'i' }, { 2, 'l' }, { 3, 'T' }, { 6, 0x1f625 }, { 2, 'e' }, { 3, 't' }, { 3, '.' }, { 2, 's' }, { 1, 'p' }, { 0, 'S' }, { 0 } }; char32_t c32; strcpy(buff, simple_test_with_emoji); // Deconstruct the string in a pseudo-random fashion const struct pos_to_char_map *p; for (p = map; p->c32 != 0 ; ++p) { c32 = utf8_remove_char_at(buff, p->pos); if (c32 != p->c32) { ck_abort_msg("test_utf8_remove_char_at: " "remove char at pos %u was %x, expected %x", p->pos, c32, p->c32); } } // Should have emptied the buffer by now ck_assert_int_eq(buff[0], '\0'); // Try to remove other characters c32 = utf8_remove_char_at(buff, 0); ck_assert_int_eq(c32, 0); c32 = utf8_remove_char_at(buff, 99); ck_assert_int_eq(c32, 0); ck_assert_int_eq(buff[0], '\0'); #undef TEST_SIZE } END_TEST /******************************************************************************/ Suite * make_suite_test_string_unicode(void) { Suite *s; TCase *tc_unicode; s = suite_create("String"); tc_unicode = tcase_create("Unicode"); suite_add_tcase(s, tc_unicode); tcase_add_test(tc_unicode, test_get_next_char__section_1); tcase_add_test(tc_unicode, test_get_next_char__section_2); tcase_add_test(tc_unicode, test_get_next_char__section_3); tcase_add_test(tc_unicode, test_get_next_char__section_4); tcase_add_test(tc_unicode, test_get_next_char__section_5); tcase_add_test(tc_unicode, test_utf_char32_to_utf8); tcase_add_test(tc_unicode, test_utf8_char_count); tcase_add_test(tc_unicode, test_utf8_as_utf16_word_count); tcase_add_test(tc_unicode, test_utf8_add_char_at); tcase_add_test(tc_unicode, test_utf8_remove_char_at); return s; } xrdp-0.10.1/tests/common/test_common.h000644 001751 000000 00000001133 14652432047 017765 0ustar00metawheel000000 000000 #ifndef TEST_COMMON_H #define TEST_COMMON_H #include char * bin_to_hex(const char *input, int length); Suite *make_suite_test_fifo(void); Suite *make_suite_test_list(void); Suite *make_suite_test_parse(void); Suite *make_suite_test_string(void); Suite *make_suite_test_string_unicode(void); Suite *make_suite_test_os_calls(void); Suite *make_suite_test_ssl_calls(void); Suite *make_suite_test_base64(void); Suite *make_suite_test_guid(void); TCase *make_tcase_test_os_calls_signals(void); void os_calls_signals_init(void); void os_calls_signals_deinit(void); #endif /* TEST_COMMON_H */ xrdp-0.10.1/tests/common/test_list_calls.c000644 001751 000000 00000012665 14652432047 020635 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "list.h" #include "os_calls.h" #include "test_common.h" #include "string_calls.h" #define TEST_LIST_SIZE 1000 START_TEST(test_list__simple) { struct list *lst = list_create(); int i; int val; for (i = 0 ; i < TEST_LIST_SIZE ; ++i) { list_add_item(lst, i); } ck_assert_int_eq(lst->count, TEST_LIST_SIZE); for (i = 0 ; i < TEST_LIST_SIZE ; ++i) { ck_assert_int_eq(lst->items[i], i); // Also check get method val = list_get_item(lst, i); ck_assert_int_eq(val, i); } i = list_index_of(lst, 50); ck_assert_int_eq(i, 50); list_remove_item(lst, 10); ck_assert_int_eq(lst->count, TEST_LIST_SIZE - 1); val = list_get_item(lst, 10); ck_assert_int_eq(val, 11); list_insert_item(lst, 10, 10); ck_assert_int_eq(lst->count, TEST_LIST_SIZE); val = list_get_item(lst, 10); ck_assert_int_eq(val, 10); list_insert_item(lst, 0, 99); ck_assert_int_eq(lst->count, TEST_LIST_SIZE + 1); val = list_get_item(lst, 10); ck_assert_int_eq(val, 9); list_clear(lst); ck_assert_int_eq(lst->count, 0); list_delete(lst); } END_TEST // This needs to be run through valgrind to truly check all memory is // being de-allocated START_TEST(test_list__simple_auto_free) { struct list *lst = list_create(); lst->auto_free = 1; int i; for (i = 0 ; i < TEST_LIST_SIZE ; ++i) { char strval[64]; g_snprintf(strval, sizeof(strval), "%d", i); // Odds, use list_add_item/strdup, evens use list_add_strdup if ((i % 2) != 0) { list_add_item(lst, (tintptr)g_strdup(strval)); } else { list_add_strdup(lst, strval); } } list_remove_item(lst, 0); list_remove_item(lst, 0); list_remove_item(lst, 0); list_remove_item(lst, 0); list_remove_item(lst, 0); ck_assert_int_eq(lst->count, TEST_LIST_SIZE - 5); list_delete(lst); } END_TEST START_TEST(test_list__simple_append_list) { int i; struct list *src = list_create(); struct list *dst = list_create(); src->auto_free = 0; dst->auto_free = 1; list_add_item(src, (tintptr)"6"); list_add_item(src, (tintptr)"7"); list_add_item(src, (tintptr)"8"); list_add_item(src, (tintptr)"9"); list_add_item(src, (tintptr)"10"); list_add_item(src, (tintptr)"11"); list_add_item(dst, (tintptr)g_strdup("0")); list_add_item(dst, (tintptr)g_strdup("1")); list_add_item(dst, (tintptr)g_strdup("2")); list_add_item(dst, (tintptr)g_strdup("3")); list_add_item(dst, (tintptr)g_strdup("4")); list_add_item(dst, (tintptr)g_strdup("5")); list_append_list_strdup(src, dst, 0); ck_assert_int_eq(dst->count, 12); for (i = 0 ; i < dst->count; ++i) { int val = g_atoi((const char *)list_get_item(dst, i)); ck_assert_int_eq(val, i); } list_delete(src); list_clear(dst); // Exercises auto_free code paths in list.c list_delete(dst); } END_TEST START_TEST(test_list__simple_strdup_multi) { int i; struct list *lst = list_create(); lst->auto_free = 1; list_add_strdup_multi(lst, "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", NULL); ck_assert_int_eq(lst->count, 12); for (i = 0 ; i < lst->count; ++i) { int val = g_atoi((const char *)list_get_item(lst, i)); ck_assert_int_eq(val, i); } list_delete(lst); } END_TEST int split_string_append_fragment(const char **start, const char *end, struct list *list); START_TEST(test_list__append_fragment) { struct list *l = list_create(); l->auto_free = 1; const char *test_string = "split this"; int fragment_ret = split_string_append_fragment(&test_string, test_string + 5, l); ck_assert_int_eq(fragment_ret, 1); ck_assert_str_eq((const char *)l->items[0], "split"); fragment_ret = split_string_append_fragment(&test_string, test_string + 1000, l); ck_assert_int_eq(fragment_ret, 1); ck_assert_str_eq((const char *)l->items[1], "this"); list_delete(l); } END_TEST START_TEST(test_list__split_string_into_list) { struct list *l = split_string_into_list("The fat cat sat on my hat.", ' '); ck_assert_int_eq(l->count, 7); ck_assert_str_eq((const char *)l->items[0], "The"); ck_assert_str_eq((const char *)l->items[1], "fat"); ck_assert_str_eq((const char *)l->items[2], "cat"); ck_assert_str_eq((const char *)l->items[3], "sat"); ck_assert_str_eq((const char *)l->items[4], "on"); ck_assert_str_eq((const char *)l->items[5], "my"); ck_assert_str_eq((const char *)l->items[6], "hat."); list_delete(l); } END_TEST /******************************************************************************/ Suite * make_suite_test_list(void) { Suite *s; TCase *tc_simple; s = suite_create("List"); tc_simple = tcase_create("simple"); suite_add_tcase(s, tc_simple); tcase_add_test(tc_simple, test_list__simple); tcase_add_test(tc_simple, test_list__simple_auto_free); tcase_add_test(tc_simple, test_list__simple_append_list); tcase_add_test(tc_simple, test_list__simple_strdup_multi); tcase_add_test(tc_simple, test_list__append_fragment); tcase_add_test(tc_simple, test_list__split_string_into_list); return s; } xrdp-0.10.1/tests/common/Makefile.am000644 001751 000000 00000001306 14652432047 017323 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/common LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh PACKAGE_STRING = "libcommon" TESTS = test_common check_PROGRAMS = test_common test_common_SOURCES = \ test_common.h \ test_common_main.c \ test_fifo_calls.c \ test_list_calls.c \ test_parse.c \ test_string_calls.c \ test_string_calls_unicode.c \ test_os_calls.c \ test_os_calls_signals.c \ test_ssl_calls.c \ test_base64.c \ test_guid.c test_common_CFLAGS = \ @CHECK_CFLAGS@ \ -D TOP_SRCDIR=\"$(top_srcdir)\" test_common_LDADD = \ $(top_builddir)/common/libcommon.la \ @CHECK_LIBS@ xrdp-0.10.1/tests/common/test_guid.c000644 001751 000000 00000005070 14652432047 017424 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "guid.h" #include "ms-rdpbcgr.h" #include "os_calls.h" #include "test_common.h" /******************************************************************************/ START_TEST(test_guid_to_str_remotefx) { /* setup */ char dest[GUID_STR_SIZE]; struct guid guid; g_memcpy(guid.g, XR_CODEC_GUID_REMOTEFX, GUID_SIZE); /* test */ guid_to_str(&guid, dest); /* verify */ ck_assert_str_eq(dest, "76772F12-BD72-4463-AFB3-B73C9C6F7886"); } END_TEST START_TEST(test_guid_to_str_nscodec) { /* setup */ char dest[GUID_STR_SIZE]; struct guid guid; g_memcpy(guid.g, XR_CODEC_GUID_NSCODEC, GUID_SIZE); /* test */ guid_to_str(&guid, dest); /* verify */ ck_assert_str_eq(dest, "CA8D1BB9-000F-154F-589F-AE2D1A87E2D6"); } END_TEST START_TEST(test_guid_to_str_ignore) { /* setup */ char dest[GUID_STR_SIZE]; struct guid guid; g_memcpy(guid.g, XR_CODEC_GUID_IGNORE, GUID_SIZE); /* test */ guid_to_str(&guid, dest); /* verify */ ck_assert_str_eq(dest, "0C4351A6-3535-42AE-910C-CDFCE5760B58"); } END_TEST START_TEST(test_guid_to_str_random) { /* setup */ char dest[GUID_STR_SIZE]; struct guid guid; unsigned int i; for (i = 0 ; i < 100; ++i) { guid = guid_new(); /* test */ guid_to_str(&guid, dest); /* Check all the '-' signs are in the right places */ ck_assert_int_eq(dest[8], '-'); ck_assert_int_eq(dest[13], '-'); ck_assert_int_eq(dest[18], '-'); ck_assert_int_eq(dest[23], '-'); /* Check the variant is RFC4122 */ char c = dest[18 + 1]; /* char after 3rd dash */ if (c != '8' && c != '9' && c != 'A' && c != 'B') { ck_abort_msg("Generated UUID is not RFC4122 compliant"); } /* Check the version is 'randomly generated' */ c = dest[13 + 1]; /* char after 2nd dash */ if (c != '4') { ck_abort_msg("Generated UUID is not RFC4122 randomly-generated"); } } } END_TEST /******************************************************************************/ Suite * make_suite_test_guid(void) { Suite *s; TCase *tc_guid; s = suite_create("GUID"); tc_guid = tcase_create("guid_to_str"); suite_add_tcase(s, tc_guid); tcase_add_test(tc_guid, test_guid_to_str_remotefx); tcase_add_test(tc_guid, test_guid_to_str_nscodec); tcase_add_test(tc_guid, test_guid_to_str_ignore); tcase_add_test(tc_guid, test_guid_to_str_random); return s; } xrdp-0.10.1/tests/common/test_os_calls.c000644 001751 000000 00000034303 14652432047 020274 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include #include #include "os_calls.h" #include "list.h" #include "test_common.h" #ifndef TOP_SRCDIR #define TOP_SRCDIR "." #endif // File for testing ro/rw opens #define RO_RW_FILE "./test_ro_rw" /******************************************************************************/ /*** * Gets the number of open file descriptors for the current process */ static unsigned int get_open_fd_count(void) { unsigned int i; unsigned int rv; // What's the max number of file descriptors? struct rlimit nofile; if (getrlimit(RLIMIT_NOFILE, &nofile) < 0) { const char *errstr = g_get_strerror(); ck_abort_msg("Can't create socketpair [%s]", errstr); } struct pollfd *fds = (struct pollfd *)g_malloc(sizeof(struct pollfd) * nofile.rlim_cur, 0); ck_assert_ptr_nonnull(fds); for (i = 0 ; i < nofile.rlim_cur; ++i) { fds[i].fd = i; fds[i].events = 0; fds[i].revents = 0; } if (poll(fds, nofile.rlim_cur, 0) < 0) { const char *errstr = g_get_strerror(); ck_abort_msg("Can't poll fds [%s]", errstr); } rv = nofile.rlim_cur; for (i = 0 ; i < nofile.rlim_cur; ++i) { if (fds[i].revents == POLLNVAL) { --rv; } } g_free(fds); return rv; } /******************************************************************************/ START_TEST(test_g_file_get_size__returns_file_size) { unsigned long long size; size = g_file_get_size(TOP_SRCDIR "/xrdp/xrdp256.bmp"); ck_assert_int_eq(size, 49278); size = g_file_get_size(TOP_SRCDIR "/xrdp/ad256.bmp"); ck_assert_int_eq(size, 19766); } END_TEST START_TEST(test_g_file_get_size__1GiB) { const char *file = "./file_1GiB.dat"; unsigned int block_size = 4096; unsigned int block_count = 262144; /* C90 5.2.4.2.1 guarantees long long is at least 64 bits */ const long long expected_size = (long long)block_size * block_count; long long size; int system_rv; char cmd[256]; /* Create a sparse file of the expected size with one block of data * at the end */ g_snprintf(cmd, sizeof(cmd), "dd if=/dev/zero of=%s bs=%u seek=%u count=1", file, block_size, block_count - 1); system_rv = system(cmd); size = g_file_get_size(file); g_file_delete(file); ck_assert_int_eq(system_rv, 0); ck_assert_int_eq(size, expected_size); } END_TEST START_TEST(test_g_file_get_size__just_less_than_2GiB) { const char *file = "./file_2GiB.dat"; unsigned int block_size = 4096; unsigned int block_count = 524287; /* 4096 * 52428__8__ = 2GiB */ /* C90 5.2.4.2.1 guarantees long long is at least 64 bits */ const long long expected_size = (long long)block_size * block_count; long long size; int system_rv; char cmd[256]; /* Create a sparse file of the expected size with one block of data * at the end */ g_snprintf(cmd, sizeof(cmd), "dd if=/dev/zero of=%s bs=%u seek=%u count=1", file, block_size, block_count - 1); system_rv = system(cmd); size = g_file_get_size(file); g_file_delete(file); ck_assert_int_eq(system_rv, 0); ck_assert_int_eq(size, expected_size); } END_TEST /* skip these tests until g_file_get_size() supports large files*/ #if 0 START_TEST(test_g_file_get_size__2GiB) { const char *file = "./file_2GiB.dat"; unsigned int block_size = 4096; unsigned int block_count = 524288; /* C90 5.2.4.2.1 guarantees long long is at least 64 bits */ const long long expected_size = (long long)block_size * block_count; long long size; int system_rv; char cmd[256]; /* Create a sparse file of the expected size with one block of data * at the end */ g_snprintf(cmd, sizeof(cmd), "dd if=/dev/zero of=%s bs=%u seek=%u count=1", file, block_size, block_count - 1); system_rv = system(cmd); size = g_file_get_size(file); g_file_delete(file); ck_assert_int_eq(system_rv, 0); ck_assert_int_eq(size, expected_size); } END_TEST START_TEST(test_g_file_get_size__5GiB) { const char *file = "./file_5GiB.dat"; unsigned int block_size = 4096; unsigned int block_count = 1310720; /* C90 5.2.4.2.1 guarantees long long is at least 64 bits */ const long long expected_size = (long long)block_size * block_count; long long size; int system_rv; char cmd[256]; /* Create a sparse file of the expected size with one block of data * at the end */ g_snprintf(cmd, sizeof(cmd), "dd if=/dev/zero of=%s bs=%u seek=%u count=1", file, block_size, block_count - 1); system_rv = system(cmd); size = g_file_get_size(file); g_file_delete(file); ck_assert_int_eq(system_rv, 0); ck_assert_int_eq(size, expected_size); } END_TEST #endif /******************************************************************************/ /* Test we can write to a file which is opened for write */ START_TEST(test_g_file_rw) { const char data[] = "File data\n"; int fd = g_file_open_rw(RO_RW_FILE); ck_assert(fd >= 0); int status = g_file_write(fd, data, sizeof(data) - 1); g_file_close(fd); // Assume no signals have occurred ck_assert_int_eq(status, sizeof(data) - 1); // Leave file in place for test_g_file_ro } END_TEST /******************************************************************************/ /* Test we can't write to a file which is opened read only */ START_TEST(test_g_file_ro) { const char data[] = "File data\n"; int fd = g_file_open_ro(RO_RW_FILE); ck_assert(fd >= 0); int status = g_file_write(fd, data, sizeof(data) - 1); g_file_close(fd); // Write must fail ck_assert_int_lt(status, 0); // Tidy-up (not checked) g_file_delete(RO_RW_FILE); } END_TEST /******************************************************************************/ /* Just test we can set and clear the flag. We don't test its operation */ START_TEST(test_g_file_cloexec) { int flag; int devzerofd = g_file_open_ro("/dev/zero"); ck_assert(devzerofd >= 0); (void)g_file_set_cloexec(devzerofd, 1); flag = g_file_get_cloexec(devzerofd); ck_assert(flag != 0); (void)g_file_set_cloexec(devzerofd, 0); flag = g_file_get_cloexec(devzerofd); ck_assert(flag == 0); g_file_close(devzerofd); } END_TEST /******************************************************************************/ START_TEST(test_g_file_get_open_fds) { int fd_count = get_open_fd_count(); int i; struct list *start_list = g_get_open_fds(0, -1); ck_assert_ptr_ne(start_list, NULL); ck_assert_int_eq(start_list->count, fd_count); // Open another file int devzerofd = g_file_open_ro("/dev/zero"); ck_assert(devzerofd >= 0); // Have we now got one more open file? struct list *open_list = g_get_open_fds(0, -1); ck_assert_ptr_ne(open_list, NULL); ck_assert_int_eq(open_list->count, fd_count + 1); // Check the new file is not in the start list, but is in the open list ck_assert_int_lt(list_index_of(start_list, devzerofd), 0); ck_assert_int_ge(list_index_of(open_list, devzerofd), 0); g_file_close(devzerofd); struct list *finish_list = g_get_open_fds(0, -1); ck_assert_ptr_ne(finish_list, NULL); // start list same as finish list? ck_assert_int_eq(finish_list->count, fd_count); for (i = 0 ; i < start_list->count; ++i) { ck_assert_int_eq((int)finish_list->items[i], (int)start_list->items[i]); } list_delete(start_list); list_delete(open_list); list_delete(finish_list); } END_TEST /******************************************************************************/ START_TEST(test_g_file_is_open) { int devzerofd = g_file_open_ro("/dev/zero"); ck_assert(devzerofd >= 0); // Check open file comes up as open ck_assert_int_ne(g_file_is_open(devzerofd), 0); g_file_close(devzerofd); // Check the now-closed file no longer registers as open ck_assert_int_eq(g_file_is_open(devzerofd), 0); } END_TEST /******************************************************************************/ START_TEST(test_g_sck_fd_passing) { int sck[2]; char buff[16]; int istatus; unsigned int fdcount; int devzerofd = g_file_open_ro("/dev/zero"); ck_assert(devzerofd >= 0); if (g_sck_local_socketpair(sck) != 0) { const char *errstr = g_get_strerror(); g_file_close(devzerofd); ck_abort_msg("Can't create socketpair [%s]", errstr); } // Pass the fd for /dev/zero to sck[0]... istatus = g_sck_send_fd_set(sck[0], "?", 1, &devzerofd, 1); if (istatus != 1) { const char *errstr = g_get_strerror(); g_file_close(devzerofd); g_file_close(sck[0]); g_file_close(sck[1]); ck_abort_msg("Can't send fd set [%s]", errstr); } // We can now close the fd for /dev/zero, as it's "in flight" g_file_close(devzerofd); devzerofd = -1; // Read the fd for /dev/zero from sck[1] fdcount = -1; istatus = g_sck_recv_fd_set(sck[1], buff, sizeof(buff), &devzerofd, 1, &fdcount); if (istatus != 1) { const char *errstr = g_get_strerror(); g_file_close(sck[0]); g_file_close(sck[1]); ck_abort_msg("Can't receive fd set [%s]", errstr); } // Don't need the socket pair any more g_file_close(sck[0]); g_file_close(sck[1]); // We should have got 1 fd back, and received a data byte of '?' if (fdcount != 1) { g_file_close(devzerofd); ck_abort_msg("Should have 1 fd, got %u", fdcount); } if (buff[0] != '?') { g_file_close(devzerofd); ck_abort_msg("Should have received '?' in buffer"); } // Does the fd for /dev/zero work? istatus = g_file_read(devzerofd, buff, 1); if (istatus != 1) { const char *errstr = g_get_strerror(); g_file_close(devzerofd); ck_abort_msg("Can't read from /dev/zero fd %d [%s]", devzerofd, errstr); } g_file_close(devzerofd); ck_assert_int_eq(buff[0], '\0'); } END_TEST START_TEST(test_g_sck_fd_overflow) { int sck[2]; char buff[16]; int istatus; unsigned int fdcount; int devzerofd[2]; // Count the number of file descriptors for the process unsigned int base_fd_count = get_open_fd_count(); unsigned int proc_fd_count; // Open a couple of file descriptors to /dev/zero devzerofd[0] = g_file_open_ro("/dev/zero"); devzerofd[1] = g_file_open_ro("/dev/zero"); ck_assert(devzerofd[0] >= 0); ck_assert(devzerofd[1] >= 0); proc_fd_count = get_open_fd_count(); ck_assert_int_eq(proc_fd_count, base_fd_count + 2); if (g_sck_local_socketpair(sck) != 0) { const char *errstr = g_get_strerror(); g_file_close(devzerofd[0]); g_file_close(devzerofd[1]); ck_abort_msg("Can't create socketpair [%s]", errstr); } proc_fd_count = get_open_fd_count(); ck_assert_int_eq(proc_fd_count, base_fd_count + 4); // Pass the /dev/zero fds to sck[0]... istatus = g_sck_send_fd_set(sck[0], "?", 1, devzerofd, 2); if (istatus != 1) { const char *errstr = g_get_strerror(); g_file_close(devzerofd[0]); g_file_close(devzerofd[1]); g_file_close(sck[0]); g_file_close(sck[1]); ck_abort_msg("Can't send fd set [%s]", errstr); } // We can now close fds for /dev/zero, as they are "in flight" g_file_close(devzerofd[0]); g_file_close(devzerofd[1]); devzerofd[0] = -1; devzerofd[1] = -1; proc_fd_count = get_open_fd_count(); ck_assert_int_eq(proc_fd_count, base_fd_count + 2); // Read one fd for /dev/zero from sck[1] fdcount = -1; istatus = g_sck_recv_fd_set(sck[1], buff, sizeof(buff), &devzerofd[0], 1, &fdcount); if (istatus != 1) { const char *errstr = g_get_strerror(); g_file_close(sck[0]); g_file_close(sck[1]); ck_abort_msg("Can't receive fd set [%s]", errstr); } // We should now have just ONE more file descriptor proc_fd_count = get_open_fd_count(); ck_assert_int_eq(proc_fd_count, base_fd_count + 3); // Don't need the socket pair any more g_file_close(sck[0]); g_file_close(sck[1]); proc_fd_count = get_open_fd_count(); ck_assert_int_eq(proc_fd_count, base_fd_count + 1); // Does the fd for /dev/zero work? istatus = g_file_read(devzerofd[0], buff, 1); if (istatus != 1) { const char *errstr = g_get_strerror(); g_file_close(devzerofd[0]); ck_abort_msg("Can't read from /dev/zero fd %d [%s]", devzerofd[0], errstr); } ck_assert_int_eq(buff[0], '\0'); g_file_close(devzerofd[0]); proc_fd_count = get_open_fd_count(); ck_assert_int_eq(proc_fd_count, base_fd_count); } END_TEST /******************************************************************************/ Suite * make_suite_test_os_calls(void) { Suite *s; TCase *tc_os_calls; s = suite_create("OS-Calls"); tc_os_calls = tcase_create("oscalls-file"); suite_add_tcase(s, tc_os_calls); tcase_add_test(tc_os_calls, test_g_file_get_size__returns_file_size); tcase_add_test(tc_os_calls, test_g_file_get_size__1GiB); tcase_add_test(tc_os_calls, test_g_file_get_size__just_less_than_2GiB); #if 0 tcase_add_test(tc_os_calls, test_g_file_get_size__2GiB); tcase_add_test(tc_os_calls, test_g_file_get_size__5GiB); #endif tcase_add_test(tc_os_calls, test_g_file_rw); tcase_add_test(tc_os_calls, test_g_file_ro); // Must follow test_g_file_rw tcase_add_test(tc_os_calls, test_g_file_cloexec); tcase_add_test(tc_os_calls, test_g_file_get_open_fds); tcase_add_test(tc_os_calls, test_g_file_is_open); tcase_add_test(tc_os_calls, test_g_sck_fd_passing); tcase_add_test(tc_os_calls, test_g_sck_fd_overflow); // Add other test cases in other files suite_add_tcase(s, make_tcase_test_os_calls_signals()); return s; } xrdp-0.10.1/tests/common/test_ssl_calls.c000644 001751 000000 00000035760 14652432047 020464 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "os_calls.h" #include "string_calls.h" #include "ssl_calls.h" #include "test_common.h" /* Time to allow RSA-based test suites to run on older, slower platforms * * These platforms are most often seen on build farms (e.g. Debian CI) */ #define RSA_BASED_TEST_SUITE_TIMEOUT 60 START_TEST(test_rc4_enc_ok) { const char *key = "16_byte_key-----"; char text[] = "xrdp-test-suite-rc4-encryption"; char *result; void *info = ssl_rc4_info_create(); ssl_rc4_set_key(info, key, g_strlen(key)); ssl_rc4_crypt(info, text, sizeof(text) - 1); ssl_rc4_info_delete(info); result = bin_to_hex(text, sizeof(text) - 1); ck_assert(result != NULL); /* Result should be the same as * echo -n '' | \ * openssl rc4 -K -e [-provider legacy] | \ * xxd -g0 * * where is the string above in hexadecimal */ ck_assert_str_eq(result, "c080f175b2d85802dbf1042f07180ddc4be1d9bd4a44158f0aebf11c961b"); g_free(result); } END_TEST START_TEST(test_rc4_enc_tv0_ok) { /* * This is one of the 5 original RC4 test vectors posted in response to * the 'RC4 Algorithm revealed' sci.crypt usenet posting */ unsigned char key[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}; unsigned char text[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}; const char *expected = "75b7878099e0c596"; char *result; void *info = ssl_rc4_info_create(); ssl_rc4_set_key(info, (char *)key, sizeof(key)); ssl_rc4_crypt(info, (char *)text, sizeof(text)); ssl_rc4_info_delete(info); result = bin_to_hex((char *)text, sizeof(text)); ck_assert(result != NULL); ck_assert_str_eq(result, expected); g_free(result); } END_TEST START_TEST(test_rc4_enc_tv1_ok) { /* * This is one of the 5 original RC4 test vectors posted in response to * the 'RC4 Algorithm revealed' sci.crypt usenet posting */ unsigned char key[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}; unsigned char text[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; const char *expected = "7494c2e7104b0879"; char *result; void *info = ssl_rc4_info_create(); ssl_rc4_set_key(info, (char *)key, sizeof(key)); ssl_rc4_crypt(info, (char *)text, sizeof(text)); ssl_rc4_info_delete(info); result = bin_to_hex((char *)text, sizeof(text)); ck_assert(result != NULL); ck_assert_str_eq(result, expected); g_free(result); } END_TEST START_TEST(test_rc4_enc_tv2_ok) { /* * This is one of the 5 original RC4 test vectors posted in response to * the 'RC4 Algorithm revealed' sci.crypt usenet posting */ unsigned char key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; unsigned char text[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; const char *expected = "de188941a3375d3a"; char *result; void *info = ssl_rc4_info_create(); ssl_rc4_set_key(info, (char *)key, sizeof(key)); ssl_rc4_crypt(info, (char *)text, sizeof(text)); ssl_rc4_info_delete(info); result = bin_to_hex((char *)text, sizeof(text)); ck_assert(result != NULL); ck_assert_str_eq(result, expected); g_free(result); } END_TEST START_TEST(test_rc4_enc_tv3_ok) { /* * This is one of the 5 original RC4 test vectors posted in response to * the 'RC4 Algorithm revealed' sci.crypt usenet posting */ unsigned char key[] = {0xef, 0x01, 0x23, 0x45}; unsigned char text[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; const char *expected = "d6a141a7ec3c38dfbd61"; char *result; void *info = ssl_rc4_info_create(); ssl_rc4_set_key(info, (char *)key, sizeof(key)); ssl_rc4_crypt(info, (char *)text, sizeof(text)); ssl_rc4_info_delete(info); result = bin_to_hex((char *)text, sizeof(text)); ck_assert(result != NULL); ck_assert_str_eq(result, expected); g_free(result); } END_TEST START_TEST(test_rc4_enc_tv4_ok) { /* * This is one of the 5 original RC4 test vectors posted in response to * the 'RC4 Algorithm revealed' sci.crypt usenet posting */ unsigned char key[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}; unsigned char text[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }; const char *expected = "7595c3e6114a09780c4ad452338e1ffd9a1be9498f813d76533449b6778dca" "d8c78a8d2ba9ac66085d0e53d59c26c2d1c490c1ebbe0ce66d1b6b1b13b6" "b919b847c25a91447a95e75e4ef16779cde8bf0a95850e32af9689444fd3" "77108f98fdcbd4e726567500990bcc7e0ca3c4aaa304a387d20f3b8fbbcd" "42a1bd311d7a4303dda5ab078896ae80c18b0af66dff319616eb784e495a" "d2ce90d7f772a81747b65f62093b1e0db9e5ba532fafec47508323e67132" "7df9444432cb7367cec82f5d44c0d00b67d650a075cd4b70dedd77eb9b10" "231b6b5b741347396d62897421d43df9b42e446e358e9c11a9b2184ecbef" "0cd8e7a877ef968f1390ec9b3d35a5585cb009290e2fcde7b5ec66d9084b" "e44055a619d9dd7fc3166f9487f7cb272912426445998514c15d53a18c86" "4ce3a2b7555793988126520eacf2e3066e230c91bee4dd5304f5fd0405b3" "5bd99c73135d3d9bc335ee049ef69b3867bf2d7bd1eaa595d8bfc0066ff8" "d31509eb0c6caa006c807a623ef84c3d33c195d23ee320c40de0558157c8" "22d4b8c569d849aed59d4e0fd7f379586b4b7ff684ed6a189f7486d49b9c" "4bad9ba24b96abf924372c8a8fffb10d55354900a77a3db5f205e1b99fcd" "8660863a159ad4abe40fa48934163ddde542a6585540fd683cbfd8c00f12" "129a284deacc4cdefe58be7137541c047126c8d49e2755ab181ab7e940b0c0"; char *result; void *info = ssl_rc4_info_create(); ssl_rc4_set_key(info, (char *)key, sizeof(key)); ssl_rc4_crypt(info, (char *)text, sizeof(text)); ssl_rc4_info_delete(info); result = bin_to_hex((char *)text, sizeof(text)); ck_assert(result != NULL); ck_assert_str_eq(result, expected); g_free(result); } END_TEST START_TEST(test_sha1_hash_ok) { const char *hash_string = "xrdp-test-suite-sha1-hash"; char digest[20]; char *result1; char *result2; void *info = ssl_sha1_info_create(); ssl_sha1_clear(info); ssl_sha1_transform(info, hash_string, g_strlen(hash_string)); ssl_sha1_complete(info, digest); result1 = bin_to_hex(digest, sizeof(digest)); ck_assert(result1 != NULL); /* Check result with echo -n '' | sha1sum */ ck_assert_str_eq(result1, "3ea0ae84e97e6262c7cfe79ccd7ad2094c06885d"); /* Check a clear has the desired effect */ ssl_sha1_clear(info); ssl_sha1_transform(info, hash_string, g_strlen(hash_string)); ssl_sha1_complete(info, digest); result2 = bin_to_hex(digest, sizeof(digest)); ck_assert(result2 != NULL); ck_assert_str_eq(result1, result2); ssl_sha1_info_delete(info); g_free(result1); g_free(result2); } END_TEST START_TEST(test_md5_hash_ok) { const char *hash_string = "xrdp-test-suite-md5-hash"; char digest[16]; char *result1; char *result2; void *info = ssl_md5_info_create(); ssl_md5_clear(info); ssl_md5_transform(info, hash_string, g_strlen(hash_string)); ssl_md5_complete(info, digest); result1 = bin_to_hex(digest, sizeof(digest)); ck_assert(result1 != NULL); /* Check result with echo -n '' | md5sum */ ck_assert_str_eq(result1, "ddc599dc7ec62b8f78760b071704c007"); /* Check a clear has the desired effect */ ssl_md5_clear(info); ssl_md5_transform(info, hash_string, g_strlen(hash_string)); ssl_md5_complete(info, digest); result2 = bin_to_hex(digest, sizeof(digest)); ck_assert(result2 != NULL); ck_assert_str_eq(result1, result2); ssl_md5_info_delete(info); g_free(result1); g_free(result2); } END_TEST START_TEST(test_des3_enc_ok) { const char *key = "24_byte_key-------------"; char plaintext[] = "xrdp-test-suite-des3-encryption-must-be-multiple-of-8-chars-long--------"; char ciphertext[sizeof(plaintext) - 1]; /* No terminator needed */ char plaintext2[sizeof(plaintext)]; char *result; void *info = ssl_des3_encrypt_info_create(key, 0); ssl_des3_encrypt(info, sizeof(plaintext) - 1, plaintext, ciphertext); ssl_des3_info_delete(info); result = bin_to_hex(ciphertext, sizeof(ciphertext)); ck_assert(result != NULL); /* Result should be the same as * echo -n '' | \ * openssl des3 -iv 0000000000000000 -K -e -nopad | \ * od -t x1 * * where is the string above in hexadecimal */ ck_assert_str_eq(result, "856d70861827365e188781616e4f9dcc3009b2c5dc7785edcbc05fa825a4ea5e10b23735c0e971ca20f895f455b8845418963af6dd8e649719790eed6cbcee0fb97b743c60e32e8b"); g_free(result); /* Let's go back again */ info = ssl_des3_decrypt_info_create(key, 0); ssl_des3_decrypt(info, sizeof(ciphertext), ciphertext, plaintext2); ssl_des3_info_delete(info); plaintext2[sizeof(plaintext2) - 1] = '\0'; ck_assert_str_eq(plaintext, plaintext2); } END_TEST START_TEST(test_hmac_sha1_dgst_ok) { const char *key = "20_byte_key---------"; const char *hash_string = "xrdp-test-suite-hmac-sha1-dgst"; char hmac[20]; char *result; void *info = ssl_hmac_info_create(); ssl_hmac_sha1_init(info, key, g_strlen(key)); ssl_hmac_transform(info, hash_string, g_strlen(hash_string)); ssl_hmac_complete(info, hmac, sizeof(hmac)); ssl_hmac_info_delete(info); result = bin_to_hex(hmac, sizeof(hmac)); ck_assert(result != NULL); /* Result should be the same as * echo -n '' | openssl dgst -sha1 -hmac '' * * or:- * * echo -n '' | openssl mac -digest sha1 -macopt key:'' hmac */ ck_assert_str_eq(result, "af8c04e609e9f3cba53ad7815b60160dc69a9936"); g_free(result); } END_TEST START_TEST(test_gen_key_xrdp1) { #define RSA_TEST_BITS 2048 char modulus[RSA_TEST_BITS / 8] = {0}; char private_key[RSA_TEST_BITS / 8] = {0}; unsigned char exponent[4] = { 0x01, 0x00, 0x01, 0x00 /* 65537 in little-endian format */ }; /* * We can't do much here because of the nature of the call, but we can * at least check it completes without error */ int error; error = ssl_gen_key_xrdp1(RSA_TEST_BITS, (const char *)exponent, sizeof(exponent), modulus, sizeof(modulus), private_key, sizeof(private_key)); ck_assert(error == 0); /* Both the modulus and the privatekey should be odd */ ck_assert((modulus[0] & 1) == 1); ck_assert((private_key[0] & 1) == 1); #undef RSA_TEST_BITS } END_TEST /******************************************************************************/ Suite * make_suite_test_ssl_calls(void) { Suite *s; TCase *tc; s = suite_create("SSL-Calls"); tc = tcase_create("ssl_calls_rc4"); suite_add_tcase(s, tc); tcase_add_test(tc, test_rc4_enc_ok); tcase_add_test(tc, test_rc4_enc_tv0_ok); tcase_add_test(tc, test_rc4_enc_tv1_ok); tcase_add_test(tc, test_rc4_enc_tv2_ok); tcase_add_test(tc, test_rc4_enc_tv3_ok); tcase_add_test(tc, test_rc4_enc_tv4_ok); tc = tcase_create("ssl_calls_sha1"); suite_add_tcase(s, tc); tcase_add_test(tc, test_sha1_hash_ok); tc = tcase_create("ssl_calls_md5"); suite_add_tcase(s, tc); tcase_add_test(tc, test_md5_hash_ok); tc = tcase_create("ssl_calls_des3"); suite_add_tcase(s, tc); tcase_add_test(tc, test_des3_enc_ok); tc = tcase_create("ssl_calls_hmac_sha1"); suite_add_tcase(s, tc); tcase_add_test(tc, test_hmac_sha1_dgst_ok); tc = tcase_create("ssl_calls_rsa_key"); suite_add_tcase(s, tc); tcase_set_timeout(tc, RSA_BASED_TEST_SUITE_TIMEOUT); tcase_add_test(tc, test_gen_key_xrdp1); return s; } xrdp-0.10.1/tests/common/Makefile.in000644 001751 000000 00000167627 14652432075 017360 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ TESTS = test_common$(EXEEXT) check_PROGRAMS = test_common$(EXEEXT) subdir = tests/common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_test_common_OBJECTS = test_common-test_common_main.$(OBJEXT) \ test_common-test_fifo_calls.$(OBJEXT) \ test_common-test_list_calls.$(OBJEXT) \ test_common-test_parse.$(OBJEXT) \ test_common-test_string_calls.$(OBJEXT) \ test_common-test_string_calls_unicode.$(OBJEXT) \ test_common-test_os_calls.$(OBJEXT) \ test_common-test_os_calls_signals.$(OBJEXT) \ test_common-test_ssl_calls.$(OBJEXT) \ test_common-test_base64.$(OBJEXT) \ test_common-test_guid.$(OBJEXT) test_common_OBJECTS = $(am_test_common_OBJECTS) test_common_DEPENDENCIES = $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_common_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_common_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test_common-test_base64.Po \ ./$(DEPDIR)/test_common-test_common_main.Po \ ./$(DEPDIR)/test_common-test_fifo_calls.Po \ ./$(DEPDIR)/test_common-test_guid.Po \ ./$(DEPDIR)/test_common-test_list_calls.Po \ ./$(DEPDIR)/test_common-test_os_calls.Po \ ./$(DEPDIR)/test_common-test_os_calls_signals.Po \ ./$(DEPDIR)/test_common-test_parse.Po \ ./$(DEPDIR)/test_common-test_ssl_calls.Po \ ./$(DEPDIR)/test_common-test_string_calls.Po \ ./$(DEPDIR)/test_common-test_string_calls_unicode.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(test_common_SOURCES) DIST_SOURCES = $(test_common_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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = "libcommon" PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/common LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh test_common_SOURCES = \ test_common.h \ test_common_main.c \ test_fifo_calls.c \ test_list_calls.c \ test_parse.c \ test_string_calls.c \ test_string_calls_unicode.c \ test_os_calls.c \ test_os_calls_signals.c \ test_ssl_calls.c \ test_base64.c \ test_guid.c test_common_CFLAGS = \ @CHECK_CFLAGS@ \ -D TOP_SRCDIR=\"$(top_srcdir)\" test_common_LDADD = \ $(top_builddir)/common/libcommon.la \ @CHECK_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/common/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) test_common$(EXEEXT): $(test_common_OBJECTS) $(test_common_DEPENDENCIES) $(EXTRA_test_common_DEPENDENCIES) @rm -f test_common$(EXEEXT) $(AM_V_CCLD)$(test_common_LINK) $(test_common_OBJECTS) $(test_common_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_common_main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_fifo_calls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_guid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_list_calls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_os_calls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_os_calls_signals.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_ssl_calls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_string_calls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_common-test_string_calls_unicode.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_common-test_common_main.o: test_common_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_common_main.o -MD -MP -MF $(DEPDIR)/test_common-test_common_main.Tpo -c -o test_common-test_common_main.o `test -f 'test_common_main.c' || echo '$(srcdir)/'`test_common_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_common_main.Tpo $(DEPDIR)/test_common-test_common_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_common_main.c' object='test_common-test_common_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_common_main.o `test -f 'test_common_main.c' || echo '$(srcdir)/'`test_common_main.c test_common-test_common_main.obj: test_common_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_common_main.obj -MD -MP -MF $(DEPDIR)/test_common-test_common_main.Tpo -c -o test_common-test_common_main.obj `if test -f 'test_common_main.c'; then $(CYGPATH_W) 'test_common_main.c'; else $(CYGPATH_W) '$(srcdir)/test_common_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_common_main.Tpo $(DEPDIR)/test_common-test_common_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_common_main.c' object='test_common-test_common_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_common_main.obj `if test -f 'test_common_main.c'; then $(CYGPATH_W) 'test_common_main.c'; else $(CYGPATH_W) '$(srcdir)/test_common_main.c'; fi` test_common-test_fifo_calls.o: test_fifo_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_fifo_calls.o -MD -MP -MF $(DEPDIR)/test_common-test_fifo_calls.Tpo -c -o test_common-test_fifo_calls.o `test -f 'test_fifo_calls.c' || echo '$(srcdir)/'`test_fifo_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_fifo_calls.Tpo $(DEPDIR)/test_common-test_fifo_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_fifo_calls.c' object='test_common-test_fifo_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_fifo_calls.o `test -f 'test_fifo_calls.c' || echo '$(srcdir)/'`test_fifo_calls.c test_common-test_fifo_calls.obj: test_fifo_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_fifo_calls.obj -MD -MP -MF $(DEPDIR)/test_common-test_fifo_calls.Tpo -c -o test_common-test_fifo_calls.obj `if test -f 'test_fifo_calls.c'; then $(CYGPATH_W) 'test_fifo_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_fifo_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_fifo_calls.Tpo $(DEPDIR)/test_common-test_fifo_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_fifo_calls.c' object='test_common-test_fifo_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_fifo_calls.obj `if test -f 'test_fifo_calls.c'; then $(CYGPATH_W) 'test_fifo_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_fifo_calls.c'; fi` test_common-test_list_calls.o: test_list_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_list_calls.o -MD -MP -MF $(DEPDIR)/test_common-test_list_calls.Tpo -c -o test_common-test_list_calls.o `test -f 'test_list_calls.c' || echo '$(srcdir)/'`test_list_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_list_calls.Tpo $(DEPDIR)/test_common-test_list_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_list_calls.c' object='test_common-test_list_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_list_calls.o `test -f 'test_list_calls.c' || echo '$(srcdir)/'`test_list_calls.c test_common-test_list_calls.obj: test_list_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_list_calls.obj -MD -MP -MF $(DEPDIR)/test_common-test_list_calls.Tpo -c -o test_common-test_list_calls.obj `if test -f 'test_list_calls.c'; then $(CYGPATH_W) 'test_list_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_list_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_list_calls.Tpo $(DEPDIR)/test_common-test_list_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_list_calls.c' object='test_common-test_list_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_list_calls.obj `if test -f 'test_list_calls.c'; then $(CYGPATH_W) 'test_list_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_list_calls.c'; fi` test_common-test_parse.o: test_parse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_parse.o -MD -MP -MF $(DEPDIR)/test_common-test_parse.Tpo -c -o test_common-test_parse.o `test -f 'test_parse.c' || echo '$(srcdir)/'`test_parse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_parse.Tpo $(DEPDIR)/test_common-test_parse.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_parse.c' object='test_common-test_parse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_parse.o `test -f 'test_parse.c' || echo '$(srcdir)/'`test_parse.c test_common-test_parse.obj: test_parse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_parse.obj -MD -MP -MF $(DEPDIR)/test_common-test_parse.Tpo -c -o test_common-test_parse.obj `if test -f 'test_parse.c'; then $(CYGPATH_W) 'test_parse.c'; else $(CYGPATH_W) '$(srcdir)/test_parse.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_parse.Tpo $(DEPDIR)/test_common-test_parse.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_parse.c' object='test_common-test_parse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_parse.obj `if test -f 'test_parse.c'; then $(CYGPATH_W) 'test_parse.c'; else $(CYGPATH_W) '$(srcdir)/test_parse.c'; fi` test_common-test_string_calls.o: test_string_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_string_calls.o -MD -MP -MF $(DEPDIR)/test_common-test_string_calls.Tpo -c -o test_common-test_string_calls.o `test -f 'test_string_calls.c' || echo '$(srcdir)/'`test_string_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_string_calls.Tpo $(DEPDIR)/test_common-test_string_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_string_calls.c' object='test_common-test_string_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_string_calls.o `test -f 'test_string_calls.c' || echo '$(srcdir)/'`test_string_calls.c test_common-test_string_calls.obj: test_string_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_string_calls.obj -MD -MP -MF $(DEPDIR)/test_common-test_string_calls.Tpo -c -o test_common-test_string_calls.obj `if test -f 'test_string_calls.c'; then $(CYGPATH_W) 'test_string_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_string_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_string_calls.Tpo $(DEPDIR)/test_common-test_string_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_string_calls.c' object='test_common-test_string_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_string_calls.obj `if test -f 'test_string_calls.c'; then $(CYGPATH_W) 'test_string_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_string_calls.c'; fi` test_common-test_string_calls_unicode.o: test_string_calls_unicode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_string_calls_unicode.o -MD -MP -MF $(DEPDIR)/test_common-test_string_calls_unicode.Tpo -c -o test_common-test_string_calls_unicode.o `test -f 'test_string_calls_unicode.c' || echo '$(srcdir)/'`test_string_calls_unicode.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_string_calls_unicode.Tpo $(DEPDIR)/test_common-test_string_calls_unicode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_string_calls_unicode.c' object='test_common-test_string_calls_unicode.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_string_calls_unicode.o `test -f 'test_string_calls_unicode.c' || echo '$(srcdir)/'`test_string_calls_unicode.c test_common-test_string_calls_unicode.obj: test_string_calls_unicode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_string_calls_unicode.obj -MD -MP -MF $(DEPDIR)/test_common-test_string_calls_unicode.Tpo -c -o test_common-test_string_calls_unicode.obj `if test -f 'test_string_calls_unicode.c'; then $(CYGPATH_W) 'test_string_calls_unicode.c'; else $(CYGPATH_W) '$(srcdir)/test_string_calls_unicode.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_string_calls_unicode.Tpo $(DEPDIR)/test_common-test_string_calls_unicode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_string_calls_unicode.c' object='test_common-test_string_calls_unicode.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_string_calls_unicode.obj `if test -f 'test_string_calls_unicode.c'; then $(CYGPATH_W) 'test_string_calls_unicode.c'; else $(CYGPATH_W) '$(srcdir)/test_string_calls_unicode.c'; fi` test_common-test_os_calls.o: test_os_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_os_calls.o -MD -MP -MF $(DEPDIR)/test_common-test_os_calls.Tpo -c -o test_common-test_os_calls.o `test -f 'test_os_calls.c' || echo '$(srcdir)/'`test_os_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_os_calls.Tpo $(DEPDIR)/test_common-test_os_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_os_calls.c' object='test_common-test_os_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_os_calls.o `test -f 'test_os_calls.c' || echo '$(srcdir)/'`test_os_calls.c test_common-test_os_calls.obj: test_os_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_os_calls.obj -MD -MP -MF $(DEPDIR)/test_common-test_os_calls.Tpo -c -o test_common-test_os_calls.obj `if test -f 'test_os_calls.c'; then $(CYGPATH_W) 'test_os_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_os_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_os_calls.Tpo $(DEPDIR)/test_common-test_os_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_os_calls.c' object='test_common-test_os_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_os_calls.obj `if test -f 'test_os_calls.c'; then $(CYGPATH_W) 'test_os_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_os_calls.c'; fi` test_common-test_os_calls_signals.o: test_os_calls_signals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_os_calls_signals.o -MD -MP -MF $(DEPDIR)/test_common-test_os_calls_signals.Tpo -c -o test_common-test_os_calls_signals.o `test -f 'test_os_calls_signals.c' || echo '$(srcdir)/'`test_os_calls_signals.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_os_calls_signals.Tpo $(DEPDIR)/test_common-test_os_calls_signals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_os_calls_signals.c' object='test_common-test_os_calls_signals.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_os_calls_signals.o `test -f 'test_os_calls_signals.c' || echo '$(srcdir)/'`test_os_calls_signals.c test_common-test_os_calls_signals.obj: test_os_calls_signals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_os_calls_signals.obj -MD -MP -MF $(DEPDIR)/test_common-test_os_calls_signals.Tpo -c -o test_common-test_os_calls_signals.obj `if test -f 'test_os_calls_signals.c'; then $(CYGPATH_W) 'test_os_calls_signals.c'; else $(CYGPATH_W) '$(srcdir)/test_os_calls_signals.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_os_calls_signals.Tpo $(DEPDIR)/test_common-test_os_calls_signals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_os_calls_signals.c' object='test_common-test_os_calls_signals.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_os_calls_signals.obj `if test -f 'test_os_calls_signals.c'; then $(CYGPATH_W) 'test_os_calls_signals.c'; else $(CYGPATH_W) '$(srcdir)/test_os_calls_signals.c'; fi` test_common-test_ssl_calls.o: test_ssl_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_ssl_calls.o -MD -MP -MF $(DEPDIR)/test_common-test_ssl_calls.Tpo -c -o test_common-test_ssl_calls.o `test -f 'test_ssl_calls.c' || echo '$(srcdir)/'`test_ssl_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_ssl_calls.Tpo $(DEPDIR)/test_common-test_ssl_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ssl_calls.c' object='test_common-test_ssl_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_ssl_calls.o `test -f 'test_ssl_calls.c' || echo '$(srcdir)/'`test_ssl_calls.c test_common-test_ssl_calls.obj: test_ssl_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_ssl_calls.obj -MD -MP -MF $(DEPDIR)/test_common-test_ssl_calls.Tpo -c -o test_common-test_ssl_calls.obj `if test -f 'test_ssl_calls.c'; then $(CYGPATH_W) 'test_ssl_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_ssl_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_ssl_calls.Tpo $(DEPDIR)/test_common-test_ssl_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ssl_calls.c' object='test_common-test_ssl_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_ssl_calls.obj `if test -f 'test_ssl_calls.c'; then $(CYGPATH_W) 'test_ssl_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_ssl_calls.c'; fi` test_common-test_base64.o: test_base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_base64.o -MD -MP -MF $(DEPDIR)/test_common-test_base64.Tpo -c -o test_common-test_base64.o `test -f 'test_base64.c' || echo '$(srcdir)/'`test_base64.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_base64.Tpo $(DEPDIR)/test_common-test_base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_base64.c' object='test_common-test_base64.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_base64.o `test -f 'test_base64.c' || echo '$(srcdir)/'`test_base64.c test_common-test_base64.obj: test_base64.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_base64.obj -MD -MP -MF $(DEPDIR)/test_common-test_base64.Tpo -c -o test_common-test_base64.obj `if test -f 'test_base64.c'; then $(CYGPATH_W) 'test_base64.c'; else $(CYGPATH_W) '$(srcdir)/test_base64.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_base64.Tpo $(DEPDIR)/test_common-test_base64.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_base64.c' object='test_common-test_base64.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_base64.obj `if test -f 'test_base64.c'; then $(CYGPATH_W) 'test_base64.c'; else $(CYGPATH_W) '$(srcdir)/test_base64.c'; fi` test_common-test_guid.o: test_guid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_guid.o -MD -MP -MF $(DEPDIR)/test_common-test_guid.Tpo -c -o test_common-test_guid.o `test -f 'test_guid.c' || echo '$(srcdir)/'`test_guid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_guid.Tpo $(DEPDIR)/test_common-test_guid.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_guid.c' object='test_common-test_guid.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_guid.o `test -f 'test_guid.c' || echo '$(srcdir)/'`test_guid.c test_common-test_guid.obj: test_guid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -MT test_common-test_guid.obj -MD -MP -MF $(DEPDIR)/test_common-test_guid.Tpo -c -o test_common-test_guid.obj `if test -f 'test_guid.c'; then $(CYGPATH_W) 'test_guid.c'; else $(CYGPATH_W) '$(srcdir)/test_guid.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_common-test_guid.Tpo $(DEPDIR)/test_common-test_guid.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_guid.c' object='test_common-test_guid.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_common_CFLAGS) $(CFLAGS) -c -o test_common-test_guid.obj `if test -f 'test_guid.c'; then $(CYGPATH_W) 'test_guid.c'; else $(CYGPATH_W) '$(srcdir)/test_guid.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_common.log: test_common$(EXEEXT) @p='test_common$(EXEEXT)'; \ b='test_common'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test_common-test_base64.Po -rm -f ./$(DEPDIR)/test_common-test_common_main.Po -rm -f ./$(DEPDIR)/test_common-test_fifo_calls.Po -rm -f ./$(DEPDIR)/test_common-test_guid.Po -rm -f ./$(DEPDIR)/test_common-test_list_calls.Po -rm -f ./$(DEPDIR)/test_common-test_os_calls.Po -rm -f ./$(DEPDIR)/test_common-test_os_calls_signals.Po -rm -f ./$(DEPDIR)/test_common-test_parse.Po -rm -f ./$(DEPDIR)/test_common-test_ssl_calls.Po -rm -f ./$(DEPDIR)/test_common-test_string_calls.Po -rm -f ./$(DEPDIR)/test_common-test_string_calls_unicode.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/test_common-test_base64.Po -rm -f ./$(DEPDIR)/test_common-test_common_main.Po -rm -f ./$(DEPDIR)/test_common-test_fifo_calls.Po -rm -f ./$(DEPDIR)/test_common-test_guid.Po -rm -f ./$(DEPDIR)/test_common-test_list_calls.Po -rm -f ./$(DEPDIR)/test_common-test_os_calls.Po -rm -f ./$(DEPDIR)/test_common-test_os_calls_signals.Po -rm -f ./$(DEPDIR)/test_common-test_parse.Po -rm -f ./$(DEPDIR)/test_common-test_ssl_calls.Po -rm -f ./$(DEPDIR)/test_common-test_string_calls.Po -rm -f ./$(DEPDIR)/test_common-test_string_calls_unicode.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tests/common/test_base64.c000644 001751 000000 00000027161 14652432047 017565 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "os_calls.h" #include "string_calls.h" #include "base64.h" #include "test_common.h" /* * These are the example test strings in RFC4648(10) */ static const char *rfc4648_ex1_text = ""; static const char *rfc4648_ex1_b64 = ""; static const char *rfc4648_ex2_text = "f"; static const char *rfc4648_ex2_b64 = "Zg=="; static const char *rfc4648_ex3_text = "fo"; static const char *rfc4648_ex3_b64 = "Zm8="; static const char *rfc4648_ex4_text = "foo"; static const char *rfc4648_ex4_b64 = "Zm9v"; static const char *rfc4648_ex5_text = "foob"; static const char *rfc4648_ex5_b64 = "Zm9vYg=="; static const char *rfc4648_ex6_text = "fooba"; static const char *rfc4648_ex6_b64 = "Zm9vYmE="; static const char *rfc4648_ex7_text = "foobar"; static const char *rfc4648_ex7_b64 = "Zm9vYmFy"; /* Every single valid base64 character, except padding */ static const char *all_b64 = "ABCDEFGHIJKL" "MNOPQRSTUVWX" "YZabcdefghij" "klmnopqrstuv" "wxyz01234567" "89+/"; /* What we should get as binary if we decode this */ static const char all_b64_decoded[] = { '\x00', '\x10', '\x83', '\x10', '\x51', '\x87', '\x20', '\x92', '\x8b', '\x30', '\xd3', '\x8f', '\x41', '\x14', '\x93', '\x51', '\x55', '\x97', '\x61', '\x96', '\x9b', '\x71', '\xd7', '\x9f', '\x82', '\x18', '\xa3', '\x92', '\x59', '\xa7', '\xa2', '\x9a', '\xab', '\xb2', '\xdb', '\xaf', '\xc3', '\x1c', '\xb3', '\xd3', '\x5d', '\xb7', '\xe3', '\x9e', '\xbb', '\xf3', '\xdf', '\xbf' }; static void test_rfc4648_to_b64(const char *plaintext, size_t len, const char *b64) { char buff[256]; size_t result; result = base64_encode(plaintext, len, buff, sizeof(buff)); ck_assert_int_eq(result, len); ck_assert_str_eq(buff, b64); } /* Text-only encoder wrapper */ static void test_rfc4648_to_b64_text(const char *plaintext, const char *b64) { test_rfc4648_to_b64(plaintext, g_strlen(plaintext), b64); } /* Text-only decoder wrapper for valid base64 */ static void test_rfc4648_from_b64_text(const char *b64, const char *text) { char buff[256]; size_t actual_len; int result; result = base64_decode(b64, buff, sizeof(buff), &actual_len); ck_assert_int_eq(result, 0); ck_assert_int_lt(actual_len, sizeof(buff)); buff[actual_len] = '\0'; ck_assert_str_eq(buff, text); } /******************************************************************************/ START_TEST(test_b64_rfc4648_ex1_to) { test_rfc4648_to_b64_text(rfc4648_ex1_text, rfc4648_ex1_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex1_from) { test_rfc4648_from_b64_text(rfc4648_ex1_b64, rfc4648_ex1_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex2_to) { test_rfc4648_to_b64_text(rfc4648_ex2_text, rfc4648_ex2_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex2_from) { test_rfc4648_from_b64_text(rfc4648_ex2_b64, rfc4648_ex2_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex3_to) { test_rfc4648_to_b64_text(rfc4648_ex3_text, rfc4648_ex3_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex3_from) { test_rfc4648_from_b64_text(rfc4648_ex3_b64, rfc4648_ex3_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex4_to) { test_rfc4648_to_b64_text(rfc4648_ex4_text, rfc4648_ex4_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex4_from) { test_rfc4648_from_b64_text(rfc4648_ex4_b64, rfc4648_ex4_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex5_to) { test_rfc4648_to_b64_text(rfc4648_ex5_text, rfc4648_ex5_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex5_from) { test_rfc4648_from_b64_text(rfc4648_ex5_b64, rfc4648_ex5_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex6_to) { test_rfc4648_to_b64_text(rfc4648_ex6_text, rfc4648_ex6_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex6_from) { test_rfc4648_from_b64_text(rfc4648_ex6_b64, rfc4648_ex6_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex7_to) { test_rfc4648_to_b64_text(rfc4648_ex7_text, rfc4648_ex7_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_rfc4648_ex7_from) { test_rfc4648_from_b64_text(rfc4648_ex7_b64, rfc4648_ex7_text); } END_TEST /******************************************************************************/ START_TEST(test_b64_all_valid_from) { char buff[256]; size_t actual_len; int result; char *str_result; char *str_expected; result = base64_decode(all_b64, buff, sizeof(buff), &actual_len); ck_assert_int_eq(result, 0); ck_assert_int_eq(actual_len, sizeof(all_b64_decoded)); str_result = bin_to_hex(buff, actual_len); str_expected = bin_to_hex(all_b64_decoded, sizeof(all_b64_decoded)); ck_assert_str_eq(str_result, str_expected); free(str_result); free(str_expected); } END_TEST /******************************************************************************/ START_TEST(test_b64_all_valid_to) { char buff[256]; size_t result; result = base64_encode(all_b64_decoded, sizeof(all_b64_decoded), buff, sizeof(buff)); ck_assert_int_eq(result, sizeof(all_b64_decoded)); ck_assert_str_eq(buff, all_b64); } END_TEST /******************************************************************************/ START_TEST(test_b64_all_invalid) { char buff[256]; size_t actual_len; char valid[256] = {0}; char encoded[5] = { "T0sh" }; /* Decodes to 'OK!' */ int result; /* Make a note of all the valid b64 characters */ unsigned int i = 0; unsigned char c; while ((c = all_b64[i]) != '\0') { valid[c] = 1; ++i; } /* Check the decoder's working on a simple string...*/ result = base64_decode(encoded, buff, sizeof(buff), &actual_len); ck_assert_int_eq(result, 0); ck_assert_int_eq(actual_len, 3); buff[actual_len] = '\0'; ck_assert_str_eq(buff, "OK!"); /* Now replace the 1st character with all invalid characters in turn, * and check they're rejected */ for (i = 0 ; i < 256; ++i) { if (i != '\0' && !valid[i]) /* Don't try the string terminator char! */ { encoded[0] = i; result = base64_decode(encoded, buff, sizeof(buff), &actual_len); if (result == 0) { ck_abort_msg("Character 0x%02x was not rejected", i); } } } } END_TEST /******************************************************************************/ START_TEST(test_b64_small_buffer_encode) { char buff[10 * 4 + 1]; /* Enough space for 10 quanta */ size_t result; result = base64_encode(all_b64_decoded, sizeof(all_b64_decoded), buff, sizeof(buff)); /* Should have read 10 lots of 24 bits from the input */ ck_assert_int_eq(result, 10 * 3); ck_assert_str_eq(buff, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn"); } END_TEST /******************************************************************************/ START_TEST(test_b64_small_buffer_decode) { char buff[10]; /* Enough space for 10 chars */ size_t actual_len; int result; char *str_result; char *str_expected; result = base64_decode(all_b64, buff, sizeof(buff), &actual_len); ck_assert_int_eq(result, 0); ck_assert_int_eq(actual_len, sizeof(all_b64_decoded)); str_result = bin_to_hex(buff, sizeof(buff)); str_expected = bin_to_hex(all_b64_decoded, sizeof(buff)); ck_assert_str_eq(str_result, str_expected); free(str_result); free(str_expected); } END_TEST /******************************************************************************/ START_TEST(test_b64_add_pad_one) { /* Check that a missing trailing '=' is added when decoding */ test_rfc4648_from_b64_text("Zm8", "fo"); /* RFC4648 example 3 */ } END_TEST /******************************************************************************/ START_TEST(test_b64_add_pad_two) { /* Check that two missing trailing '=' chars are added when decoding */ test_rfc4648_from_b64_text("Zg", "f"); /* RFC4648 example 2 */ } END_TEST /******************************************************************************/ START_TEST(test_b64_bad_pad) { char buff[16]; size_t actual_len; /* Check all bad quanta with padding chars */ static const char *bad_pad[] = { "=AAA", "A=AA", "AA=A", "==AA", "=A=A", "=AA=", "A==A", "A=A=", "===A", "A===", NULL }; const char **p; for (p = bad_pad ; *p != NULL ; ++p) { int result = base64_decode(*p, buff, sizeof(buff), &actual_len); if (result == 0) { ck_abort_msg("Padding '%s' was not rejected", *p); } } } END_TEST /******************************************************************************/ START_TEST(test_b64_concat_pad) { const char *src = "VGVzdA==" /* Test */ "IA==" /* */ "Y29uY2F0ZW5hdGVk" /* concatenated */ "IA==" /* */ "cGFkZGluZw=="; /*padding */ const char *expected = "Test concatenated padding"; char buff[64]; size_t actual_len; int result; result = base64_decode(src, buff, sizeof(buff), &actual_len); ck_assert_int_eq(result, 0); ck_assert_int_eq(actual_len, g_strlen(expected)); buff[actual_len] = '\0'; ck_assert_str_eq(buff, expected); } END_TEST /******************************************************************************/ Suite * make_suite_test_base64(void) { Suite *s; TCase *tc_b64; s = suite_create("base64"); tc_b64 = tcase_create("base64"); suite_add_tcase(s, tc_b64); tcase_add_test(tc_b64, test_b64_rfc4648_ex1_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex1_from); tcase_add_test(tc_b64, test_b64_rfc4648_ex2_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex2_from); tcase_add_test(tc_b64, test_b64_rfc4648_ex3_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex3_from); tcase_add_test(tc_b64, test_b64_rfc4648_ex4_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex4_from); tcase_add_test(tc_b64, test_b64_rfc4648_ex5_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex5_from); tcase_add_test(tc_b64, test_b64_rfc4648_ex6_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex6_from); tcase_add_test(tc_b64, test_b64_rfc4648_ex7_to); tcase_add_test(tc_b64, test_b64_rfc4648_ex7_from); tcase_add_test(tc_b64, test_b64_all_valid_from); tcase_add_test(tc_b64, test_b64_all_valid_to); tcase_add_test(tc_b64, test_b64_all_invalid); tcase_add_test(tc_b64, test_b64_small_buffer_encode); tcase_add_test(tc_b64, test_b64_small_buffer_decode); tcase_add_test(tc_b64, test_b64_add_pad_one); tcase_add_test(tc_b64, test_b64_add_pad_two); tcase_add_test(tc_b64, test_b64_bad_pad); tcase_add_test(tc_b64, test_b64_concat_pad); return s; } xrdp-0.10.1/tests/libipm/test_libipm_recv_calls.c000644 001751 000000 00000067153 14652432047 022143 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include "libipm.h" #include "os_calls.h" #include "string_calls.h" #include "trans.h" #include "test_libipm.h" /* Random(ish) values for test_libipm_send_recv_all_test */ #define TEST_y_VALUE 89 #define TEST_b_VALUE 1 #define TEST_n_VALUE -143 #define TEST_q_VALUE 329 #define TEST_i_VALUE -150000 #define TEST_u_VALUE 150000 #define TEST_x_VALUE -4500000000L #define TEST_t_VALUE 8500000000L #define TEST_s_VALUE "libipm recv test" #define TEST_B_VALUE 'b', 'y', 'B', 'Y', '8', '2', '/' /** * Type for fields in the message header * * The type value is the offset of the field within the header */ enum header_field { HDR_IPM_VER = 0, HDR_MSG_LEN = 2, HDR_FACILITY = 4, HDR_MSGNO = 6, HDR_RESERVED = 8 }; /** * Gets a message header field value */ static unsigned int get_header_field(struct stream *s, enum header_field field) { unsigned int res; char *saved_p = s->p; s->p = s->data + (unsigned short)field; if (field == HDR_RESERVED) { in_uint32_le(s, res); } else { in_uint16_le(s, res); } s->p = saved_p; return res; } /** * Sets a message header field value */ static void set_header_field(struct stream *s, enum header_field field, unsigned int val) { char *saved_p = s->p; s->p = s->data + (unsigned short)field; if (field == HDR_RESERVED) { out_uint32_le(s, val); } else { out_uint16_le(s, val); } s->p = saved_p; } /** * Flushes input on a non-blocking socket * * Returns number of bytes read */ static unsigned int flush_socket(int sck) { char buff[1024]; unsigned int result = 0; int status; while (1) { status = g_sck_recv(g_t_in->sck, buff, sizeof(buff), 0); if (status < 0) { break; } result += status; } return result; } /** * Waits for an expected incoming message */ static void check_for_incoming_message(unsigned short expected_msgno) { enum libipm_status status; unsigned short msgno; /* Get the message at the other end */ libipm_msg_in_reset(g_t_in); status = libipm_msg_in_wait_available(g_t_in); ck_assert_int_eq(status, E_LI_SUCCESS); msgno = libipm_msg_in_get_msgno(g_t_in); ck_assert_int_eq(msgno, expected_msgno); } /** * Test for input truncated by a number of bytes * * This call assumes the output buffer contains a message of a single * type that has already been successfully sent and checked. * * The send size is truncated, and the message is sent again. This * lets us check the input parser won't accept a type for which * there is insufficient data. */ static void test_truncated_input_type(char typechar, void *valueptr, int truncate_value, enum libipm_status expected_status) { const char format[] = {typechar, '\0'}; enum libipm_status status; int istatus; unsigned int msg_size; /* The same message is still in the buffer. * * reduce the payload length by the truncate value...*/ msg_size = get_header_field(g_t_out->out_s, HDR_MSG_LEN); set_header_field(g_t_out->out_s, HDR_MSG_LEN, msg_size - truncate_value); /* ...and re-send it */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); /* Catch the message at the other end */ check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ switch (typechar) { case 'B': /* For this type, the descriptor is critical to read * the value */ status = libipm_msg_in_parse(g_t_in, format, (struct fsb_type *)valueptr); break; default: /* For other types, the value shouldn't be needed, as * it's only written to if the parse is successful */ status = libipm_msg_in_parse(g_t_in, format, (struct fsb_type *)NULL); break; } ck_assert_int_eq(status, expected_status); /* There should be 'truncate_value' extra octets left on the input * socket which wasn't read when we shrunk the header */ istatus = flush_socket(g_t_in->sck); ck_assert_int_eq(istatus, truncate_value); /* Put the message size back to its original value, for further tests */ set_header_field(g_t_out->out_s, HDR_MSG_LEN, msg_size); } /** * Test for bad header values * * This call assumes the output buffer contains a message containing * a single 'u' type that has already been send and checked * * The specified header field is overwritten, and the message is * sent. On the receive side we check for a 'bad header' error, and * then put everything back to its starting place. */ static void test_bad_header_value(enum header_field field, unsigned int test_val) { unsigned int old_val; enum libipm_status status; int istatus; /* The same message is still in the buffer. * * Save the field value we are going to change, and replace it */ old_val = get_header_field(g_t_out->out_s, field); set_header_field(g_t_out->out_s, field, test_val); /* re-send the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); /* Catch the message at the other end. The error is * reported when we wait for the incoming message */ libipm_msg_in_reset(g_t_in); status = libipm_msg_in_wait_available(g_t_in); ck_assert_int_eq(status, E_LI_BAD_HEADER); /* There should be 5 extra octets ('u' + 32-bit value) left on the input * socket which wasn't read when we broke the header */ istatus = flush_socket(g_t_in->sck); ck_assert_int_eq(istatus, 1 + sizeof(uint32_t)); /* Put the message size back to its original value, for further tests */ set_header_field(g_t_out->out_s, field, old_val); } /***************************************************************************//** * As the 'append all' test, but data is sent across a link, demarshalled, * and validated */ START_TEST(test_libipm_send_recv_all_test) { ck_assert_ptr_ne(g_t_out, NULL); ck_assert_ptr_ne(g_t_in, NULL); static char bin_out[] = { TEST_B_VALUE }; struct libipm_fsb binary_desc = { (void *)bin_out, sizeof(bin_out) }; enum libipm_status status; /* variables for received values */ uint8_t y; int b; int16_t n; uint16_t q; int32_t i; uint32_t u; int64_t x; uint64_t t; char *s; int h = -1; char B[sizeof(bin_out)]; char c; /* The message is small enough to fit in the socket buffer */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "ybnqiuxtshB", TEST_y_VALUE, TEST_b_VALUE, TEST_n_VALUE, TEST_q_VALUE, TEST_i_VALUE, TEST_u_VALUE, TEST_x_VALUE, TEST_t_VALUE, TEST_s_VALUE, g_fd, &binary_desc); ck_assert_int_eq(status, E_LI_SUCCESS); /* Catch the message at the other end */ check_for_incoming_message(TEST_MESSAGE_NO); /* Re-use our descriptor for the receive operation */ binary_desc.data = (void *)&B; binary_desc.datalen = sizeof(B); status = libipm_msg_in_parse( g_t_in, "ybnqiuxtshB", &y, &b, &n, &q, &i, &u, &x, &t, &s, &h, &binary_desc); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(y, TEST_y_VALUE); ck_assert_int_eq(b, TEST_b_VALUE); ck_assert_int_eq(n, TEST_n_VALUE); ck_assert_int_eq(q, TEST_q_VALUE); ck_assert_int_eq(i, TEST_i_VALUE); ck_assert_int_eq(u, TEST_u_VALUE); ck_assert_int_eq(x, TEST_x_VALUE); ck_assert_int_eq(t, TEST_t_VALUE); check_binary_data_eq(TEST_s_VALUE, sizeof(TEST_s_VALUE) - 1, s, g_strlen(s)); /* The file descriptor should not be -1, neither should it be * the value we sent. It should also point to /dev/zero */ ck_assert_int_ne(h, -1); ck_assert_int_ne(h, g_fd); check_fd_is_dev_zero(h); g_file_close(h); check_binary_data_eq(bin_out, sizeof(bin_out), B, sizeof(B)); /* Check we're at the end of the message */ c = libipm_msg_in_peek_type(g_t_in); ck_assert_int_eq(c, '\0'); } END_TEST /***************************************************************************//** * Checks various receive errors for 'y' */ START_TEST(test_libipm_receive_y_type) { enum libipm_status status; uint8_t y; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "y", TEST_y_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "y", &y); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(y, TEST_y_VALUE); test_truncated_input_type('y', &y, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 'b' */ START_TEST(test_libipm_receive_b_type) { enum libipm_status status; int b; int istatus; char c; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "b", TEST_b_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "b", &b); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(b, TEST_b_VALUE); test_truncated_input_type('b', &b, 1, E_LI_BUFFER_OVERFLOW); /* Resend and re-catch the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO); /* Modify the message to contain a '2' for the boolean */ c = libipm_msg_in_peek_type(g_t_in); ck_assert_int_eq(c, 'b'); /* Next type should be a 'b' */ c = *(g_t_in->in_s->p + 1); /* This should be the test value */ ck_assert_int_eq(c, TEST_b_VALUE); /* Check it */ *(g_t_in->in_s->p + 1) = 2; status = libipm_msg_in_parse( g_t_in, "b", &b); ck_assert_int_eq(status, E_LI_BAD_VALUE); /* Resend and re-catch the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO); /* Modify the message to contain a '-1' for the boolean */ *(g_t_in->in_s->p + 1) = (char) -1; status = libipm_msg_in_parse( g_t_in, "b", &b); ck_assert_int_eq(status, E_LI_BAD_VALUE); } END_TEST /***************************************************************************//** * Checks various receive errors for 'n' */ START_TEST(test_libipm_receive_n_type) { enum libipm_status status; int16_t n; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "n", TEST_n_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "n", &n); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(n, TEST_n_VALUE); test_truncated_input_type('n', &n, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 'q' */ START_TEST(test_libipm_receive_q_type) { enum libipm_status status; uint16_t q; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "q", TEST_q_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "q", &q); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(q, TEST_q_VALUE); test_truncated_input_type('q', &q, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 'i' */ START_TEST(test_libipm_receive_i_type) { enum libipm_status status; int32_t i; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "i", TEST_i_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "i", &i); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(i, TEST_i_VALUE); test_truncated_input_type('i', &i, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 'u' */ START_TEST(test_libipm_receive_u_type) { enum libipm_status status; uint32_t u; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "u", TEST_u_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "u", &u); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(u, TEST_u_VALUE); test_truncated_input_type('u', &u, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 'x' */ START_TEST(test_libipm_receive_x_type) { enum libipm_status status; int64_t x; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "x", TEST_x_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "x", &x); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(x, TEST_x_VALUE); test_truncated_input_type('x', &x, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 't' */ START_TEST(test_libipm_receive_t_type) { enum libipm_status status; uint64_t t; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "t", TEST_t_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "t", &t); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(t, TEST_t_VALUE); test_truncated_input_type('t', &t, 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks various receive errors for 's' */ START_TEST(test_libipm_receive_s_type) { enum libipm_status status; char *s; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "s", TEST_s_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "s", &s); ck_assert_int_eq(status, E_LI_SUCCESS); check_binary_data_eq(TEST_s_VALUE, sizeof(TEST_s_VALUE) - 1, s, g_strlen(s)); /* This effectively tests that unterminated strings are not * passed back to the user */ test_truncated_input_type('s', &s, 1, E_LI_BAD_VALUE); } END_TEST /***************************************************************************//** * Checks various receive errors for 'h' */ START_TEST(test_libipm_receive_h_type) { enum libipm_status status; int istatus; unsigned int i; int fd_count; /* Get the number of open file descriptors */ int base_fd_count = get_open_fd_count(); ck_assert_int_gt(base_fd_count, 0); /* Send the max number of copies of the /dev/zero * file descriptor */ status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, NULL); ck_assert_int_eq(status, E_LI_SUCCESS); for (i = 0 ; i < LIBIPM_MAX_FD_PER_MSG; ++i) { status = libipm_msg_out_append(g_t_out, "h", g_fd); ck_assert_int_eq(status, E_LI_SUCCESS); } libipm_msg_out_mark_end(g_t_out); istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the number of file descriptors has gone up as expected */ fd_count = get_open_fd_count(); ck_assert_int_eq(fd_count, base_fd_count + LIBIPM_MAX_FD_PER_MSG); /* Check half the descriptors work */ for (i = 0 ; i < LIBIPM_MAX_FD_PER_MSG / 2; ++i) { int h = -1; status = libipm_msg_in_parse(g_t_in, "h", &h); ck_assert_int_eq(status, E_LI_SUCCESS); check_fd_is_dev_zero(h); g_file_close(h); } /* Close the message without reading the other descriptors */ libipm_msg_in_reset(g_t_in); /* Check all the file descriptors we received have been closed */ fd_count = get_open_fd_count(); ck_assert_int_eq(fd_count, base_fd_count); } END_TEST /***************************************************************************//** * Checks various receive errors for 'B' */ START_TEST(test_libipm_receive_B_type) { enum libipm_status status; static char bin_out[] = { TEST_B_VALUE }; char bin_in[sizeof(bin_out)]; struct libipm_fsb binary_desc = { (void *)bin_out, sizeof(bin_out) }; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "B", &binary_desc); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ binary_desc.data = (void *)bin_in; binary_desc.datalen = sizeof(bin_in); status = libipm_msg_in_parse( g_t_in, "B", &binary_desc); ck_assert_int_eq(status, E_LI_SUCCESS); check_binary_data_eq(bin_out, sizeof(bin_out), bin_in, sizeof(bin_in)); /* Check a truncated binary object is rejected */ test_truncated_input_type('B', &binary_desc, 1, E_LI_BUFFER_OVERFLOW); /* Check a binary object without a complete length field is rejected */ test_truncated_input_type('B', &binary_desc, sizeof(bin_out) + 1, E_LI_BUFFER_OVERFLOW); /* Check a binary object with a mismatching FSB length field is rejected */ --binary_desc.datalen; test_truncated_input_type('B', &binary_desc, 0, E_LI_BAD_VALUE); ++binary_desc.datalen; /* Check a binary object with a null FSB data field is rejected */ binary_desc.data = NULL; test_truncated_input_type('B', &binary_desc, 0, E_LI_PROGRAM_ERROR); test_truncated_input_type('B', NULL, 0, E_LI_PROGRAM_ERROR); } END_TEST /***************************************************************************//** * Checks for a message with a completely missing type */ START_TEST(test_libipm_receive_no_type) { enum libipm_status status; uint32_t u; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "u", TEST_u_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "u", &u); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(u, TEST_u_VALUE); /* Completely remove the type flag and the value from the message */ test_truncated_input_type('u', &u, sizeof(uint32_t) + 1, E_LI_BUFFER_OVERFLOW); } END_TEST /***************************************************************************//** * Checks for a message with an unexpected type */ START_TEST(test_libipm_receive_unexpected_type) { enum libipm_status status; int istatus; uint32_t u; int32_t i; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "u", TEST_u_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "u", &u); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(u, TEST_u_VALUE); /* Resend and re-catch the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO); /* Try parsing with a type mismatch */ status = libipm_msg_in_parse( g_t_in, "i", &i); ck_assert_int_eq(status, E_LI_UNEXPECTED_TYPE); } END_TEST /***************************************************************************//** * Checks for a message with an unsupported type */ START_TEST(test_libipm_receive_unsupported_type) { enum libipm_status status; int istatus; uint32_t u; char c; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "u", TEST_u_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "u", &u); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(u, TEST_u_VALUE); /* Resend and re-catch the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO); /* Modify the message to contain an unsupported type */ c = libipm_msg_in_peek_type(g_t_in); ck_assert_int_eq(c, 'u'); /* Next type should be a 'u' */ *g_t_in->in_s->p = 'A'; /* unsupported type */ c = libipm_msg_in_peek_type(g_t_in); ck_assert_int_eq(c, '?'); /* peek should say this is an error */ status = libipm_msg_in_parse( g_t_in, "A", NULL); /* Parse it anyway */ ck_assert_int_eq(status, E_LI_UNSUPPORTED_TYPE); } END_TEST /***************************************************************************//** * Checks for a message with an unimplemented type */ START_TEST(test_libipm_receive_unimplemented_type) { enum libipm_status status; int istatus; uint32_t u; char c; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO_STRING_NO, "u", TEST_u_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO_STRING_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "u", &u); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(u, TEST_u_VALUE); /* Resend and re-catch the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO_STRING_NO); /* Try parsing with an unimplemented type. * To do this we need to modify the type marker in the input stream */ c = libipm_msg_in_peek_type(g_t_in); ck_assert_int_eq(c, 'u'); /* Next type should be a 'u' */ *g_t_in->in_s->p = 'd'; /* reserved type */ c = libipm_msg_in_peek_type(g_t_in); ck_assert_int_eq(c, 'd'); status = libipm_msg_in_parse( g_t_in, "d", NULL); ck_assert_int_eq(status, E_LI_UNIMPLEMENTED_TYPE); } END_TEST /***************************************************************************//** * Checks for bad header values */ START_TEST(test_libipm_receive_bad_header) { enum libipm_status status; uint32_t u; unsigned short hdr_ipm_ver; unsigned short hdr_facility; unsigned int i; /* First, a simple send... */ status = libipm_msg_out_simple_send( g_t_out, TEST_MESSAGE_NO, "u", TEST_u_VALUE); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); /* Check the value */ status = libipm_msg_in_parse( g_t_in, "u", &u); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_eq(u, TEST_u_VALUE); /* Save existing header values */ hdr_ipm_ver = get_header_field(g_t_out->out_s, HDR_IPM_VER); hdr_facility = get_header_field(g_t_out->out_s, HDR_FACILITY); test_bad_header_value(HDR_IPM_VER, hdr_ipm_ver + 1); test_bad_header_value(HDR_FACILITY, hdr_facility - 1); test_bad_header_value(HDR_RESERVED, 0xff); test_bad_header_value(HDR_MSG_LEN, LIBIPM_MAX_MESSAGE_SIZE + 1); test_bad_header_value(HDR_MSG_LEN, 0xffff); for (i = 0 ; i < LIBIPM_HEADER_SIZE; ++i) { test_bad_header_value(HDR_MSG_LEN, i); } } END_TEST /***************************************************************************//** * Checks message erase works as expected */ START_TEST(test_libipm_receive_msg_erase) { enum libipm_status status; int istatus; const char *username = "username"; const char *password = "password"; /* Send a message containing sensitive information */ status = libipm_msg_out_simple_send(g_t_out, TEST_MESSAGE_NO, "ss", username, password); ck_assert_int_eq(status, E_LI_SUCCESS); check_for_incoming_message(TEST_MESSAGE_NO); libipm_set_flags(g_t_in, LIBIPM_E_MSG_IN_ERASE_AFTER_USE); ck_assert_int_ne(does_stream_contain_string(g_t_in->in_s, password), 0); libipm_msg_in_reset(g_t_in); ck_assert_msg(does_stream_contain_string(g_t_in->in_s, password) == 0, "Auto buffer reset on input not working"); /* The flag should be reset automatically */ /* Resend and re-catch the message */ istatus = trans_force_write(g_t_out); ck_assert_int_eq(istatus, 0); check_for_incoming_message(TEST_MESSAGE_NO); ck_assert_int_ne(does_stream_contain_string(g_t_in->in_s, password), 0); libipm_msg_in_reset(g_t_in); ck_assert_msg(does_stream_contain_string(g_t_in->in_s, password) != 0, "LIBIPM_E_MSG_IN_ERASE_AFTER_USE not automatically cleared"); } END_TEST /***************************************************************************//** * Exercises codepaths that shouldn't be called (programming errors) */ START_TEST(test_libipm_receive_programming_errors) { enum libipm_status status; int available; int32_t dummy; status = libipm_msg_in_wait_available(g_t_vanilla); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); status = libipm_msg_in_check_available(g_t_vanilla, &available); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); status = libipm_msg_in_parse(g_t_vanilla, "i", &dummy); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); libipm_msg_in_reset(g_t_vanilla); /* No status to check */ } END_TEST /******************************************************************************/ Suite * make_suite_test_libipm_recv_calls(void) { Suite *s; TCase *tc; s = suite_create("libipm_recv"); tc = tcase_create("libipm_recv"); suite_add_tcase(s, tc); tcase_add_test(tc, test_libipm_send_recv_all_test); tcase_add_test(tc, test_libipm_receive_y_type); tcase_add_test(tc, test_libipm_receive_b_type); tcase_add_test(tc, test_libipm_receive_n_type); tcase_add_test(tc, test_libipm_receive_q_type); tcase_add_test(tc, test_libipm_receive_i_type); tcase_add_test(tc, test_libipm_receive_u_type); tcase_add_test(tc, test_libipm_receive_x_type); tcase_add_test(tc, test_libipm_receive_t_type); tcase_add_test(tc, test_libipm_receive_s_type); tcase_add_test(tc, test_libipm_receive_h_type); tcase_add_test(tc, test_libipm_receive_B_type); tcase_add_test(tc, test_libipm_receive_no_type); tcase_add_test(tc, test_libipm_receive_unexpected_type); tcase_add_test(tc, test_libipm_receive_unsupported_type); tcase_add_test(tc, test_libipm_receive_unimplemented_type); tcase_add_test(tc, test_libipm_receive_bad_header); tcase_add_test(tc, test_libipm_receive_msg_erase); tcase_add_test(tc, test_libipm_receive_programming_errors); return s; } xrdp-0.10.1/tests/libipm/Makefile.am000644 001751 000000 00000001123 14652432047 017304 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/common LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh PACKAGE_STRING = "libipm" TESTS = test_libipm check_PROGRAMS = test_libipm test_libipm_SOURCES = \ test_libipm_main.c \ test_libipm.h \ test_libipm_send_calls.c \ test_libipm_recv_calls.c test_libipm_CFLAGS = \ @CHECK_CFLAGS@ \ -D TOP_SRCDIR=\"$(top_srcdir)\" test_libipm_LDADD = \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la \ @CHECK_LIBS@ xrdp-0.10.1/tests/libipm/test_libipm_send_calls.c000644 001751 000000 00000040372 14652432047 022127 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include "libipm.h" #include "os_calls.h" #include "string_calls.h" #include "trans.h" #include "test_libipm.h" /* Random(ish) values for test_libipm_append_all_test */ #define ALL_TEST_y_VALUE 45 #define ALL_TEST_b_VALUE 0 #define ALL_TEST_n_VALUE -14 #define ALL_TEST_q_VALUE 327 #define ALL_TEST_i_VALUE -100000 #define ALL_TEST_u_VALUE 100000 #define ALL_TEST_x_VALUE -4000000000L #define ALL_TEST_t_VALUE 8000000000L #define ALL_TEST_s_VALUE \ 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\0' #define ALL_TEST_B_VALUE 'a', 'z', 'A', 'Z', '0', '9', '#' /* This macro generates two unsigned char values, separated by a comma, * representing a 2's complement little-endian 16-bit integer */ #define BITS16_LE(x) ((x) & 0xff), (((unsigned int)(x) >> 8) & 0xff) /* This macro generates four unsigned char values, separated by a comma, * representing a 2's complement little-endian 32-bit integer */ #define BITS32_LE(x) BITS16_LE((x) & 0xffff), \ BITS16_LE(((unsigned int)(x) >> 16) & 0xffff) /* This macro generates eight unsigned char values, separated by a comma, * representing a 2's complement little-endian 64-bit integer */ #define BITS64_LE(x) BITS32_LE((uint64_t)(x) & 0xffffffff), \ BITS32_LE(((uint64_t)(x) >> 32) & 0xffffffff) /* Expected buffer contents for test_libipm_append_all_test */ static const unsigned char all_test_expected_buff[] = { BITS16_LE(LIBIPM_VERSION), BITS16_LE(74), /* Header : message length */ BITS16_LE(LIBIPM_FAC_TEST), BITS16_LE(TEST_MESSAGE_NO), BITS32_LE(0), /* ------------------- */ 'y', ALL_TEST_y_VALUE, 'b', ALL_TEST_b_VALUE, 'n', BITS16_LE(ALL_TEST_n_VALUE), 'q', BITS16_LE(ALL_TEST_q_VALUE), 'i', BITS32_LE(ALL_TEST_i_VALUE), 'u', BITS32_LE(ALL_TEST_u_VALUE), 'x', BITS64_LE(ALL_TEST_x_VALUE), 't', BITS64_LE(ALL_TEST_t_VALUE), /* String + terminator */ 's', ALL_TEST_s_VALUE, 'h', /* No buffer value is needed for 'h' */ /* Fixed size block */ 'B', BITS16_LE(7) /* length */, ALL_TEST_B_VALUE }; /* Type used to map small test values (i.e. simple types that fit in an int) * to expected status codes if we try to output them for a given type */ struct int_test_value { int value; enum libipm_status expected_status; }; /***************************************************************************//** * Compares the data in a stream against an expected data block * * @param s Stream to check * @param expdata Expected data * @aram explen Expected data len */ static void check_stream_data_eq(const struct stream *s, const unsigned char *expected_data, unsigned int expected_len) { check_binary_data_eq((unsigned char *)s->data, (unsigned int)(s->end - s->data), expected_data, expected_len); } /***************************************************************************//** * Value checks for small types (i.e. those that fit in an 'int' */ static void test_small_type_values(char typechar, const struct int_test_value v[], unsigned int count) { unsigned int i; enum libipm_status status; char format[] = { typechar, '\0'}; for (i = 0 ; i < count; ++i) { status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, format, v[i].value); if (status != v[i].expected_status) { ck_abort_msg("Test value %d. Expected status %d, got %d", v[i].value, v[i].expected_status, status); } } } /***************************************************************************//** * Checks we can add a simple type right at the end of a buffer, but that * a buffer overflow is also detected if there's not enough space. */ static void test_append_at_end_of_message(char typechar, unsigned int wire_size) { char padding[LIBIPM_MAX_PAYLOAD_SIZE] = {0}; struct libipm_fsb desc; enum libipm_status status; const char format[] = {'B', typechar, '\0'}; /* Construct a descriptor for a binary object that fills most of * the output buffer, leaving just enough space for our type at the end. * Three bytes are needed for the binary descriptor overhead */ desc.data = padding; desc.datalen = LIBIPM_MAX_PAYLOAD_SIZE - 3 - wire_size; /* Check we're OK at the end of the buffer... */ status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, format, &desc, 0); ck_assert_int_eq(status, E_LI_SUCCESS); /* ..but if the value would overflow the end of the packet it's an error */ ++desc.datalen; status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, format, &desc, 0); ck_assert_int_eq(status, E_LI_BUFFER_OVERFLOW); } /***************************************************************************//** * Appends all data types to a transport, and checks the binary data in * the output stream is as expected */ START_TEST(test_libipm_append_all_test) { ck_assert_ptr_ne(g_t_out, NULL); static char string[] = { ALL_TEST_s_VALUE }; static char binary[] = { ALL_TEST_B_VALUE }; struct libipm_fsb binary_desc = { (void *)binary, sizeof(binary) }; enum libipm_status status; status = libipm_msg_out_init( g_t_out, TEST_MESSAGE_NO, "ybnqiuxtshB", ALL_TEST_y_VALUE, ALL_TEST_b_VALUE, ALL_TEST_n_VALUE, ALL_TEST_q_VALUE, ALL_TEST_i_VALUE, ALL_TEST_u_VALUE, ALL_TEST_x_VALUE, ALL_TEST_t_VALUE, string, g_fd, &binary_desc); ck_assert_int_eq(status, E_LI_SUCCESS); libipm_msg_out_mark_end(g_t_out); check_stream_data_eq( g_t_out->out_s, all_test_expected_buff, sizeof(all_test_expected_buff)); } END_TEST /***************************************************************************//** * Checks various send errors for 'y' */ START_TEST(test_libipm_send_y_type) { static const struct int_test_value test_values[] = { {0, E_LI_SUCCESS}, {255, E_LI_SUCCESS}, {-1, E_LI_BAD_VALUE}, {256, E_LI_BAD_VALUE}, {63336, E_LI_BAD_VALUE}, {2147483647, E_LI_BAD_VALUE} }; test_small_type_values('y', test_values, sizeof(test_values) / sizeof(test_values[0])); test_append_at_end_of_message('y', 2); } END_TEST /***************************************************************************//** * Checks various send errors for 'b' */ START_TEST(test_libipm_send_b_type) { static const struct int_test_value test_values[] = { {0, E_LI_SUCCESS}, {1, E_LI_SUCCESS}, {2, E_LI_BAD_VALUE}, {-1, E_LI_BAD_VALUE}, {256, E_LI_BAD_VALUE} }; test_small_type_values('b', test_values, sizeof(test_values) / sizeof(test_values[0])); test_append_at_end_of_message('b', 2); } END_TEST /***************************************************************************//** * Checks various send errors for 'n' */ START_TEST(test_libipm_send_n_type) { static const struct int_test_value test_values[] = { {-32768, E_LI_SUCCESS}, {32767, E_LI_SUCCESS}, {-32769, E_LI_BAD_VALUE}, {32768, E_LI_BAD_VALUE}, {2147483647, E_LI_BAD_VALUE} }; test_small_type_values('n', test_values, sizeof(test_values) / sizeof(test_values[0])); test_append_at_end_of_message('n', 3); } END_TEST /***************************************************************************//** * Checks various send errors for 'q' */ START_TEST(test_libipm_send_q_type) { static const struct int_test_value test_values[] = { {0, E_LI_SUCCESS}, {65535, E_LI_SUCCESS}, {-1, E_LI_BAD_VALUE}, {65536, E_LI_BAD_VALUE}, {2147483647, E_LI_BAD_VALUE} }; test_small_type_values('q', test_values, sizeof(test_values) / sizeof(test_values[0])); test_append_at_end_of_message('q', 3); } END_TEST /***************************************************************************//** * Checks various send errors for 'i' */ START_TEST(test_libipm_send_i_type) { #if SIZEOF_INT > 4 static const struct int_test_value test_values[] = { {-2147483648, E_LI_SUCCESS}, {2147483647, E_LI_SUCCESS}, {-2147483649, E_LI_BAD_VALUE}, {2147483648, E_LI_BAD_VALUE}, }; test_small_type_values('i', test_values, sizeof(test_values) / sizeof(test_values[0])); #endif test_append_at_end_of_message('i', 5); } END_TEST /***************************************************************************//** * Checks various send errors for 'u' */ START_TEST(test_libipm_send_u_type) { #if SIZEOF_INT > 4 static const struct int_test_value test_values[] = { {0, E_LI_SUCCESS}, {4294967296, E_LI_SUCCESS}, {-1, E_LI_BAD_VALUE}, {4294967297, E_LI_BAD_VALUE}, }; test_small_type_values('u', test_values, sizeof(test_values) / sizeof(test_values[0])); #endif test_append_at_end_of_message('u', 5); } END_TEST /***************************************************************************//** * Checks various send errors for 'x' */ START_TEST(test_libipm_send_x_type) { test_append_at_end_of_message('x', 9); } END_TEST /***************************************************************************//** * Checks various send errors for 't' */ START_TEST(test_libipm_send_t_type) { test_append_at_end_of_message('t', 9); } END_TEST /***************************************************************************//** * Checks various send errors for 's' */ START_TEST(test_libipm_send_s_type) { enum libipm_status status; /* The maximum string length would be LIBIPM_MAX_PAYLOAD_SIZE-2, as we * need one char for the 's' type marker, and another for the string * terminator */ /* Construct a string one character too long to fit in the buffer */ char str[LIBIPM_MAX_PAYLOAD_SIZE]; g_memset(str, 'A', sizeof(str)); str[sizeof(str) - 1] = '\0'; /* A write should overflow... */ status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "s", str); ck_assert_int_eq(status, E_LI_BUFFER_OVERFLOW); /* .. but a string one character shorter should be OK */ str[sizeof(str) - 2] = '\0'; status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "s", str); ck_assert_int_eq(status, E_LI_SUCCESS); /* Check passing a NULL string doesn't crash the program */ status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "s", NULL); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); } END_TEST /***************************************************************************//** * Checks various send errors for 'h' */ START_TEST(test_libipm_send_h_type) { enum libipm_status status; unsigned int i; test_append_at_end_of_message('h', 1); status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, NULL); ck_assert_int_eq(status, E_LI_SUCCESS); for (i = 0 ; i < LIBIPM_MAX_FD_PER_MSG; ++i) { status = libipm_msg_out_append(g_t_out, "h", g_fd); ck_assert_int_eq(status, E_LI_SUCCESS); } status = libipm_msg_out_append(g_t_out, "h", 1); ck_assert_int_eq(status, E_LI_TOO_MANY_FDS); } END_TEST /***************************************************************************//** * Checks various send errors for 'B' */ START_TEST(test_libipm_send_B_type) { enum libipm_status status; char bin[LIBIPM_MAX_PAYLOAD_SIZE] = {0}; struct libipm_fsb desc; /* The maximum binary block length would be LIBIPM_MAX_PAYLOAD_SIZE - 3, * as we need one char for the 'B' type marker, and two for the length * * Construct a descriptor for a binary object that completely fills * the output buffer */ desc.data = bin; desc.datalen = LIBIPM_MAX_PAYLOAD_SIZE - 3; /* Check it fits in the buffer... */ status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "B", &desc); ck_assert_int_eq(status, E_LI_SUCCESS); /* ..but one byte bigger, and it won't fit */ ++desc.datalen; status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "B", &desc); ck_assert_int_eq(status, E_LI_BUFFER_OVERFLOW); --desc.datalen; /* Check NULL pointers don't crash the library */ desc.data = NULL; status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "B", &desc); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, "B", NULL); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); } END_TEST /***************************************************************************//** * Checks send errors for unsupported and unimplemented types */ START_TEST(test_libipm_send_bad_types) { enum libipm_status status; enum libipm_status expected_status; char format[2] = {0}; char c; for (c = 0x1; c < 0x7f; ++c) { if (!isprint(c)) { continue; } if (g_strchr(g_supported_types, c) == NULL) { expected_status = E_LI_UNSUPPORTED_TYPE; } else if (g_strchr(g_unimplemented_types, c) != NULL) { expected_status = E_LI_UNIMPLEMENTED_TYPE; } else { continue; } format[0] = c; status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO_STRING_NO, format, NULL); if (status != expected_status) { ck_abort_msg("Output char '%c'. Expected status %d, got %d", c, expected_status, status); } } } END_TEST /***************************************************************************//** * Checks message erase works as expected * * Also calls libipm_msg_out_append() which isn't exercised anywhere else */ START_TEST(test_libipm_send_msg_erase) { enum libipm_status status; const char *username = "username"; const char *password = "password"; status = libipm_msg_out_init(g_t_out, TEST_MESSAGE_NO, NULL); ck_assert_int_eq(status, E_LI_SUCCESS); status = libipm_msg_out_append(g_t_out, "ss", username, password); ck_assert_int_eq(status, E_LI_SUCCESS); ck_assert_int_ne(does_stream_contain_string(g_t_out->out_s, password), 0); libipm_msg_out_erase(g_t_out); ck_assert_int_eq(does_stream_contain_string(g_t_out->out_s, password), 0); } END_TEST /***************************************************************************//** * Exercises codepaths that shouldn't be called (programming errors) */ START_TEST(test_libipm_send_programming_errors) { enum libipm_status status; status = libipm_msg_out_init(g_t_vanilla, TEST_MESSAGE_NO, NULL); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); status = libipm_msg_out_append(g_t_vanilla, "i", 0); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); libipm_msg_out_mark_end(g_t_vanilla); /* No status to check */ status = libipm_msg_out_simple_send(g_t_vanilla, TEST_MESSAGE_NO, "i", 0); ck_assert_int_eq(status, E_LI_PROGRAM_ERROR); } END_TEST /******************************************************************************/ Suite * make_suite_test_libipm_send_calls(void) { Suite *s; TCase *tc; s = suite_create("libipm_send"); tc = tcase_create("libipm_send"); suite_add_tcase(s, tc); tcase_add_test(tc, test_libipm_append_all_test); tcase_add_test(tc, test_libipm_send_y_type); tcase_add_test(tc, test_libipm_send_b_type); tcase_add_test(tc, test_libipm_send_n_type); tcase_add_test(tc, test_libipm_send_q_type); tcase_add_test(tc, test_libipm_send_i_type); tcase_add_test(tc, test_libipm_send_u_type); tcase_add_test(tc, test_libipm_send_x_type); tcase_add_test(tc, test_libipm_send_t_type); tcase_add_test(tc, test_libipm_send_s_type); tcase_add_test(tc, test_libipm_send_h_type); tcase_add_test(tc, test_libipm_send_B_type); tcase_add_test(tc, test_libipm_send_y_type); tcase_add_test(tc, test_libipm_send_bad_types); tcase_add_test(tc, test_libipm_send_msg_erase); tcase_add_test(tc, test_libipm_send_programming_errors); return s; } xrdp-0.10.1/tests/libipm/test_libipm.h000644 001751 000000 00000004077 14652432047 017747 0ustar00metawheel000000 000000 #ifndef TEST_LIBIPM__H #define TEST_LIBIPM__H #include /* Private libipm stuff. This is duplicated here, so if the libipm * value change, tests will fail! */ enum { LIBIPM_VERSION = 2, LIBIPM_HEADER_SIZE = 12, LIBIPM_MAX_MESSAGE_SIZE = 8192, LIBIPM_MAX_FD_PER_MSG = 8, LIBIPM_MAX_PAYLOAD_SIZE = LIBIPM_MAX_MESSAGE_SIZE - LIBIPM_HEADER_SIZE }; /* Globals */ extern struct trans *g_t_out; /* Channel for outputting libipm messages */ extern struct trans *g_t_in; /* Channel for inputting libipm messages */ extern struct trans *g_t_vanilla; /* Non-SCP channel */ extern int g_fd; /* An open file descriptor (/dev/zero) */ extern const char *g_supported_types; /* All recognised type codes */ extern const char *g_unimplemented_types; /* recognised, unimplemented codes */ #define TEST_MESSAGE_NO 66 /* Test message with no string translation */ #define TEST_MESSAGE_NO_STRING_NO 67 /** * Compares two binary blocks * * @param actual_data Actual data * @param actual_len Actual length * @param expected_data Expected data * @aram expected_len Expected data length * * Differences are raised using ck_* calls */ void check_binary_data_eq(const void *actual_data, unsigned int actual_len, const void *expected_data, unsigned int expected_len); /** * Check the file descriptor specified is working as /dev/zero * * If it isn't, an exception is raised using ck_* calls */ void check_fd_is_dev_zero(int fd); /** * Looks for the specified string in the specified stream * @param s Stream to search * @param str Null-terminated string to look for * @return != 0 if string found in the buffer * * The whole buffer is searched for the string. not just the * used bit. */ int does_stream_contain_string(const struct stream *s, const char *str); /** * Returns the number of open file descriptors in the process */ unsigned int get_open_fd_count(void); Suite *make_suite_test_libipm_send_calls(void); Suite *make_suite_test_libipm_recv_calls(void); #endif /* TEST_LIBIPM__H */ xrdp-0.10.1/tests/libipm/Makefile.in000644 001751 000000 00000123152 14652432075 017325 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ TESTS = test_libipm$(EXEEXT) check_PROGRAMS = test_libipm$(EXEEXT) subdir = tests/libipm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_test_libipm_OBJECTS = test_libipm-test_libipm_main.$(OBJEXT) \ test_libipm-test_libipm_send_calls.$(OBJEXT) \ test_libipm-test_libipm_recv_calls.$(OBJEXT) test_libipm_OBJECTS = $(am_test_libipm_OBJECTS) test_libipm_DEPENDENCIES = $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_libipm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_libipm_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test_libipm-test_libipm_main.Po \ ./$(DEPDIR)/test_libipm-test_libipm_recv_calls.Po \ ./$(DEPDIR)/test_libipm-test_libipm_send_calls.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(test_libipm_SOURCES) DIST_SOURCES = $(test_libipm_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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = "libipm" PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/common LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tap-driver.sh test_libipm_SOURCES = \ test_libipm_main.c \ test_libipm.h \ test_libipm_send_calls.c \ test_libipm_recv_calls.c test_libipm_CFLAGS = \ @CHECK_CFLAGS@ \ -D TOP_SRCDIR=\"$(top_srcdir)\" test_libipm_LDADD = \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la \ @CHECK_LIBS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/libipm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/libipm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) test_libipm$(EXEEXT): $(test_libipm_OBJECTS) $(test_libipm_DEPENDENCIES) $(EXTRA_test_libipm_DEPENDENCIES) @rm -f test_libipm$(EXEEXT) $(AM_V_CCLD)$(test_libipm_LINK) $(test_libipm_OBJECTS) $(test_libipm_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libipm-test_libipm_main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libipm-test_libipm_recv_calls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libipm-test_libipm_send_calls.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< test_libipm-test_libipm_main.o: test_libipm_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -MT test_libipm-test_libipm_main.o -MD -MP -MF $(DEPDIR)/test_libipm-test_libipm_main.Tpo -c -o test_libipm-test_libipm_main.o `test -f 'test_libipm_main.c' || echo '$(srcdir)/'`test_libipm_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libipm-test_libipm_main.Tpo $(DEPDIR)/test_libipm-test_libipm_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libipm_main.c' object='test_libipm-test_libipm_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -c -o test_libipm-test_libipm_main.o `test -f 'test_libipm_main.c' || echo '$(srcdir)/'`test_libipm_main.c test_libipm-test_libipm_main.obj: test_libipm_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -MT test_libipm-test_libipm_main.obj -MD -MP -MF $(DEPDIR)/test_libipm-test_libipm_main.Tpo -c -o test_libipm-test_libipm_main.obj `if test -f 'test_libipm_main.c'; then $(CYGPATH_W) 'test_libipm_main.c'; else $(CYGPATH_W) '$(srcdir)/test_libipm_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libipm-test_libipm_main.Tpo $(DEPDIR)/test_libipm-test_libipm_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libipm_main.c' object='test_libipm-test_libipm_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -c -o test_libipm-test_libipm_main.obj `if test -f 'test_libipm_main.c'; then $(CYGPATH_W) 'test_libipm_main.c'; else $(CYGPATH_W) '$(srcdir)/test_libipm_main.c'; fi` test_libipm-test_libipm_send_calls.o: test_libipm_send_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -MT test_libipm-test_libipm_send_calls.o -MD -MP -MF $(DEPDIR)/test_libipm-test_libipm_send_calls.Tpo -c -o test_libipm-test_libipm_send_calls.o `test -f 'test_libipm_send_calls.c' || echo '$(srcdir)/'`test_libipm_send_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libipm-test_libipm_send_calls.Tpo $(DEPDIR)/test_libipm-test_libipm_send_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libipm_send_calls.c' object='test_libipm-test_libipm_send_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -c -o test_libipm-test_libipm_send_calls.o `test -f 'test_libipm_send_calls.c' || echo '$(srcdir)/'`test_libipm_send_calls.c test_libipm-test_libipm_send_calls.obj: test_libipm_send_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -MT test_libipm-test_libipm_send_calls.obj -MD -MP -MF $(DEPDIR)/test_libipm-test_libipm_send_calls.Tpo -c -o test_libipm-test_libipm_send_calls.obj `if test -f 'test_libipm_send_calls.c'; then $(CYGPATH_W) 'test_libipm_send_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_libipm_send_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libipm-test_libipm_send_calls.Tpo $(DEPDIR)/test_libipm-test_libipm_send_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libipm_send_calls.c' object='test_libipm-test_libipm_send_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -c -o test_libipm-test_libipm_send_calls.obj `if test -f 'test_libipm_send_calls.c'; then $(CYGPATH_W) 'test_libipm_send_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_libipm_send_calls.c'; fi` test_libipm-test_libipm_recv_calls.o: test_libipm_recv_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -MT test_libipm-test_libipm_recv_calls.o -MD -MP -MF $(DEPDIR)/test_libipm-test_libipm_recv_calls.Tpo -c -o test_libipm-test_libipm_recv_calls.o `test -f 'test_libipm_recv_calls.c' || echo '$(srcdir)/'`test_libipm_recv_calls.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libipm-test_libipm_recv_calls.Tpo $(DEPDIR)/test_libipm-test_libipm_recv_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libipm_recv_calls.c' object='test_libipm-test_libipm_recv_calls.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -c -o test_libipm-test_libipm_recv_calls.o `test -f 'test_libipm_recv_calls.c' || echo '$(srcdir)/'`test_libipm_recv_calls.c test_libipm-test_libipm_recv_calls.obj: test_libipm_recv_calls.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -MT test_libipm-test_libipm_recv_calls.obj -MD -MP -MF $(DEPDIR)/test_libipm-test_libipm_recv_calls.Tpo -c -o test_libipm-test_libipm_recv_calls.obj `if test -f 'test_libipm_recv_calls.c'; then $(CYGPATH_W) 'test_libipm_recv_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_libipm_recv_calls.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_libipm-test_libipm_recv_calls.Tpo $(DEPDIR)/test_libipm-test_libipm_recv_calls.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_libipm_recv_calls.c' object='test_libipm-test_libipm_recv_calls.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_libipm_CFLAGS) $(CFLAGS) -c -o test_libipm-test_libipm_recv_calls.obj `if test -f 'test_libipm_recv_calls.c'; then $(CYGPATH_W) 'test_libipm_recv_calls.c'; else $(CYGPATH_W) '$(srcdir)/test_libipm_recv_calls.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test_libipm.log: test_libipm$(EXEEXT) @p='test_libipm$(EXEEXT)'; \ b='test_libipm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test_libipm-test_libipm_main.Po -rm -f ./$(DEPDIR)/test_libipm-test_libipm_recv_calls.Po -rm -f ./$(DEPDIR)/test_libipm-test_libipm_send_calls.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/test_libipm-test_libipm_main.Po -rm -f ./$(DEPDIR)/test_libipm-test_libipm_recv_calls.Po -rm -f ./$(DEPDIR)/test_libipm-test_libipm_send_calls.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tests/libipm/test_libipm_main.c000644 001751 000000 00000015706 14652432047 020747 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include #include #include "log.h" #include "libipm.h" #include "trans.h" #include "os_calls.h" #include "string_calls.h" #include "test_libipm.h" struct trans *g_t_out = NULL; struct trans *g_t_in = NULL; struct trans *g_t_vanilla = NULL; int g_fd = -1; const char *g_supported_types = "ybnqiuxtsdhogB"; const char *g_unimplemented_types = "dog"; /******************************************************************************/ static const char * msgno_to_str(unsigned short msgno) { return (msgno == TEST_MESSAGE_NO) ? "TEST_MESSAGE_NO" : NULL; } /******************************************************************************/ static void suite_test_libipm_calls_start(void) { int sck[2]; int istatus; struct trans *t1 = NULL; struct trans *t2 = NULL; struct trans *t3 = NULL; int fd = -1; int success = 0; if ((t1 = trans_create(TRANS_MODE_UNIX, 128, 128)) == NULL) { const char *errstr = g_get_strerror(); LOG(LOG_LEVEL_ERROR, "Can't create test transport 1 [%s]", errstr); } else if ((t2 = trans_create(TRANS_MODE_UNIX, 128, 128)) == NULL) { const char *errstr = g_get_strerror(); LOG(LOG_LEVEL_ERROR, "Can't create test transport 2 [%s]", errstr); } else if ((t3 = trans_create(TRANS_MODE_UNIX, 128, 128)) == NULL) { const char *errstr = g_get_strerror(); LOG(LOG_LEVEL_ERROR, "Can't create test transport 3 [%s]", errstr); } else if ((fd = g_file_open_rw("/dev/zero")) < 0) { const char *errstr = g_get_strerror(); LOG(LOG_LEVEL_ERROR, "Can't open /dev/zero [%s]", errstr); } else if ((istatus = g_sck_local_socketpair(sck)) < 0) { const char *errstr = g_get_strerror(); LOG(LOG_LEVEL_ERROR, "Can't create test sockets [%s]", errstr); } else { enum libipm_status init1; enum libipm_status init2; t1->sck = sck[0]; t1->type1 = TRANS_TYPE_CLIENT; t1->status = TRANS_STATUS_UP; t2->sck = sck[1]; t2->type1 = TRANS_TYPE_SERVER; t2->status = TRANS_STATUS_UP; init1 = libipm_init_trans(t1, LIBIPM_FAC_TEST, msgno_to_str); init2 = libipm_init_trans(t2, LIBIPM_FAC_TEST, msgno_to_str); if (init1 != E_LI_SUCCESS || init2 != E_LI_SUCCESS) { LOG(LOG_LEVEL_ERROR, "libipm_init_trans() call failed"); } else { success = 1; } } if (success) { g_t_out = t1; g_t_in = t2; g_t_vanilla = t3; g_fd = fd; } else { trans_delete(t1); trans_delete(t2); trans_delete(t3); if (fd >= 0) { g_file_close(fd); } } } /******************************************************************************/ static void suite_test_libipm_calls_end(void) { trans_delete(g_t_out); trans_delete(g_t_in); trans_delete(g_t_vanilla); } /******************************************************************************/ void check_binary_data_eq(const void *actual_data, unsigned int actual_len, const void *expected_data, unsigned int expected_len) { const unsigned char *cp_expected = (const unsigned char *)expected_data; const unsigned char *cp_expected_end = (const unsigned char *)expected_data + expected_len; const unsigned char *cp_actual = (const unsigned char *)actual_data; if (expected_len != actual_len) { ck_abort_msg("Differing lengths. Expected %u, got %u", expected_len, actual_len); } while (cp_expected < cp_expected_end) { if (*cp_expected != *cp_actual) { int byte_pos = cp_expected - (const unsigned char *)expected_data; ck_abort_msg("Byte position %d. Expected %02x, got %02x", byte_pos, *cp_expected, *cp_actual); } ++cp_expected; ++cp_actual; } } /******************************************************************************/ void check_fd_is_dev_zero(int fd) { char buff[1] = { '\001' }; int status; status = g_file_read(fd, buff, sizeof(buff)); ck_assert_int_eq(status, 1); ck_assert_int_eq(buff[0], '\0'); status = g_file_write(fd, buff, sizeof(buff)); ck_assert_int_eq(status, 1); } /******************************************************************************/ int does_stream_contain_string(const struct stream *s, const char *str) { int len = g_strlen(str); int i; if (len > 0 && len <= s->size) { for (i = 0 ; i <= s->size - len; ++i) { /* This is not a sophisticated string search. We use a * single character test to avoid a function call for * every comparison */ if (str[0] == s->data[i] && g_memcmp(str, &s->data[i], len) == 0) { return 1; } } } return 0; } /******************************************************************************/ unsigned int get_open_fd_count(void) { unsigned int i; unsigned int rv; // What's the max number of file descriptors? struct rlimit nofile; if (getrlimit(RLIMIT_NOFILE, &nofile) < 0) { const char *errstr = g_get_strerror(); ck_abort_msg("Can't create socketpair [%s]", errstr); } struct pollfd *fds = (struct pollfd *)g_malloc(sizeof(struct pollfd) * nofile.rlim_cur, 0); ck_assert_ptr_nonnull(fds); for (i = 0 ; i < nofile.rlim_cur; ++i) { fds[i].fd = i; fds[i].events = 0; fds[i].revents = 0; } if (poll(fds, nofile.rlim_cur, 0) < 0) { const char *errstr = g_get_strerror(); ck_abort_msg("Can't poll fds [%s]", errstr); } rv = nofile.rlim_cur; for (i = 0 ; i < nofile.rlim_cur; ++i) { if (fds[i].revents == POLLNVAL) { --rv; } } g_free(fds); return rv; } /******************************************************************************/ int main (void) { int number_failed; SRunner *sr; sr = srunner_create (make_suite_test_libipm_send_calls()); srunner_add_suite (sr, make_suite_test_libipm_recv_calls()); srunner_set_tap(sr, "-"); /* * Set up console logging */ struct log_config *lc = log_config_init_for_console(LOG_LEVEL_INFO, NULL); log_start_from_param(lc); log_config_free(lc); /* Disable stdout buffering, as this can confuse the error * reporting when running in libcheck fork mode */ setvbuf(stdout, NULL, _IONBF, 0); /* Initialise modules */ suite_test_libipm_calls_start(); srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed(sr); srunner_free(sr); suite_test_libipm_calls_end(); log_end(); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } xrdp-0.10.1/tests/memtest/Makefile.in000644 001751 000000 00000103573 14652432075 017534 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = memtest$(EXEEXT) TESTS = memtest$(EXEEXT) subdir = tests/memtest ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_memtest_OBJECTS = libmem.$(OBJEXT) memtest.$(OBJEXT) memtest_OBJECTS = $(am_memtest_OBJECTS) memtest_DEPENDENCIES = $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmem.Po ./$(DEPDIR)/memtest.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(memtest_SOURCES) DIST_SOURCES = $(memtest_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__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = "memtest" PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir)/common memtest_SOURCES = \ libmem.h \ libmem.c \ memtest.c memtest_LDADD = \ $(top_builddir)/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/memtest/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/memtest/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: $(am__rm_f) $(check_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=) memtest$(EXEEXT): $(memtest_OBJECTS) $(memtest_DEPENDENCIES) $(EXTRA_memtest_DEPENDENCIES) @rm -f memtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(memtest_OBJECTS) $(memtest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmem.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memtest.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: $(check_PROGRAMS) @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? memtest.log: memtest$(EXEEXT) @p='memtest$(EXEEXT)'; \ b='memtest'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libmem.Po -rm -f ./$(DEPDIR)/memtest.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-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 ./$(DEPDIR)/libmem.Po -rm -f ./$(DEPDIR)/memtest.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/tests/memtest/memtest.c000644 001751 000000 00000003617 14652432047 017306 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "libmem.h" #include "log.h" int main(int argc, char **argv) { void *obj; unsigned int addr1; unsigned int addr2; unsigned int addr3; unsigned int addr4; unsigned int addr5; int index; int rd; struct log_config *config; config = log_config_init_for_console(LOG_LEVEL_DEBUG, NULL); log_start_from_param(config); log_config_free(config); /* Disable stdout buffering, as this can confuse the error * reporting when running in libcheck fork mode */ setvbuf(stdout, NULL, _IONBF, 0); srand(time(0)); obj = libmem_init(0x80000000, 64 * 1024 * 1024); for (index = 0; index < 256; index++) { rd = rand() & 0xffff; printf("1 rd %d\n", rd); addr1 = libmem_alloc(obj, rd); rd = rand() & 0xffff; printf("2 rd %d\n", rd); addr2 = libmem_alloc(obj, rd); rd = rand() & 0xffff; printf("3 rd %d\n", rd); addr3 = libmem_alloc(obj, rd); rd = rand() & 0xffff; printf("4 rd %d\n", rd); addr4 = libmem_alloc(obj, rd); addr5 = libmem_alloc(obj, rd); libmem_free(obj, addr1); printf("5\n"); addr1 = libmem_alloc(obj, 64); printf("6\n"); libmem_free(obj, addr3); printf("7\n"); addr3 = libmem_alloc(obj, 64 * 1024); libmem_free(obj, addr5); addr5 = libmem_alloc(obj, 64 * 1024); printf("8\n"); libmem_free(obj, addr1); printf("9\n"); libmem_free(obj, addr2); printf("10\n"); libmem_free(obj, addr3); libmem_free(obj, addr4); if (index == 255) { libmem_set_flags(obj, 1); } libmem_free(obj, addr5); } libmem_deinit(obj); log_end(); return 0; } xrdp-0.10.1/tests/memtest/libmem.h000644 001751 000000 00000000544 14652432047 017076 0ustar00metawheel000000 000000 #ifndef _LIBMEM_C #define _LIBMEM_C void * libmem_init(unsigned int addr, int bytes); void libmem_deinit(void *aself); unsigned int libmem_alloc(void *obj, int bytes); int libmem_free(void *obj, unsigned int addr); int libmem_set_flags(void *obj, int flags); int libmem_clear_flags(void *obj, int flags); int libmem_get_alloced_bytes(void *obj); #endif xrdp-0.10.1/tests/memtest/Makefile.am000644 001751 000000 00000000355 14652432047 017514 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -I$(top_srcdir)/common PACKAGE_STRING = "memtest" check_PROGRAMS = \ memtest memtest_SOURCES = \ libmem.h \ libmem.c \ memtest.c memtest_LDADD = \ $(top_builddir)/common/libcommon.la TESTS = \ memtest xrdp-0.10.1/tests/memtest/libmem.c000644 001751 000000 00000023601 14652432047 017070 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "log.h" #define ALIGN_BY 32 #define ALIGN_BY_M1 (ALIGN_BY - 1) #define ALIGN(_in) (((_in) + ALIGN_BY_M1) & (~ALIGN_BY_M1)) struct mem_item { unsigned int addr; int bytes; struct mem_item *next; struct mem_item *prev; }; struct mem_info { unsigned int addr; int bytes; int flags; struct mem_item *free_head; struct mem_item *free_tail; struct mem_item *used_head; struct mem_item *used_tail; int total_bytes; }; /*****************************************************************************/ static int libmem_free_mem_item(struct mem_info *self, struct mem_item *mi) { if (self == 0 || mi == 0) { return 0; } if (mi->prev != 0) { mi->prev->next = mi->next; } if (mi->next != 0) { mi->next->prev = mi->prev; } if (mi == self->free_head) { self->free_head = mi->next; } if (mi == self->free_tail) { self->free_tail = mi->prev; } if (mi == self->used_head) { self->used_head = mi->next; } if (mi == self->used_tail) { self->used_tail = mi->prev; } free(mi); return 0; } /*****************************************************************************/ void * libmem_init(unsigned int addr, int bytes) { struct mem_info *self; struct mem_item *mi; self = (struct mem_info *)malloc(sizeof(struct mem_info)); memset(self, 0, sizeof(struct mem_info)); self->addr = addr; self->bytes = bytes; //self->flags = 1; mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(mi, 0, sizeof(struct mem_item)); mi->addr = addr; mi->bytes = bytes; self->free_head = mi; self->free_tail = mi; return self; } /*****************************************************************************/ void libmem_deinit(void *aself) { struct mem_info *self; self = (struct mem_info *)aself; if (self == 0) { return; } while (self->free_head != 0) { libmem_free_mem_item(self, self->free_head); } while (self->used_head != 0) { libmem_free_mem_item(self, self->used_head); } free(self); } /****************************************************************************/ static int libmem_add_used_item(struct mem_info *self, unsigned int addr, int bytes) { struct mem_item *mi; struct mem_item *new_mi; int added; if (self == 0 || addr == 0) { return 1; } if (self->used_head == 0) { /* add first item */ new_mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(new_mi, 0, sizeof(struct mem_item)); new_mi->addr = addr; new_mi->bytes = bytes; self->used_head = new_mi; self->used_tail = new_mi; return 0; } added = 0; mi = self->used_head; while (mi != 0) { if (mi->addr > addr) { /* add before */ new_mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(new_mi, 0, sizeof(struct mem_item)); new_mi->addr = addr; new_mi->bytes = bytes; new_mi->prev = mi->prev; new_mi->next = mi; if (mi->prev != 0) { mi->prev->next = new_mi; } mi->prev = new_mi; if (self->used_head == mi) { self->used_head = new_mi; } added = 1; break; } mi = mi->next; } if (!added) { /* add last */ new_mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(new_mi, 0, sizeof(struct mem_item)); new_mi->addr = addr; new_mi->bytes = bytes; self->used_tail->next = new_mi; new_mi->prev = self->used_tail; self->used_tail = new_mi; } return 0; } /****************************************************************************/ static int libmem_add_free_item(struct mem_info *self, unsigned int addr, int bytes) { struct mem_item *mi; struct mem_item *new_mi; int added; if (self == 0 || addr == 0) { return 1; } if (self->free_head == 0) { /* add first item */ new_mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(new_mi, 0, sizeof(struct mem_item)); new_mi->addr = addr; new_mi->bytes = bytes; self->free_head = new_mi; self->free_tail = new_mi; return 0; } added = 0; mi = self->free_head; while (mi != 0) { if (mi->addr > addr) { if (mi->prev != 0) { if (mi->prev->addr + mi->prev->bytes == addr) { /* don't need to add, just make prev bigger */ mi->prev->bytes += bytes; if (mi->prev->addr + mi->prev->bytes == mi->addr) { /* here we can remove one */ mi->prev->bytes += mi->bytes; libmem_free_mem_item(self, mi); } return 0; } } if (addr + bytes == mi->addr) { /* don't need to add here either */ mi->addr = addr; mi->bytes += bytes; return 0; } /* add before */ new_mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(new_mi, 0, sizeof(struct mem_item)); new_mi->addr = addr; new_mi->bytes = bytes; new_mi->prev = mi->prev; new_mi->next = mi; if (mi->prev != 0) { mi->prev->next = new_mi; } mi->prev = new_mi; if (self->free_head == mi) { self->free_head = new_mi; } added = 1; break; } mi = mi->next; } if (!added) { /* add last */ new_mi = (struct mem_item *)malloc(sizeof(struct mem_item)); memset(new_mi, 0, sizeof(struct mem_item)); new_mi->addr = addr; new_mi->bytes = bytes; self->free_tail->next = new_mi; new_mi->prev = self->free_tail; self->free_tail = new_mi; } return 0; } /*****************************************************************************/ static int libmem_print(struct mem_info *self) { struct mem_item *mi; LOG_DEVEL(LOG_LEVEL_DEBUG, "libmem_print:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " used_head %p", self->used_head); LOG_DEVEL(LOG_LEVEL_DEBUG, " used_tail %p", self->used_tail); mi = self->used_head; if (mi != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " used list"); while (mi != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " ptr %p prev %p next %p addr 0x%8.8x bytes %d", mi, mi->prev, mi->next, mi->addr, mi->bytes); mi = mi->next; } } LOG_DEVEL(LOG_LEVEL_DEBUG, " free_head %p", self->free_head); LOG_DEVEL(LOG_LEVEL_DEBUG, " free_tail %p", self->free_tail); mi = self->free_head; if (mi != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " free list"); while (mi != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " ptr %p prev %p next %p addr 0x%8.8x bytes %d", mi, mi->prev, mi->next, mi->addr, mi->bytes); mi = mi->next; } } return 0; } /*****************************************************************************/ unsigned int libmem_alloc(void *obj, int bytes) { struct mem_info *self; struct mem_item *mi; unsigned int addr; if (bytes < 1) { return 0; } bytes = ALIGN(bytes); self = (struct mem_info *)obj; addr = 0; mi = self->free_head; while (mi != 0) { if (bytes <= mi->bytes) { addr = mi->addr; mi->bytes -= bytes; mi->addr += bytes; if (mi->bytes < 1) { libmem_free_mem_item(self, mi); } break; } mi = mi->next; } if (addr != 0) { self->total_bytes += bytes; libmem_add_used_item(self, addr, bytes); if (self->flags & 1) { libmem_print(self); } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "libmem_alloc: error"); } return addr; } /*****************************************************************************/ int libmem_free(void *obj, unsigned int addr) { struct mem_info *self; struct mem_item *mi; if (addr == 0) { return 0; } self = (struct mem_info *)obj; mi = self->used_tail; while (mi != 0) { if (mi->addr == addr) { self->total_bytes -= mi->bytes; libmem_add_free_item(self, mi->addr, mi->bytes); libmem_free_mem_item(self, mi); if (self->flags & 1) { libmem_print(self); } return 0; } mi = mi->prev; } LOG_DEVEL(LOG_LEVEL_ERROR, "libmem_free: error"); return 1; } /*****************************************************************************/ int libmem_set_flags(void *obj, int flags) { struct mem_info *self; self = (struct mem_info *)obj; self->flags |= flags; return 0; } /*****************************************************************************/ int libmem_clear_flags(void *obj, int flags) { struct mem_info *self; self = (struct mem_info *)obj; self->flags &= ~flags; return 0; } /*****************************************************************************/ int libmem_get_alloced_bytes(void *obj) { struct mem_info *self; self = (struct mem_info *)obj; return self->total_bytes; } xrdp-0.10.1/m4/ax_cflags_warn_all.m4000644 001751 000000 00000011701 14652432047 017225 0ustar00metawheel000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html # =========================================================================== # # SYNOPSIS # # AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] # # DESCRIPTION # # Try to find a compiler option that enables most reasonable warnings. # # For the GNU compiler it will be -Wall (and -ansi -pedantic) The result # is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default. # # Currently this macro knows about the GCC, Solaris, Digital Unix, AIX, # HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and # Intel compilers. For a given compiler, the Fortran flags are much more # experimental than their C equivalents. # # - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS # - $2 add-value-if-not-found : nothing # - $3 action-if-found : add value to shellvariable # - $4 action-if-not-found : nothing # # NOTE: These macros depend on AX_APPEND_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2010 Rhys Ulerich # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 15 AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], VAR,[VAR="no, unknown" ac_save_[]FLAGS="$[]FLAGS" for ac_arg dnl in "-warn all % -warn all" dnl Intel "-pedantic % -Wall" dnl GCC "-xstrconst % -v" dnl Solaris C "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX "-ansi -ansiE % -fullwarn" dnl IRIX "+ESlit % +w1" dnl HP-UX C "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) "-h conform % -h msglevel 2" dnl Cray C (Unicos) # do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) done FLAGS="$ac_save_[]FLAGS" ]) AS_VAR_POPDEF([FLAGS])dnl AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) case ".$VAR" in .ok|.ok,*) m4_ifvaln($3,$3) ;; .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; esac AS_VAR_POPDEF([VAR])dnl ])dnl AX_FLAGS_WARN_ALL dnl implementation tactics: dnl the for-argument contains a list of options. The first part of dnl these does only exist to detect the compiler - usually it is dnl a global option to enable -ansi or -extrawarnings. All other dnl compilers will fail about it. That was needed since a lot of dnl compilers will give false positives for some option-syntax dnl like -Woption or -Xoption as they think of it is a pass-through dnl to later compile stages or something. The "%" is used as a dnl delimiter. A non-option comment can be given after "%%" marks dnl which will be shown but not added to the respective C/CXXFLAGS. AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([C]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([C]) ]) AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([C++]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([C++]) ]) AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl AC_LANG_PUSH([Fortran]) AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) AC_LANG_POP([Fortran]) ]) xrdp-0.10.1/m4/libtool.m4000644 001751 000000 00001127551 14652432071 015074 0ustar00metawheel000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2022 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) 2014 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 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 this program. If not, see . ]) # serial 59 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 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 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) 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_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _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 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl 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_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that 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 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 set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.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_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify 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' ]) # _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 "$][$1" | $SED "$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 "$" | $SED "$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' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_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]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false 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) 2011 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. lt_cl_success=: test yes = "$silent" && 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) ])# 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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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 '$q' "$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' 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)], [Go], [_LT_LANG(GO)], [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 m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _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([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) 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)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) 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], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _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 there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; 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 ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) 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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # 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 if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _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 yes != "$lt_cv_apple_cc_single_mod"; 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([TAGNAME]) # ---------------------------------- # 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. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _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 no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) 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_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR 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 bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _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_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _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" ## exclude from sc_useless_quotes_in_assignment # 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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 yes = "[$]$2"; 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 "$_lt_linker_boilerplate" | $SED '/^$/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 yes = "[$]$2"; 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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" && \ test undefined != "$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`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 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 yes = "$cross_compiling"; 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 $LINENO "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 /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* 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 yes != "$enable_dlopen"; 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 ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; 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:$LINENO: $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:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; 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 -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _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 m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` 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 AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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 # correct to gnu/linux during the next big refactor 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,$cc_basename in yes,*) # gcc 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' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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 # correct to gnu/linux during the next big refactor 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 ;; freebsd* | dragonfly* | midnightbsd*) # 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[[23]].*) 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor 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 yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no 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], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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;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' ;; 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 # correct to gnu/linux during the next big refactor 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 # correct to gnu/linux during the next big refactor 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 yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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=sco 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 yes = "$with_gnu_ld"; 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 # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _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([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _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], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that 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 that 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 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' 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* | midnightbsd*) 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=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD 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])(-bit)?( [LM]SB)? 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) 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=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi 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_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi 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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $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:$LINENO: 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_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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 yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _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([AC_PROG_AWK])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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # 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 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #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. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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_globsym_save_LIBS=$LIBS lt_globsym_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 yes = "$pipe_works"; 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' 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_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _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_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _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)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $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 ia64 = "$host_cpu"; 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 ;; 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; 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* | midnightbsd*) # 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 ia64 != "$host_cpu"; 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 | 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* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _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*) ;; *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* | sunCC*) # 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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 case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; 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 ia64 = "$host_cpu"; 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 ;; 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' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 | 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' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny 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)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _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\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # 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)='' ;; *Sun\ F* | *Sun*Fortran*) _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 ' ;; *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,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; 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* | sunf77* | sunf90* | sunf95*) _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 that 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_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # 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]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # 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_PATH_MANIFEST_TOOL])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' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ 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_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++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([[^)]]\+)\s\+//' 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 ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _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(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _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/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] 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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; 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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' 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; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; 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; func_echo_all \"$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 yes = "$supports_anon_versioning"; 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 tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # 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)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; 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 $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 cannot *** 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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([$1]) _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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([$1]) _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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _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' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _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 `func_echo_all "$deplibs" | $SED '\''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(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; 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 ;; # 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* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -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 yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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 no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$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 yes,no = "$GCC,$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_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 no = "$with_gnu_ld"; 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 yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) 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* | bitrig*) 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__`"; 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 _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' 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 shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $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" && func_echo_all "-set_version $verstring"` -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 yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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 yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $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 $pic_flag $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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; 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_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$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_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_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* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_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_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([], [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([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _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], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi 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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_caught_CXX_error"; 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_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS 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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -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 -v "^Configured with:" | $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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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([$1]) _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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # 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 _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _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(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $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 ;; freebsd2.*) # 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* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; 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 "x$output_objdir/$soname" = "x$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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $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" && func_echo_all "-set_version $verstring"` -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 yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -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 | 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; func_echo_all "$list"' _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 | sort | $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 | sort | $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 | sort | $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 | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above 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; func_echo_all \"$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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # 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 yes = "$supports_anon_versioning"; 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; func_echo_all \"$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='func_echo_all' # 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 ;; openbsd* | bitrig*) 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__`"; 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=func_echo_all 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" && func_echo_all "$wl-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; 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" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $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 -v "^Configured with:" | $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* | sunCC*) # 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='func_echo_all' # 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 yes,no = "$GXX,$with_gnu_ld"; 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 $pic_flag -nostdlib $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 $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -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 -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $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 $wl-h $wl$soname -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 -v "^Configured with:" | $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 CANNOT 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(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 CFLAGS=$lt_save_CFLAGS 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 yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf 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). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _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 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])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 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac 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 $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 no = "$pre_test_object_deps_done"; 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 CFLAGS=$_lt_libdeps_save_CFLAGS # 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)= ;; 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_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_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_disable_F77"; 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 lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _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_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _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_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(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 yes != "$_lt_disable_FC"; 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 lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" 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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS 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 _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # 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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go 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 _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_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 CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_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_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= 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 CFLAGS=$lt_save_CFLAGS ])# _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 set = "${GCJFLAGS+set}" || 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_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # 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_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_TOOL([FILECMD], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _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 10 -lt "$lt_ac_count" && 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], [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_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS xrdp-0.10.1/m4/ax_require_defined.m4000644 001751 000000 00000002301 14652432047 017235 0ustar00metawheel000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_require_defined.html # =========================================================================== # # SYNOPSIS # # AX_REQUIRE_DEFINED(MACRO) # # DESCRIPTION # # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have # been defined and thus are available for use. This avoids random issues # where a macro isn't expanded. Instead the configure script emits a # non-fatal: # # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found # # It's like AC_REQUIRE except it doesn't expand the required macro. # # Here's an example: # # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) # # LICENSE # # Copyright (c) 2014 Mike Frysinger # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 1 AC_DEFUN([AX_REQUIRE_DEFINED], [dnl m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) ])dnl AX_REQUIRE_DEFINED xrdp-0.10.1/m4/pkg.m4000644 001751 000000 00000024011 14652432047 014176 0ustar00metawheel000000 000000 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR xrdp-0.10.1/m4/ax_check_compile_flag.m4000644 001751 000000 00000006402 14652432047 017667 0ustar00metawheel000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 4 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS xrdp-0.10.1/m4/ax_append_flag.m4000644 001751 000000 00000005331 14652432047 016351 0ustar00metawheel000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AC_DEFUN([AX_APPEND_FLAG], [dnl AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) AS_VAR_SET_IF(FLAGS,[ AS_CASE([" AS_VAR_GET(FLAGS) "], [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], [ AS_VAR_APPEND(FLAGS,[" $1"]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) ], [ AS_VAR_SET(FLAGS,[$1]) AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG xrdp-0.10.1/m4/lt~obsolete.m4000644 001751 000000 00000014007 14652432071 015770 0ustar00metawheel000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 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 5 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_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])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) xrdp-0.10.1/m4/ltsugar.m4000644 001751 000000 00000010453 14652432071 015100 0ustar00metawheel000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 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 ]) xrdp-0.10.1/m4/.gitignore000644 001751 000000 00000000022 14652432047 015137 0ustar00metawheel000000 000000 libtool.m4 lt*.m4 xrdp-0.10.1/m4/ltversion.m4000644 001751 000000 00000001312 14652432071 015436 0ustar00metawheel000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2022 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. # @configure_input@ # serial 4245 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.7' macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xrdp-0.10.1/m4/ax_type_socklen_t.m4000644 001751 000000 00000004644 14652432047 017141 0ustar00metawheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_type_socklen_t.html # =========================================================================== # # SYNOPSIS # # AX_TYPE_SOCKLEN_T # # DESCRIPTION # # Check whether sys/socket.h defines type socklen_t. Please note that some # systems require sys/types.h to be included before sys/socket.h can be # compiled. # # LICENSE # # Copyright (c) 2008 Lars Brinkhoff # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 AU_ALIAS([TYPE_SOCKLEN_T], [AX_TYPE_SOCKLEN_T]) AC_DEFUN([AX_TYPE_SOCKLEN_T], [AC_CACHE_CHECK([for socklen_t], [ac_cv_ax_type_socklen_t], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[socklen_t len = (socklen_t) 42; return (!len);]])], [ac_cv_ax_type_socklen_t=yes], [ac_cv_ax_type_socklen_t=no]) ]) if test $ac_cv_ax_type_socklen_t != yes; then AC_DEFINE(socklen_t, int, [Substitute for socklen_t]) fi ]) xrdp-0.10.1/m4/ltoptions.m4000644 001751 000000 00000034275 14652432071 015462 0ustar00metawheel000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _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], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [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_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _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@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [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])]) xrdp-0.10.1/m4/ax_gcc_func_attribute.m4000644 001751 000000 00000017073 14652432047 017751 0ustar00metawheel000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html # =========================================================================== # # SYNOPSIS # # AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) # # DESCRIPTION # # This macro checks if the compiler supports one of GCC's function # attributes; many other compilers also provide function attributes with # the same syntax. Compiler warnings are used to detect supported # attributes as unsupported ones are ignored by default so quieting # warnings when using this macro will yield false positives. # # The ATTRIBUTE parameter holds the name of the attribute to be checked. # # If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. # # The macro caches its result in the ax_cv_have_func_attribute_ # variable. # # The macro currently supports the following function attributes: # # alias # aligned # alloc_size # always_inline # artificial # cold # const # constructor # constructor_priority for constructor attribute with priority # deprecated # destructor # dllexport # dllimport # error # externally_visible # flatten # format # format_arg # gnu_inline # hot # ifunc # leaf # malloc # noclone # noinline # nonnull # noreturn # nothrow # optimize # pure # unused # used # visibility # warning # warn_unused_result # weak # weakref # # Unsuppored function attributes will be tested with a prototype returning # an int and not accepting any arguments and the result of the check might # be wrong or meaningless so use with care. # # LICENSE # # Copyright (c) 2013 Gabriele Svelto # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 3 AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([ m4_case([$1], [alias], [ int foo( void ) { return 0; } int bar( void ) __attribute__(($1("foo"))); ], [aligned], [ int foo( void ) __attribute__(($1(32))); ], [alloc_size], [ void *foo(int a) __attribute__(($1(1))); ], [always_inline], [ inline __attribute__(($1)) int foo( void ) { return 0; } ], [artificial], [ inline __attribute__(($1)) int foo( void ) { return 0; } ], [cold], [ int foo( void ) __attribute__(($1)); ], [const], [ int foo( void ) __attribute__(($1)); ], [constructor_priority], [ int foo( void ) __attribute__((__constructor__(65535/2))); ], [constructor], [ int foo( void ) __attribute__(($1)); ], [deprecated], [ int foo( void ) __attribute__(($1(""))); ], [destructor], [ int foo( void ) __attribute__(($1)); ], [dllexport], [ __attribute__(($1)) int foo( void ) { return 0; } ], [dllimport], [ int foo( void ) __attribute__(($1)); ], [error], [ int foo( void ) __attribute__(($1(""))); ], [externally_visible], [ int foo( void ) __attribute__(($1)); ], [flatten], [ int foo( void ) __attribute__(($1)); ], [format], [ int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); ], [format_arg], [ char *foo(const char *p) __attribute__(($1(1))); ], [gnu_inline], [ inline __attribute__(($1)) int foo( void ) { return 0; } ], [hot], [ int foo( void ) __attribute__(($1)); ], [ifunc], [ int my_foo( void ) { return 0; } static int (*resolve_foo(void))(void) { return my_foo; } int foo( void ) __attribute__(($1("resolve_foo"))); ], [leaf], [ __attribute__(($1)) int foo( void ) { return 0; } ], [malloc], [ void *foo( void ) __attribute__(($1)); ], [noclone], [ int foo( void ) __attribute__(($1)); ], [noinline], [ __attribute__(($1)) int foo( void ) { return 0; } ], [nonnull], [ int foo(char *p) __attribute__(($1(1))); ], [noreturn], [ void foo( void ) __attribute__(($1)); ], [nothrow], [ int foo( void ) __attribute__(($1)); ], [optimize], [ __attribute__(($1(3))) int foo( void ) { return 0; } ], [pure], [ int foo( void ) __attribute__(($1)); ], [unused], [ int foo( void ) __attribute__(($1)); ], [used], [ int foo( void ) __attribute__(($1)); ], [visibility], [ int foo_def( void ) __attribute__(($1("default"))); int foo_hid( void ) __attribute__(($1("hidden"))); int foo_int( void ) __attribute__(($1("internal"))); int foo_pro( void ) __attribute__(($1("protected"))); ], [warning], [ int foo( void ) __attribute__(($1(""))); ], [warn_unused_result], [ int foo( void ) __attribute__(($1)); ], [weak], [ int foo( void ) __attribute__(($1)); ], [weakref], [ static int foo( void ) { return 0; } static int bar( void ) __attribute__(($1("foo"))); ], [ m4_warn([syntax], [Unsupported attribute $1, the test may fail]) int foo( void ) __attribute__(($1)); ] )], []) ], dnl GCC doesn't exit with an error if an unknown attribute is dnl provided but only outputs a warning, so accept the attribute dnl only if no warning were issued. [AS_IF([test -s conftest.err], [AS_VAR_SET([ac_var], [no])], [AS_VAR_SET([ac_var], [yes])])], [AS_VAR_SET([ac_var], [no])]) ]) AS_IF([test yes = AS_VAR_GET([ac_var])], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, [Define to 1 if the system has the `$1' function attribute])], []) AS_VAR_POPDEF([ac_var]) ]) xrdp-0.10.1/m4/ax_append_compile_flags.m4000644 001751 000000 00000005654 14652432047 020254 0ustar00metawheel000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # For every FLAG1, FLAG2 it is checked whether the compiler works with the # flag. If it does, the flag is added FLAGS-VARIABLE # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. During the check the flag is always added to the # current language's flags. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: This macro depends on the AX_APPEND_FLAG and # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with # AX_APPEND_LINK_FLAGS. # # LICENSE # # Copyright (c) 2011 Maarten Bosmans # # 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 program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 5 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4]) done ])dnl AX_APPEND_COMPILE_FLAGS xrdp-0.10.1/docs/Makefile.in000644 001751 000000 00000047343 14652432075 015646 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = \ man all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/docs/Makefile.am000644 001751 000000 00000000023 14652432047 015614 0ustar00metawheel000000 000000 SUBDIRS = \ man xrdp-0.10.1/docs/man/000755 001751 000000 00000000000 14652432105 014333 5ustar00metawheel000000 000000 xrdp-0.10.1/docs/man/xrdp-dis.1.in000644 001751 000000 00000001027 14652432047 016561 0ustar00metawheel000000 000000 .TH "xrdp-dis" "1" "@PACKAGE_VERSION@" "xrdp team" .SH NAME xrdp\-dis \- xrdp disconnect utility .SH SYNOPSIS .B xrdp\-dis .SH DESCRIPTION .PP \fBxrdp\-dis\fP is run with no parameters to disconnect your xrdp session. .SH ENVIRONMENT .TP .B DISPLAY to get the default host and display number. .SH FILES .TP .I @socketdir@/xrdp_disconnect_display_* UNIX socket used to communicate the disconnect request to xorgxrdp. .SH KNOWN ISSUES .TP This utility doesn't support disconnecting Xvnc sessions so far. .SH SEE ALSO .BR xrdp (8). xrdp-0.10.1/docs/man/xrdp-mkfv1.8.in000644 001751 000000 00000004500 14652432047 017034 0ustar00metawheel000000 000000 .TH "xrdp-mkfv1" "8" "@PACKAGE_VERSION@" "xrdp team" .SH NAME xrdp\-mkfv1 \- Create .fv1 font files from other font files .SH SYNOPSIS \fBxrdp-mkfv1\fR [ options ] font_file fv1_file .SH DESCRIPTION \fBxrdp\-mkfv1\fP can be used to convert a font file such as a TrueType font to a fv1 file. .SH OPTIONS A summary of options is included below. .TP \fB\-n\fR Give the font a name, which is stored in the font header. The default is to use the font family name from the source font. .TP \fB\-p\fR Set the point size of the font. A fixed DPI value of 96 is used for converting this value into a pixel size. The default value for this option is '10'. .TP \fB\-m\fR Set the limit on the glyphs stored in the font file. The argument is the last glyph stored in the font file. Specify the glyph using one of the following strings: \fBU+\fR - Unicode character, e.g. \fBU+25\fR for a percentage symbol (%). \fB@\fR - Unicode character, e.g. \fB@%\fR for a percentage symbol. \fBnumber\fR - Unicode value as an integer, e.g. \fB37\fR for a percentage symbol The default value for this option is 'U+4DFF'. .TP \fB\-C\fR When used with the "DejaVu Sans" font at a point-size of 10, a small number of glyphs are assigned a different x-offset than they have when the original Windows font generation program is used. This switch can be used to preserve the original x-offsets for glyphs in the range U+0020 - U+00FF when a 10 point DajaVu Sans font is generated. Use one of the following arguments to this option:- \fBauto\fR - Automatic mode. Offsets are preserved if a "DajaVu Sans" 10-point font is converted. \fBon / true / yes\fR - Preserve offsets if automatic font detection does not work. \fBoff / false / no\fR - Do not tamper with the offsets generated by the program. The default value of this switch is \fRauto\fR. To see the effects of this switch, set the \fBMKFV1_LOG_LEVEL\fR environment variable to \fBinfo\fR before running the program. .SH "EXAMPLES" .TP \fBxrdp-mkfv1 -p18 /path/to/DejaVuSans.ttf ./sans-18.fv1\fR Generate an 18-point Deja Sans font. .TP \fBxrdp-mkfv1 -C off -p10 /path/to/DejaVuSans.ttf ./sans-10.fv1\fR Generate a 10-point DajaVu Sans font using natural offsets. .SH SEE ALSO .BR xrdp\-dumpfv1(8). More info on \fBxrdp\fR can be found on the .UR @xrdphomeurl@ xrdp homepage .UE xrdp-0.10.1/docs/man/xrdp-genkeymap.8.in000644 001751 000000 00000002515 14652432047 017774 0ustar00metawheel000000 000000 .TH "xrdp\-genkeymap" "8" "@PACKAGE_VERSION@" "xrdp team" "" .de URL . \\$2 \(laURL: \\$1 \(ra\\$3 .. .if \n[.g] .mso www.tmac .SH "NAME" \fBxrdp\-genkeymap\fR \- key map generator for XRDP .SH "SYNTAX" .B xrdp\-genkeymap .I file .SH "DESCRIPTION" \fBxrdp\-genkeymap\fR extracts the key map used by the currently running X session to generated a mapping from Remote Desktop Protocol (RDP) key codes to X keysyms and Unicode code points. .SH OPTIONS .TP .I outfile The key map information is stored in the file named \fIoutfile\fP. .SH "FILES" .TP .I @sysconfdir@/xrdp/km-XXXXXXXX.ini Files containing the keyboard mapping for language \fIXXXXXXXX\fP, which is a 8 digit hexadecimal number identifying the country and language code. .RS 8 .TP .B 00000405 cs Czech .TP .B 00000407 de German .TP .B 00000409 en-us US English .TP .B 0000040c fr French .TP .B 00000410 it Italian .TP .B 00000416 br Portuguese (Brazil) .TP .B 00000419 ru Russian .TP .B 0000041d se Swedish .TP .B 00000809 en-uk UK English .RE .SH "AUTHORS" Jay Sorg .br Simone Fedele .SH "SEE ALSO" .BR xrdp (8), .BR setxkbmap (1), .BR unicode (7) .PP Description of Keyboard Input mapping on the .UR https://github.com/FreeRDP/FreeRDP/wiki/Keyboard FreeRDP wiki .UE .PP For more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/sesman.ini.5.in000644 001751 000000 00000032500 14652432047 017077 0ustar00metawheel000000 000000 .\" .TH "sesman.ini" "5" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" \fBsesman.ini\fR \- Configuration file for \fBxrdp-sesman\fR(8) .SH "DESCRIPTION" \fBsesman.ini\fR consists of several sections. Each section starts with the section name in square brackets, followed by a list of \fIparameter\fR=\fIvalue\fR lines. Following sections are recognized: .TP \fB[Globals]\fR Global configuration .TP \fB[Logging]\fR Logging subsystem .TP \fB[Sessions]\fR Session management .TP \fB[Security]\fR Access control .TP \fB[Chansrv]\fR Settings for xrdp-chansrv(8) .TP \fB[ChansrvLogging]\fR Logging settings for xrdp-chansrv(8) .TP \fB[SessionVariables]\fR Environment variables for the session .LP All parameters and values (except for file names and paths) are case insensitive, and are described in detail below. If any parameter is specified more than once, the last entry will be used. Options specified outside their proper section will be \fIignored\fR. .SH "GLOBALS" Following parameters can be used in the \fB[Globals]\fR section. .TP \fBListenPort\fR=\fIpath-to-socket\fR UNIX domain socket for xrdp-sesman(8) to listen on. .PP .RS The default value of this setting is 'sesman.socket'. .PP An absolute path can be specified by starting this parameter with a '/'. In this instance, the system administrator is responsible for ensuring the socket can only be created by a suitably privileged process. .PP If the parameter does not start with a '/', a name within @socketdir@ is used. .RE .TP \fBEnableUserWindowManager\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables user specific startup script. That is, xrdp-sesman will execute the script specified by \fBUserWindowManager\fR if it exists. .TP \fBUserWindowManager\fR=\fIfilename\fR Path of the startup script relative to the user's home directory. If present and enabled by \fBEnableUserWindowManager\fR, that script is executed instead of \fBDefaultWindowManager\fR. .TP \fBDefaultWindowManager\fR=\fIfilename\fR Full path or relative path of the default startup script used by xrdp-sesman to start a session. If the path is not a full path, it will be resolved as relative path to \fI@xrdpconfdir@\fR. If not specified, defaults to \fI@xrdpconfdir@/startwm.sh\fR. .TP \fBReconnectScript\fR=\fIfilename\fR Full path or relative path if the script which executed when users reconnects to the existing session. If the path is not a full path, it will be resolved as relative path to \fI@xrdpconfdir@\fR. If not specified, defaults to \fI@xrdpconfdir@/reconnectwm.sh\fR. .SH "LOGGING" Following parameters can be used in the \fB[Logging]\fR and \fB[ChansrvLogging]\fR sections. .TP \fBLogFile\fR=\fIfilename\fR Log file path. It can be either absolute or relative. If not specified, defaults to \fI./sesman.log\fR. If set to \fB\fR, log will go to stdout. Use for debugging only\fR It is ignored in the [ChansrvLogging] section since the channel server creates one log file per display and instead uses the following log file naming convention \fIxrdp-chansrv.${DISPLAY}.log\fR .TP \fBLogLevel\fR=\fIlevel\fR This option can have one of the following values: \fBCORE\fR or \fB0\fR \- Log only core messages. Those messages are logged \fIregardless\fR of the selected logging level. \fBERROR\fR or \fB1\fR \- Log only error messages. \fBWARNING\fR, \fBWARN\fR or \fB2\fR \- Logs warnings and error messages. \fBINFO\fR or \fB3\fR \- Log errors, warnings and informational messages. \fBDEBUG\fR or \fB4\fR \- Log everything. If xrdp-sesman is compiled in debug mode, this options will output many more low\-level messages. .TP \fBEnableSyslog\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to syslog. .TP \fBSyslogLevel\fR=\fIlevel\fR Logging level for syslog. It can have the same values as \fBLogLevel\fR. Defaults to \fBDEBUG\fR. .TP \fBEnableConsole\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to the console (ie. stdout). .TP \fBConsoleLevel\fR=\fIlevel\fR Logging level for the console. It can have the same values as \fBLogLevel\fR. Defaults to \fBDEBUG\fR. .TP \fBEnableProcessId\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging the process id in all log messages. Defaults to \fBfalse\fR. .SH "SESSIONS" Following parameters can be used in the \fB[Sessions]\fR section. .TP \fBX11DisplayOffset\fR=\fInumber\fR The first X display number available for xrdp-sesman. This prevents xrdp-sesman from interfering with real X11 servers. If not specified, defaults to \fI10\fR. .TP \fBMaxSessions\fR=\fInumber\fR Sets the maximum number of simultaneous sessions. If not set or set to \fI0\fR, unlimited session are allowed. .TP \fBMaxDisplayNumber\fR=\fInumber\fR Sets the maximum number which can be assigned to an X11 $DISPLAY. The default is compatible with IANA TCP port allocations. If you are not allowing TCP connections to your X servers you may safely increase this number. .TP \fBKillDisconnected\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed within \fBDisconnectedTimeLimit\fR seconds after the user disconnects. This setting currently only works with xorgxrdp sessions. .TP \fBDisconnectedTimeLimit\fR=\fInumber\fR Sets the time limit for \fBKillDisconnected\fR to a value greater than 60. Values less than 60 are to be overridden with 60. This setting currently only works with xorgxrdp sessions. .TP \fBIdleTimeLimit\fR=\fInumber\fR Sets the time limit (in seconds) before an idle session is disconnected. Idle means no keyboard inputs and no mouse moves/clicks here. If set to \fI0\fR, idle sessions will never be disconnected by timeout. This works only with xorgxrdp sessions. Moreover, xorgxrdp must be v0.2.9 or later. .TP \fBPolicy\fR=\fI[Default|Separate|{UBDI}]\fR Session allocation policy. Used to decide when to allocate a new session. Set to one of the following values: .br .RS .HP 12 \fBDefault\fR - Currently the same as "UB" for all session types .HP 12 \fBSeparate\fR - All sessions are separate. Sessions can never be rejoined, and will need to be cleaned up manually, or automatically by setting other sesman options. .P Alternatively combine one-or-more of the following options .HP 4 \fBU\fR - Sessions are separated per user .HP 4 \fBB\fR - Sessions are separated by bits-per-pixel .HP 4 \fBD\fR - Sessions are separated by initial display size .HP 4 \fBI\fR - Sessions are separated by IP address .RE .IP Note that the \fBU\fR and \fBB\fR criteria cannot be turned off. \fBDisplaySize\fR refers to the initial geometry of a connection, as actual display sizes can change dynamically. .SH "SECURITY" Following parameters can be used in the \fB[Security]\fR section. .TP \fBAllowRootLogin\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, enables root login on the terminal server. .TP \fBMaxLoginRetry\fR=\fInumber\fR The number of login attempts that are allowed on terminal server. If set to \fI0\fR, unlimited attempts are allowed. If not specified, defaults to \fI3\fR. .TP \fBTerminalServerUsers\fR=\fIgroup\fR Only the users belonging to the specified group are allowed to login on terminal server. If unset or set to an invalid or non\-existent group, login for all users is enabled. .TP \fBTerminalServerAdmins\fR=\fIgroup\fR \fIThis option is currently ignored!\fR Only members of this group can have session management rights. .TP \fBRestrictOutboundClipboard\fR=\fI[all|none|text|file|image]\fR If set to \fBall\fR, will restrict the clipboard outbound from the server, to prevent data copied inside the xrdp session to be pasted in the client. Default value is \fBnone\fR. In addition, you can control text/file/image transfer restrictions respectively. It also accepts comma separated list such as text,file,image. .br .br \fBnone\fR - No restriction about copying inbound clipboard data. .br \fBall\fR - Restrict to copy inbound clipboard data. .br \fBtext\fR - Restrict to copy only inbound text clipboard data. .br \fBfile\fR - Restrict to copy only inbound file clipboard data. .br \fBimage\fR - Restrict to copy only inbound image clipboard data. .br To keep compatibility, the following aliases are also available. .br \fBtrue\fR - an alias of \fBall\fR. .br \fBfalse\fR - an alias of \fBnone\fR. .br \fByes\fR - an alias of \fBall\fR. .TP \fBRestrictInboundClipboard\fR=\fI[none|all|text|file|image]\fR If set to \fBall\fR, will restrict the clipboard inbound from the client, to prevent data copied inside the client to be pasted in the xrdp session. Default value is \fBnone\fR. In addition, you can control text/file/image transfer restrictions respectively. It also accepts comma separated list such as text,file,image. .br .br \fBnone\fR - No restriction about copying inbound clipboard data. .br \fBall\fR - Restrict to copy inbound clipboard data. .br \fBtext\fR - Restrict to copy only inbound text clipboard data. .br \fBfile\fR - Restrict to copy only inbound file clipboard data. .br \fBimage\fR - Restrict to copy only inbound image clipboard data. .br To keep compatibility, the following aliases are also available. .br \fBtrue\fR - an alias of \fBall\fR. .br \fBfalse\fR - an alias of \fBnone\fR. .br \fByes\fR - an alias of \fBall\fR. .TP \fBAlwaysGroupCheck\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, require group membership even if the group specified in \fBTerminalServerUsers\fR doesn't exist. .TP \fBAllowAlternateShell\fR=\fI[true|false]\fR If set to \fB0\fR, \fBfalse\fR or \fBno\fR, prevent usage of alternate shells by users. .TP \fBXorgNoNewPrivileges\fR=\fI[true|false]\fR Only applicable on Linux. If set to \fB0\fR, \fBfalse\fR or \fBno\fR, do not use the kernel's \fIno_new_privs\fR restriction when invoking the Xorg X11 server. The use of \fIno_new_privs\fR is intended to prevent issues due to a setuid Xorg executable. However, if a kernel security module (such as AppArmor) is used to confine xrdp, \fIno_new_privs\fR may interfere with transitions between confinement domains. .TP \fBSessionSockdirGroup\fR=\fIgroup\fR Sets the group owner of the directories containing session sockets. This is normally the GID of the xrdp process so xrdp can connect to user sessions. .SH "X11 SERVER" Following parameters can be used in the \fB[Xvnc]\fR and \fB[Xorg]\fR sections. .TP \fBparam\fR=\fIstring\fR Multiple \fIparam\fR lines are supported. This first line specifies the path to the X11 server executable. Following lines specify command line arguments passed to the X11 server. .SH "CHANSRV" Following parameters can be used in the \fB[Chansrv]\fR section. .TP \fBFuseMountName\fR=\fIstring\fR Directory for drive redirection. Created if it doesn't exist. If not specified, defaults to \fIxrdp_client\fR. If first character is not a '/', this is relative to $HOME. .P .RS The following substitutions are made in this string:- %U - Username %u - Numeric UID %d - Numeric display number (ex 10) %D - Display environment variable (ex :10.0) %% - Percent character .HP 3 1) The directory path permissions MUST be configured correctly by the system administrator or the system itself - xrdp-chansrv will not do this for you (although it will create the final directories owned by the user). .HP 3 2) The desktop may not automatically display a link for the redirected drive. To fix this, consult the docs for your chosen desktop. .RE .TP \fBFileUmask\fR=\fImode\fR Additional umask to apply to files in the \fBFuseMountName\fR directory. The default value of 077 prevents other users on the system from reading files on your redirected drives. This may not be appropriate for all environments, and so you can change this value to allow other users to access your remote files if required. .TP \fBEnableFuseMount\fR=\fI[true|false]\fR Defaults to \fItrue\fR. Set to \fIfalse\fR to disable xrdp-chansrv's use of the FUSE system feature, even if it has been built with this feature enabled. .P .RS Setting this value to \fIfalse\fR will disable the following application features:- .P - drive redirection .P - copying-and-pasting of files .RE .TP \fBUseNautilus3FlistFormat\fR=\fI[false|true]\fR Defaults to \fIfalse\fR. Set to \fItrue\fR to make file copy-paste compatible with Nautilus from GNOME 3 versions later than 3.29.92. Do not use this for any other reason. This setting will be removed in a later version of xrdp, when GNOME 3 is no longer supported. .TP \fBSoundNumSilentFramesAAC\fR=\fInumber\fR Sets the \fInumber\fR of silent frames which are sent to client before close message is sent, when AAC is selected. If set to 0, no silent frame is sent. If not specified, defaults to \fI4\fR. .TP \fBSoundNumSilentFramesMP3\fR=\fInumber\fR Sets the \fInumber\fR of silent frames which are sent to client before close message is sent, when MP3 is selected. If set to 0, no silent frame is sent. If not specified, defaults to \fI2\fR. .TP \fBSoundMsecDoNotSend\fR=\fInumber\fR Sets the duration(msec). Sound data is not send to client during \fInumber\fR millisecond(s) after close message is sent, when AAC/MP3 is selected. If set to 0, all the data is sent. If not specified, defaults to \fI1000\fR. .SH "SESSIONS VARIABLES" All entries in the \fB[SessionVariables]\fR section are set as environment variables in the user's session. .SH "FILES" @sysconfdir@/xrdp/sesman.ini .SH "SEE ALSO" .BR xrdp-sesman (8), .BR xrdp-sesrun (8), .BR xrdp (8), .BR xrdp.ini (5) For more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/xrdp-keygen.8.in000644 001751 000000 00000002262 14652432047 017275 0ustar00metawheel000000 000000 .\" Hey, EMACS: -*- nroff -*- .\"- .\" Copyright © 2007, 2008 Vincent Bernat .\" License: GPL-2+ .\"- .TH xrdp\-keygen 8 "@PACKAGE_VERSION@" "xrdp team" .SH NAME xrdp\-keygen \- xrdp RSA key generation utility .SH SYNOPSIS .B xrdp\-keygen xrdp < \fIoutfile\fP | \fBauto\fP > .br .B xrdp\-keygen test .SH DESCRIPTION \fBxrdp\-keygen\fP generates the file .I @sysconfdir@/xrdp/rsakeys.ini which contains the RSA key pair used to perform authentication to remote clients. The public key is self-signed. .SH OPTIONS This program takes one of the following options: .TP \fBxrdp\fP \fIoutfile\fP Generate a new key pair. The key data is stored in the file named \fIoutfile\fP. .br If \fBauto\fP is used as \fIoutfile\fP, the default file \fI@sysconfdir@/xrdp/rsakeys.ini\fP gets created if it does not yet exists. .TP .B test Generate a test key pair and print information to standard output. .SH FILES .TP .I @sysconfdir@/xrdp/rsakeys.ini RSA public and private key pair used to identify this XRDP server. .SH SEE ALSO .BR xrdp (8), .BR xrdp\-sesman (8). .SH AUTHOR This manual page was originally written by Vincent Bernat . xrdp-0.10.1/docs/man/xrdp-dumpfv1.8.in000644 001751 000000 00000003254 14652432047 017377 0ustar00metawheel000000 000000 .TH "xrdp-dumpfv1" "8" "@PACKAGE_VERSION@" "xrdp team" .SH NAME xrdp\-dumpfv1 \- Display content of .fv1 font files .SH SYNOPSIS \fBxrdp-dumpfv1\fR [ options ] fv1_file .SH DESCRIPTION \fBxrdp\-dumpfv1\fP can be used to display the contents of an fv1 file. .SH OPTIONS A summary of options is included below. One of \fB\-i\fR, \fB\-t\fR, or \fB\-c\fR must be specified. .TP \fB\-i\fR Displays general information about the fv1 file. .TP \fB\-t\fR Displays a CSV table of all the glyphs in the font. This table can be imported into a spreadsheet program for further manipulation. .TP \fB\-c\fR Displays detailed information about a particular glyph in the font, including a representation of the bitmap for the glyph. Specify the character using one of the following strings: \fBU+\fR - Unicode character, e.g. \fBU+25\fR for a percentage symbol (%). \fB@\fR - Unicode character, e.g. \fB@%\fR for a percentage symbol. \fBnumber\fR - Unicode value as an integer, e.g. \fB37\fR for a percentage symbol Note that the row numbers shown in the font data are relative to the natural font baseline. If comparing two fonts, be aware that when the glyph is drawn, the row number may be affected by the global descender value for the font (displayed with \fB\-i\fR). .SH "EXAMPLES" .TP \fBxrdp\-dumpfv1 -i @xrdpdatadir@/sans-10.fv1\fR Displays global information about the sans 10 font file distributed with xrdp. .TP \fBxrdp\-dumpfv1 -c @'*' @xrdpdatadir@/sans-10.fv1\fR Displays information about the asterisk symbol in the sans 10 font file distributed with xrdp. .SH SEE ALSO .BR xrdp\-mkfv1(8). More info on \fBxrdp\fR can be found on the .UR @xrdphomeurl@ xrdp homepage .UE xrdp-0.10.1/docs/man/xrdp-sesman.8.in000644 001751 000000 00000003752 14652432047 017306 0ustar00metawheel000000 000000 .TH "xrdp\-sesman" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" xrdp\-sesman \- \fBxrdp\fR(8) session manager .SH "SYNTAX" .B xrdp\-sesman \-\-kill .br .B xrdp\-sesman \-\-reload .br .B xrdp\-sesman \-\-help .br .B xrdp\-sesman \-\-version .br .B xrdp\-sesman [\-\-nodaemon] [\-\-dump\-config] [\-\-config /path/to/sesman.ini] .SH "DESCRIPTION" \fBxrdp\-sesman\fR is \fBxrdp\fR(8) session manager. .br It manages user sessions by authenticating the user and starting the appropriate Xserver. .SH "OPTIONS" .TP \fB\-k\fR, \fB\-\-kill\fR Kills running \fBxrdp\-sesman\fR daemon. .TP \fB\-r\fR, \fB\-\-reload\fR Reloads running \fBxrdp\-sesman\fR daemon. .TP \fB\-h\fR, \fB\-\-help\fR Output help information and exit. .TP \fB\-v\fR, \fB\-\-version\fR Output version information and exit. .TP \fB\-n\fR, \fB\-\-nodaemon\fR Starts \fBxrdp\-sesman\fR in foreground instead of starting it as a daemon. .TP \fB\-\-dump\-config\fR Print the configuration on stdout before starting the daemon. The default is not to do this. .TP \fB\-c\fR, \fB\-\-config\fR Specify a path to a different \fIsesman.ini\fR file. This option is intended to be used primarily for testing or for unusual configurations. .P .RS If you use this option, be aware that you will have to have a \fB@sysconfdir@/xrdp/sesman.ini\fR in place too, as a few elements of the system (notably \fBxrdp(8)\fR and \fBxrdp\-chansrv(8)\fR) will want to read it. .RE .SH "SIGNALS" .TP \fBSIGHUP\fR Causes \fBxrdp\-sesman\fR to reload its configuration. Needed if you're not running \fBxrdp\-sesman\fR as a daemon. .SH "FILES" @sbindir@/xrdp\-sesman .br @bindir@/xrdp\-sesrun .br @sysconfdir@/xrdp/sesman.ini .br @localstatedir@/log/xrdp\-sesman.log .br @localstatedir@/run/xrdp\-sesman.pid .br @socketdir@/sesman.socket .SH "AUTHORS" Jay Sorg .br Simone Fedele .SH "SEE ALSO" .BR sesman.ini (5), .BR xrdp\-sesrun (8), .BR xrdp (8), .BR xrdp.ini (5) for more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/xrdp-chansrv.8.in000644 001751 000000 00000002722 14652432047 017460 0ustar00metawheel000000 000000 .TH "xrdp\-chansrv" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" \fBxrdp\-chansrv\fR \- \fBxrdp\fR channel server .SH "SYNTAX" .B xrdp\-chansrv .SH "DESCRIPTION" \fBxrdp\-chansrv\fR is the \fBxrdp\fR(8) channel server, which manages the Remote Desktop Protocol (RDP) sub-channels. .PP This program is only forked internally by \fBxrdp\-sesman\fP(8). .PP Currently \fBxrdp\-chansrv\fP knows about the following channels: .RS 8 .TP .B cliprdr Clipboard Redirection .TP .B rdpsnd Remote Desktop Protocol Sound .TP .B rdpdr Remote Desktop Protocol Device Redirection .TP .B rail Remote Applications Integrated Locally .TP .B drdynvc Dynamic Virtual Channel .RE .SH ENVIRONMENT .TP .I CHANSRV_LOG_PATH Path to the location where the log file is stored. If not specified, $\fBXDG_DATA_HOME/xrdp\fP or \fB$HOME/.local/share/xrdp\fP is used instead. .TP .I DISPLAY X11 display number. Must be specified. .SH FILES .TP .I @sysconfdir@/xrdp/sesman.ini Contains some settings for this program. .TP .I @socketdir@/xrdp_chansrv_socket_* UNIX socket used by external programs to implement channels. .TP .I @socketdir@/xrdp_api_* UNIX socket used by \fBxrdp\-chansrv\fP to communicate with \fBxrdp\-sesman\fP. .TP .I xrdp-chansrv.%s.log Log file used by \fBxrdp\-chansrv\fP(8). \fB%s\fP is display number. See the description of \fBCHANSRV_LOG_PATH\fP above for the file's location. .SH "SEE ALSO" .BR xrdp\-sesman (8), .BR sesman.ini (5). For more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/xrdp.ini.5.in000644 001751 000000 00000034711 14652432047 016574 0ustar00metawheel000000 000000 .TH "xrdp.ini" "5" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" \fBxrdp.ini\fR \- Configuration file for \fBxrdp\fR(8) .SH "DESCRIPTION" This is the man page for \fBxrdp.ini\fR, \fBxrdp\fR(8) configuration file. It is composed by a number of sections, each one composed by a section name, enclosed by square brackets, followed by a list of \fI\fR=\fI\fR lines. \fBxrdp.ini\fR supports the following sections: .TP \fB[Globals]\fP \- sets some global configuration settings for \fBxrdp\fR(8). .TP \fB[Logging]\fP \- logging subsystem parameters .TP \fB[Channels]\fP \- channel subsystem parameters .LP All options and values (except for file names and paths) are case insensitive, and are described in detail below. .SH "GLOBALS" The options to be specified in the \fB[Globals]\fR section are the following: .TP \fBautorun\fP=\fIsession_name\fP Section name for automatic login. If set and the client supplies valid username and password, the user will be logged in automatically using the connection specified by \fIsession_name\fP. If \fIsession_name\fP is empty, the \fBLOGIN DOMAIN\fR from the client with be used to select the section. If no domain name is supplied, the first suitable section will be used for automatic login. .TP \fBbitmap_cache\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables bitmap caching in \fBxrdp\fR(8). .TP \fBbitmap_compression\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables bitmap compression in \fBxrdp\fR(8). .TP \fBbulk_compression\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables compression of bulk data in \fBxrdp\fR(8). .TP \fBcertificate\fP=\fI/path/to/certificate\fP .TP \fBkey_file\fP=\fI/path/to/private_key\fP Set location of TLS certificate and private key. They must be written in PEM format. If not specified, defaults to \fB@sysconfdir@/xrdp/cert.pem\fP, \fB@sysconfdir@/xrdp/key.pem\fP. This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP. .TP \fBchannel_code\fP=\fI[true|false]\fP If set to \fB0\fR, \fBfalse\fR or \fBno\fR this option disables all channels \fBxrdp\fR(8). See section \fBCHANNELS\fP below for more fine grained options. .TP \fBcrypt_level\fP=\fI[low|medium|high|fips]\fP .\" Regulate encryption level of Standard RDP Security. This parameter is effective only if \fBsecurity_layer\fP is set to \fBrdp\fP or \fBnegotiate\fP. Encryption in Standard RDP Security is controlled by two settings: \fIEncryption Level\fP and \fIEncryption Method\fP. The only supported \fIEncryption Method\fP are \fB40BIT_ENCRYPTION\fP and \fB128BIT_ENCRYPTION\fP. \fB56BIT_ENCRYPTION\fP is not supported. This option controls the \fIEncryption Level\fP: .RS 8 .TP .B low All data sent from the client to the server is protected by encryption based on the maximum key strength supported by the client. .I This is the only level that the traffic sent by the server to client is not encrypted. .TP .B medium All data sent between the client and the server is protected by encryption based on the maximum key strength supported by the client (client compatible). .TP .B high All data sent between the client and the server is protected by encryption based on the server's maximum key strength (sever compatible). .TP .B fips All data sent between the client and server is protected using Federal Information Processing Standard 140-1 validated encryption methods. .I This level is required for Windows clients (mstsc.exe) if the client's group policy .I enforces FIPS-compliance mode. .RE .TP \fBfork\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR for each incoming connection \fBxrdp\fR(8) forks a sub-process instead of using threads. .TP \fBhidelogwindow\fP=\fI[true|false]\fP If set to \fB1\fP, \fBtrue\fP or \fByes\fP, \fBxrdp\fP will not show a window for log messages. If not specified, defaults to \fBfalse\fP. .TP \fBmax_bpp\fP=\fI[8|15|16|24|32]\fP Limit the color depth by specifying the maximum number of bits per pixel. If not specified or set to \fB0\fP, unlimited. .TP \fBpamerrortxt\fP=\fIerror_text\fP Specify additional text displayed to user if authentication fails. The maximum length is \fB256\fP. The use of 'pam' in the name of this option is historic .TP \fBport\fP=\fIport\fP Specify TCP port and interface to listen on for incoming connections. Specifying only the port means that xrdp will listen on all interfaces. The default port for RDP is \fB3389\fP. Multiple address:port instances must be separated by spaces or commas. Check the .ini file for examples. Specifying interfaces requires said interfaces to be UP before xrdp starts. .TP \fBenable_token_login\fP=\fI[true|false]\fP If set to \fB1\fP, \fBtrue\fP or \fByes\fP, \fBxrdp\fP will scan the user name provided by the client for the ASCII field separator character (0x1F). It will then copy over what is after the separator as the password supplied by the user and treats it as autologon. If not specified, defaults to \fBfalse\fP. .TP \fBdomain_user_separator\fP=\fBseparator\fP If specified the domain name supplied by the client is appended to the username separated by \fBseparator\fP. .TP \fBrequire_credentials\fP=\fI[true|false]\fP If set to \fB1\fP, \fBtrue\fP or \fByes\fP, \fBxrdp\fP requires clients to include username and password initial connection phase. In other words, xrdp doesn't allow clients to show login screen if set to true. It follows that an incorrect password will cause the login to immediately fail without displaying the login screen. If not specified, defaults to \fBfalse\fP. .TP \fBsecurity_layer\fP=\fI[tls|rdp|negotiate]\fP Regulate security methods. If not specified, defaults to \fBnegotiate\fP. .RS 8 .TP .B tls Enhanced RDP Security is used. All security operations (encryption, decryption, data integrity verification, and server authentication) are implemented by TLS. .TP .B rdp Standard RDP Security, which is not safe from man-in-the-middle attack, is used. The encryption level of Standard RDP Security is controlled by \fBcrypt_level\fP. .TP .B negotiate Negotiate these security methods with clients. .RE .TP \fBssl_protocols\fP=\fI[SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3]\fP Enables the specified SSL/TLS protocols. Each value should be separated by comma. SSLv2 is always disabled. At least one protocol should be given to accept TLS connections. This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP. .TP \fBtcp_keepalive\fP=\fI[true|false]\fP Regulate if the listening socket uses socket option \fBSO_KEEPALIVE\fP. If set to \fB1\fP, \fBtrue\fP or \fByes\fP and the network connection disappears without closing messages, the connection will be closed. .TP \fBtcp_nodelay\fP=\fI[true|false]\fP Regulate if the listening socket uses socket option \fBTCP_NODELAY\fP. If set to \fB1\fP, \fBtrue\fP or \fByes\fP, no buffering will be performed in the TCP stack. .TP \fBtcp_send_buffer_bytes\fP=\fIbuffer_size\fP .TP \fBtcp_recv_buffer_bytes\fP=\fIbuffer_size\fP Specify send/recv buffer sizes in bytes. The default value depends on the operating system. It is recommended not to set these on systems with dynamic TCP buffer sizing .TP \fBtls_ciphers\fP=\fIcipher_suite\fP Specifies TLS cipher suite. The format of this parameter is equivalent to which \fBopenssl\fP(1) ciphers subcommand accepts. (ex. $ openssl ciphers 'HIGH:!ADH:!SHA1') This parameter is effective only if \fBsecurity_layer\fP is set to \fBtls\fP or \fBnegotiate\fP. .TP \fBuse_fastpath\fP=\fI[input|output|both|none]\fP If not specified, defaults to \fBnone\fP. .TP \fBblack\fP=\fI000000\fP .TP \fBgrey\fP=\fIc0c0c0\fP .TP \fBdark_grey\fP=\fI808080\fP .TP \fBblue\fP=\fI0000ff\fP .TP \fBdark_blue\fP=\fI00007f\fP .TP \fBwhite\fP=\fIffffff\fP .TP \fBred\fP=\fIff0000\fP .TP \fBgreen\fP=\fI00ff00\fP .TP \fBbackground\fP=\fI000000\fP These options override the colors used internally by \fBxrdp\fP(8) to draw the login and log windows. Colors are defined using a hexadecimal (hex) notation for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one of the light sources is 0 (hex 00). The highest value is 255 (hex FF). .TP \fBfv1_select\fP=\fI130:sans-18.fv1,0:sans-10.fv1\fP Selects a default fv1 font. This parameter is a comma-separated list of DPI:name pairs. The list is scanned from left-to-right. The font used is the first font whose DPI value is less-than-or-equal to the vertical DPI of the monitor used for the login screen. .TP \fBdefault_dpi\fP=\fI96\fP Default DPI used for a monitor if the client does not send physical size information. .SH "LOGGING" The following parameters can be used in the \fB[Logging]\fR section: .TP \fBLogFile\fR=\fI@localstatedir@/log/xrdp.log\fR This options contains the path to logfile. It can be either absolute or relative. If set to \fB\fR, log will go to stdout. Use for debugging only\fR .TP \fBLogLevel\fR=\fIlevel\fR This option can have one of the following values: \fBCORE\fR or \fB0\fR \- Log only core messages. these messages are _always_ logged, regardless the logging level selected. \fBERROR\fR or \fB1\fR \- Log only error messages \fBWARNING\fR, \fBWARN\fR or \fB2\fR \- Logs warnings and error messages \fBINFO\fR or \fB3\fR \- Logs errors, warnings and informational messages \fBDEBUG\fR or \fB4\fR \- Log everything. If \fBxrdp-sesman\fR is compiled in debug mode, this options will output many more low\-level message, useful for developers .TP \fBEnableSyslog\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables logging to syslog. Otherwise syslog is disabled. .TP \fBSyslogLevel\fR=\fIlevel\fR This option sets the logging level for syslog. It can have the same values of \fBLogLevel\fR. If \fBSyslogLevel\fR is greater than \fBLogLevel\fR, its value is lowered to that of \fBLogLevel\fR. .TP \fBEnableConsole\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to the console (ie. stdout). .TP \fBConsoleLevel\fR=\fIlevel\fR Logging level for the console. It can have the same values as \fBLogLevel\fR. Defaults to \fBDEBUG\fR. .TP \fBEnableProcessId\fR=\fI[true|false]\fR If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging the process id in all log messages. Defaults to \fBfalse\fR. .SH "CHANNELS" The Remote Desktop Protocol supports several channels, which are used to transfer additional data like sound, clipboard data and others. Channel names not listed here will be blocked by \fBxrdp\fP. Not all channels are supported in all cases, so setting a value to \fItrue\fP is a prerequisite, but does not force its use. .br Channels can also be enabled or disabled on a per connection basis by prefixing each setting with \fBchannel.\fP in the channel section. .TP \fBrdpdr\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for device redirection is allowed. .TP \fBrdpsnd\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for sound is allowed. .TP \fBdrdynvc\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel to initiate additional dynamic virtual channels is allowed. .TP \fBcliprdr\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for clipboard redirection is allowed. .TP \fBrail\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for remote applications integrated locally (RAIL) is allowed. .TP \fBxrdpvr\fP=\fI[true|false]\fP If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for XRDP Video streaming is allowed. .SH "CONNECTIONS" A connection section is made of a section name, enclosed in square brackets, and the following entries: .TP \fBname\fR=\fI\fR The name displayed in \fBxrdp\fR(8) login window's combo box. .TP \fBlib\fR=\fI../vnc/libvnc.so\fR Sets the library to be used with this connection. .TP \fBusername\fR=\fI\fR|\fI{base64}\fR|\fIask\fR Specifies the username used for authenticating in the connection. If set to \fIask\fR, user name should be provided in the login window. If the username includes comment out symbols such as '#', or ';', the username can be provided in base64 form prefixing "{base64}". .TP \fBpassword\fR=\fI\fR|\fI{base64}\fR|\fIask\fR Specifies the password used for authenticating in the connection. If set to \fIask\fR, password should be provided in the login window. This parameter can be provided in base64 form as well as username. See also examples below. .TP \fBip\fR=\fI127.0.0.1\fR Specifies the ip address of the host to connect to. .TP \fBport\fR=\fI\fR|\fI\-1\fR Specifies the port number to connect to. If set to \fI\-1\fR, the default port for the specified library is used. .TP \fBxserverbpp\fR=\fI\fR Specifies color depth of the backend X server. The default is the color depth of the client. Only Xvnc uses that setting. Xorg runs at \fI24\fR bpp. .TP \fBdisabled_encodings_mask\fR=\fI\fR Set this bitmask to a non-zero value to prevent \fBxrdp\fR(8) requesting some features from the Xvnc server. You should only need to set this to a non-zero value to work around bugs in your Xvnc server. The bit values supported for a particular release of \fBxrdp\fR(8) are documented in \fBxrdp.ini\fR. .TP \fBcode\fR=\fI\fR|\fI0\fR Specifies the session type. The default, \fI0\fR, is Xvnc, and \fI20\fR is Xorg with xorgxrdp modules. .TP \fBchansrvport\fR=\fBDISPLAY(\fR\fIn\fR\fB)\fR|\fI/path/to/domain-socket\fR Asks xrdp to connect to a manually started \fBxrdp-chansrv\fR instance. This can be useful if you wish to use to use xrdp to connect to a VNC session which has been started other than by \fBxrdp-sesman\fR, as you can then make use of \fBxrdp\-chansrv\fR facilities in the VNC session. The first form of this setting is recommended, replacing \fIn\fR with the X11 display number of the session. .SH "EXAMPLES" This is an example \fBxrdp.ini\fR: .nf [Globals] bitmap_cache=true bitmap_compression=true [Xorg] name=Xorg lib=libxup.so username=ask password=ask ip=127.0.0.1 port=-1 code=20 [vnc-any] name=vnc-any lib=libvnc.so ip=ask port=ask5900 username=na password={base64}cGFzc3dvcmQhCg== .fi .SH "FILES" @sysconfdir@/xrdp/xrdp.ini .SH "SEE ALSO" .BR xrdp (8), .BR xrdp\-chansrv (8), .BR xrdp\-sesman (8), .BR xrdp\-sesrun (8), .BR sesman.ini (5) For more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/Makefile.am000644 001751 000000 00000001653 14652432047 016401 0ustar00metawheel000000 000000 man_MANS = \ xrdp-dis.1 \ sesman.ini.5 \ xrdp.ini.5 \ xrdp.8 \ xrdp-chansrv.8 \ xrdp-genkeymap.8 \ xrdp-keygen.8 \ xrdp-sesadmin.8 \ xrdp-sesman.8 \ xrdp-sesrun.8 \ xrdp-dumpfv1.8 EXTRA_DIST = xrdp-mkfv1.8.in $(man_MANS:=.in) if USE_FREETYPE2 man_MANS += xrdp-mkfv1.8 endif SUBST_VARS = sed \ -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@socketdir[@]|$(socketdir)|g' \ -e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|g' \ -e 's|@xrdpdatadir[@]|$(datadir)/xrdp|g' \ -e 's|@xrdphomeurl[@]|http://www.xrdp.org/|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in .in: $(subst_verbose)$(SUBST_VARS) $< > $@ CLEANFILES = $(man_MANS) xrdp-0.10.1/docs/man/xrdp-sesadmin.8.in000644 001751 000000 00000002125 14652432047 017614 0ustar00metawheel000000 000000 .TH "xrdp-sesadmin" "8" "@PACKAGE_VERSION@" "xrdp team" .SH NAME xrdp\-sesadmin \- console XRDP sessions administration tool .SH SYNOPSIS .B xrdp\-sesadmin .RI [ options ] .BI -c= command .SH DESCRIPTION This manual page documents briefly the .B xrdp\-sesadmin command. .PP \fBxrdp\-sesadmin\fP is a console program to administer running XRDP sessions. .SH OPTIONS A summary of options is included below. .TP .BI \-u= username Retained for compatibility, but ignored. .TP .BI \-p= password Retained for compatibility, but ignored. .TP .BI \-i= port The sesman \fIUNIX domain socket\fP to connect to. Defaults to \fBsesman.socket\fP. If no path is specified for the socket, a default of @socketdir@ is used. .TP .BI \-c= command Specifies the \fIcommand\fP to execute on the server. Valid commands are: .RS 4 .TP .B list List active sessions for the current user. .TP .BI kill: sid Kills the session specified the given \fIsession id\fP. (not yet implemented). .RE .SH FILES xrdp\-sesadmin.log .SH SEE ALSO .BR xrdp (8). More info on \fBxrdp\fR can be found on the .UR @xrdphomeurl@ xrdp homepage .UE xrdp-0.10.1/docs/man/xrdp.8.in000644 001751 000000 00000003422 14652432047 016014 0ustar00metawheel000000 000000 .TH "xrdp" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" \fBxrdp\fR \- a Remote Desktop Protocol (RDP) server .SH "SYNTAX" .B xrdp \-\-kill .br .B xrdp \-\-help .br .B xrdp \-\-version .br .B xrdp [\-\-nodaemon] [\-\-port port] [\-\-fork] [\-\-dump\-config] [\-\-config /path/to/xrdp.ini] .SH "DESCRIPTION" \fBxrdp\fR is a Remote Desktop Protocol (RDP) Server. .br Unlike Windows NT/2000/2003 server, \fBxrdp\fR will not display a Windows desktop but an X window desktop to the user. It can also be used as a VNC\->RDP bridge. .SH "OPTIONS" .TP \fB\-k\fR, \fB\-\-kill\fR Kill running \fBxrdp\fR daemon. .TP \fB\-h\fR, \fB\-\-help\fR Output help information and exit. .TP \fB\-v\fR, \fB\-\-version\fR Output version information and exit. .TP \fB\-n\fR, \fB\-\-nodaemon\fR Start \fBxrdp\fR in foreground instead of starting it as a daemon. .TP \fB\-p\fR, \fB\-\-port\fR Specify TCP port to listen to. This overrides \fIport\fR setting in \fIxrdp.ini\fR file. .TP \fB\-f\fR, \fB\-\-fork\fR Fork a new process on a new connection. If not enabled, use a new thread for every connection. This overrides \fIfork\fR setting in \fIxrdp.ini\fR file. .TP \fB\-\-dump\-config\fR Print the configuration on stdout before starting the daemon. The default is not to do this. .TP \fB\-c\fR, \fB\-\-config\fR Specify a path to a different \fIxrdp.ini\fR file. This option is intended to be used primarily for testing or for unusual configurations. .SH "FILES" @sbindir@/xrdp .br @sysconfdir@/xrdp/xrdp.ini .br @localstatedir@/log/xrdp.log .br @localstatedir@/run/xrdp.pid .SH "AUTHORS" Jay Sorg .br Simone Fedele .SH "SEE ALSO" .BR xrdp.ini (5), .BR sesman (8), .BR sesman.ini (5), .BR sesrun (8) for more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/xrdp-sesrun.8.in000644 001751 000000 00000005751 14652432047 017340 0ustar00metawheel000000 000000 .TH "xrdp\-sesrun" "8" "@PACKAGE_VERSION@" "xrdp team" "" .SH "NAME" \fBxrdp\-sesrun\fR \- \fBxrdp\-sesman\fR(8) session launcher .SH "SYNTAX" .B xrdp\-sesrun .I --help .br .B xrdp\-sesrun .I [ options ] [ username ] .SH "DESCRIPTION" \fBxrdp\-sesrun\fR starts a session using \fBxrdp\-sesman\fR(8). .br This is a tool useful for testing. It simply behaves like xrdp when some user logs in a new session and authenticates, thus starting a new session. Default values for the options are set at compile-time. Run the utility with the '--help' option to see what the defaults are for your installation. If no username is used, the current username is used, and no password needs to be provided. In this instance, it is important that any necessary authentication tokens for a GUI session (e.g. a Kerberos ticket) have already been acquired. If a username is provided, a password must also be provided. In this instance the utility prompts for a password if neither \fB-p\fR or \fB-F\fR is used. .SH "OPTIONS" .TP .B -g x Set session geometry. .br Note that most configurations will resize the session on connection, so this option may not do what you expect. .TP .B -b Set session bits-per-pixel (colour depth). Some session types (i.e. Xorg) will ignore this setting. .TP .B -t Session type - one of Xorg or Xvnc. Alternatively, for testing only, use the numeric session code. .TP .B -D Directory to run the new session in. Defaults to $HOME for the specified user. .TP .B -S Specify an alternate shell to run, instead of the default window manager. .TP .B -p Password for user. USE FOR TESTING ONLY - the password will be visible in the output of the \fBps\fR command. .TP .B -F Specify a file descriptor (normally 0) to read the password in from. This is a secure way to pass the password in to the utility. .TP .B -c Specify a different sesman.ini file. This file is used to find out how to connect to \fBxrdp\-sesman\fR. .SH "ENVIRONMENT" .TP .I SESRUN_LOG_LEVEL Override the default logging level. One of "error", "warn", "info", "debug", "trace" or a number 1-5. .SH "EXAMPLES" .TP .B xrdp-sesrun Create a default session for the current user. .TP .B xrdp-sesrun -F 0 user1 .br Simone Fedele .SH "SEE ALSO" .BR xrdp\-sesman (8), .BR sesman.ini (5), .BR xrdp (8), .BR xrdp.ini (5) For more info on \fBxrdp\fR see .UR @xrdphomeurl@ .UE xrdp-0.10.1/docs/man/Makefile.in000644 001751 000000 00000051556 14652432075 016422 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @USE_FREETYPE2_TRUE@am__append_1 = xrdp-mkfv1.8 subdir = docs/man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man8dir)" man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man_MANS = xrdp-dis.1 sesman.ini.5 xrdp.ini.5 xrdp.8 xrdp-chansrv.8 \ xrdp-genkeymap.8 xrdp-keygen.8 xrdp-sesadmin.8 xrdp-sesman.8 \ xrdp-sesrun.8 xrdp-dumpfv1.8 $(am__append_1) EXTRA_DIST = xrdp-mkfv1.8.in $(man_MANS:=.in) SUBST_VARS = sed \ -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@socketdir[@]|$(socketdir)|g' \ -e 's|@xrdpconfdir[@]|$(sysconfdir)/xrdp|g' \ -e 's|@xrdpdatadir[@]|$(datadir)/xrdp|g' \ -e 's|@xrdphomeurl[@]|http://www.xrdp.org/|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in CLEANFILES = $(man_MANS) all: all-am .SUFFIXES: .SUFFIXES: .in $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign docs/man/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; 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: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-man8 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man5 install-man8 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man5 \ uninstall-man8 .PRECIOUS: Makefile .in: $(subst_verbose)$(SUBST_VARS) $< > $@ # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/sesman/reconnectwm.sh000755 001751 000000 00000000104 14652432047 017001 0ustar00metawheel000000 000000 #!/bin/sh # Write procedures here you want to execute on reconnect xrdp-0.10.1/sesman/eicp_process.c000644 001751 000000 00000006043 14652432047 016750 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file eicp_process.c * @brief eicp (executive initialisation control protocol) handler function * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include "trans.h" #include "eicp.h" #include "eicp_process.h" #include "os_calls.h" #include "pre_session_list.h" #include "scp.h" #include "sesman.h" /******************************************************************************/ static int process_sys_login_response(struct pre_session_item *psi) { int rv; int is_logged_in; uid_t uid; int scp_fd; rv = eicp_get_sys_login_response(psi->sesexec_trans, &is_logged_in, &uid, &scp_fd); if (rv == 0) { LOG(LOG_LEVEL_INFO, "Received sys login status for %s : %s", psi->username, (is_logged_in) ? "logged in" : "not logged in"); if (!is_logged_in) { // This shouldn't happen. Close the connection to the // client immediately. psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; } else { /* We've been handed back the client connection */ psi->client_trans = scp_init_trans_from_fd(scp_fd, TRANS_TYPE_SERVER, sesman_is_term); if (psi->client_trans == NULL) { LOG(LOG_LEVEL_ERROR, "Can't re-create client connection"); g_file_close(scp_fd); psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; } else { psi->client_trans->trans_data_in = sesman_scp_data_in; psi->client_trans->callback_data = (void *)psi; psi->login_state = E_PS_LOGIN_SYS; psi->uid = uid; } } } return rv; } /******************************************************************************/ int eicp_process(struct pre_session_item *psi) { enum eicp_msg_code msgno; int rv = 0; switch ((msgno = eicp_msg_in_get_msgno(psi->sesexec_trans))) { case E_EICP_SYS_LOGIN_RESPONSE: rv = process_sys_login_response(psi); break; default: { char buff[64]; eicp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "Ignored EICP message %s", buff); } } return rv; } xrdp-0.10.1/sesman/session_list.c000644 001751 000000 00000035072 14652432047 017014 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * BSD process grouping by: * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland. * Copyright (c) 2000-2001 Markus Friedl. * Copyright (c) 2011-2015 Koichiro Iwao, Kyushu Institute of Technology. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file session_list.c * @brief Session list management code * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "arch.h" #include "session_list.h" #include "trans.h" #include "sesman_config.h" #include "list.h" #include "log.h" #include "os_calls.h" #include "sesman.h" #include "string_calls.h" #include "xrdp_sockets.h" static struct list *g_session_list = NULL; #define SESSION_IN_USE(si) \ ((si) != NULL && \ (si)->sesexec_trans != NULL && \ (si)->sesexec_trans->status == TRANS_STATUS_UP) /******************************************************************************/ int session_list_init(void) { int rv = 1; if (g_session_list == NULL) { g_session_list = list_create_sized(g_cfg->sess.max_sessions); } if (g_session_list == NULL) { LOG(LOG_LEVEL_ERROR, "Can't allocate session list"); } else { g_session_list->auto_free = 0; rv = 0; } return rv; } /******************************************************************************/ /** * Frees resources allocated to a session_item * * @param si Session item * * @note Any pointer to this item on g_session_list will be invalid * after this call. */ static void free_session(struct session_item *si) { if (si != NULL) { if (si->sesexec_trans != NULL) { trans_delete(si->sesexec_trans); } g_free(si); } } /******************************************************************************/ void session_list_cleanup(void) { if (g_session_list != NULL) { int i; for (i = 0 ; i < g_session_list->count ; ++i) { struct session_item *si; si = (struct session_item *)list_get_item(g_session_list, i); free_session(si); } list_delete(g_session_list); g_session_list = NULL; } } /******************************************************************************/ unsigned int session_list_get_count(void) { return g_session_list->count; } /******************************************************************************/ struct session_item * session_list_new(void) { struct session_item *result = g_new0(struct session_item, 1); if (result != NULL) { result->state = E_SESSION_STARTING; if (!list_add_item(g_session_list, (tintptr)result)) { g_free(result); result = NULL; } } return result; } /******************************************************************************/ /** * * @brief checks if there's a server running on a display * @param display the display to check * @return 0 if there isn't a display running, nonzero otherwise * */ static int x_server_running_check_ports(int display) { char text[256]; int x_running; int sck; g_sprintf(text, "/tmp/.X11-unix/X%d", display); x_running = g_file_exist(text); if (!x_running) { LOG(LOG_LEVEL_DEBUG, "Did not find a running X server at %s", text); g_sprintf(text, "/tmp/.X%d-lock", display); x_running = g_file_exist(text); } if (!x_running) /* check 59xx */ { LOG(LOG_LEVEL_DEBUG, "Did not find a running X server at %s", text); if ((sck = g_tcp_socket()) != -1) { g_sprintf(text, "59%2.2d", display); x_running = g_tcp_bind(sck, text); g_tcp_close(sck); } } if (!x_running) /* check 60xx */ { LOG(LOG_LEVEL_DEBUG, "Did not find a running X server at %s", text); if ((sck = g_tcp_socket()) != -1) { g_sprintf(text, "60%2.2d", display); x_running = g_tcp_bind(sck, text); g_tcp_close(sck); } } if (!x_running) /* check 62xx */ { LOG(LOG_LEVEL_DEBUG, "Did not find a running X server at %s", text); if ((sck = g_tcp_socket()) != -1) { g_sprintf(text, "62%2.2d", display); x_running = g_tcp_bind(sck, text); g_tcp_close(sck); } } if (x_running) { LOG(LOG_LEVEL_INFO, "Found X server running at %s", text); } return x_running; } /******************************************************************************/ /* Helper function for get_sorted_display_list():qsort() */ static int icmp(const void *v1, const void *v2) { // Pointers point to unsigned ints unsigned int i1 = *(unsigned int *)v1; unsigned int i2 = *(unsigned int *)v2; return (i1 < i2) ? -1 : (i1 > i2) ? 1 : 0; } /******************************************************************************/ /** * Get a sorted array of all the displays allocated to sessions * @param[out] cnt Count of displays in list * @return Allocated array of displays or NULL for no memory * * Result must always be freed, even if cnt == 0 */ static unsigned int * get_sorted_session_displays(unsigned int *cnt) { unsigned int *displays; *cnt = 0; displays = g_new(unsigned int, session_list_get_count() + 1); if (displays == NULL) { LOG(LOG_LEVEL_ERROR, "Can't allocate memory for display list"); } else if (g_session_list != NULL) { int i; for (i = 0 ; i < g_session_list->count ; ++i) { const struct session_item *si; si = (const struct session_item *)list_get_item(g_session_list, i); if (SESSION_IN_USE(si) && si->display >= 0) { displays[(*cnt)++] = si->display; } } qsort(displays, *cnt, sizeof(displays[0]), icmp); } return displays; } /******************************************************************************/ int session_list_get_available_display(void) { int rv = -1; unsigned int max_alloc = 0; // Find all displays already allocated. We do this to prevent // unnecessary file system accesses, and also to prevent us allocating // the same display number to two callers who call in quick // succession i.e. if the first caller has not created its X server // by the time we service the second request unsigned int *allocated_displays = get_sorted_session_displays(&max_alloc); if (allocated_displays != NULL) { unsigned int i = 0; unsigned int display; for (display = g_cfg->sess.x11_display_offset; display <= g_cfg->sess.max_display_number; ++display) { // Have we already allocated this one? while (i < max_alloc && display > allocated_displays[i]) { ++i; } if (i < max_alloc && display == allocated_displays[i]) { continue; // Already allocated } if (!x_server_running_check_ports(display)) { break; } } g_free(allocated_displays); if (display > g_cfg->sess.max_display_number) { LOG(LOG_LEVEL_ERROR, "X server -- no display in range (%d to %d) is available", g_cfg->sess.x11_display_offset, g_cfg->sess.max_display_number); } else { rv = display; } } return rv; } /******************************************************************************/ struct session_item * session_list_get_bydata(uid_t uid, enum scp_session_type type, unsigned short width, unsigned short height, unsigned char bpp, const char *ip_addr) { char policy_str[64]; int policy = g_cfg->sess.policy; int i; if (ip_addr == NULL) { ip_addr = ""; } if ((policy & SESMAN_CFG_SESS_POLICY_DEFAULT) != 0) { /* Before xrdp v0.9.14, the default * session policy varied by type. If this is needed again * in the future, here is the place to add it */ policy = SESMAN_CFG_SESS_POLICY_U | SESMAN_CFG_SESS_POLICY_B; } config_output_policy_string(policy, policy_str, sizeof(policy_str)); LOG(LOG_LEVEL_DEBUG, "%s: search policy=%s type=%s U=%d B=%d D=(%dx%d) I=%s", __func__, policy_str, SCP_SESSION_TYPE_TO_STR(type), uid, bpp, width, height, ip_addr); /* 'Separate' policy never matches */ if (policy & SESMAN_CFG_SESS_POLICY_SEPARATE) { LOG(LOG_LEVEL_DEBUG, "%s: No matches possible", __func__); return NULL; } for (i = 0 ; i < g_session_list->count ; ++i) { struct session_item *si; si = (struct session_item *)list_get_item(g_session_list, i); if (!SESSION_IN_USE(si)) { continue; } LOG(LOG_LEVEL_DEBUG, "%s: try %p type=%s U=%d B=%d D=(%dx%d) I=%s", __func__, si, SCP_SESSION_TYPE_TO_STR(si->type), si->uid, si->bpp, si->start_width, si->start_height, si->start_ip_addr); if (si->type != type) { LOG(LOG_LEVEL_DEBUG, "%s: Type doesn't match", __func__); continue; } if ((policy & SESMAN_CFG_SESS_POLICY_U) && uid != si->uid) { LOG(LOG_LEVEL_DEBUG, "%s: UID doesn't match for 'U' policy", __func__); continue; } if ((policy & SESMAN_CFG_SESS_POLICY_B) && si->bpp != bpp) { LOG(LOG_LEVEL_DEBUG, "%s: bpp doesn't match for 'B' policy", __func__); continue; } if ((policy & SESMAN_CFG_SESS_POLICY_D) && (si->start_width != width || si->start_height != height)) { LOG(LOG_LEVEL_DEBUG, "%s: Dimensions don't match for 'D' policy", __func__); continue; } if ((policy & SESMAN_CFG_SESS_POLICY_I) && g_strcmp(si->start_ip_addr, ip_addr) != 0) { LOG(LOG_LEVEL_DEBUG, "%s: IPs don't match for 'I' policy", __func__); continue; } LOG(LOG_LEVEL_DEBUG, "%s: Got match, display=%d", __func__, si->display); return si; } LOG(LOG_LEVEL_DEBUG, "%s: No matches found", __func__); return NULL; } /******************************************************************************/ struct scp_session_info * session_list_get_byuid(uid_t uid, unsigned int *cnt, unsigned int flags) { int i; struct scp_session_info *sess; int count; int index; count = 0; LOG(LOG_LEVEL_DEBUG, "searching for session by UID: %d", uid); for (i = 0 ; i < g_session_list->count ; ++i) { const struct session_item *si; si = (const struct session_item *)list_get_item(g_session_list, i); if (SESSION_IN_USE(si) && uid == si->uid) { count++; } } if (count == 0) { (*cnt) = 0; return 0; } /* malloc() an array of disconnected sessions */ sess = g_new0(struct scp_session_info, count); if (sess == 0) { (*cnt) = 0; return 0; } index = 0; for (i = 0 ; i < g_session_list->count ; ++i) { const struct session_item *si; si = (const struct session_item *)list_get_item(g_session_list, i); if (SESSION_IN_USE(si) && uid == si->uid) { (sess[index]).sid = si->sesexec_pid; (sess[index]).display = si->display; (sess[index]).type = si->type; (sess[index]).height = si->start_height; (sess[index]).width = si->start_width; (sess[index]).bpp = si->bpp; (sess[index]).start_time = si->start_time; (sess[index]).uid = si->uid; (sess[index]).start_ip_addr = g_strdup(si->start_ip_addr); /* Check for string allocation failures */ if ((sess[index]).start_ip_addr == NULL) { free_session_info_list(sess, *cnt); (*cnt) = 0; return 0; } index++; } } (*cnt) = count; return sess; } /******************************************************************************/ void free_session_info_list(struct scp_session_info *sesslist, unsigned int cnt) { if (sesslist != NULL && cnt > 0) { unsigned int i; for (i = 0 ; i < cnt ; ++i) { g_free(sesslist[i].start_ip_addr); } } g_free(sesslist); } /******************************************************************************/ int session_list_get_wait_objs(tbus robjs[], int *robjs_count) { int i; for (i = 0 ; i < g_session_list->count; ++i) { const struct session_item *si; si = (const struct session_item *)list_get_item(g_session_list, i); if (SESSION_IN_USE(si)) { robjs[(*robjs_count)++] = si->sesexec_trans->sck; } } return 0; } /******************************************************************************/ int session_list_check_wait_objs(void) { int i = 0; while (i < g_session_list->count) { struct session_item *si; si = (struct session_item *)list_get_item(g_session_list, i); if (SESSION_IN_USE(si)) { if (trans_check_wait_objs(si->sesexec_trans) != 0) { LOG(LOG_LEVEL_ERROR, "sesman_check_wait_objs: " "trans_check_wait_objs failed, removing trans"); si->sesexec_trans->status = TRANS_STATUS_DOWN; } } if (SESSION_IN_USE(si)) { ++i; } else { free_session(si); list_remove_item(g_session_list, i); } } return 0; } xrdp-0.10.1/sesman/pre_session_list.h000644 001751 000000 00000007404 14652432047 017665 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file pre_session_list.h * @brief List of pre-session connections to sesman (declarations) * * Items on this list are moved to the session list once they have * authenticated and a session is started. * * @author Matt Burt * */ #ifndef PRE_SESSION_LIST_H #define PRE_SESSION_LIST_H #include #include "xrdp_constants.h" /** * Type describing the login state of a pre-session item */ enum ps_login_state { E_PS_LOGIN_NOT_LOGGED_IN = 0, E_PS_LOGIN_SYS, E_PS_LOGIN_UDS }; /** * Action we require the dispatcher to do for us * * We can't do some things in an SCP or EICP callback, so we have to * ask the dispatcher to do them. For example, we can't delete the * client_trans as the callback stack won't be expecting this. */ enum pre_session_dispatcher_action { E_PSD_NONE = 0, E_PSD_REMOVE_CLIENT_TRANS, E_PSD_TERMINATE_PRE_SESSION }; /** * Type for managing sesman connections from SCP clients (xrdp, etc) * and any sesexec processes we've created for them. */ struct pre_session_item { struct trans *client_trans; ///< SCP link to sesman client struct trans *sesexec_trans; ///< ECP link to sesexec pid_t sesexec_pid; ///< PID of sesexec (if sesexec is active) char peername[15 + 1]; ///< Name of peer, if known, for logging enum ps_login_state login_state; ///< Login state /** * Any action which a callback requires the dispatcher to * do out of scope of the callback */ enum pre_session_dispatcher_action dispatcher_action; uid_t uid; ///< User char *username; ///< Username from UID (at time of logon) char start_ip_addr[MAX_PEER_ADDRSTRLEN]; }; /** * Initialise the module * @param list_size Number of pre-session items allowed * @return 0 for success * * Errors are logged */ int pre_session_list_init(unsigned int list_size); /** * Clean up the module on program exit */ void pre_session_list_cleanup(void); /** * Returns the number of items on the pre-session list * @return Item count */ unsigned int pre_session_list_get_count(void); /** * Allocates a new pre-session item on the list * * @return pointer to new pre-session object or NULL for no memory * * After allocating the session, you must initialise the sesexec_trans field * with a valid transport. * * The session is removed by pre_session_list_get_wait_objs() or * pre_session_check_wait_objs() when the client * transport goes down (or wasn't allocated in the first place). */ struct pre_session_item * pre_session_list_new(void); /** * Set the peername of a pre-session * * @param psi pre-session-item * @param name Name to set * @result 0 for success */ int pre_session_list_set_peername(struct pre_session_item *psi, const char *name); /** * @brief Get the wait objs for the pre-session list module * @param @robjs Objects array to update * @param robjs_count Elements in robjs (by reference) * @return 0 for success */ int pre_session_list_get_wait_objs(tbus robjs[], int *robjs_count); /** * @brief Check the wait objs for the pre-session list module * @return 0 for success */ int pre_session_list_check_wait_objs(void); #endif // PRE_SESSION_LIST_H xrdp-0.10.1/sesman/scp_process.h000644 001751 000000 00000001722 14652432047 016621 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file scp_process.h * @brief scp (sesman control protocol) handler function * @author Simone Fedele * */ #ifndef SCP_PROCESS_H #define SCP_PROCESS_H struct pre_session_item; /** * * @brief Processes an SCP message * @param sc the sesman connection * */ int scp_process(struct pre_session_item *sc); #endif xrdp-0.10.1/sesman/ercp_process.h000644 001751 000000 00000001752 14652432047 016770 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file ercp_process.h * @brief ERCP (executive run-time control protocol) handler function * @author Matt Burt * */ #ifndef ERCP_PROCESS_H #define ERCP_PROCESS_H struct session_item; /** * * @brief Processes an ERCP message * @param sc the sesman connection * */ int ercp_process(struct session_item *si); #endif // ERCP_PROCESS_H xrdp-0.10.1/sesman/sesexec/000755 001751 000000 00000000000 14652432105 015555 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/lock_uds.c000644 001751 000000 00000010154 14652432047 016073 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file lock_uds.c * @brief Providing a locking facility for Unix Domain Sockets * @author Matt Burt * * It is difficult for a server to determine whether a socket it wishes * to listen on is already active or not. The purpose of this module is to * provide a locking facility which can be used as a proxy for this. */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include "string_calls.h" #include "log.h" #include "lock_uds.h" struct lock_uds { char *filename; ///<< Name of the lock file int fd; ///<< File descriptor for open file int pid; ///<< PID of process originally taking out lock }; /******************************************************************************/ struct lock_uds * lock_uds(const char *sockname) { struct lock_uds *lock = NULL; char *filename = NULL; int fd = -1; if (sockname == NULL || sockname[0] != '/') { LOG_DEVEL(LOG_LEVEL_ERROR, "Invalid sockname '%s'", (sockname == NULL) ? "" : sockname); } else { /* Allocate space for lock filename and result */ filename = (char *)g_malloc(g_strlen(sockname) + 1 + 5 + 1, 0); lock = g_new0(struct lock_uds, 1); if (lock == NULL || filename == NULL) { LOG(LOG_LEVEL_ERROR, "%s : Out of memory", __func__); } else { int saved_umask; /* Construct the filename */ /* This call is guaranteed to succeed as we know that sockname * contains at least one '/' */ char *p = filename; const char *basename = g_strrchr(sockname, '/') + 1; g_memcpy(p, sockname, basename - sockname); p += basename - sockname; *p++ = '.'; g_strcpy(p, basename); p += g_strlen(p); *p++ = '.'; *p++ = 'l'; *p++ = 'o'; *p++ = 'c'; *p++ = 'k'; *p++ = '\0'; saved_umask = g_umask_hex(0x77); fd = g_file_open_rw(filename); g_umask_hex(saved_umask); if (fd < 0) { LOG(LOG_LEVEL_ERROR, "Unable to create '%s' [%s]", filename, g_get_strerror()); } else if (g_file_lock(fd, 0, 0) == 0) { LOG(LOG_LEVEL_ERROR, "Unable to get lock for '%s' - " "program already running?", sockname); g_file_close(fd); fd = -1; } else { (void)g_file_set_cloexec(fd, 1); } } } if (fd >= 0) { /* Success - finish off */ lock->filename = filename; lock->fd = fd; lock->pid = g_getpid(); } else { g_free(filename); g_free(lock); lock = NULL; } return lock; } /******************************************************************************/ void unlock_uds(struct lock_uds *lock) { if (lock != NULL) { if (lock->fd >= 0) { g_file_close(lock->fd); lock->fd = -1; // In case of use-after-free } /* Only delete the lock file if we are the process which * created it */ if (g_getpid() == lock->pid) { g_file_delete(lock->filename); } g_free(lock->filename); lock->filename = NULL; g_free(lock); } } xrdp-0.10.1/sesman/Doxyfile000644 001751 000000 00000020214 14652432047 015630 0ustar00metawheel000000 000000 # Doxyfile 1.4.4 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = xrdp/sesman PROJECT_NUMBER = 0.2.0 OUTPUT_DIRECTORY = ../docs/sesman CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = NO ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = NO SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = FILE_PATTERNS = RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = NO INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = NO #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO xrdp-0.10.1/sesman/startwm.sh000755 001751 000000 00000007672 14652432047 016177 0ustar00metawheel000000 000000 #!/usr/bin/env bash # # This script is an example. You might need to edit this script # depending on your distro if it doesn't work for you. # # Uncomment the following line for debug: # exec xterm # Execution sequence for interactive login shell - pseudocode # # IF /etc/profile is readable THEN # execute /etc/profile # END IF # IF ~/.bash_profile is readable THEN # execute ~/.bash_profile # ELSE # IF ~/.bash_login is readable THEN # execute ~/.bash_login # ELSE # IF ~/.profile is readable THEN # execute ~/.profile # END IF # END IF # END IF pre_start() { if [ -r /etc/profile ]; then . /etc/profile fi if [ -r ~/.bash_profile ]; then . ~/.bash_profile else if [ -r ~/.bash_login ]; then . ~/.bash_login else if [ -r ~/.profile ]; then . ~/.profile fi fi fi return 0 } # When logging out from the interactive shell, the execution sequence is: # # IF ~/.bash_logout exists THEN # execute ~/.bash_logout # END IF post_start() { if [ -r ~/.bash_logout ]; then . ~/.bash_logout fi return 0 } get_xdg_session_startupcmd() { # If DESKTOP_SESSION is set and valid then the STARTUP command will be taken from there # GDM exports environment variables XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP. # This follows it. if [ -n "$1" ] && [ -d /usr/share/xsessions ] \ && [ -f "/usr/share/xsessions/$1.desktop" ]; then STARTUP=$(grep ^Exec= "/usr/share/xsessions/$1.desktop") STARTUP=${STARTUP#Exec=*} XDG_CURRENT_DESKTOP=$(grep ^DesktopNames= "/usr/share/xsessions/$1.desktop") XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP#DesktopNames=*} XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP//;/:} export XDG_CURRENT_DESKTOP export XDG_SESSION_DESKTOP="$DESKTOP_SESSION" fi } #start the window manager wm_start() { if [ -r /etc/default/locale ]; then . /etc/default/locale export LANG LANGUAGE fi # debian if [ -r /etc/X11/Xsession ]; then pre_start # if you want to start preferred desktop environment, # add following line, # [ -n "$XRDP_SESSION" ] && export DESKTOP_SESSION= # in either of following file. # 1. ~/.profile # 2. create a file (any_filename.sh is OK) in /etc/profile.d # shall be one of "ls -1 /usr/share/xsessions/|cut -d. -f1" # e.g. [ -n "$XRDP_SESSION" ] && export DESKTOP_SESSION=ubuntu # STARTUP is the default startup command. # if $1 is empty and STARTUP was not set # /etc/X11/Xsession.d/50x11-common_determine-startup will fallback to # x-session-manager if [ -z "$STARTUP" ] && [ -n "$DESKTOP_SESSION" ]; then get_xdg_session_startupcmd "$DESKTOP_SESSION" fi . /etc/X11/Xsession post_start exit 0 fi # alpine # Don't use /etc/X11/xinit/Xsession - it doesn't work if [ -f /etc/alpine-release ]; then if [ -f /etc/X11/xinit/xinitrc ]; then pre_start /etc/X11/xinit/xinitrc post_start else echo "** xinit package isn't installed" >&2 exit 1 fi fi # el if [ -r /etc/X11/xinit/Xsession ]; then pre_start . /etc/X11/xinit/Xsession post_start exit 0 fi # suse if [ -r /etc/X11/xdm/Xsession ]; then # since the following script run a user login shell, # do not execute the pseudo login shell scripts . /etc/X11/xdm/Xsession exit 0 elif [ -r /usr/etc/X11/xdm/Xsession ]; then . /usr/etc/X11/xdm/Xsession exit 0 fi pre_start xterm post_start } #. /etc/environment #export PATH=$PATH #export LANG=$LANG # change PATH to be what your environment needs usually what is in # /etc/environment #PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" #export PATH=$PATH # for PATH and LANG from /etc/environment # pam will auto process the environment file if /etc/pam.d/xrdp-sesman # includes # auth required pam_env.so readenv=1 wm_start exit 1 xrdp-0.10.1/sesman/libsesman/000755 001751 000000 00000000000 14652432105 016073 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/sesexec_control.c000644 001751 000000 00000014627 14652432047 017500 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) 2023 Matt Burt * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesexec_control.c * @brief Start/stop session executive process * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include "sesman_config.h" #include "eicp.h" #include "log.h" #include "os_calls.h" #include "pre_session_list.h" #include "string_calls.h" #include "sesexec_control.h" #include "sesman.h" #include "trans.h" #include "xrdp_sockets.h" #define SESEXEC_SHORTNAME "xrdp-sesexec" #define SESEXEC_LONGNAME XRDP_LIBEXEC_PATH "/" SESEXEC_SHORTNAME // Some platforms using setsid() benefit from sesexec being // forked again, so the UNIX session can be created cleanly // See FreeBSD bug // ports/157282: effective login name is not set by xrdp-sesman // https://www.freebsd.org/cgi/query-pr.cgi?pr=157282 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define USE_BSD_SETLOGIN 1 #endif /*****************************************************************************/ /** * Adds entries to the args list for running sesexec * * @param args Argument list * @return 0 for memory allocation failure, 1 for success */ static int create_exec_args_add_entries(struct list *args) { if (!list_add_strdup(args, SESEXEC_SHORTNAME)) { return 0; } if (g_strcmp(g_cfg->sesman_ini, DEFAULT_SESMAN_INI) != 0) { if (!list_add_strdup_multi(args, "-c", g_cfg->sesman_ini, NULL)) { return 0; } } return 1; } /*****************************************************************************/ /** * Create an args list for sesexec * @return NULL if memory could not be allocated * * The result must be freed with list_delete() after use */ static struct list * create_exec_args(void) { struct list *result = list_create(); if (result != NULL) { result->auto_free = 1; if (!create_exec_args_add_entries(result)) { list_delete(result); result = NULL; } } return result; } /*****************************************************************************/ int sesexec_start(struct pre_session_item *psi) { // Local socket pair used to set up the EICP channel for sesexec // We also use the socket pair to communicate the PID of sesexec back // to sesman. Technically we only need this if USE_BSD_SETLOGIN // is set, but removing this variable complicates the code so // much it isn't worth it. int sck[2] = {-1, -1}; int rv = -1; int size; const char *exe = SESEXEC_LONGNAME; struct list *args = NULL; if (!g_executable_exist(exe)) { LOG(LOG_LEVEL_ERROR, "Can't execute %s", exe); } else if ((args = create_exec_args()) == NULL) { LOG(LOG_LEVEL_ERROR, "Out of memory running sesexec"); } else if (g_sck_local_socketpair(sck) < 0) { LOG(LOG_LEVEL_ERROR, "Can't create sesexec EICP socket [%s]", g_get_strerror()); } else { int pid = g_fork(); if (pid == -1) { // Error already logged g_file_close(sck[0]); g_file_close(sck[1]); } else if (pid == 0) { /* Sesexec process */ g_file_close(sck[0]); #if USE_BSD_SETLOGIN if (g_fork() != 0) { g_exit(0); } #endif // Send our pid back to sesman pid = g_getpid(); size = g_file_write(sck[1], (const char *)&pid, sizeof(pid)); if (size != sizeof(pid)) { LOG(LOG_LEVEL_ERROR, "Can't write to PID socket [%s]", g_get_strerror()); } else { /* Put the number of the file descriptor in EICP_FD * in the environment */ char buff[64]; g_snprintf(buff, sizeof(buff), "%d", sck[1]); g_setenv("EICP_FD", buff, 1); /* [Development] Log all file descriptors not marked cloexec * other than stdin, stdout, stderr, and the EICP fd in sck[1]. */ if (sck[1] < 3) { // EICP fd has overwritten one of the standard descriptors LOG_DEVEL_LEAKING_FDS("xrdp-sesexec", 3, -1); } else { LOG_DEVEL_LEAKING_FDS("xrdp-sesexec", 3, sck[1]); LOG_DEVEL_LEAKING_FDS("xrdp-sesexec", sck[1] + 1, -1); } g_execvp_list(exe, args); // Shouldn't get here. Errors are logged if we do. } g_exit(1); } else { g_file_close(sck[1]); // Get the PID from the child (or the grancdchild) int size = g_file_read(sck[0], (char *)&pid, sizeof(pid)); if (size != sizeof(pid)) { LOG(LOG_LEVEL_ERROR, "Can't read PID of sesexec process [%s]", g_get_strerror()); g_file_close(sck[0]); } else { struct trans *t = eicp_init_trans_from_fd(sck[0], TRANS_TYPE_CLIENT, sesman_is_term); if (t == NULL) { LOG(LOG_LEVEL_ERROR, "Can't create sesexec transport [%s]", g_get_strerror()); g_file_close(sck[0]); } else { t->trans_data_in = sesman_eicp_data_in; t->callback_data = (void *)psi; psi->sesexec_trans = t; psi->sesexec_pid = pid; rv = 0; } } } } list_delete(args); return rv; } xrdp-0.10.1/sesman/sesman.h000644 001751 000000 00000003514 14652432047 015565 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman.h * @brief Main include file * @author Jay Sorg * */ #ifndef SESMAN_H #define SESMAN_H struct config_sesman; struct trans; /* Globals */ extern struct config_sesman *g_cfg; /** * Close all file descriptors used by sesman. * * This is generally used after forking, to make sure the * file descriptors used by the main process are not disturbed * * This call will also :- * - release all trans objects held by sesman * - Delete sesman wait objects * - Call sesman_delete_listening_transport() */ int sesman_close_all(void); /* * Remove the listening transport * * Needed if reloading the config and the listener has changed */ void sesman_delete_listening_transport(void); /* * Create the listening socket transport * * @return 0 for success */ int sesman_create_listening_transport(const struct config_sesman *cfg); /** * Callback to process incoming SCP data */ int sesman_scp_data_in(struct trans *self); /** * Callback to process incoming EICP data */ int sesman_eicp_data_in(struct trans *self); /** * Callback to process incoming ERCP data */ int sesman_ercp_data_in(struct trans *self); /* * Check for termination */ int sesman_is_term(void); #endif xrdp-0.10.1/sesman/sig.h000644 001751 000000 00000001556 14652432047 015065 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sig.h * @brief Signal handling function declarations * @author Jay Sorg, Simone Fedele * */ #ifndef SIG_H #define SIG_H /** * * @brief SIGHUP handling code * */ void sig_sesman_reload_cfg(void); #endif xrdp-0.10.1/sesman/pre_session_list.c000644 001751 000000 00000015537 14652432047 017666 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file pre_session_list.h * @brief List of pre-session connections to sesman (definitions) * * @author Matt Burt */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "list.h" #include "os_calls.h" #include "pre_session_list.h" #include "trans.h" #define PRE_SESSION_IN_USE(si) \ ( \ (si) != NULL && \ ( \ ((si)->client_trans != NULL && (si)->client_trans->status == TRANS_STATUS_UP) || \ ((si)->sesexec_trans != NULL && (si)->sesexec_trans->status == TRANS_STATUS_UP) \ ) \ ) static struct list *g_pre_session_list = NULL; /** * Deletes a pre_session_item, freeing resources * * After this call, the passed-in pointer is invalid and must not be * referenced. * * Any auth_info struct found in the sesman_con is also deallocated. * * @param sc struct to de-allocate */ static void free_pre_session_item(struct pre_session_item *psi) { if (psi != NULL) { trans_delete(psi->client_trans); trans_delete(psi->sesexec_trans); g_free(psi->username); g_free(psi); } } /******************************************************************************/ int pre_session_list_init(unsigned int list_size) { int rv = 1; if (g_pre_session_list == NULL) { g_pre_session_list = list_create_sized(list_size); } if (g_pre_session_list == NULL) { LOG(LOG_LEVEL_ERROR, "Can't allocate pre-session list"); } else { g_pre_session_list->auto_free = 0; rv = 0; } return rv; } /******************************************************************************/ void pre_session_list_cleanup(void) { if (g_pre_session_list != NULL) { int i; for (i = 0 ; i < g_pre_session_list->count ; ++i) { struct pre_session_item *p; p = (struct pre_session_item *)list_get_item(g_pre_session_list, i); free_pre_session_item(p); } list_delete(g_pre_session_list); g_pre_session_list = NULL; } } /******************************************************************************/ unsigned int pre_session_list_get_count(void) { return g_pre_session_list->count; } /******************************************************************************/ struct pre_session_item * pre_session_list_new(void) { struct pre_session_item *result = g_new0(struct pre_session_item, 1); if (result != NULL) { g_snprintf(result->peername, sizeof(result->peername), "unknown"); result->uid = (uid_t) -1; if (!list_add_item(g_pre_session_list, (tintptr)result)) { g_free(result); result = NULL; } } return result; } /*****************************************************************************/ int pre_session_list_set_peername(struct pre_session_item *psi, const char *name) { int rv = 1; if (psi != NULL && name != NULL) { g_snprintf(psi->peername, sizeof(psi->peername), "%s", name); rv = 0; } return rv; } /******************************************************************************/ int pre_session_list_get_wait_objs(tbus robjs[], int *robjs_count) { int i = 0; while (i < g_pre_session_list->count) { struct pre_session_item *psi; psi = (struct pre_session_item *)list_get_item(g_pre_session_list, i); int psi_in_use = 0; if (psi != NULL) { if (psi->client_trans != NULL && psi->client_trans->status == TRANS_STATUS_UP) { robjs[(*robjs_count)++] = psi->client_trans->sck; psi_in_use = 1; } if (psi->sesexec_trans != NULL && psi->sesexec_trans->status == TRANS_STATUS_UP) { robjs[(*robjs_count)++] = psi->sesexec_trans->sck; psi_in_use = 1; } } if (psi_in_use) { ++i; } else { free_pre_session_item(psi); list_remove_item(g_pre_session_list, i); } } return 0; } /******************************************************************************/ int pre_session_list_check_wait_objs(void) { int i = 0; while (i < g_pre_session_list->count) { struct pre_session_item *psi; enum pre_session_dispatcher_action action; psi = (struct pre_session_item *)list_get_item(g_pre_session_list, i); action = E_PSD_TERMINATE_PRE_SESSION; if (PRE_SESSION_IN_USE(psi)) { if (psi->client_trans != NULL && psi->client_trans->status == TRANS_STATUS_UP) { if (trans_check_wait_objs(psi->client_trans) != 0) { LOG(LOG_LEVEL_ERROR, "pre_session_list_check_wait_objs: " "trans_check_wait_objs(1) failed, removing trans"); psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; } } if (psi->sesexec_trans != NULL && psi->sesexec_trans->status == TRANS_STATUS_UP) { if (trans_check_wait_objs(psi->sesexec_trans) != 0) { LOG(LOG_LEVEL_ERROR, "pre_session_list_check_wait_objs: " "trans_check_wait_objs(2) failed, removing trans"); psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; } } /* Get any action, and reset the requested one */ action = psi->dispatcher_action; psi->dispatcher_action = E_PSD_NONE; } switch (action) { case E_PSD_NONE: /* On to the next item on the list */ ++i; break; case E_PSD_REMOVE_CLIENT_TRANS: trans_delete(psi->client_trans); psi->client_trans = NULL; /* On to the next item on the list */ ++i; break; case E_PSD_TERMINATE_PRE_SESSION: free_pre_session_item(psi); list_remove_item(g_pre_session_list, i); break; } } return 0; } xrdp-0.10.1/sesman/sesman.ini000644 001751 000000 00000015401 14652432105 016106 0ustar00metawheel000000 000000 ;; See `man 5 sesman.ini` for details [Globals] ; listening port #ListenPort=sesman.socket EnableUserWindowManager=true ; Give in relative path to user's home directory UserWindowManager=startwm.sh ; Give in full path or relative path to /etc/xrdp DefaultWindowManager=startwm.sh ; Give in full path or relative path to /etc/xrdp ReconnectScript=reconnectwm.sh [Security] AllowRootLogin=true MaxLoginRetry=4 TerminalServerUsers=tsusers TerminalServerAdmins=tsadmins ; When AlwaysGroupCheck=false access will be permitted ; if the group TerminalServerUsers is not defined. AlwaysGroupCheck=false ; When RestrictOutboundClipboard=all clipboard from the ; server is not pushed to the client. ; In addition, you can control text/file/image transfer restrictions ; respectively. It also accepts comma separated list such as text,file,image. ; To keep compatibility, some aliases are also available: ; true: an alias of all ; false: an alias of none ; yes: an alias of all RestrictOutboundClipboard=none ; When RestrictInboundClipboard=all clipboard from the ; client is not pushed to the server. ; In addition, you can control text/file/image transfer restrictions ; respectively. It also accepts comma separated list such as text,file,image. ; To keep compatibility, some aliases are also available: ; true: an alias of all ; false: an alias of none ; yes: an alias of all RestrictInboundClipboard=none ; Set to 'no' to prevent users from logging in with alternate shells #AllowAlternateShell=true ; On Linux systems, the Xorg X11 server is normally invoked using ; no_new_privs to avoid problems if the executable is suid. This may, ; however, interfere with the use of security modules such as AppArmor. ; Leave this unset unless you need to disable it. #XorgNoNewPrivileges=true ; Specify the group which is to have read access to the directory where ; local sockets for the session are created. This is normally the GID ; which the xrdp process runs as. ; Default is 'root' #SessionSockdirGroup=root [Sessions] ;; X11DisplayOffset - x11 display number offset ; Type: integer ; Default: 10 X11DisplayOffset=10 ;; MaxSessions - maximum number of connections to an xrdp server ; Type: integer ; Default: 0 MaxSessions=50 ;; MaxDisplayNumer - maximum number considered for an X display ; Type: integer ; Default: 63 ; ; IANA only allocates TCP ports up to 6063 for X servers. If you are not ; allowing TCP connections to your X servers you may safely increase this ; number. #MaxDisplayNumber=63 ;; KillDisconnected - kill disconnected sessions ; Type: boolean ; Default: false ; if 1, true, or yes, every session will be killed within DisconnectedTimeLimit ; seconds after the user disconnects KillDisconnected=false ;; DisconnectedTimeLimit (seconds) - wait before kill disconnected sessions ; Type: integer ; Default: 0 ; if KillDisconnected is set to false, this value is ignored DisconnectedTimeLimit=0 ;; IdleTimeLimit (seconds) - wait before disconnect idle sessions ; Type: integer ; Default: 0 ; Set to 0 to disable idle disconnection. IdleTimeLimit=0 ;; Policy - session allocation policy ; ; Type: enum [ "Default" | "Separate" | Combination from {UBDI} ] ; "Default" Currently same as "UB" ; "Separate" All sessions are separate. Sessions can never be rejoined, ; and will need to be cleaned up manually, or automatically ; by setting other sesman options. ; ; Combination options:- ; U Sessions are separated per user ; B Sessions are separated by bits-per-pixel ; D Sessions are separated by initial display size ; I Sessions are separated by IP address ; ; The options U and B are always active, and cannot be de-selected. Policy=Default [Logging] ; Note: Log levels can be any of: core, error, warning, info, debug, or trace LogFile=xrdp-sesman.log LogLevel=INFO EnableSyslog=true #SyslogLevel=INFO #EnableConsole=false #ConsoleLevel=INFO #EnableProcessId=false [LoggingPerLogger] ; Note: per logger configuration is only used if xrdp is built with ; --enable-devel-logging #sesman.c=INFO #main()=INFO ; ; Session definitions - startup command-line parameters for each session type ; [Xorg] ; Specify the path of non-suid Xorg executable. It might differ depending ; on your distribution and version. Find out the appropriate path for your ; environment. The typical path is known as follows: ; ; Fedora 26 or later : param=/usr/libexec/Xorg ; Debian 9 or later : param=/usr/lib/xorg/Xorg ; Ubuntu 16.04 or later : param=/usr/lib/xorg/Xorg ; Arch Linux : param=/usr/lib/Xorg ; CentOS 7 : param=/usr/bin/Xorg or param=Xorg ; CentOS 8 : param=/usr/libexec/Xorg ; FreeBSD (from 2022Q4) : param=/usr/local/libexec/Xorg ; param=Xorg ; Leave the rest parameters as-is unless you understand what will happen. param=-config param=xrdp/xorg.conf param=-noreset param=-nolisten param=tcp param=-logfile param=.xorgxrdp.%s.log [Xvnc] param=Xvnc param=-bs param=-nolisten param=tcp param=-localhost param=-dpi param=96 [Chansrv] ; drive redirection ; See sesman.ini(5) for the format of this parameter #FuseMountName=/run/user/%u/thinclient_drives #FuseMountName=/media/thinclient_drives/%U/thinclient_drives FuseMountName=thinclient_drives ; this value allows only the user to access their own mapped drives. ; Make this more permissive (e.g. 022) if required. FileUmask=077 ; Can be used to disable FUSE functionality - see sesman.ini(5) #EnableFuseMount=false ; Uncomment this line only if you are using GNOME 3 versions 3.29.92 ; and up, and you wish to cut-paste files between Nautilus and Windows. Do ; not use this setting for GNOME 4, or other file managers #UseNautilus3FlistFormat=true ; sound redirection ; workaround for Microsoft mstsc.exe to suppress noise. ; SoundNumSilentFramesAAC | SoundNumSilentFramesMP3 silent frames are sent before SNDC_CLOSE is sent. ; during SoundMsecDoNotSend mS after SNDC_CLOSE is sent, sound data is not send. ; depending on the environment, it might be necessary to increase values. ; Defaults: SoundNumSilentFramesAAC=4, SoundNumSilentFramesMP3=2, SoundMsecDoNotSend=1000 ; If set to 0, this workaround is not applied. #SoundNumSilentFramesAAC=4 #SoundNumSilentFramesMP3=2 #SoundMsecDoNotSend=1000 [ChansrvLogging] ; Note: one log file is created per display and the LogFile config value ; is ignored. The channel server log file names follow the naming convention: ; xrdp-chansrv.${DISPLAY}.log ; ; Note: Log levels can be any of: core, error, warning, info, debug, or trace LogLevel=INFO EnableSyslog=true #SyslogLevel=INFO #EnableConsole=false #ConsoleLevel=INFO #EnableProcessId=false [ChansrvLoggingPerLogger] ; Note: per logger configuration is only used if xrdp is built with ; --enable-devel-logging #chansrv.c=INFO #main()=INFO [SessionVariables] PULSE_SCRIPT=/etc/xrdp/pulse/default.pa xrdp-0.10.1/sesman/scp_process.c000644 001751 000000 00000047561 14652432047 016627 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file scp.c * @brief scp (sesman control protocol) handler function * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "trans.h" #include "os_calls.h" #include "eicp.h" #include "ercp.h" #include "scp.h" #include "scp_process.h" #include "sesman.h" #include "sesman_access.h" #include "sesman_auth.h" #include "sesman_config.h" #include "os_calls.h" #include "pre_session_list.h" #include "session_list.h" #include "sesexec_control.h" #include "string_calls.h" #include "xrdp_sockets.h" /******************************************************************************/ static int process_set_peername_request(struct pre_session_item *psi) { int rv; const char *peername; rv = scp_get_set_peername_request(psi->client_trans, &peername); if (rv == 0) { if (pre_session_list_set_peername(psi, peername) != 0) { LOG(LOG_LEVEL_WARNING, "Failed to set connection peername from %s to %s", psi->peername, peername); } } return rv; } /******************************************************************************/ static int process_sys_login_request(struct pre_session_item *psi) { int rv; const char *username; const char *password; const char *ip_addr; int send_client_reply = 1; rv = scp_get_sys_login_request(psi->client_trans, &username, &password, &ip_addr); if (rv == 0) { enum scp_login_status errorcode; LOG(LOG_LEVEL_INFO, "Received system login request from %s for user: %s IP: %s", psi->peername, username, ip_addr); if (psi->login_state != E_PS_LOGIN_NOT_LOGGED_IN) { errorcode = E_SCP_LOGIN_ALREADY_LOGGED_IN; LOG(LOG_LEVEL_ERROR, "Connection is already logged in for %s", psi->username); } else if ((psi->username = g_strdup(username)) == NULL) { errorcode = E_SCP_LOGIN_NO_MEMORY; LOG(LOG_LEVEL_ERROR, "Memory allocation failure logging in %s", username); } else { /* * Copy the IP address of the requesting user, anticipating a * successful login. We need this so we can search for a session * with a matching IP address if required. */ g_snprintf(psi->start_ip_addr, sizeof(psi->start_ip_addr), "%s", ip_addr); /* Create a sesexec process to handle the login * * We won't check for the user being valid here, as this might * lead to information leakage */ if (sesexec_start(psi) != 0) { LOG(LOG_LEVEL_ERROR, "Can't start sesexec to authenticate user"); errorcode = E_SCP_LOGIN_GENERAL_ERROR; } else { int eicp_stat; eicp_stat = eicp_send_sys_login_request(psi->sesexec_trans, username, password, ip_addr, psi->client_trans->sck); if (eicp_stat != 0) { LOG(LOG_LEVEL_ERROR, "Can't ask sesexec to authenticate user"); errorcode = E_SCP_LOGIN_GENERAL_ERROR; } else { /* We've handed over responsibility for the * SCP communication */ send_client_reply = 0; psi->dispatcher_action = E_PSD_REMOVE_CLIENT_TRANS; } } } if (send_client_reply) { /* We only get here if something has gone * wrong with the handover to sesexec */ rv = scp_send_login_response(psi->client_trans, errorcode, 1, -1); psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; } } return rv; } /******************************************************************************/ /** * Authenticate and authorize a UDS connection * * @param psi Connection to sesman * @param uid UID for user * @param username Name for user * @return Status for the operation * * @post If E_SCP_LOGIN_OK is returned, psi->username is non-NULL */ static enum scp_login_status authenticate_and_authorize_uds_connection(struct pre_session_item *psi, int uid, const char *username) { enum scp_login_status status = E_SCP_LOGIN_GENERAL_ERROR; struct auth_info *auth_info = auth_uds(username, &status); if (auth_info != NULL) { if (status != E_SCP_LOGIN_OK) { /* This shouldn't happen */ LOG(LOG_LEVEL_ERROR, "Unexpected status return %d from auth_uds call", (int)status); } else if (!access_login_allowed(&g_cfg->sec, username)) { status = E_SCP_LOGIN_NOT_AUTHORIZED; LOG(LOG_LEVEL_INFO, "Username okay but group problem for " "user: %s", username); } /* If all is well, add info to the sesman connection for later use */ if (status == E_SCP_LOGIN_OK) { if ((psi->username = g_strdup(username)) == NULL) { LOG(LOG_LEVEL_ERROR, "%s : Memory allocation failed", __func__); g_free(psi->username); psi->username = NULL; status = E_SCP_LOGIN_NO_MEMORY; } else { LOG(LOG_LEVEL_INFO, "Access permitted for user: %s", username); psi->login_state = E_PS_LOGIN_UDS; psi->uid = uid; psi->start_ip_addr[0] = '\0'; } } auth_end(auth_info); } return status; } /******************************************************************************/ static int process_uds_login_request(struct pre_session_item *psi) { enum scp_login_status errorcode; int rv; int uid; int pid; char *username = NULL; int server_closed; rv = g_sck_get_peer_cred(psi->client_trans->sck, &pid, &uid, NULL); if (rv != 0) { errorcode = E_SCP_LOGIN_GENERAL_ERROR; LOG(LOG_LEVEL_INFO, "Unable to get peer credentials for socket %d", (int)psi->client_trans->sck); } else { LOG(LOG_LEVEL_INFO, "Received UDS login request from %s for UID: %d from PID: %d", psi->peername, uid, pid); if (psi->login_state != E_PS_LOGIN_NOT_LOGGED_IN) { errorcode = E_SCP_LOGIN_ALREADY_LOGGED_IN; LOG(LOG_LEVEL_ERROR, "Connection is already logged in for %s", psi->username); } else if (g_getuser_info_by_uid(uid, &username, NULL, NULL, NULL, NULL) != 0) { errorcode = E_SCP_LOGIN_GENERAL_ERROR; LOG(LOG_LEVEL_ERROR, "Can't reverse lookup UID %d", uid); } else { errorcode = authenticate_and_authorize_uds_connection( psi, uid, username); g_free(username); } } if (errorcode == E_SCP_LOGIN_OK) { server_closed = 0; } else { server_closed = 1; /* Close the connection after returning from this callback */ psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; /* Never return the UID if the server is closing */ uid = -1; } return scp_send_login_response(psi->client_trans, errorcode, server_closed, uid); } /******************************************************************************/ static void logout_pre_session(struct pre_session_item *psi) { if (psi->login_state != E_PS_LOGIN_NOT_LOGGED_IN) { (void)eicp_send_logout_request(psi->sesexec_trans); trans_delete(psi->sesexec_trans); psi->sesexec_trans = NULL; psi->uid = (uid_t) -1; g_free(psi->username); psi->username = NULL; psi->start_ip_addr[0] = '\0'; psi->login_state = E_PS_LOGIN_NOT_LOGGED_IN; } } /******************************************************************************/ static int process_logout_request(struct pre_session_item *psi) { if (psi->login_state != E_PS_LOGIN_NOT_LOGGED_IN) { LOG(LOG_LEVEL_INFO, "Logging out %s from sesman", psi->username); logout_pre_session(psi); } return 0; } /******************************************************************************/ /** * Create xrdp socket path for the user * * We do this here rather than in sesexec as we're single-threaded here * and so don't have to worry about race conditions * * Directory is owned by UID of session, but can be accessed by * the group specified in the config. * * Errors are logged so the caller doesn't have to */ static int create_xrdp_socket_path(uid_t uid) { // Owner all permissions, group read+execute #define RWX_PERMS 0x750 int rv = 1; const char *sockdir_group = g_cfg->sec.session_sockdir_group; int gid = 0; // Default if no group specified char sockdir[XRDP_SOCKETS_MAXPATH]; g_snprintf(sockdir, sizeof(sockdir), XRDP_SOCKET_PATH, (int)uid); // Create directory permissions RWX_PERMS, if it doesn't exist already // (our os_calls layer doesn't allow us to set the SGID bit here) int old_umask = g_umask_hex(RWX_PERMS ^ 0x777); if (!g_directory_exist(sockdir) && !g_create_dir(sockdir)) { LOG(LOG_LEVEL_ERROR, "create_xrdp_socket_path: Can't create %s [%s]", sockdir, g_get_strerror()); } else if (g_chmod_hex(sockdir, RWX_PERMS | 0x2000) != 0) { LOG(LOG_LEVEL_ERROR, "create_xrdp_socket_path: Can't set SGID bit on %s [%s]", sockdir, g_get_strerror()); } else if (sockdir_group != NULL && sockdir_group[0] != '\0' && g_getgroup_info(sockdir_group, &gid) != 0) { LOG(LOG_LEVEL_ERROR, "create_xrdp_socket_path: Can't get GID of group %s [%s]", sockdir_group, g_get_strerror()); } else if (g_chown(sockdir, uid, gid) != 0) { LOG(LOG_LEVEL_ERROR, "create_xrdp_socket_path: Can't set owner of %s to %d:%d [%s]", sockdir, uid, gid, g_get_strerror()); } else { rv = 0; } (void)g_umask_hex(old_umask); return rv; #undef RWX_PERMS } /******************************************************************************/ static int process_create_session_request(struct pre_session_item *psi) { int rv; /* Client parameters describing new session*/ enum scp_session_type type; unsigned short width; unsigned short height; unsigned char bpp; const char *shell; const char *directory; struct guid guid; int display = 0; struct session_item *s_item = NULL; int send_client_reply = 1; enum scp_screate_status status = E_SCP_SCREATE_OK; rv = scp_get_create_session_request(psi->client_trans, &type, &width, &height, &bpp, &shell, &directory); if (rv == 0) { if (psi->login_state == E_PS_LOGIN_NOT_LOGGED_IN) { status = E_SCP_SCREATE_NOT_LOGGED_IN; } else { LOG(LOG_LEVEL_INFO, "Received request from %s to create a session for user %s", psi->peername, psi->username); s_item = session_list_get_bydata(psi->uid, type, width, height, bpp, psi->start_ip_addr); if (s_item != NULL) { // Found an existing session display = s_item->display; guid = s_item->guid; // Tell the existing session to run the reconnect script. // We ignore errors at this level, as any comms errors // will be picked up in the main loop (void)ercp_send_session_reconnect_event(s_item->sesexec_trans); if (psi->start_ip_addr[0] != '\0') { LOG( LOG_LEVEL_INFO, "++ reconnected session: username %s, " "display :%d.0, session_pid %d, ip %s", psi->username, display, s_item->sesexec_pid, psi->start_ip_addr); } else { LOG(LOG_LEVEL_INFO, "++ reconnected session: username %s, " "display :%d.0, session_pid %d", psi->username, display, s_item->sesexec_pid); } // If we created an authentication process for this SCP // connection, close it gracefully logout_pre_session(psi); } // Need to create a new session else if (g_cfg->sess.max_sessions > 0 && session_list_get_count() >= g_cfg->sess.max_sessions) { status = E_SCP_SCREATE_MAX_REACHED; } else if ((display = session_list_get_available_display()) < 0) { status = E_SCP_SCREATE_NO_DISPLAY; } // Create an entry on the session list for the new session else if ((s_item = session_list_new()) == NULL) { status = E_SCP_SCREATE_NO_MEMORY; } // Create a socket dir for this user else if (create_xrdp_socket_path(psi->uid) != 0) { status = E_SCP_SCREATE_GENERAL_ERROR; } // Create a sesexec process if we don't have one (UDS login) else if (psi->sesexec_trans == NULL && sesexec_start(psi) != 0) { LOG(LOG_LEVEL_ERROR, "Can't start sesexec to manage session"); status = E_SCP_SCREATE_GENERAL_ERROR; } else { // Pass the session create request to sesexec int eicp_stat; eicp_stat = eicp_send_create_session_request( psi->sesexec_trans, psi->client_trans->sck, display, type, width, height, bpp, shell, directory); if (eicp_stat != 0) { LOG(LOG_LEVEL_ERROR, "Can't ask sesexec to authenticate user"); status = E_SCP_SCREATE_GENERAL_ERROR; } else { // We've handed over responsibility for the // SCP communication send_client_reply = 0; // Further comms from sesexec comes over the ERCP // protocol ercp_trans_from_eicp_trans(psi->sesexec_trans, sesman_ercp_data_in, (void *)s_item); // Move the transport over to the session list item s_item->sesexec_trans = psi->sesexec_trans; s_item->sesexec_pid = psi->sesexec_pid; psi->sesexec_trans = NULL; psi->sesexec_pid = 0; // Add the display to the session item so we don't try // to allocate it to another session s_item->display = display; } } } // Currently a create session request is the last thing on a // connection, and results in automatic closure // // We may have passed the client_trans over to sesexec. If so, // we can't send a reply here. psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; if (send_client_reply) { rv = scp_send_create_session_response(psi->client_trans, status, display, &guid); } } return rv; } /******************************************************************************/ static int process_list_sessions_request(struct pre_session_item *psi) { int rv = 0; struct scp_session_info *info = NULL; unsigned int cnt = 0; unsigned int i; if (psi->login_state == E_PS_LOGIN_NOT_LOGGED_IN) { rv = scp_send_list_sessions_response(psi->client_trans, E_SCP_LS_NOT_LOGGED_IN, NULL); } else { LOG(LOG_LEVEL_INFO, "Received request from %s to list sessions for user %s", psi->peername, psi->username); info = session_list_get_byuid(psi->uid, &cnt, 0); for (i = 0; rv == 0 && i < cnt; ++i) { rv = scp_send_list_sessions_response(psi->client_trans, E_SCP_LS_SESSION_INFO, &info[i]); } free_session_info_list(info, cnt); if (rv == 0) { rv = scp_send_list_sessions_response(psi->client_trans, E_SCP_LS_END_OF_LIST, NULL); } } return rv; } /******************************************************************************/ static int process_close_connection_request(struct pre_session_item *psi) { int rv = 0; LOG(LOG_LEVEL_INFO, "Received request to close connection from %s", psi->peername); /* Expecting no more client messages. Close the connection * after returning from this callback */ psi->dispatcher_action = E_PSD_TERMINATE_PRE_SESSION; return rv; } /******************************************************************************/ int scp_process(struct pre_session_item *psi) { enum scp_msg_code msgno; int rv = 0; switch ((msgno = scp_msg_in_get_msgno(psi->client_trans))) { case E_SCP_SET_PEERNAME_REQUEST: rv = process_set_peername_request(psi); break; case E_SCP_SYS_LOGIN_REQUEST: rv = process_sys_login_request(psi); break; case E_SCP_UDS_LOGIN_REQUEST: rv = process_uds_login_request(psi); break; case E_SCP_LOGOUT_REQUEST: rv = process_logout_request(psi); break; case E_SCP_CREATE_SESSION_REQUEST: rv = process_create_session_request(psi); break; case E_SCP_LIST_SESSIONS_REQUEST: rv = process_list_sessions_request(psi); break; case E_SCP_CLOSE_CONNECTION_REQUEST: rv = process_close_connection_request(psi); break; default: { char buff[64]; scp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "Ignored SCP message %s", buff); } } return rv; } xrdp-0.10.1/sesman/ercp_process.c000644 001751 000000 00000005561 14652432047 016765 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file ercp_process.c * @brief ERCP (executive run-time control protocol) handler function * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "trans.h" #include "ercp.h" #include "ercp_process.h" #include "session_list.h" /******************************************************************************/ static int process_session_announce_event(struct session_item *si) { int rv; const char *start_ip_addr; rv = ercp_get_session_announce_event(si->sesexec_trans, NULL, &si->uid, &si->type, &si->start_width, &si->start_height, &si->bpp, &si->guid, &start_ip_addr, &si->start_time); if (rv == 0) { snprintf(si->start_ip_addr, sizeof(si->start_ip_addr), "%s", start_ip_addr); si->state = E_SESSION_RUNNING; } return rv; } /******************************************************************************/ static void process_session_finished_event(struct session_item *si) { LOG(LOG_LEVEL_INFO, "Session on display %d has finished.", si->display); // Setting the transport down will remove this connection from the list si->sesexec_trans->status = TRANS_STATUS_DOWN; } /******************************************************************************/ int ercp_process(struct session_item *si) { enum ercp_msg_code msgno; int rv = 0; switch ((msgno = ercp_msg_in_get_msgno(si->sesexec_trans))) { case E_ERCP_SESSION_ANNOUNCE_EVENT: rv = process_session_announce_event(si); break; case E_ERCP_SESSION_FINISHED_EVENT: process_session_finished_event(si); break; default: { char buff[64]; ercp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "Ignored EICP message %s", buff); } } return rv; } xrdp-0.10.1/sesman/Makefile.in000644 001751 000000 00000100215 14652432075 016170 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = xrdp-sesman$(EXEEXT) subdir = sesman ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_sesmansysconf_SCRIPTS) \ $(dist_sesmansysconf_DATA) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(sesmansysconfdir)" \ "$(DESTDIR)$(sesmansysconfdir)" PROGRAMS = $(sbin_PROGRAMS) am_xrdp_sesman_OBJECTS = eicp_process.$(OBJEXT) ercp_process.$(OBJEXT) \ lock_uds.$(OBJEXT) pre_session_list.$(OBJEXT) \ scp_process.$(OBJEXT) sesman.$(OBJEXT) \ sesexec_control.$(OBJEXT) session_list.$(OBJEXT) sig.$(OBJEXT) xrdp_sesman_OBJECTS = $(am_xrdp_sesman_OBJECTS) xrdp_sesman_DEPENDENCIES = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } SCRIPTS = $(dist_sesmansysconf_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/eicp_process.Po \ ./$(DEPDIR)/ercp_process.Po ./$(DEPDIR)/lock_uds.Po \ ./$(DEPDIR)/pre_session_list.Po ./$(DEPDIR)/scp_process.Po \ ./$(DEPDIR)/sesexec_control.Po ./$(DEPDIR)/sesman.Po \ ./$(DEPDIR)/session_list.Po ./$(DEPDIR)/sig.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_sesman_SOURCES) DIST_SOURCES = $(xrdp_sesman_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dist_sesmansysconf_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am 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)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ Doxyfile AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libipm xrdp_sesman_SOURCES = \ eicp_process.c \ eicp_process.h \ ercp_process.c \ ercp_process.h \ lock_uds.c \ lock_uds.h \ pre_session_list.c \ pre_session_list.h \ scp_process.c \ scp_process.h \ sesman.c \ sesman.h \ sesexec_control.c \ sesexec_control.h \ session_list.c \ session_list.h \ sig.c \ sig.h xrdp_sesman_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la sesmansysconfdir = $(sysconfdir)/xrdp SUBST_VARS = sed \ -e 's|@sesmansysconfdir[@]|$(sesmansysconfdir)|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in dist_sesmansysconf_DATA = \ sesman.ini dist_sesmansysconf_SCRIPTS = \ startwm.sh \ reconnectwm.sh SUBDIRS = \ libsesman \ sesexec \ tools \ chansrv all: all-recursive .SUFFIXES: .SUFFIXES: .in .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sesman/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign sesman/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || 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)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && $(am__rm_f) $$files clean-sbinPROGRAMS: $(am__rm_f) $(sbin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(sbin_PROGRAMS:$(EXEEXT)=) xrdp-sesman$(EXEEXT): $(xrdp_sesman_OBJECTS) $(xrdp_sesman_DEPENDENCIES) $(EXTRA_xrdp_sesman_DEPENDENCIES) @rm -f xrdp-sesman$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_sesman_OBJECTS) $(xrdp_sesman_LDADD) $(LIBS) install-dist_sesmansysconfSCRIPTS: $(dist_sesmansysconf_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_sesmansysconf_SCRIPTS)'; test -n "$(sesmansysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sesmansysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sesmansysconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(sesmansysconfdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sesmansysconfdir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_sesmansysconfSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_sesmansysconf_SCRIPTS)'; test -n "$(sesmansysconfdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sesmansysconfdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eicp_process.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ercp_process.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock_uds.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_session_list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scp_process.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesexec_control.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesman.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session_list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_sesmansysconfDATA: $(dist_sesmansysconf_DATA) @$(NORMAL_INSTALL) @list='$(dist_sesmansysconf_DATA)'; test -n "$(sesmansysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sesmansysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sesmansysconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sesmansysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sesmansysconfdir)" || exit $$?; \ done uninstall-dist_sesmansysconfDATA: @$(NORMAL_UNINSTALL) @list='$(dist_sesmansysconf_DATA)'; test -n "$(sesmansysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sesmansysconfdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sesmansysconfdir)" "$(DESTDIR)$(sesmansysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/eicp_process.Po -rm -f ./$(DEPDIR)/ercp_process.Po -rm -f ./$(DEPDIR)/lock_uds.Po -rm -f ./$(DEPDIR)/pre_session_list.Po -rm -f ./$(DEPDIR)/scp_process.Po -rm -f ./$(DEPDIR)/sesexec_control.Po -rm -f ./$(DEPDIR)/sesman.Po -rm -f ./$(DEPDIR)/session_list.Po -rm -f ./$(DEPDIR)/sig.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_sesmansysconfDATA \ install-dist_sesmansysconfSCRIPTS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/eicp_process.Po -rm -f ./$(DEPDIR)/ercp_process.Po -rm -f ./$(DEPDIR)/lock_uds.Po -rm -f ./$(DEPDIR)/pre_session_list.Po -rm -f ./$(DEPDIR)/scp_process.Po -rm -f ./$(DEPDIR)/sesexec_control.Po -rm -f ./$(DEPDIR)/sesman.Po -rm -f ./$(DEPDIR)/session_list.Po -rm -f ./$(DEPDIR)/sig.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_sesmansysconfDATA \ uninstall-dist_sesmansysconfSCRIPTS uninstall-sbinPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_sesmansysconfDATA \ install-dist_sesmansysconfSCRIPTS 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-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-dist_sesmansysconfDATA \ uninstall-dist_sesmansysconfSCRIPTS uninstall-sbinPROGRAMS .PRECIOUS: Makefile .in: $(subst_verbose)$(SUBST_VARS) $< > $@ # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/sesman/eicp_process.h000644 001751 000000 00000001747 14652432047 016763 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file eicp_process.h * @brief eicp (executive initialisation control protocol) handler function * @author Matt Burt * */ #ifndef EICP_PROCESS_H #define EICP_PROCESS_H struct pre_session_item; /** * * @brief Processes an EICP message * @param sc the sesman connection * */ int eicp_process(struct pre_session_item *psi); #endif xrdp-0.10.1/sesman/session_list.h000644 001751 000000 00000010314 14652432047 017011 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file session_list.h * @brief Session list management definitions * @author Jay Sorg, Simone Fedele * */ #ifndef SESSION_LIST_H #define SESSION_LIST_H #include #include "guid.h" #include "scp_application_types.h" #include "xrdp_constants.h" enum session_state { /** * Session definition is little more than a sesexec process. We're * waiting for more details of the session from sesexec */ E_SESSION_STARTING, /** Session is fully active */ E_SESSION_RUNNING }; /** * Object describing a session * * Unless otherwide noted, fields are only valid if * the status is E_SESSION_RUNNING */ struct session_item { enum session_state state; struct trans *sesexec_trans; // trans for sesexec process. Always valid. pid_t sesexec_pid; // pid for sesexec process. Always valid /** * May be valid if known when the session is starting, otherwise -1 */ int display; uid_t uid; enum scp_session_type type; unsigned short start_width; unsigned short start_height; unsigned char bpp; struct guid guid; char start_ip_addr[MAX_PEER_ADDRSTRLEN]; time_t start_time; }; /** * Initialise the module * @return 0 for success * * Errors are logged */ int session_list_init(void); /** * Clean up the module on program exit */ void session_list_cleanup(void); /** * Returns the number of sessions currently active * @return Session count */ unsigned int session_list_get_count(void); /** * Allocates a new session on the list * * state will be E_SESSION_STARTING. Other data must be filled in by * the caller as appropriate. * * @return pointer to new session object or NULL for no memory * * After allocating the session, you must initialise the sesexec_trans field * with a valid transport. * * The session is removed by session_check_wait_objs() when the transport * goes down (or wasn't allocated in the first place). */ struct session_item * session_list_new(void); /** * Get the next available display * * The display isn't reserved until the caller has allocated a new session * (with session_list_new()) and put the new display in it. */ int session_list_get_available_display(void); /** * * @brief finds a session matching the supplied parameters * @return session data or 0 * */ struct session_item * session_list_get_bydata(uid_t uid, enum scp_session_type type, unsigned short width, unsigned short height, unsigned char bpp, const char *ip_addr); /** * @brief retrieves session descriptions * @param uid the UID for the descriptions * @param[out] cnt The number of sessions returned * @param flags Future expansion * @return A block of session descriptions * * Pass the return result to free_session_info_list() after use * */ struct scp_session_info * session_list_get_byuid(uid_t uid, unsigned int *cnt, unsigned int flags); /** * * @brief Frees the result of session_get_byuser() * @param sesslist Resuit of session_get_byuser() * @param cnt Number of entries in sess */ void free_session_info_list(struct scp_session_info *sesslist, unsigned int cnt); /** * @brief Get the wait objs for the session list module * @param @robjs Objects array to update * @param robjs_count Elements in robjs (by reference) * @return 0 for success */ int session_list_get_wait_objs(tbus robjs[], int *robjs_count); /** * @brief Check the wait objs for the session list module * @return 0 for success */ int session_list_check_wait_objs(void); #endif // SESSION_LIST_H xrdp-0.10.1/sesman/tools/000755 001751 000000 00000000000 14652432105 015256 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/Makefile.am000644 001751 000000 00000002466 14652432047 016167 0ustar00metawheel000000 000000 EXTRA_DIST = \ Doxyfile AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libipm sbin_PROGRAMS = \ xrdp-sesman xrdp_sesman_SOURCES = \ eicp_process.c \ eicp_process.h \ ercp_process.c \ ercp_process.h \ lock_uds.c \ lock_uds.h \ pre_session_list.c \ pre_session_list.h \ scp_process.c \ scp_process.h \ sesman.c \ sesman.h \ sesexec_control.c \ sesexec_control.h \ session_list.c \ session_list.h \ sig.c \ sig.h xrdp_sesman_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la sesmansysconfdir=$(sysconfdir)/xrdp SUBST_VARS = sed \ -e 's|@sesmansysconfdir[@]|$(sesmansysconfdir)|g' subst_verbose = $(subst_verbose_@AM_V@) subst_verbose_ = $(subst_verbose_@AM_DEFAULT_V@) subst_verbose_0 = @echo " SUBST $@"; SUFFIXES = .in .in: $(subst_verbose)$(SUBST_VARS) $< > $@ dist_sesmansysconf_DATA = \ sesman.ini dist_sesmansysconf_SCRIPTS = \ startwm.sh \ reconnectwm.sh SUBDIRS = \ libsesman \ sesexec \ tools \ chansrv xrdp-0.10.1/sesman/sesman.c000644 001751 000000 00000061046 14652432047 015564 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman.c * @brief Main program file * @author Jay Sorg * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "arch.h" #include "sesman.h" #include "sesman_auth.h" #include "sesman_config.h" #include "eicp.h" #include "eicp_process.h" #include "ercp.h" #include "ercp_process.h" #include "pre_session_list.h" #include "session_list.h" #include "lock_uds.h" #include "os_calls.h" #include "scp.h" #include "scp_process.h" #include "sesexec_control.h" #include "sig.h" #include "string_calls.h" #include "trans.h" #include "xrdp_configure_options.h" #include "xrdp_sockets.h" /** * Maximum number of pre-session items */ #define MAX_PRE_SESSION_ITEMS 16 /** * Define the mode of operation of the program */ enum sesman_mode { SSM_NORMAL = 0, SSM_KILL_DAEMON, SSM_RELOAD_DAEMON }; struct sesman_startup_params { const char *sesman_ini; enum sesman_mode mode; int no_daemon; int help; int version; int dump_config; }; struct config_sesman *g_cfg; static tintptr g_term_event = 0; static tintptr g_sigchld_event = 0; static tintptr g_reload_event = 0; static struct trans *g_list_trans; /* Variables used to lock g_list_trans */ static struct lock_uds *g_list_trans_lock; static struct list *g_con_list = NULL; static int g_pid; /*****************************************************************************/ /** * @brief looks for a case-insensitive match of a string in a list * @param candidate String to match * @param ... NULL-terminated list of strings to compare the candidate with * @return !=0 if the candidate is found in the list */ static int nocase_matches(const char *candidate, ...) { va_list vl; const char *member; int result = 0; va_start(vl, candidate); while ((member = va_arg(vl, const char *)) != NULL) { if (g_strcasecmp(candidate, member) == 0) { result = 1; break; } } va_end(vl); return result; } /*****************************************************************************/ /** * * @brief Command line argument parser * @param[in] argc number of command line arguments * @param[in] argv pointer array of commandline arguments * @param[out] sesman_startup_params Returned startup parameters * @return 0 on success, n on nth argument is unknown * */ static int sesman_process_params(int argc, char **argv, struct sesman_startup_params *startup_params) { int index; const char *option; const char *value; startup_params->mode = SSM_NORMAL; index = 1; while (index < argc) { option = argv[index]; if (index + 1 < argc) { value = argv[index + 1]; } else { value = ""; } if (nocase_matches(option, "-help", "--help", "-h", NULL)) { startup_params->help = 1; } else if (nocase_matches(option, "-kill", "--kill", "-k", NULL)) { startup_params->mode = SSM_KILL_DAEMON; } else if (nocase_matches(option, "-reload", "--reload", "-r", NULL)) { startup_params->mode = SSM_RELOAD_DAEMON; } else if (nocase_matches(option, "-nodaemon", "--nodaemon", "-n", "-nd", "--nd", "-ns", "--ns", NULL)) { startup_params->no_daemon = 1; } else if (nocase_matches(option, "-v", "--version", NULL)) { startup_params->version = 1; } else if (nocase_matches(option, "--dump-config", NULL)) { startup_params->dump_config = 1; } else if (nocase_matches(option, "-c", "--config", NULL)) { index++; startup_params->sesman_ini = value; } else /* unknown option */ { return index; } index++; } return 0; } /******************************************************************************/ static int sesman_listen_test(struct config_sesman *cfg) { int status = sesman_create_listening_transport(cfg); sesman_delete_listening_transport(); return status; } /******************************************************************************/ int sesman_close_all(void) { LOG_DEVEL(LOG_LEVEL_TRACE, "sesman_close_all:"); pre_session_list_cleanup(); session_list_cleanup(); g_delete_wait_obj(g_reload_event); g_delete_wait_obj(g_sigchld_event); g_delete_wait_obj(g_term_event); sesman_delete_listening_transport(); return 0; } /******************************************************************************/ int sesman_scp_data_in(struct trans *self) { int rv; int available; rv = scp_msg_in_check_available(self, &available); if (rv == 0 && available) { struct pre_session_item *psi; psi = (struct pre_session_item *)self->callback_data; if ((rv = scp_process(psi)) != 0) { LOG(LOG_LEVEL_ERROR, "sesman_data_in: scp_process_msg failed"); } scp_msg_in_reset(self); } return rv; } /******************************************************************************/ static int sesman_listen_conn_in(struct trans *self, struct trans *new_self) { struct pre_session_item *psi; if (pre_session_list_get_count() >= MAX_PRE_SESSION_ITEMS) { LOG(LOG_LEVEL_ERROR, "sesman_listen_conn_in: error, too many " "connections, rejecting"); trans_delete(new_self); } else if ((psi = pre_session_list_new()) == NULL) { LOG(LOG_LEVEL_ERROR, "sesman_data_in: No memory to allocate " "new connection"); trans_delete(new_self); } else if (scp_init_trans(new_self) != 0) { LOG(LOG_LEVEL_ERROR, "sesman_data_in: Can't init SCP connection"); trans_delete(new_self); } else { new_self->callback_data = (void *)psi; new_self->trans_data_in = sesman_scp_data_in; psi->client_trans = new_self; } return 0; } /******************************************************************************/ int sesman_eicp_data_in(struct trans *self) { int rv; int available; rv = eicp_msg_in_check_available(self, &available); if (rv == 0 && available) { struct pre_session_item *psi; psi = (struct pre_session_item *)self->callback_data; if ((rv = eicp_process(psi)) != 0) { LOG(LOG_LEVEL_ERROR, "sesman_eicp_data_in: eicp_process_msg failed"); } eicp_msg_in_reset(self); } return rv; } /******************************************************************************/ int sesman_ercp_data_in(struct trans *self) { int rv; int available; rv = ercp_msg_in_check_available(self, &available); if (rv == 0 && available) { struct session_item *si = (struct session_item *)self->callback_data; if ((rv = ercp_process(si)) != 0) { LOG(LOG_LEVEL_ERROR, "sesman_ercp_data_in: ercp_process_msg failed"); } ercp_msg_in_reset(self); } return rv; } /******************************************************************************/ /** * Informs the main loop a termination signal has been received */ static void set_term_event(int sig) { /* Don't try to use a wait obj in a child process */ if (g_getpid() == g_pid) { g_set_wait_obj(g_term_event); } } /*****************************************************************************/ /* No-op signal handler. */ static void sig_no_op(int sig) { /* no-op */ } /******************************************************************************/ /** * Catch a SIGCHLD and ignore the main loop * * In theory we could use waitpid() in the signal handler, but that * would prevent us adding any logging */ static void set_sigchld_event(int sig) { /* Don't try to use a wait obj in a child process */ if (g_getpid() == g_pid) { g_set_wait_obj(g_sigchld_event); } } /******************************************************************************/ /** * Informs the main loop a SIGHUP has been received */ static void set_reload_event(int sig) { /* Don't try to use a wait obj in a child process */ if (g_getpid() == g_pid) { g_set_wait_obj(g_reload_event); } } /******************************************************************************/ void sesman_delete_listening_transport(void) { if (g_getpid() == g_pid) { trans_delete(g_list_trans); } else { trans_delete_from_child(g_list_trans); } g_list_trans = NULL; unlock_uds(g_list_trans_lock); // Won't unlock anything for a child process g_list_trans_lock = NULL; } /******************************************************************************/ int sesman_create_listening_transport(const struct config_sesman *cfg) { int rv = 1; g_list_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); if (g_list_trans == NULL) { LOG(LOG_LEVEL_ERROR, "%s: trans_create failed", __func__); } else if ((g_list_trans_lock = lock_uds(cfg->listen_port)) != NULL) { /* Make sure the file is always created with the correct * permissions, if it's not there */ int entry_umask = g_umask_hex(0x666); LOG_DEVEL(LOG_LEVEL_DEBUG, "%s: port %s", __func__, cfg->listen_port); rv = trans_listen_address(g_list_trans, cfg->listen_port, NULL); if (rv != 0) { LOG(LOG_LEVEL_ERROR, "%s: trans_listen_address failed", __func__); } else if (g_chown(cfg->listen_port, g_getuid(), g_getuid()) != 0) { LOG(LOG_LEVEL_ERROR, "Can't set ownership of '%s' [%s]", cfg->listen_port, g_get_strerror()); } else if ((rv = g_chmod_hex(cfg->listen_port, 0x666)) != 0) { LOG(LOG_LEVEL_ERROR, "%s: Can't set permissions on '%s' [%s]", __func__, cfg->listen_port, g_get_strerror()); } else { g_list_trans->trans_conn_in = sesman_listen_conn_in; } g_umask_hex(entry_umask); } if (rv != 0) { sesman_delete_listening_transport(); } return rv; } /******************************************************************************/ int sesman_is_term(void) { return g_is_wait_obj_set(g_term_event); } /******************************************************************************/ /** * * @brief Starts sesman main loop * */ static int sesman_main_loop(void) { int error; int robjs_count; intptr_t robjs[1024]; g_con_list = list_create(); if (g_con_list == NULL) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: list_create failed"); return 1; } if (sesman_create_listening_transport(g_cfg) != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: sesman_create_listening_transport failed"); list_delete(g_con_list); return 1; } LOG(LOG_LEVEL_INFO, "Sesman now listening on %s", g_cfg->listen_port); error = 0; while (!error) { robjs_count = 0; robjs[robjs_count++] = g_term_event; robjs[robjs_count++] = g_sigchld_event; robjs[robjs_count++] = g_reload_event; if (g_list_trans != NULL) { /* g_list_trans might be NULL on a reconfigure if sesman * is unable to listen again */ error = trans_get_wait_objs(g_list_trans, robjs, &robjs_count); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: " "trans_get_wait_objs failed"); break; } } error = pre_session_list_get_wait_objs(robjs, &robjs_count); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: " "pre_session_list_get_wait_objs failed"); break; } error = session_list_get_wait_objs(robjs, &robjs_count); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: " "session_list_get_wait_objs failed"); break; } if (g_obj_wait(robjs, robjs_count, NULL, 0, -1) != 0) { /* should not get here */ LOG(LOG_LEVEL_WARNING, "sesman_main_loop: " "Unexpected error from g_obj_wait()"); g_sleep(100); } if (g_is_wait_obj_set(g_term_event)) /* term */ { LOG(LOG_LEVEL_INFO, "sesman_main_loop: " "sesman asked to terminate"); break; } if (g_is_wait_obj_set(g_sigchld_event)) /* term */ { g_reset_wait_obj(g_sigchld_event); // Prevent any zombies from hanging around while (g_waitchild(NULL) > 0) { ; } } if (g_is_wait_obj_set(g_reload_event)) /* We're asked to reload */ { g_reset_wait_obj(g_reload_event); sig_sesman_reload_cfg(); } if (g_list_trans != NULL) { error = trans_check_wait_objs(g_list_trans); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: " "trans_check_wait_objs failed"); break; } } error = pre_session_list_check_wait_objs(); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: " "pre_session_list_check_wait_objs failed"); break; } error = session_list_check_wait_objs(); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesman_main_loop: " "session_list_check_wait_objs failed"); break; } } return error; } /*****************************************************************************/ static void print_version(void) { g_writeln("xrdp-sesman %s", PACKAGE_VERSION); g_writeln(" The xrdp session manager"); g_writeln(" Copyright (C) 2004-%d Jay Sorg, " "Neutrino Labs, and all contributors.", VERSION_YEAR); g_writeln(" See https://github.com/neutrinolabs/xrdp for more information."); g_writeln("%s", ""); #if defined(XRDP_CONFIGURE_OPTIONS) g_writeln(" Configure options:"); g_writeln("%s", XRDP_CONFIGURE_OPTIONS); #endif } /******************************************************************************/ static void print_help(void) { g_printf("Usage: xrdp-sesman [options]\n"); g_printf(" -k, --kill shut down xrdp-sesman\n"); g_printf(" -r, --reload reload xrdp-sesman\n"); g_printf(" -h, --help show help\n"); g_printf(" -v, --version show version\n"); g_printf(" -n, --nodaemon don't fork into background\n"); g_printf(" -c, --config specify new path to sesman.ini\n"); g_printf(" --dump-config display config on stdout on startup\n"); g_deinit(); } /******************************************************************************/ /** * Reads the PID file */ static int read_pid_file(const char *pid_file, int *pid) { int rv = 1; int fd; /* check if sesman is running */ if (!g_file_exist(pid_file)) { g_printf("sesman is not running (pid file not found - %s)\n", pid_file); } else if ((fd = g_file_open_ro(pid_file)) < 0) { g_printf("error opening pid file[%s]: %s\n", pid_file, g_get_strerror()); } else { char pid_s[32] = {0}; int error = g_file_read(fd, pid_s, sizeof(pid_s) - 1); g_file_close(fd); if (error < 0) { g_printf("error reading pid file: %s\n", g_get_strerror()); } else { *pid = g_atoi(pid_s); rv = 0; } } return rv; } /******************************************************************************/ /** Creates the socket path for sesman and session sockets */ static int create_xrdp_socket_root_path(void) { int uid = g_getuid(); int gid = g_getgid(); /* Create the path using 0755 permissions */ int old_umask = g_umask_hex(0x22); (void)g_create_path(XRDP_SOCKET_ROOT_PATH"/"); (void)g_umask_hex(old_umask); /* Check the ownership and permissions on the last path element * are as expected */ if (g_chown(XRDP_SOCKET_ROOT_PATH, uid, gid) != 0) { LOG(LOG_LEVEL_ERROR, "create_xrdp_socket_root_path: Can't set owner of %s to %d:%d", XRDP_SOCKET_ROOT_PATH, uid, gid); return 1; } if (g_chmod_hex(XRDP_SOCKET_ROOT_PATH, 0x755) != 0) { LOG(LOG_LEVEL_ERROR, "create_xrdp_socket_root_path: Can't set perms of %s to 0x755", XRDP_SOCKET_ROOT_PATH); return 1; } return 0; } /******************************************************************************/ int main(int argc, char **argv) { int error; enum logReturns log_error; char text[256]; char pid_file[256]; struct sesman_startup_params startup_params = {0}; int errored_argc; int daemon; g_init("xrdp-sesman"); g_snprintf(pid_file, 255, "%s/xrdp-sesman.pid", XRDP_PID_PATH); startup_params.sesman_ini = DEFAULT_SESMAN_INI; errored_argc = sesman_process_params(argc, argv, &startup_params); if (errored_argc > 0) { print_version(); g_writeln("%s", ""); print_help(); g_writeln("%s", ""); g_writeln("Unknown option: %s", argv[errored_argc]); g_deinit(); g_exit(1); } if (startup_params.help) { print_help(); g_exit(0); } if (startup_params.version) { print_version(); g_exit(0); } if (startup_params.mode == SSM_KILL_DAEMON) { int pid; int error = 1; if (read_pid_file(pid_file, &pid) == 0) { if (g_sigterm(pid) != 0) { g_printf("error killing sesman: %s\n", g_get_strerror()); } else { /* File is no longer required */ g_file_delete(pid_file); error = 0; } } g_deinit(); g_exit(error); } if (startup_params.mode == SSM_RELOAD_DAEMON) { int pid; int error = 1; if (read_pid_file(pid_file, &pid) == 0) { if (g_sighup(pid) != 0) { g_printf("error reloading sesman: %s\n", g_get_strerror()); } else { error = 0; } } g_deinit(); g_exit(error); } if (g_file_exist(pid_file)) { g_printf("xrdp-sesman is already running.\n"); g_printf("if it's not running, try removing "); g_printf("%s", pid_file); g_printf("\n"); g_deinit(); g_exit(1); } /* starting logging subsystem */ if (!g_file_exist(startup_params.sesman_ini)) { g_printf("Config file %s does not exist\n", startup_params.sesman_ini); g_deinit(); g_exit(1); } log_error = log_start( startup_params.sesman_ini, "xrdp-sesman", (startup_params.dump_config) ? LOG_START_DUMP_CONFIG : 0); if (log_error != LOG_STARTUP_OK) { switch (log_error) { case LOG_ERROR_MALLOC: g_writeln("error on malloc. cannot start logging. quitting."); break; case LOG_ERROR_FILE_OPEN: g_writeln("error opening log file [%s]. quitting.", getLogFile(text, 255)); break; default: // Assume sufficient messages have already been generated break; } g_deinit(); g_exit(1); } /* reading config */ if ((g_cfg = config_read(startup_params.sesman_ini)) == NULL) { LOG(LOG_LEVEL_ALWAYS, "error reading config %s: %s", startup_params.sesman_ini, g_get_strerror()); log_end(); g_deinit(); g_exit(1); } if (startup_params.dump_config) { config_dump(g_cfg); } LOG(LOG_LEVEL_TRACE, "config loaded in %s at %s:%d", __func__, __FILE__, __LINE__); LOG(LOG_LEVEL_TRACE, " sesman_ini = %s", g_cfg->sesman_ini); LOG(LOG_LEVEL_TRACE, " listen_port = %s", g_cfg->listen_port); LOG(LOG_LEVEL_TRACE, " enable_user_wm = %d", g_cfg->enable_user_wm); LOG(LOG_LEVEL_TRACE, " default_wm = %s", g_cfg->default_wm); LOG(LOG_LEVEL_TRACE, " user_wm = %s", g_cfg->user_wm); LOG(LOG_LEVEL_TRACE, " reconnect_sh = %s", g_cfg->reconnect_sh); LOG(LOG_LEVEL_TRACE, " auth_file_path = %s", g_cfg->auth_file_path); daemon = !startup_params.no_daemon; if (daemon) { /* not to spit on the console, shut up stdout/stderr before anything's logged */ g_file_close(0); g_file_close(1); g_file_close(2); if (g_file_open_rw("/dev/null") < 0) { } if (g_file_open_rw("/dev/null") < 0) { } if (g_file_open_rw("/dev/null") < 0) { } } /* Create the socket directory before we try to listen (or * test-listen), so there's somewhere for the default socket to live */ if (create_xrdp_socket_root_path() != 0) { config_free(g_cfg); log_end(); g_deinit(); g_exit(1); } if (daemon) { /* start of daemonizing code */ if (sesman_listen_test(g_cfg) != 0) { LOG(LOG_LEVEL_ERROR, "Failed to start xrdp-sesman daemon, " "possibly address already in use."); config_free(g_cfg); log_end(); g_deinit(); g_exit(1); } if (0 != g_fork()) { config_free(g_cfg); log_end(); g_deinit(); g_exit(0); } } /* Now we've forked (if necessary), we can get the program PID */ g_pid = g_getpid(); /* signal handling */ g_snprintf(text, 255, "xrdp_sesman_%8.8x_main_term", g_pid); g_term_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_sesman_%8.8x_sigchld", g_pid); g_sigchld_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_sesman_%8.8x_reload", g_pid); g_reload_event = g_create_wait_obj(text); g_signal_user_interrupt(set_term_event); /* SIGINT */ g_signal_terminate(set_term_event); /* SIGTERM */ g_signal_pipe(sig_no_op); /* SIGPIPE */ g_signal_child_stop(set_sigchld_event); /* SIGCHLD */ g_signal_hang_up(set_reload_event); /* SIGHUP */ if (daemon) { /* writing pid file */ char pid_s[32]; int fd = g_file_open_rw(pid_file); if (-1 == fd) { LOG(LOG_LEVEL_ERROR, "error opening pid file[%s]: %s", pid_file, g_get_strerror()); log_end(); config_free(g_cfg); g_deinit(); g_exit(1); } g_sprintf(pid_s, "%d", g_pid); g_file_write(fd, pid_s, g_strlen(pid_s)); g_file_close(fd); } /* start program main loop */ LOG(LOG_LEVEL_INFO, "starting xrdp-sesman with pid %d", g_pid); /* make sure the /tmp/.X11-unix directory exists */ if (!g_directory_exist("/tmp/.X11-unix")) { if (!g_create_dir("/tmp/.X11-unix")) { LOG(LOG_LEVEL_ERROR, "sesman.c: error creating dir /tmp/.X11-unix"); } g_chmod_hex("/tmp/.X11-unix", 0x1777); } if ((error = pre_session_list_init(MAX_PRE_SESSION_ITEMS)) == 0 && (error = session_list_init()) == 0) { error = sesman_main_loop(); } /* clean up PID file on exit */ if (daemon) { g_file_delete(pid_file); } sesman_close_all(); log_end(); config_free(g_cfg); g_deinit(); g_exit(error); return 0; } xrdp-0.10.1/sesman/chansrv/000755 001751 000000 00000000000 14652432105 015562 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/sig.c000644 001751 000000 00000005135 14652432047 015055 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sig.c * @brief signal handling functions * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "sig.h" #include "sesman_config.h" #include "log.h" #include "os_calls.h" #include "sesman.h" #include "session_list.h" #include "string_calls.h" /******************************************************************************/ void sig_sesman_reload_cfg(void) { int error; struct config_sesman *cfg; LOG(LOG_LEVEL_INFO, "receiving SIGHUP"); if ((cfg = config_read(g_cfg->sesman_ini)) == NULL) { LOG(LOG_LEVEL_ERROR, "error reading config - keeping old cfg"); return; } /* Deal with significant config changes */ if (g_strcmp(g_cfg->listen_port, cfg->listen_port) != 0) { LOG(LOG_LEVEL_INFO, "sesman listen port changed to %s", cfg->listen_port); /* We have to delete the old port before listening to the new one * in case they overlap in scope */ sesman_delete_listening_transport(); if (sesman_create_listening_transport(cfg) == 0) { LOG(LOG_LEVEL_INFO, "Sesman now listening on %s", g_cfg->listen_port); } } /* free old config data */ config_free(g_cfg); /* replace old config with newly read one */ g_cfg = cfg; /* Restart logging subsystem */ error = log_start(g_cfg->sesman_ini, "xrdp-sesman", LOG_START_RESTART); if (error != LOG_STARTUP_OK) { char buf[256]; switch (error) { case LOG_ERROR_MALLOC: g_printf("error on malloc. cannot restart logging. log stops here, sorry.\n"); break; case LOG_ERROR_FILE_OPEN: g_printf("error reopening log file [%s]. log stops here, sorry.\n", getLogFile(buf, 255)); break; } } LOG(LOG_LEVEL_INFO, "configuration reloaded, log subsystem restarted"); } xrdp-0.10.1/sesman/sesexec_control.h000644 001751 000000 00000002312 14652432047 017471 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) 2023 Matt Burt * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesexec_control.h * @brief Start/stop session executive process * @author Matt Burt * */ #ifndef SESEXEC_H #define SESEXEC_H #include struct trans; struct pre_session_item; /** * Start a session executive * @param psi Pre-session item to allocate EICP transport to * @result 0 for success * * If non-zero is returned, all errors have been logged. * If zero is returned, the sesexec_trans and sesexec_pid fields of * the pre-session-item have been initialised. */ int sesexec_start(struct pre_session_item *psi); #endif // SESEXEC_H xrdp-0.10.1/sesman/lock_uds.h000644 001751 000000 00000003642 14652432047 016104 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file lock_uds.h * @brief Providing a locking facility for Unix Domain Sockets * @author Matt Burt * * It is difficult for a server to determine whether a socket it wishes * to listen on is already active or not. The purpose of this module is to * provide a locking facility which can be used as a proxy for this. */ #ifndef LOCK_UDS_H #define LOCK_UDS_H struct lock_uds; /** * Take out a lock for the specified Unix Domain socket * @param sockname Name of socket. Must start with a '/' * @return A struct lock_uds instance if the lock was successfully acquired. * * A NULL return may indicate a lack of memory, or that another * process has the lock. * * A file is created in the same directory as the socket. The name * of the file is ".${basename}.lock", where basename is the base name * of the socket. THE file is removed when the lock is relinquished. */ struct lock_uds * lock_uds(const char *sockname); /** * Relinquish a lock on the specified Unix Domain Socket. * @param lock to relinquish * * If the process which has originally taken out the lock forks, this * routine should be called from the child process to prevent the lock * inadvertently being passed to the child. */ void unlock_uds(struct lock_uds *lock); #endif // LOCK_UDS_H xrdp-0.10.1/sesman/chansrv/sound.c000644 001751 000000 00000156137 14652432047 017100 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2009-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include "sound.h" #include "thread_calls.h" #include "defines.h" #include "fifo.h" #include "xrdp_constants.h" #include "xrdp_sockets.h" #include "chansrv_common.h" #include "chansrv_config.h" #include "list.h" #include "audin.h" #if defined(XRDP_FDK_AAC) #include static HANDLE_AACENCODER g_fdk_aac_encoder = 0; #define AACENCODER_LIB_VER_GTEQ(vl0, vl1, vl2) \ (defined(AACENCODER_LIB_VL0) && \ ((AACENCODER_LIB_VL0 > vl0) || \ (AACENCODER_LIB_VL0 == vl0 && AACENCODER_LIB_VL1 >= vl1) || \ (AACENCODER_LIB_VL0 == vl0 && AACENCODER_LIB_VL1 == vl1 && AACENCODER_LIB_VL2 > vl2))) #endif #if defined(XRDP_OPUS) #include static OpusEncoder *g_opus_encoder = 0; #endif #if defined(XRDP_MP3LAME) #include static lame_global_flags *g_lame_encoder = 0; #endif extern int g_rdpsnd_chan_id; /* in chansrv.c */ extern int g_display_num; /* in chansrv.c */ extern struct config_chansrv *g_cfg; /* in chansrv.c */ /* audio out: sound_server -> xrdp -> NeutrinoRDP */ static struct trans *g_audio_l_trans_out = 0; /* listener */ static struct trans *g_audio_c_trans_out = 0; /* connection */ /* audio in: sound_server <- xrdp <- NeutrinoRDP */ static struct trans *g_audio_l_trans_in = 0; /* listener */ static struct trans *g_audio_c_trans_in = 0; /* connection */ static int g_training_sent_time = 0; static int g_cBlockNo = 0; static int g_bytes_in_stream = 0; struct fifo *g_in_fifo; int g_bytes_in_fifo = 0; static int g_time_diff = 0; static int g_best_time_diff = 0; static struct stream *g_stream_inp = NULL; static struct stream *g_stream_incoming_packet = NULL; #define MAX_BBUF_SIZE (1024 * 16) static char g_buffer[MAX_BBUF_SIZE]; static int g_buf_index = 0; static int g_sent_time[256]; static int g_bbuf_size = 1024 * 8; /* may change later */ static struct list *g_ack_time_diff = 0; struct xr_wave_format_ex { int wFormatTag; int nChannels; int nSamplesPerSec; int nAvgBytesPerSec; int nBlockAlign; int wBitsPerSample; int cbSize; tui8 *data; }; /* output formats */ static tui8 g_pcm_22050_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_22050 = { WAVE_FORMAT_PCM, /* wFormatTag */ 2, /* num of channels */ 22050, /* samples per sec */ 88200, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_pcm_22050_data /* data */ }; static tui8 g_pcm_44100_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_44100 = { WAVE_FORMAT_PCM, /* wFormatTag */ 2, /* num of channels */ 44100, /* samples per sec */ 176400, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_pcm_44100_data /* data */ }; #if defined(XRDP_FDK_AAC) static tui8 g_fdk_aac_44100_data[] = { 0 }; static struct xr_wave_format_ex g_fdk_aac_44100 = { WAVE_FORMAT_AAC, /* wFormatTag */ 2, /* num of channels */ 44100, /* samples per sec */ 12000, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_fdk_aac_44100_data /* data */ }; #endif #if defined(XRDP_OPUS) static tui8 g_opus_44100_data[] = { 0 }; static struct xr_wave_format_ex g_opus_44100 = { WAVE_FORMAT_OPUS, /* wFormatTag */ 2, /* num of channels */ 44100, /* samples per sec */ 176400, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_opus_44100_data /* data */ }; #endif #if defined(XRDP_MP3LAME) static tui8 g_mp3lame_44100_data[] = { 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x71, 0x05 }; static struct xr_wave_format_ex g_mp3lame_44100 = { WAVE_FORMAT_MPEGLAYER3, /* wFormatTag */ 2, /* num of channels */ 44100, /* samples per sec */ 176400, /* avg bytes per sec */ 4, /* block align */ 0, /* bits per sample */ 12, /* data size */ g_mp3lame_44100_data /* data */ }; #endif static struct xr_wave_format_ex *g_wave_outp_formats[] = { &g_pcm_44100, &g_pcm_22050, #if defined(XRDP_FDK_AAC) &g_fdk_aac_44100, #endif #if defined(XRDP_OPUS) &g_opus_44100, #endif #if defined(XRDP_MP3LAME) &g_mp3lame_44100, #endif 0 }; static int g_client_does_fdk_aac = 0; static int g_client_fdk_aac_index = 0; static int g_client_does_opus = 0; static int g_client_opus_index = 0; static int g_client_does_mp3lame = 0; static int g_client_mp3lame_index = 0; /* index into list from client */ static int g_current_client_format_index = 0; /* index into list from server */ static int g_current_server_format_index = 0; /* input formats */ static tui8 g_pcm_inp_22050_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_inp_22050 = { WAVE_FORMAT_PCM, /* wFormatTag */ 2, /* num of channels */ 22050, /* samples per sec */ 88200, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_pcm_inp_22050_data /* data */ }; static tui8 g_pcm_inp_44100_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_inp_44100 = { WAVE_FORMAT_PCM, /* wFormatTag */ 2, /* num of channels */ 44100, /* samples per sec */ 176400, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_pcm_inp_44100_data /* data */ }; static struct xr_wave_format_ex *g_wave_inp_formats[] = { &g_pcm_inp_44100, &g_pcm_inp_22050, 0 }; static int g_rdpsnd_can_rec = 0; static int g_client_input_format_index = 0; static int g_server_input_format_index = 0; /* microphone related */ static int sound_send_server_input_formats(void); static int sound_process_input_format(int aindex, int wFormatTag, int nChannels, int nSamplesPerSec, int nAvgBytesPerSec, int nBlockAlign, int wBitsPerSample, int cbSize, char *data); static int sound_process_input_formats(struct stream *s, int size); static int sound_input_start_recording(void); static int sound_input_stop_recording(void); static int sound_process_input_data(struct stream *s, int bytes); static int sound_sndsrvr_source_data_in(struct trans *trans); static int sound_start_source_listener(void); static int sound_start_sink_listener(void); /*****************************************************************************/ static int sound_send_server_output_formats(void) { struct stream *s; int bytes; int index; int num_formats; char *size_ptr; num_formats = sizeof(g_wave_outp_formats) / sizeof(g_wave_outp_formats[0]) - 1; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_server_output_formats: num_formats %d", num_formats); make_stream(s); init_stream(s, 8182); out_uint16_le(s, SNDC_FORMATS); size_ptr = s->p; out_uint16_le(s, 0); /* size, set later */ out_uint32_le(s, 0); /* dwFlags */ out_uint32_le(s, 0); /* dwVolume */ out_uint32_le(s, 0); /* dwPitch */ out_uint16_le(s, 0); /* wDGramPort */ out_uint16_le(s, num_formats); /* wNumberOfFormats */ out_uint8(s, g_cBlockNo); /* cLastBlockConfirmed */ out_uint16_le(s, 5); /* wVersion */ out_uint8(s, 0); /* bPad */ /* sndFormats */ /* wFormatTag 2 byte offset 0 nChannels 2 byte offset 2 nSamplesPerSec 4 byte offset 4 nAvgBytesPerSec 4 byte offset 8 nBlockAlign 2 byte offset 12 wBitsPerSample 2 byte offset 14 cbSize 2 byte offset 16 data variable offset 18 */ /* examples 01 00 02 00 44 ac 00 00 10 b1 02 00 04 00 10 00 ....D........... 00 00 01 00 02 00 22 56 00 00 88 58 01 00 04 00 10 00 ...."V...X...... 00 00 */ for (index = 0; index < num_formats; index++) { out_uint16_le(s, g_wave_outp_formats[index]->wFormatTag); out_uint16_le(s, g_wave_outp_formats[index]->nChannels); out_uint32_le(s, g_wave_outp_formats[index]->nSamplesPerSec); out_uint32_le(s, g_wave_outp_formats[index]->nAvgBytesPerSec); out_uint16_le(s, g_wave_outp_formats[index]->nBlockAlign); out_uint16_le(s, g_wave_outp_formats[index]->wBitsPerSample); bytes = g_wave_outp_formats[index]->cbSize; out_uint16_le(s, bytes); if (bytes > 0) { out_uint8p(s, g_wave_outp_formats[index]->data, bytes); } } s_mark_end(s); bytes = (int)((s->end - s->data) - 4); size_ptr[0] = bytes; size_ptr[1] = bytes >> 8; bytes = (int)(s->end - s->data); send_channel_data(g_rdpsnd_chan_id, s->data, bytes); free_stream(s); return 0; } /*****************************************************************************/ static int sound_send_training(void) { struct stream *s; int bytes; int time; char *size_ptr; make_stream(s); init_stream(s, 8182); out_uint16_le(s, SNDC_TRAINING); size_ptr = s->p; out_uint16_le(s, 0); /* size, set later */ time = g_time3(); g_training_sent_time = time; out_uint16_le(s, time); out_uint16_le(s, 1024); out_uint8s(s, (1024 - 4)); s_mark_end(s); bytes = (int)((s->end - s->data) - 4); size_ptr[0] = bytes; size_ptr[1] = bytes >> 8; bytes = (int)(s->end - s->data); send_channel_data(g_rdpsnd_chan_id, s->data, bytes); free_stream(s); return 0; } /*****************************************************************************/ static int sound_process_output_format(int aindex, int wFormatTag, int nChannels, int nSamplesPerSec, int nAvgBytesPerSec, int nBlockAlign, int wBitsPerSample, int cbSize, char *data) { LOG(LOG_LEVEL_INFO, "sound_process_output_format:"); LOG(LOG_LEVEL_INFO, " wFormatNo %d", aindex); LOG(LOG_LEVEL_INFO, " wFormatTag %s", audin_wave_format_tag_to_str(wFormatTag)); LOG(LOG_LEVEL_INFO, " nChannels %d", nChannels); LOG(LOG_LEVEL_INFO, " nSamplesPerSec %d", nSamplesPerSec); LOG(LOG_LEVEL_INFO, " nAvgBytesPerSec %d", nAvgBytesPerSec); LOG(LOG_LEVEL_INFO, " nBlockAlign %d", nBlockAlign); LOG(LOG_LEVEL_INFO, " wBitsPerSample %d", wBitsPerSample); LOG(LOG_LEVEL_INFO, " cbSize %d", cbSize); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", data, cbSize); /* select CD quality audio */ if (wFormatTag == g_pcm_44100.wFormatTag && nChannels == g_pcm_44100.nChannels && nSamplesPerSec == g_pcm_44100.nSamplesPerSec && nAvgBytesPerSec == g_pcm_44100.nAvgBytesPerSec && nBlockAlign == g_pcm_44100.nBlockAlign && wBitsPerSample == g_pcm_44100.wBitsPerSample) { g_current_client_format_index = aindex; g_current_server_format_index = 0; } #if 0 for (lindex = 0; lindex < NUM_BUILT_IN; lindex++) { if (wFormatTag == g_wave_formats[lindex]->wFormatTag && nChannels == g_wave_formats[lindex]->nChannels && nSamplesPerSec == g_wave_formats[lindex]->nSamplesPerSec && nAvgBytesPerSec == g_wave_formats[lindex]->nAvgBytesPerSec && nBlockAlign == g_wave_formats[lindex]->nBlockAlign && wBitsPerSample == g_wave_formats[lindex]->wBitsPerSample) { g_current_client_format_index = aindex; g_current_server_format_index = lindex; } } #endif switch (wFormatTag) { case WAVE_FORMAT_AAC: LOG_DEVEL(LOG_LEVEL_INFO, "wFormatTag, fdk aac"); g_client_does_fdk_aac = 1; g_client_fdk_aac_index = aindex; break; case WAVE_FORMAT_MPEGLAYER3: LOG_DEVEL(LOG_LEVEL_INFO, "wFormatTag, mp3"); g_client_does_mp3lame = 1; g_client_mp3lame_index = aindex; break; case WAVE_FORMAT_OPUS: LOG_DEVEL(LOG_LEVEL_INFO, "wFormatTag, opus"); g_client_does_opus = 1; g_client_opus_index = aindex; break; } return 0; } /*****************************************************************************/ /* 0000 07 02 26 00 03 00 80 00 ff ff ff ff 00 00 00 00 ..&............. 0010 00 00 01 00 00 02 00 00 01 00 02 00 44 ac 00 00 ............D... 0020 10 b1 02 00 04 00 10 00 00 00 */ static int sound_process_output_formats(struct stream *s, int size) { int num_formats; int index; int wFormatTag; int nChannels; int nSamplesPerSec; int nAvgBytesPerSec; int nBlockAlign; int wBitsPerSample; int cbSize; char *data; if (size < 16) { return 1; } in_uint8s(s, 14); in_uint16_le(s, num_formats); in_uint8s(s, 4); if (num_formats > 0) { for (index = 0; index < num_formats; index++) { in_uint16_le(s, wFormatTag); in_uint16_le(s, nChannels); in_uint32_le(s, nSamplesPerSec); in_uint32_le(s, nAvgBytesPerSec); in_uint16_le(s, nBlockAlign); in_uint16_le(s, wBitsPerSample); in_uint16_le(s, cbSize); in_uint8p(s, data, cbSize); sound_process_output_format(index, wFormatTag, nChannels, nSamplesPerSec, nAvgBytesPerSec, nBlockAlign, wBitsPerSample, cbSize, data); } sound_send_training(); } return 0; } #if defined(XRDP_FDK_AAC) /*****************************************************************************/ static int sound_wave_compress_fdk_aac(char *data, int data_bytes, int *format_index) { int rv; int cdata_bytes; char *cdata; AACENC_ERROR error; int aot; int sample_rate; int mode; int bitrate; int afterburner; int channel_order; AACENC_InfoStruct info; AACENC_BufDesc in_buf; AACENC_BufDesc out_buf; AACENC_InArgs in_args; AACENC_OutArgs out_args; void *in_buffer; int in_identifier; int in_size; int in_elem_size; void *out_buffer; int out_identifier; int out_size; int out_elem_size; rv = data_bytes; if (g_client_does_fdk_aac == 0) { return rv; } if (g_fdk_aac_encoder == 0) { /* init fdk aac encoder */ LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: using fdk aac"); error = aacEncOpen(&g_fdk_aac_encoder, 0, 2); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_wave_compress_fdk_aac: aacEncOpen() failed"); return rv; } aot = 2; /* MPEG-4 AAC Low Complexity. */ error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_AOT, aot); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_AOT failed"); } sample_rate = g_fdk_aac_44100.nSamplesPerSec; error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_SAMPLERATE, sample_rate); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_SAMPLERATE failed"); } mode = MODE_2; error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_CHANNELMODE, mode); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_CHANNELMODE failed"); } channel_order = 1; /* WAVE file format channel ordering */ error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_CHANNELORDER, channel_order); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_CHANNELORDER failed"); } /* bytes rate to bit rate */ bitrate = g_fdk_aac_44100.nAvgBytesPerSec * 8; error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_BITRATE, bitrate); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_BITRATE failed"); } error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_TRANSMUX, 0); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_TRANSMUX failed"); } afterburner = 1; error = aacEncoder_SetParam(g_fdk_aac_encoder, AACENC_AFTERBURNER, afterburner); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncoder_SetParam() " "AACENC_AFTERBURNER failed"); } error = aacEncEncode(g_fdk_aac_encoder, NULL, NULL, NULL, NULL); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: Unable to initialize " "the encoder"); } g_memset(&info, 0, sizeof(info)); error = aacEncInfo(g_fdk_aac_encoder, &info); if (error != AACENC_OK) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac: aacEncInfo failed"); } LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_fdk_aac:"); LOG_DEVEL(LOG_LEVEL_INFO, " AACENC_InfoStruct"); LOG_DEVEL(LOG_LEVEL_INFO, " maxOutBufBytes %d", info.maxOutBufBytes); LOG_DEVEL(LOG_LEVEL_INFO, " maxAncBytes %d", info.maxAncBytes); LOG_DEVEL(LOG_LEVEL_INFO, " inBufFillLevel %d", info.inBufFillLevel); LOG_DEVEL(LOG_LEVEL_INFO, " inputChannels %d", info.inputChannels); LOG_DEVEL(LOG_LEVEL_INFO, " frameLength %d", info.frameLength); #if AACENCODER_LIB_VER_GTEQ(4, 0, 0) LOG_DEVEL(LOG_LEVEL_INFO, " nDelay %d", info.nDelay); LOG_DEVEL(LOG_LEVEL_INFO, " nDelayCore %d", info.nDelayCore); #else LOG_DEVEL(LOG_LEVEL_INFO, " encoderDelay %d", info.encoderDelay); #endif LOG_DEVEL(LOG_LEVEL_INFO, " confBuf"); LOG_DEVEL(LOG_LEVEL_INFO, " confSize %d", info.confSize); } rv = data_bytes; cdata_bytes = data_bytes; cdata = (char *) g_malloc(cdata_bytes, 0); if (data_bytes < g_bbuf_size) { g_memset(data + data_bytes, 0, g_bbuf_size - data_bytes); data_bytes = g_bbuf_size; } in_buffer = data; in_identifier = IN_AUDIO_DATA; in_size = data_bytes; in_elem_size = 2; g_memset(&in_args, 0, sizeof(in_args)); in_args.numInSamples = data_bytes / 2; g_memset(&in_buf, 0, sizeof(in_buf)); in_buf.numBufs = 1; in_buf.bufs = &in_buffer; in_buf.bufferIdentifiers = &in_identifier; in_buf.bufSizes = &in_size; in_buf.bufElSizes = &in_elem_size; out_buffer = cdata; out_identifier = OUT_BITSTREAM_DATA; out_size = cdata_bytes; out_elem_size = 1; g_memset(&out_buf, 0, sizeof(out_buf)); out_buf.numBufs = 1; out_buf.bufs = &out_buffer; out_buf.bufferIdentifiers = &out_identifier; out_buf.bufSizes = &out_size; out_buf.bufElSizes = &out_elem_size; g_memset(&out_args, 0, sizeof(out_args)); error = aacEncEncode(g_fdk_aac_encoder, &in_buf, &out_buf, &in_args, &out_args); if (error == AACENC_OK) { cdata_bytes = out_args.numOutBytes; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_wave_compress_fdk_aac: aacEncEncode ok " "cdata_bytes %d", cdata_bytes); *format_index = g_client_fdk_aac_index; g_memcpy(data, cdata, cdata_bytes); rv = cdata_bytes; } else { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_wave_compress_fdk_aac: aacEncEncode failed"); } g_free(cdata); return rv; } #else /*****************************************************************************/ static int sound_wave_compress_fdk_aac(char *data, int data_bytes, int *format_index) { return data_bytes; } #endif #if defined(XRDP_OPUS) /*****************************************************************************/ static int sound_wave_compress_opus(char *data, int data_bytes, int *format_index) { unsigned char *cdata; int cdata_bytes; int rv; int error; int data_bytes_org; opus_int16 *os16; if (g_client_does_opus == 0) { return data_bytes; } if (g_opus_encoder == 0) { /* NB (narrowband) 8 kHz MB (medium-band) 12 kHz WB (wideband) 16 kHz SWB (super-wideband) 24 kHz FB (fullband) 48 kHz */ g_opus_encoder = opus_encoder_create(48000, 2, OPUS_APPLICATION_AUDIO, &error); if (g_opus_encoder == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_wave_compress_opus: opus_encoder_create failed"); return data_bytes; } } data_bytes_org = data_bytes; rv = data_bytes; cdata_bytes = data_bytes; cdata = (unsigned char *) g_malloc(cdata_bytes, 0); os16 = (opus_int16 *) data; /* at 48000 we have 2.5 ms 480 5 ms 960 10 ms 1920 20 ms 3840 40 ms 7680 60 ms 11520 */ if (data_bytes < g_bbuf_size) { g_memset(data + data_bytes, 0, g_bbuf_size - data_bytes); data_bytes = g_bbuf_size; } cdata_bytes = opus_encode(g_opus_encoder, os16, data_bytes / 4, cdata, cdata_bytes); if ((cdata_bytes > 0) && (cdata_bytes < data_bytes_org)) { *format_index = g_client_opus_index; g_memcpy(data, cdata, cdata_bytes); rv = cdata_bytes; } g_free(cdata); return rv; } #else /*****************************************************************************/ static int sound_wave_compress_opus(char *data, int data_bytes, int *format_index) { return data_bytes; } #endif #if defined(XRDP_MP3LAME) /*****************************************************************************/ static int sound_wave_compress_mp3lame(char *data, int data_bytes, int *format_index) { int rv; int cdata_bytes; int odata_bytes; unsigned char *cdata; cdata = NULL; rv = data_bytes; if (g_client_does_mp3lame == 0) { return rv; } if (g_lame_encoder == 0) { /* init mp3 lame encoder */ LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_mp3lame: using mp3lame"); g_lame_encoder = lame_init(); if (g_lame_encoder == 0) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_mp3lame: lame_init() failed"); return rv; } lame_set_num_channels(g_lame_encoder, g_mp3lame_44100.nChannels); lame_set_in_samplerate(g_lame_encoder, g_mp3lame_44100.nSamplesPerSec); //lame_set_brate(g_lame_encoder, 64); lame_set_quality(g_lame_encoder, 7); if (lame_init_params(g_lame_encoder) == -1) { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_wave_compress_mp3lame: lame_init_params() failed"); return rv; } LOG_DEVEL(LOG_LEVEL_INFO, "sound_wave_compress_mp3lame: lame config:"); LOG_DEVEL(LOG_LEVEL_INFO, " brate : %d", lame_get_brate(g_lame_encoder)); LOG_DEVEL(LOG_LEVEL_INFO, " compression ratio: %f", lame_get_compression_ratio(g_lame_encoder)); LOG_DEVEL(LOG_LEVEL_INFO, " encoder delay : %d", lame_get_encoder_delay(g_lame_encoder)); LOG_DEVEL(LOG_LEVEL_INFO, " frame size : %d", lame_get_framesize(g_lame_encoder)); LOG_DEVEL(LOG_LEVEL_INFO, " encoder padding : %d", lame_get_encoder_padding(g_lame_encoder)); LOG_DEVEL(LOG_LEVEL_INFO, " mode : %d", lame_get_mode(g_lame_encoder)); } odata_bytes = data_bytes; cdata_bytes = data_bytes; cdata = (unsigned char *) g_malloc(cdata_bytes, 0); if (data_bytes < g_bbuf_size) { g_memset(data + data_bytes, 0, g_bbuf_size - data_bytes); data_bytes = g_bbuf_size; } cdata_bytes = lame_encode_buffer_interleaved(g_lame_encoder, (short int *) data, data_bytes / 4, cdata, cdata_bytes); if (cdata_bytes < 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_wave_compress: lame_encode_buffer_interleaved() " "failed, error %d", cdata_bytes); return rv; } if ((cdata_bytes > 0) && (cdata_bytes < odata_bytes)) { *format_index = g_client_mp3lame_index; g_memcpy(data, cdata, cdata_bytes); rv = cdata_bytes; } g_free(cdata); return rv; } #else /*****************************************************************************/ static int sound_wave_compress_mp3lame(char *data, int data_bytes, int *format_index) { return data_bytes; } #endif /*****************************************************************************/ static int sound_wave_compress(char *data, int data_bytes, int *format_index) { if (g_client_does_fdk_aac) { g_bbuf_size = 4096; return sound_wave_compress_fdk_aac(data, data_bytes, format_index); } else if (g_client_does_opus) { g_bbuf_size = 11520; return sound_wave_compress_opus(data, data_bytes, format_index); } else if (g_client_does_mp3lame) { g_bbuf_size = 11520; return sound_wave_compress_mp3lame(data, data_bytes, format_index); } return data_bytes; } /*****************************************************************************/ /* send wave message to client */ static int sound_send_wave_data_chunk(char *data, int data_bytes) { struct stream *s; int bytes; int time; int format_index; char *size_ptr; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_wave_data_chunk: data_bytes %d", data_bytes); if ((data_bytes < 4) || (data_bytes > 128 * 1024)) { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_send_wave_data_chunk: bad data_bytes %d", data_bytes); return 1; } /* compress, if available */ format_index = g_current_client_format_index; data_bytes = sound_wave_compress(data, data_bytes, &format_index); LOG(LOG_LEVEL_TRACE, "sound_send_wave_data_chunk: wFormatNo %d", format_index); /* part one of 2 PDU wave info */ LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_wave_data_chunk: sending %d bytes", data_bytes); make_stream(s); init_stream(s, 16 + data_bytes); /* some extra space */ out_uint16_le(s, SNDC_WAVE); size_ptr = s->p; out_uint16_le(s, 0); /* size, set later */ time = g_time3(); out_uint16_le(s, time); out_uint16_le(s, format_index); /* wFormatNo */ g_cBlockNo++; out_uint8(s, g_cBlockNo); g_sent_time[g_cBlockNo & 0xff] = time; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_wave_data_chunk: sending time %d, g_cBlockNo %d", time & 0xffff, g_cBlockNo & 0xff); out_uint8s(s, 3); out_uint8a(s, data, 4); s_mark_end(s); bytes = (int)((s->end - s->data) - 4); bytes += data_bytes; bytes -= 4; size_ptr[0] = bytes; size_ptr[1] = bytes >> 8; bytes = (int)(s->end - s->data); send_channel_data(g_rdpsnd_chan_id, s->data, bytes); /* part two of 2 PDU wave info even is zero, we have to send this */ init_stream(s, data_bytes); out_uint32_le(s, 0); out_uint8a(s, data + 4, data_bytes - 4); s_mark_end(s); bytes = (int)(s->end - s->data); send_channel_data(g_rdpsnd_chan_id, s->data, bytes); free_stream(s); return 0; } /*****************************************************************************/ /* send wave message to client, buffer first */ static int sound_send_wave_data(char *data, int data_bytes) { int space_left; int chunk_bytes; int data_index; int error; int res; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_wave_data: sending %d bytes", data_bytes); if (g_time_diff > g_best_time_diff + 250) { data_bytes = data_bytes / 4; data_bytes = data_bytes & ~3; g_memset(data, 0, data_bytes); g_time_diff = 0; } data_index = 0; error = 0; while (data_bytes > 0) { space_left = g_bbuf_size - g_buf_index; chunk_bytes = MIN(space_left, data_bytes); if (chunk_bytes < 1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_wave_data: error"); error = 1; break; } g_memcpy(g_buffer + g_buf_index, data + data_index, chunk_bytes); g_buf_index += chunk_bytes; if (g_buf_index >= g_bbuf_size) { g_buf_index = 0; res = sound_send_wave_data_chunk(g_buffer, g_bbuf_size); if (res == 2) { /* don't need to error on this */ LOG_DEVEL(LOG_LEVEL_ERROR, "sound_send_wave_data: dropped, no room"); break; } else if (res != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_wave_data: error"); error = 1; break; } } data_bytes -= chunk_bytes; data_index += chunk_bytes; } return error; } /*****************************************************************************/ /* send close message to client */ static int sound_send_close(void) { struct stream *s; int bytes; char *size_ptr; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_close:"); g_best_time_diff = 0; g_buf_index = 0; /* send close msg */ make_stream(s); init_stream(s, 8182); out_uint16_le(s, SNDC_CLOSE); size_ptr = s->p; out_uint16_le(s, 0); /* size, set later */ s_mark_end(s); bytes = (int)((s->end - s->data) - 4); size_ptr[0] = bytes; size_ptr[1] = bytes >> 8; bytes = (int)(s->end - s->data); send_channel_data(g_rdpsnd_chan_id, s->data, bytes); free_stream(s); return 0; } /*****************************************************************************/ /* from client */ static int sound_process_training(struct stream *s, int size) { int time_diff; time_diff = g_time3() - g_training_sent_time; LOG(LOG_LEVEL_INFO, "sound_process_training: round trip time %u", time_diff); return 0; } /*****************************************************************************/ /* from client */ static int sound_process_wave_confirm(struct stream *s, int size) { int wTimeStamp; int cConfirmedBlockNo; int time; int time_diff; int index; int acc; time = g_time3(); in_uint16_le(s, wTimeStamp); in_uint8(s, cConfirmedBlockNo); time_diff = time - g_sent_time[cConfirmedBlockNo & 0xff]; LOG(LOG_LEVEL_TRACE, "sound_process_wave_confirm: wTimeStamp %d, " "cConfirmedBlockNo %d time diff %d", wTimeStamp, cConfirmedBlockNo, time_diff); acc = 0; list_add_item(g_ack_time_diff, time_diff); if (g_ack_time_diff->count >= 50) { while (g_ack_time_diff->count > 50) { list_remove_item(g_ack_time_diff, 0); } for (index = 0; index < g_ack_time_diff->count; index++) { acc += list_get_item(g_ack_time_diff, index); } acc = acc / g_ack_time_diff->count; if ((g_best_time_diff < 1) || (g_best_time_diff > acc)) { g_best_time_diff = acc; } } g_time_diff = acc; return 0; } /*****************************************************************************/ /* process message in from the audio source, eg pulse, alsa on it's way to the client. returns error */ static int process_pcm_message(int id, int size, struct stream *s) { static int sending_silence = 0; static int silence_start_time = 0; switch (id) { case 0: if ((g_client_does_fdk_aac || g_client_does_mp3lame) && sending_silence) { if ((g_time3() - silence_start_time) < (int)g_cfg->msec_do_not_send) { /* do not send data within msec_do_not_send msec after SNDC_CLOSE is sent, to avoid stutter. setting from sesman.ini */ return 0; } sending_silence = 0; } return sound_send_wave_data(s->p, size); break; case 1: if ((g_client_does_fdk_aac || g_client_does_mp3lame) && sending_silence == 0) { /* workaround for mstsc.exe. send silence data before send close */ int send_silence_times = g_client_does_fdk_aac ? g_cfg->num_silent_frames_aac : g_cfg->num_silent_frames_mp3; /* setting from sesman.ini */ char *buf = (char *) g_malloc(g_bbuf_size, 0); if (buf != NULL) { int i; silence_start_time = g_time3(); sending_silence = 1; for (i = 0; i < send_silence_times; i++) { g_memset(buf, 0, g_bbuf_size); sound_send_wave_data_chunk(buf, g_bbuf_size); } free(buf); g_time_diff = 0; } } return sound_send_close(); break; default: LOG_DEVEL(LOG_LEVEL_ERROR, "process_pcm_message: unknown id %d", id); break; } return 1; } /*****************************************************************************/ /* data in from sound_server_sink */ static int sound_sndsrvr_sink_data_in(struct trans *trans) { struct stream *s; int id; int size; int error; if (trans == 0) { return 0; } if (trans != g_audio_c_trans_out) { return 1; } s = trans_get_in_s(trans); in_uint32_le(s, id); in_uint32_le(s, size); if ((id & ~3) || (size > 128 * 1024 + 8) || (size < 8)) { LOG_DEVEL(LOG_LEVEL_ERROR, "sound_sndsrvr_sink_data_in: bad message id %d size %d", id, size); return 1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_sndsrvr_sink_data_in: good message id %d size %d", id, size); error = trans_force_read(trans, size - 8); if (error == 0) { /* here, the entire message block is read in, process it */ error = process_pcm_message(id, size - 8, s); } return error; } /*****************************************************************************/ /* incoming connection on unix domain socket - sound_server_sink -> xrdp */ static int sound_sndsrvr_sink_conn_in(struct trans *trans, struct trans *new_trans) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_sndsrvr_sink_conn_in:"); if (trans == 0) { return 1; } if (trans != g_audio_l_trans_out) { return 1; } if (g_audio_c_trans_out != 0) /* if already set, error */ { return 1; } if (new_trans == 0) { return 1; } g_audio_c_trans_out = new_trans; g_audio_c_trans_out->trans_data_in = sound_sndsrvr_sink_data_in; g_audio_c_trans_out->header_size = 8; trans_delete(g_audio_l_trans_out); g_audio_l_trans_out = 0; return 0; } /*****************************************************************************/ /* incoming connection on unix domain socket - sound_server_source -> xrdp */ static int sound_sndsrvr_source_conn_in(struct trans *trans, struct trans *new_trans) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_sndsrvr_source_conn_in: client connected"); if (trans == 0) { return 1; } if (trans != g_audio_l_trans_in) { return 1; } if (g_audio_c_trans_in != 0) /* if already set, error */ { return 1; } if (new_trans == 0) { return 1; } g_audio_c_trans_in = new_trans; g_audio_c_trans_in->trans_data_in = sound_sndsrvr_source_data_in; g_audio_c_trans_in->header_size = 8; trans_delete(g_audio_l_trans_in); g_audio_l_trans_in = 0; return 0; } /*****************************************************************************/ /* Item destructor for g_in_fifo */ static void in_fifo_item_destructor(void *item, void *closure) { xstream_free((struct stream *)item); } /*****************************************************************************/ int sound_init(void) { LOG_DEVEL(LOG_LEVEL_INFO, "sound_init:"); g_stream_incoming_packet = NULL; /* init sound output */ sound_send_server_output_formats(); sound_start_sink_listener(); /* init sound input */ sound_send_server_input_formats(); sound_start_source_listener(); /* save data from sound_server_source */ g_in_fifo = fifo_create(in_fifo_item_destructor); g_client_does_fdk_aac = 0; g_client_fdk_aac_index = 0; g_client_does_opus = 0; g_client_opus_index = 0; g_client_does_mp3lame = 0; g_client_mp3lame_index = 0; if (g_ack_time_diff == 0) { g_ack_time_diff = list_create(); } list_clear(g_ack_time_diff); #if defined(XRDP_FDK_AAC) || defined(XRDP_MP3LAME) LOG(LOG_LEVEL_INFO, "num_silent_frames_aac: %d", g_cfg->num_silent_frames_aac); LOG(LOG_LEVEL_INFO, "num_silent_frames_mp3: %d", g_cfg->num_silent_frames_mp3); LOG(LOG_LEVEL_INFO, "msec_do_not_send: %d", g_cfg->msec_do_not_send); #endif return 0; } /*****************************************************************************/ int sound_deinit(void) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_deinit:"); if (g_audio_l_trans_out != 0) { trans_delete(g_audio_l_trans_out); g_audio_l_trans_out = 0; } if (g_audio_c_trans_out != 0) { trans_delete(g_audio_c_trans_out); g_audio_c_trans_out = 0; } if (g_audio_l_trans_in != 0) { trans_delete(g_audio_l_trans_in); g_audio_l_trans_in = 0; } if (g_audio_c_trans_in != 0) { trans_delete(g_audio_c_trans_in); g_audio_c_trans_in = 0; } #if defined(XRDP_MP3LAME) if (g_lame_encoder) { lame_close(g_lame_encoder); g_lame_encoder = 0; g_client_does_mp3lame = 0; } #endif fifo_delete(g_in_fifo, NULL); return 0; } /*****************************************************************************/ /* data in from client ( client -> xrdp -> chansrv ) */ int sound_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length) { int code; int size; int ok_to_free = 1; if (!read_entire_packet(s, &g_stream_incoming_packet, chan_flags, length, total_length)) { return 0; } in_uint8(g_stream_incoming_packet, code); in_uint8s(g_stream_incoming_packet, 1); in_uint16_le(g_stream_incoming_packet, size); switch (code) { case SNDC_WAVECONFIRM: sound_process_wave_confirm(g_stream_incoming_packet, size); break; case SNDC_TRAINING: sound_process_training(g_stream_incoming_packet, size); break; case SNDC_FORMATS: sound_process_output_formats(g_stream_incoming_packet, size); break; case SNDC_REC_NEGOTIATE: sound_process_input_formats(g_stream_incoming_packet, size); break; case SNDC_REC_DATA: sound_process_input_data(g_stream_incoming_packet, size); ok_to_free = 0; break; default: LOG_DEVEL(LOG_LEVEL_ERROR, "sound_data_in: unknown code %d size %d", code, size); break; } if (ok_to_free && g_stream_incoming_packet) { xstream_free(g_stream_incoming_packet); g_stream_incoming_packet = NULL; } return 0; } /*****************************************************************************/ int sound_get_wait_objs(tbus *objs, int *count, int *timeout) { int lcount; lcount = *count; if (g_audio_l_trans_out != 0) { objs[lcount] = g_audio_l_trans_out->sck; lcount++; } if (g_audio_c_trans_out != 0) { objs[lcount] = g_audio_c_trans_out->sck; lcount++; } if (g_audio_l_trans_in != 0) { objs[lcount] = g_audio_l_trans_in->sck; lcount++; } if (g_audio_c_trans_in != 0) { objs[lcount] = g_audio_c_trans_in->sck; lcount++; } *count = lcount; return 0; } /*****************************************************************************/ int sound_check_wait_objs(void) { if (g_audio_l_trans_out != 0) { if (trans_check_wait_objs(g_audio_l_trans_out) != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_check_wait_objs: g_audio_l_trans_out returned non-zero"); trans_delete(g_audio_l_trans_out); g_audio_l_trans_out = 0; } } if (g_audio_c_trans_out != 0) { if (trans_check_wait_objs(g_audio_c_trans_out) != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_check_wait_objs: g_audio_c_trans_out returned non-zero"); trans_delete(g_audio_c_trans_out); g_audio_c_trans_out = 0; sound_start_sink_listener(); } } if (g_audio_l_trans_in != 0) { if (trans_check_wait_objs(g_audio_l_trans_in) != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_check_wait_objs: g_audio_l_trans_in returned non-zero"); trans_delete(g_audio_l_trans_in); g_audio_l_trans_in = 0; } } if (g_audio_c_trans_in != 0) { if (trans_check_wait_objs(g_audio_c_trans_in) != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_check_wait_objs: g_audio_c_trans_in returned non-zero"); trans_delete(g_audio_c_trans_in); g_audio_c_trans_in = 0; sound_start_source_listener(); } } return 0; } /****************************************************************************** ** ** ** Microphone related code ** ** ** ******************************************************************************/ /** * *****************************************************************************/ static int sound_send_server_input_formats(void) { #if defined(XRDP_RDPSNDAUDIN) struct stream *s; int bytes; int index; int num_formats; char *size_ptr; num_formats = sizeof(g_wave_inp_formats) / sizeof(g_wave_inp_formats[0]) - 1; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_send_server_input_formats: num_formats %d", num_formats); make_stream(s); init_stream(s, 8182); out_uint16_le(s, SNDC_REC_NEGOTIATE); size_ptr = s->p; out_uint16_le(s, 0); /* size, set later */ out_uint32_le(s, 0); /* unused */ out_uint32_le(s, 0); /* unused */ out_uint16_le(s, num_formats); /* wNumberOfFormats */ out_uint16_le(s, 5); /* wVersion */ /* wFormatTag 2 byte offset 0 nChannels 2 byte offset 2 nSamplesPerSec 4 byte offset 4 nAvgBytesPerSec 4 byte offset 8 nBlockAlign 2 byte offset 12 wBitsPerSample 2 byte offset 14 cbSize 2 byte offset 16 data variable offset 18 */ for (index = 0; index < num_formats; index++) { out_uint16_le(s, g_wave_inp_formats[index]->wFormatTag); out_uint16_le(s, g_wave_inp_formats[index]->nChannels); out_uint32_le(s, g_wave_inp_formats[index]->nSamplesPerSec); out_uint32_le(s, g_wave_inp_formats[index]->nAvgBytesPerSec); out_uint16_le(s, g_wave_inp_formats[index]->nBlockAlign); out_uint16_le(s, g_wave_inp_formats[index]->wBitsPerSample); bytes = g_wave_inp_formats[index]->cbSize; out_uint16_le(s, bytes); if (bytes > 0) { out_uint8p(s, g_wave_inp_formats[index]->data, bytes); } } s_mark_end(s); bytes = (int)((s->end - s->data) - 4); size_ptr[0] = bytes; size_ptr[1] = bytes >> 8; bytes = (int)(s->end - s->data); send_channel_data(g_rdpsnd_chan_id, s->data, bytes); free_stream(s); #else /* avoid warning */ (void)g_wave_inp_formats; #endif return 0; } /** * *****************************************************************************/ static int sound_process_input_format(int aindex, int wFormatTag, int nChannels, int nSamplesPerSec, int nAvgBytesPerSec, int nBlockAlign, int wBitsPerSample, int cbSize, char *data) { LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_process_input_format:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " wFormatTag %d", wFormatTag); LOG_DEVEL(LOG_LEVEL_DEBUG, " nChannels %d", nChannels); LOG_DEVEL(LOG_LEVEL_DEBUG, " nSamplesPerSec %d", nSamplesPerSec); LOG_DEVEL(LOG_LEVEL_DEBUG, " nAvgBytesPerSec %d", nAvgBytesPerSec); LOG_DEVEL(LOG_LEVEL_DEBUG, " nBlockAlign %d", nBlockAlign); LOG_DEVEL(LOG_LEVEL_DEBUG, " wBitsPerSample %d", wBitsPerSample); LOG_DEVEL(LOG_LEVEL_DEBUG, " cbSize %d", cbSize); #if 1 /* select CD quality audio */ if (wFormatTag == g_pcm_inp_44100.wFormatTag && nChannels == g_pcm_inp_44100.nChannels && nSamplesPerSec == g_pcm_inp_44100.nSamplesPerSec && nAvgBytesPerSec == g_pcm_inp_44100.nAvgBytesPerSec && nBlockAlign == g_pcm_inp_44100.nBlockAlign && wBitsPerSample == g_pcm_inp_44100.wBitsPerSample) { g_client_input_format_index = aindex; g_server_input_format_index = 0; } #else /* select half of CD quality audio */ if (wFormatTag == g_pcm_inp_22050.wFormatTag && nChannels == g_pcm_inp_22050.nChannels && nSamplesPerSec == g_pcm_inp_22050.nSamplesPerSec && nAvgBytesPerSec == g_pcm_inp_22050.nAvgBytesPerSec && nBlockAlign == g_pcm_inp_22050.nBlockAlign && wBitsPerSample == g_pcm_inp_22050.wBitsPerSample) { g_client_input_format_index = aindex; g_server_input_format_index = 0; } #endif return 0; } /** * *****************************************************************************/ static int sound_process_input_formats(struct stream *s, int size) { int num_formats; int index; int wFormatTag; int nChannels; int nSamplesPerSec; int nAvgBytesPerSec; int nBlockAlign; int wBitsPerSample; int cbSize; char *data; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_process_input_formats: size=%d", size); if (g_getenv("XRDP_NO_RDPSND_REC") == NULL) { g_rdpsnd_can_rec = 1; } in_uint8s(s, 8); /* skip 8 bytes */ in_uint16_le(s, num_formats); in_uint8s(s, 2); /* skip version */ if (num_formats > 0) { for (index = 0; index < num_formats; index++) { in_uint16_le(s, wFormatTag); in_uint16_le(s, nChannels); in_uint32_le(s, nSamplesPerSec); in_uint32_le(s, nAvgBytesPerSec); in_uint16_le(s, nBlockAlign); in_uint16_le(s, wBitsPerSample); in_uint16_le(s, cbSize); in_uint8p(s, data, cbSize); sound_process_input_format(index, wFormatTag, nChannels, nSamplesPerSec, nAvgBytesPerSec, nBlockAlign, wBitsPerSample, cbSize, data); } } return 0; } /** * *****************************************************************************/ static int sound_input_start_recording(void) { struct stream *s; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_input_start_recording:"); /* if there is any data in FIFO, discard it */ fifo_clear(g_in_fifo, NULL); g_bytes_in_fifo = 0; xstream_new(s, 1024); /* * command format * * 02 bytes command SNDC_REC_START * 02 bytes length * 02 bytes data format received earlier */ out_uint16_le(s, SNDC_REC_START); out_uint16_le(s, 2); out_uint16_le(s, g_client_input_format_index); s_mark_end(s); send_channel_data(g_rdpsnd_chan_id, s->data, 6); xstream_free(s); return 0; } /** * *****************************************************************************/ static int sound_input_stop_recording(void) { struct stream *s; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_input_stop_recording:"); xstream_new(s, 1024); /* * command format * * 02 bytes command SNDC_REC_STOP * 02 bytes length (zero) */ out_uint16_le(s, SNDC_REC_STOP); out_uint16_le(s, 0); s_mark_end(s); send_channel_data(g_rdpsnd_chan_id, s->data, 4); xstream_free(s); return 0; } /** * Process data: xrdp <- client *****************************************************************************/ static int sound_process_input_data(struct stream *s, int bytes) { struct stream *ls; LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_process_input_data: bytes %d g_bytes_in_fifo %d", bytes, g_bytes_in_fifo); #if 0 /* no need to cap anymore */ /* cap data in fifo */ if (g_bytes_in_fifo > 8 * 1024) { return 0; } #endif xstream_new(ls, bytes); g_memcpy(ls->data, s->p, bytes); ls->p += bytes; s_mark_end(ls); fifo_add_item(g_in_fifo, (void *) ls); g_bytes_in_fifo += bytes; return 0; } /** * Got a command from sound_server_source *****************************************************************************/ static int sound_sndsrvr_source_data_in(struct trans *trans) { struct stream *ts = NULL; struct stream *s = NULL; tui16 bytes_req = 0; int bytes_read = 0; int cmd; int i; if (trans == 0) { return 0; } if (trans != g_audio_c_trans_in) { return 1; } ts = trans_get_in_s(trans); if (trans_force_read(trans, 3)) { LOG(LOG_LEVEL_ERROR, "sound.c: error reading from transport"); } ts->p = ts->data + 8; in_uint8(ts, cmd); in_uint16_le(ts, bytes_req); LOG_DEVEL(LOG_LEVEL_DEBUG, "sound_sndsrvr_source_data_in: bytes_req %d", bytes_req); xstream_new(s, bytes_req + 2); if (cmd == PA_CMD_SEND_DATA) { /* set real len later */ out_uint16_le(s, 0); while (bytes_read < bytes_req) { if (g_stream_inp == NULL) { g_stream_inp = (struct stream *) fifo_remove_item(g_in_fifo); if (g_stream_inp != NULL) { g_bytes_in_fifo -= g_stream_inp->size; LOG_DEVEL(LOG_LEVEL_DEBUG, " g_bytes_in_fifo %d", g_bytes_in_fifo); } } if (g_stream_inp == NULL) { /* no more data, send what we have */ break; } else { if (g_bytes_in_stream == 0) { g_bytes_in_stream = g_stream_inp->size; } i = bytes_req - bytes_read; if (i < g_bytes_in_stream) { xstream_copyin(s, &g_stream_inp->data[g_stream_inp->size - g_bytes_in_stream], i); bytes_read += i; g_bytes_in_stream -= i; } else { xstream_copyin(s, &g_stream_inp->data[g_stream_inp->size - g_bytes_in_stream], g_bytes_in_stream); bytes_read += g_bytes_in_stream; g_bytes_in_stream = 0; xstream_free(g_stream_inp); g_stream_inp = NULL; } } } if (bytes_read) { s->data[0] = (char) (bytes_read & 0xff); s->data[1] = (char) ((bytes_read >> 8) & 0xff); } s_mark_end(s); trans_force_write_s(trans, s); } else if (cmd == PA_CMD_START_REC) { if (g_rdpsnd_can_rec) { sound_input_start_recording(); } else { audin_start(); } } else if (cmd == PA_CMD_STOP_REC) { if (g_rdpsnd_can_rec) { sound_input_stop_recording(); } else { audin_stop(); } } xstream_free(s); return 0; } /** * Start a listener for microphone redirection connections *****************************************************************************/ static int sound_start_source_listener(void) { char port[XRDP_SOCKETS_MAXPATH]; g_audio_l_trans_in = trans_create(TRANS_MODE_UNIX, 128 * 1024, 8192); g_audio_l_trans_in->is_term = g_is_term; g_snprintf(port, sizeof(port), CHANSRV_PORT_IN_STR, g_getuid(), g_display_num); g_audio_l_trans_in->trans_conn_in = sound_sndsrvr_source_conn_in; if (trans_listen(g_audio_l_trans_in, port) != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "trans_listen failed"); } return 0; } /** * Start a listener for speaker redirection connections *****************************************************************************/ static int sound_start_sink_listener(void) { char port[XRDP_SOCKETS_MAXPATH]; g_audio_l_trans_out = trans_create(TRANS_MODE_UNIX, 128 * 1024, 8192); g_audio_l_trans_out->is_term = g_is_term; g_snprintf(port, sizeof(port), CHANSRV_PORT_OUT_STR, g_getuid(), g_display_num); g_audio_l_trans_out->trans_conn_in = sound_sndsrvr_sink_conn_in; if (trans_listen(g_audio_l_trans_out, port) != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "trans_listen failed"); } return 0; } xrdp-0.10.1/sesman/chansrv/pcsc/000755 001751 000000 00000000000 14652432047 016517 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/chansrv/chansrv_config.h000644 001751 000000 00000004530 14652432047 020733 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file contains the chansrv configuration parameters from sesman.ini */ #ifndef _CHANSRV_CONFIG #define _CHANSRV_CONFIG #include struct config_chansrv { /** Whether the FUSE mount is enabled or not */ int enable_fuse_mount; /** RestrictOutboundClipboard setting from sesman.ini */ int restrict_outbound_clipboard; /** RestrictInboundClipboard setting from sesman.ini */ int restrict_inbound_clipboard; /** * FuseMountName from sesman.ini */ char *fuse_mount_name; /** FileUmask from sesman.ini */ mode_t file_umask; /** Whether to use nautilus3-compatible file lists for the clipboard */ int use_nautilus3_flist_format; /** Number of silent frames to send before SNDC_CLOSE is sent, setting from sesman.ini */ unsigned int num_silent_frames_aac; unsigned int num_silent_frames_mp3; /** Do net send sound data afer SNDC_CLOSE is sent. unit is millisecond, setting from sesman.ini */ unsigned int msec_do_not_send; }; /** * * @brief Reads sesman configuration * @param use_logger Use logger to log errors (otherwise stdout) * @param sesman_ini Name of configuration file to read * * @return configuration on success, NULL on failure * * @pre logging is assumed to be active * @post pass return value to config_free() to prevent memory leaks * */ struct config_chansrv * config_read(int use_logger, const char *sesman_ini); /** * * @brief Dumps configuration to stdout * @param pointer to a config_chansrv struct * */ void config_dump(struct config_chansrv *config); /** * * @brief Frees configuration allocated by config_read() * @param pointer to a config_chansrv struct (may be NULL) * */ void config_free(struct config_chansrv *cs); #endif /* _CHANSRV_CONFIG */ xrdp-0.10.1/sesman/chansrv/xcommon.h000644 001751 000000 00000002140 14652432047 017415 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XCOMMON_H) #define XCOMMON_H #include "arch.h" #include "parse.h" /* 32 implies long */ #define FORMAT_TO_BYTES(_format) \ (_format) == 32 ? sizeof(long) : (_format) / 8 typedef void (*x_server_fatal_cb_type)(void); int xcommon_get_local_time(void); int xcommon_init(void); int xcommon_get_wait_objs(tbus *objs, int *count, int *timeout); int xcommon_check_wait_objs(void); void xcommon_set_x_server_fatal_handler(x_server_fatal_cb_type handler); #endif xrdp-0.10.1/sesman/chansrv/irp.h000644 001751 000000 00000007477 14652432047 016551 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * manage I/O for redirected file system and devices */ #ifndef __IRP_H #define __IRP_H #ifndef _TIME_H_ #include #endif #include "chansrv_fuse.h" /* Opaque data types to us */ typedef struct xfuse_info XFUSE_INFO; enum irp_lookup_state { E_LOOKUP_GET_FH = 0, E_LOOKUP_CHECK_BASIC, E_LOOKUP_CHECK_EOF } ; enum irp_setattr_state { E_SETATTR_GET_FH = 0, E_SETATTR_CHECK_BASIC, E_SETATTR_CHECK_EOF } ; struct irp_lookup { enum irp_lookup_state state; /* Next state to consider */ struct file_attr fattr; /* Attributes to get */ }; struct irp_setattr { enum irp_setattr_state state; /* Next state to consider */ tui32 to_set; /* Bit mask for elements in use */ struct file_attr fattr; /* Attributes to set */ }; struct irp_write { tui64 offset; /* Offset the write was made at */ }; struct irp_create { int creating_dir; /* We're creating a directory */ }; struct irp_rename { char *new_name; /* New name for file */ }; /* An I/O Resource Packet to track I/O calls */ typedef struct irp IRP; struct irp { tui32 CompletionId; /* unique number */ tui32 DeviceId; /* identifies remote device */ tui32 FileId; /* RDP client provided unique number */ char completion_type; /* describes I/O type */ char *pathname; /* absolute pathname * Allocate with * devredir_irp_with_pathname_new() */ union { struct irp_lookup lookup; /* Used by lookup */ struct irp_setattr setattr; /* Used by setattr */ struct irp_write write; /* Used by write */ struct irp_create create; /* Used by create */ struct irp_rename rename; /* Use by rename */ } gen; /* Additional state data for some ops */ void *fuse_info; /* Fuse info pointer for FUSE calls */ IRP *next; /* point to next IRP */ IRP *prev; /* point to previous IRP */ int scard_index; /* used to smart card to locate dev */ void (*callback)(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); void *user_data; }; IRP *devredir_irp_new(void); /* As above, but allocates sufficient space for the specified * pathname, and copies it in to the pathname field */ IRP *devredir_irp_with_pathname_new(const char *pathname); /* As above, but specifies a pathname length with pathname * initially set to "". Use if you need to modify the pathname * significantly */ IRP *devredir_irp_with_pathnamelen_new(unsigned int pathnamelen); int devredir_irp_delete(IRP *irp); IRP *devredir_irp_find(tui32 completion_id); IRP *devredir_irp_find_by_fileid(tui32 FileId); IRP *devredir_irp_get_last(void); void devredir_irp_dump(void); #endif /* end ifndef __IRP_H */ xrdp-0.10.1/sesman/chansrv/chansrv_common.h000644 001751 000000 00000002120 14652432047 020747 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2009-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _CHANSRV_COMMON_H #define _CHANSRV_COMMON_H #include "parse.h" #include "os_calls.h" /* Define bitmask values for restricting the clipboard */ #define CLIP_RESTRICT_NONE 0 #define CLIP_RESTRICT_TEXT (1<<0) #define CLIP_RESTRICT_FILE (1<<1) #define CLIP_RESTRICT_IMAGE (1<<2) #define CLIP_RESTRICT_ALL 0x7fffffff int read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, int length, int total_length); #endif xrdp-0.10.1/sesman/chansrv/Makefile.in000644 001751 000000 00000063721 14652432075 017646 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @XRDP_FUSE_TRUE@am__append_1 = -DXRDP_FUSE $(FUSE_CFLAGS) -DFUSE_USE_VERSION=26 @XRDP_FUSE_TRUE@am__append_2 = $(FUSE_LIBS) @XRDP_FDK_AAC_TRUE@am__append_3 = -DXRDP_FDK_AAC $(FDKAAC_CFLAGS) @XRDP_FDK_AAC_TRUE@am__append_4 = $(FDKAAC_LIBS) @XRDP_OPUS_TRUE@am__append_5 = -DXRDP_OPUS @XRDP_OPUS_TRUE@am__append_6 = -lopus @XRDP_MP3LAME_TRUE@am__append_7 = -DXRDP_MP3LAME @XRDP_MP3LAME_TRUE@am__append_8 = -lmp3lame @XRDP_RDPSNDAUDIN_TRUE@am__append_9 = -DXRDP_RDPSNDAUDIN sbin_PROGRAMS = xrdp-chansrv$(EXEEXT) subdir = sesman/chansrv ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_xrdp_chansrv_OBJECTS = chansrv.$(OBJEXT) chansrv_common.$(OBJEXT) \ chansrv_config.$(OBJEXT) chansrv_fuse.$(OBJEXT) \ chansrv_xfs.$(OBJEXT) clipboard.$(OBJEXT) \ clipboard_file.$(OBJEXT) devredir.$(OBJEXT) irp.$(OBJEXT) \ rail.$(OBJEXT) smartcard.$(OBJEXT) smartcard_pcsc.$(OBJEXT) \ sound.$(OBJEXT) xcommon.$(OBJEXT) audin.$(OBJEXT) xrdp_chansrv_OBJECTS = $(am_xrdp_chansrv_OBJECTS) am__DEPENDENCIES_1 = @XRDP_FUSE_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @XRDP_FDK_AAC_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) am__DEPENDENCIES_4 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) xrdp_chansrv_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_4) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = xrdp_chansrv_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xrdp_chansrv_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/audin.Po ./$(DEPDIR)/chansrv.Po \ ./$(DEPDIR)/chansrv_common.Po ./$(DEPDIR)/chansrv_config.Po \ ./$(DEPDIR)/chansrv_fuse.Po ./$(DEPDIR)/chansrv_xfs.Po \ ./$(DEPDIR)/clipboard.Po ./$(DEPDIR)/clipboard_file.Po \ ./$(DEPDIR)/devredir.Po ./$(DEPDIR)/irp.Po ./$(DEPDIR)/rail.Po \ ./$(DEPDIR)/smartcard.Po ./$(DEPDIR)/smartcard_pcsc.Po \ ./$(DEPDIR)/sound.Po ./$(DEPDIR)/xcommon.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_chansrv_SOURCES) DIST_SOURCES = $(xrdp_chansrv_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ clipboard-notes.txt \ pcsc \ wave-format-server.txt AM_CPPFLAGS = -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman -I$(top_srcdir)/common \ $(am__append_1) $(am__append_3) $(am__append_5) \ $(am__append_7) $(am__append_9) CHANSRV_EXTRA_LIBS = $(am__append_2) $(am__append_4) $(am__append_6) \ $(am__append_8) AM_CFLAGS = $(X_CFLAGS) xrdp_chansrv_SOURCES = \ chansrv.c \ chansrv.h \ chansrv_common.c \ chansrv_common.h \ chansrv_config.c \ chansrv_config.h \ chansrv_fuse.c \ chansrv_fuse.h \ chansrv_xfs.c \ chansrv_xfs.h \ clipboard.c \ clipboard.h \ clipboard_common.h \ clipboard_file.c \ clipboard_file.h \ devredir.c \ devredir.h \ irp.c \ irp.h \ rail.c \ rail.h \ smartcard.c \ smartcard.h \ smartcard_pcsc.c \ smartcard_pcsc.h \ sound.c \ sound.h \ xcommon.c \ xcommon.h \ audin.c \ audin.h xrdp_chansrv_LDFLAGS = \ $(X_LIBS) xrdp_chansrv_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \ $(CHANSRV_EXTRA_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sesman/chansrv/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign sesman/chansrv/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || 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)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && $(am__rm_f) $$files clean-sbinPROGRAMS: $(am__rm_f) $(sbin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(sbin_PROGRAMS:$(EXEEXT)=) xrdp-chansrv$(EXEEXT): $(xrdp_chansrv_OBJECTS) $(xrdp_chansrv_DEPENDENCIES) $(EXTRA_xrdp_chansrv_DEPENDENCIES) @rm -f xrdp-chansrv$(EXEEXT) $(AM_V_CCLD)$(xrdp_chansrv_LINK) $(xrdp_chansrv_OBJECTS) $(xrdp_chansrv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chansrv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chansrv_common.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chansrv_config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chansrv_fuse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chansrv_xfs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clipboard.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clipboard_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devredir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rail.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smartcard.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smartcard_pcsc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sound.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcommon.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/audin.Po -rm -f ./$(DEPDIR)/chansrv.Po -rm -f ./$(DEPDIR)/chansrv_common.Po -rm -f ./$(DEPDIR)/chansrv_config.Po -rm -f ./$(DEPDIR)/chansrv_fuse.Po -rm -f ./$(DEPDIR)/chansrv_xfs.Po -rm -f ./$(DEPDIR)/clipboard.Po -rm -f ./$(DEPDIR)/clipboard_file.Po -rm -f ./$(DEPDIR)/devredir.Po -rm -f ./$(DEPDIR)/irp.Po -rm -f ./$(DEPDIR)/rail.Po -rm -f ./$(DEPDIR)/smartcard.Po -rm -f ./$(DEPDIR)/smartcard_pcsc.Po -rm -f ./$(DEPDIR)/sound.Po -rm -f ./$(DEPDIR)/xcommon.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-sbinPROGRAMS 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 ./$(DEPDIR)/audin.Po -rm -f ./$(DEPDIR)/chansrv.Po -rm -f ./$(DEPDIR)/chansrv_common.Po -rm -f ./$(DEPDIR)/chansrv_config.Po -rm -f ./$(DEPDIR)/chansrv_fuse.Po -rm -f ./$(DEPDIR)/chansrv_xfs.Po -rm -f ./$(DEPDIR)/clipboard.Po -rm -f ./$(DEPDIR)/clipboard_file.Po -rm -f ./$(DEPDIR)/devredir.Po -rm -f ./$(DEPDIR)/irp.Po -rm -f ./$(DEPDIR)/rail.Po -rm -f ./$(DEPDIR)/smartcard.Po -rm -f ./$(DEPDIR)/smartcard_pcsc.Po -rm -f ./$(DEPDIR)/sound.Po -rm -f ./$(DEPDIR)/xcommon.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-sbinPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/sesman/chansrv/chansrv_xfs.h000644 001751 000000 00000021674 14652432047 020276 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is the interface to the FUSE file system used by * chansrv */ #ifndef _CHANSRV_XFS #define _CHANSRV_XFS /* Skip this include if there's no FUSE */ #ifdef XRDP_FUSE #include #include #include #include "arch.h" #define XFS_MAXFILENAMELEN 255 /* * Incomplete types for the public interface */ struct xfs_fs; struct xfs_dir_handle; typedef struct xfs_inode { fuse_ino_t inum; /* File serial number. */ mode_t mode; /* File mode. */ uid_t uid; /* User ID of the file's owner. */ gid_t gid; /* Group ID of the file's group. */ off_t size; /* Size of file, in bytes. */ time_t atime; /* Time of last access. */ time_t mtime; /* Time of last modification. */ time_t ctime; /* Time of last status change. */ char name[XFS_MAXFILENAMELEN + 1]; /* Short name */ tui32 generation; /* Changes if inode is reused */ char is_redirected; /* file is on redirected device */ tui32 device_id; /* device ID of redirected device */ int lindex; /* used in clipboard operations */ } XFS_INODE; /* * Create a new filesystem instance * * @param umask Umask to apply to initial data structures * @param uid Owner UID for initial root directory * @param gid Owner GID for initial root directory * @return Pointer to instance, or NULL if no memory */ struct xfs_fs * xfs_create_xfs_fs(mode_t umask, uid_t uid, gid_t gid); /* * Delete a filesystem instance * * @param xfs Filesystem instance */ void xfs_delete_xfs_fs(struct xfs_fs *xfs); /* * Add an entry to the filesystem * * The returned element has default values inherited from the parent * * The specified mode is sanitised in that:- * - Bits other than the lowest nine permissions bits, the directory * bit (S_IFDIR) and the regular bit (S_IFREG) are cleared. * - S_IFREG is cleared if S_IFDIR is set * - S_IFREG is set if neither S_IFDIR or S_IFREG is set * * NULL is returned for one of the following conditions:- * - the parent does not exist * - the parent is not a directory * - the name length exceeds XFS_MAXFILENAMELEN * - the entry already exists * - memory is exhausted. * * @param xfs filesystem instance * @param parent_inode parent inode * @param name Name of entry * @param mode Initial mode for file. * @return inode, or NULL */ XFS_INODE * xfs_add_entry(struct xfs_fs *xfs, fuse_ino_t parent_inum, const char *name, mode_t mode); /* * Delete the contents of a directory * * If normal files are opened when they are deleted, the inode is not * released until the open count goes to zero. * * @param xfs filesystem instance * @param inode Reference to entry to delete * */ void xfs_remove_directory_contents(struct xfs_fs *xfs, fuse_ino_t inum); /* * Delete an entry from the filesystem * * If normal files are opened when they are deleted, the inode is not * released until the open count goes to zero. * * For directories, the contents are removed first. * * @param xfs filesystem instance * @param inode Reference to entry to delete * */ void xfs_remove_entry(struct xfs_fs *xfs, fuse_ino_t inum); /* * Get an XFS_INODE for an inum * * @param xfs filesystem instance * @param inum Inumber * @return Pointer to XFS_INODE */ XFS_INODE * xfs_get(struct xfs_fs *xfs, fuse_ino_t inum); /* * Get the full path for an inum * * The path is dynamically allocated, and must be freed after use * * @param xfs filesystem instance * @param inum Inumber to get path for * @return Full path (free after use) */ char * xfs_get_full_path(struct xfs_fs *xfs, fuse_ino_t inum); /* * Lookup a file in a directory * * @param xfs filesystem instance * @param inum Inumber of the directory * @param name Name of the file to lookup * @return Pointer to XFS_INODE if found */ XFS_INODE * xfs_lookup_in_dir(struct xfs_fs *xfs, fuse_ino_t inum, const char *name); /* * Inquires as to whether a directory is empty. * * The caller must check that the inum is actually a directory, or * the result is undefined. * * @param xfs filesystem instance * @param inum Inumber of the directory * @return True if the directory is empty */ int xfs_is_dir_empty(struct xfs_fs *xfs, fuse_ino_t inum); /* * Inquires as to whether an entry is under a directory. * * This can be used to check for invalid renames, where we try to * rename a directory into one of its sub-directories. * * Returned value means one of the following:- * 0 Entry is not related to the directory * 1 Entry is an immediate member of the directory * 2.. Entry is a few levels below the directory * * @param xfs filesystem instance * @param dir Inumber of the directory * @param entry Inumber of the entry * @return Nesting count of entry in the directory, or 0 for * no nesting */ unsigned int xfs_is_under(struct xfs_fs *xfs, fuse_ino_t dir, fuse_ino_t entry); /* * Opens a directory for reading * * @param xfs filesystem instance * @param dir Inumber of the directory * @return handle to be passed to xfs_readdir() and xfs_closedir() */ struct xfs_dir_handle * xfs_opendir(struct xfs_fs *xfs, fuse_ino_t dir); /* * Gets the next entry from a directory * * This function is safe to call while the filesystem is being modified. * Whether files added or removed from the directory in question are * returned or not is unspecified by this interface. * * @param xfs filesystem instance * @param handle Handle from xfs_opendir * @param off Offset (by reference). Pass in zero to get the first * entry. After the call, the offset is updated so that * the next call gets the next entry. * * @return pointer to details of file entry, or NULL if no more * entries are available. */ XFS_INODE * xfs_readdir(struct xfs_fs *xfs, struct xfs_dir_handle *handle, off_t *off); /* * Closes a directory opened for reading * * @param xfs filesystem instance * @param handle Earlier result of readdir() call */ void xfs_closedir(struct xfs_fs *xfs, struct xfs_dir_handle *handle); /* * Increment the file open count * * The file open count is used to be sure when an entry can be deleted from * the data structures. It allows us to remove an entry while still retaining * enough state to manage the file * * This call is only necessary for regular files - not directories * * @param xfs filesystem instance * @param inum File to increment the count of */ void xfs_increment_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum); /* * Decrement the file open count * * This call will ensure that deleted inodes are cleared up at the appropriate * time. * * This call is only necessary for regular files - not directories * * @param xfs filesystem instance * @param inum File to decrement the count of */ void xfs_decrement_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum); /* * Return the file open count for a regular file */ unsigned int xfs_get_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum); /* * Deletes all redirected entries with the matching device id * * Files are deleted even if they are open * * @param device_id Device ID */ void xfs_delete_redirected_entries_with_device_id(struct xfs_fs *xfs, tui32 device_id); /* * Check an entry move will be successful * * A move will fail if:- * - Any of the parameters are invalid * - if the entry is a directory, and the new parent is below the * entry in the existing hierarchy. * * @param xfs filesystem instance * @param inum Inumber of entry * @param new_parent New parent * @param name New name * * @result != 0 if all looks OK */ int xfs_check_move_entry(struct xfs_fs *xfs, fuse_ino_t inum, fuse_ino_t new_parent_inum, const char *name); /* * Move (rename) an entry * * @param xfs filesystem instance * @param inum Inumber of entry * @param new_parent New parent * @param name New name * * @result 0, or a suitable errno value. */ int xfs_move_entry(struct xfs_fs *xfs, fuse_ino_t inum, fuse_ino_t new_parent_inum, const char *name); #endif /* XRDP_FUSE */ #endif /* _CHANSRV_XFS */ xrdp-0.10.1/sesman/chansrv/rail.h000644 001751 000000 00000001722 14652432047 016671 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _RAIL_H_ #define _RAIL_H_ #include "../../common/rail.h" #include "arch.h" #include "parse.h" int rail_init(void); int rail_deinit(void); int rail_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length); int rail_xevent(void *xevent); int rail_request_title(int window_id); #endif xrdp-0.10.1/sesman/chansrv/wave-format-server.txt000644 001751 000000 00000140405 14652432047 022070 0ustar00metawheel000000 000000 Example wave formats from some servers see MMREG.H for defines Windows 7 SP1 example wave data sizes coming from server 8820 wFormatTag=1 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=176400 nBlockAlign=4 wBitsPerSample=16 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=88200 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=88200 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=44359 nBlockAlign=2048 wBitsPerSample=4 cbSize=32 0000 f4 07 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=44100 nAvgBytesPerSec=44251 nBlockAlign=2048 wBitsPerSample=4 cbSize=2 0000 f9 07 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=44100 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=44100 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22311 nBlockAlign=1024 wBitsPerSample=4 cbSize=32 0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22201 nBlockAlign=1024 wBitsPerSample=4 cbSize=2 0000 f9 03 .. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=22179 nBlockAlign=1024 wBitsPerSample=4 cbSize=32 0000 f4 07 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=22125 nBlockAlign=1024 wBitsPerSample=4 cbSize=2 0000 f9 07 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11289 nBlockAlign=512 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11177 nBlockAlign=512 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11155 nBlockAlign=512 wBitsPerSample=4 cbSize=32 0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11100 nBlockAlign=512 wBitsPerSample=4 cbSize=2 0000 f9 03 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0 wFormatTag=49 nChannels=1 nSamplesPerSec=44100 nAvgBytesPerSec=8957 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8192 nBlockAlign=512 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8110 nBlockAlign=512 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0 wFormatTag=2 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5644 nBlockAlign=256 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... wFormatTag=17 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5588 nBlockAlign=256 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ wFormatTag=49 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=4478 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4096 nBlockAlign=256 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4055 nBlockAlign=256 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ wFormatTag=49 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2239 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ wFormatTag=49 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1625 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. Windows XP SP3 example wave data sizes coming from server 32512, 16256 wFormatTag=1 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=88200 nBlockAlign=4 wBitsPerSample=16 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=44100 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22311 nBlockAlign=1024 wBitsPerSample=4 cbSize=32 0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=22201 nBlockAlign=1024 wBitsPerSample=4 cbSize=2 0000 f9 03 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=22050 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=22050 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=16000 nBlockAlign=2 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11289 nBlockAlign=512 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=11177 nBlockAlign=512 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11155 nBlockAlign=512 wBitsPerSample=4 cbSize=32 0000 f4 03 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=11100 nBlockAlign=512 wBitsPerSample=4 cbSize=2 0000 f9 03 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=11025 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8192 nBlockAlign=512 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=8110 nBlockAlign=512 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ wFormatTag=6 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ wFormatTag=7 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=8000 nBlockAlign=1 wBitsPerSample=8 cbSize=0 #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=7000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 b6 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=7000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 fc 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=6000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 9c 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=6000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 d8 00 01 00 71 05 ..........q. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5644 nBlockAlign=256 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=5588 nBlockAlign=256 wBitsPerSample=4 cbSize=2 0000 f9 01 .. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=5000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 82 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=5000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 b4 00 01 00 71 05 ..........q. #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ wFormatTag=49 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=4478 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ wFormatTag=2 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4096 nBlockAlign=256 wBitsPerSample=4 cbSize=32 0000 f4 01 07 00 00 01 00 00 00 02 00 ff 00 00 00 00 ................ 0010 c0 00 40 00 f0 00 00 00 cc 01 30 ff 88 01 18 ff ..@.......0..... #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ wFormatTag=17 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=4055 nBlockAlign=256 wBitsPerSample=4 cbSize=2 0000 f9 01 .. ? wFormatTag=353 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=4005 nBlockAlign=186 wBitsPerSample=16 cbSize=47 0000 00 04 00 00 01 00 ba 00 00 00 46 36 44 43 39 38 ..........F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=16000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 c0 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 d0 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 20 01 01 00 71 05 ...... ...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 68 00 01 00 71 05 ......h...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=4000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 9c 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 d8 00 01 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 4e 00 01 00 71 05 ......N...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=3000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 6c 00 01 00 71 05 ......l...q. ? wFormatTag=353 nChannels=1 nSamplesPerSec=22050 nAvgBytesPerSec=2519 nBlockAlign=117 wBitsPerSample=16 cbSize=47 0000 00 04 00 00 00 00 75 00 00 00 46 36 44 43 39 38 ......u...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. ? wFormatTag=353 nChannels=2 nSamplesPerSec=22050 nAvgBytesPerSec=2519 nBlockAlign=117 wBitsPerSample=16 cbSize=47 0000 00 04 00 00 00 00 75 00 00 00 46 36 44 43 39 38 ......u...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 f0 00 02 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 04 01 02 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 68 01 02 00 71 05 ......h...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 b4 00 02 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 f0 00 02 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2500 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 04 01 02 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=12000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 b0 01 04 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=11025 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 d4 01 04 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 88 02 04 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 44 01 04 00 71 05 ......D...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 b0 01 04 00 71 05 ..........q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2250 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 d4 01 04 00 71 05 ..........q. #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ wFormatTag=49 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2239 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. ? wFormatTag=353 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2000 nBlockAlign=64 wBitsPerSample=16 cbSize=47 0000 00 02 00 00 00 00 40 00 00 00 46 36 44 43 39 38 ......@...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=16000 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 48 00 01 00 71 05 ......H...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 60 00 01 00 71 05 ......`...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 68 00 01 00 71 05 ......h...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=2000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 90 00 01 00 71 05 ..........q. #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ wFormatTag=49 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1625 nBlockAlign=65 wBitsPerSample=0 cbSize=2 0000 40 01 @. ? wFormatTag=353 nChannels=2 nSamplesPerSec=8000 nAvgBytesPerSec=1500 nBlockAlign=96 wBitsPerSample=16 cbSize=47 0000 00 02 00 00 00 00 60 00 00 00 46 36 44 43 39 38 ......`...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. ? wFormatTag=353 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=1249 nBlockAlign=58 wBitsPerSample=16 cbSize=47 0000 00 02 00 00 00 00 3a 00 00 00 46 36 44 43 39 38 ......:...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. #define WAVE_FORMAT_DSPGROUP_TRUESPEECH 0x0022 /* DSP Group, Inc */ wFormatTag=34 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1067 nBlockAlign=32 wBitsPerSample=1 cbSize=32 0000 01 00 f0 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ? wFormatTag=353 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=1012 nBlockAlign=47 wBitsPerSample=16 cbSize=47 0000 00 02 00 00 00 00 2f 00 00 00 46 36 44 43 39 38 ....../...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. ? wFormatTag=353 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1000 nBlockAlign=64 wBitsPerSample=16 cbSize=47 0000 00 02 00 00 00 00 40 00 00 00 46 36 44 43 39 38 ......@...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=12000 nAvgBytesPerSec=1000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 30 00 01 00 71 05 ......0...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=11025 nAvgBytesPerSec=1000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 34 00 01 00 71 05 ......4...q. #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ wFormatTag=85 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=1000 nBlockAlign=1 wBitsPerSample=0 cbSize=12 0000 01 00 02 00 00 00 48 00 01 00 71 05 ......H...q. ? wFormatTag=66 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=800 nBlockAlign=24 wBitsPerSample=0 cbSize=10 0000 02 00 ce 9a 32 f7 a2 ae de ac ....2..... ? wFormatTag=353 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=750 nBlockAlign=48 wBitsPerSample=16 cbSize=47 0000 00 02 00 00 00 00 30 00 00 00 46 36 44 43 39 38 ......0...F6DC98 0010 33 30 2d 42 43 37 39 2d 31 31 64 32 2d 41 39 44 30-BC79-11d2-A9D 0020 30 2d 30 30 36 30 39 37 39 32 36 30 33 36 00 0-006097926036. ? wFormatTag=66 nChannels=1 nSamplesPerSec=8000 nAvgBytesPerSec=666 nBlockAlign=20 wBitsPerSample=0 cbSize=10 0000 03 00 ce 9a 32 f7 a2 ae de ac ....2..... //*************************************************************** // Windows 7 SP1 x64 Server Formats WAVE_FORMAT_PCM: wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 176400 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44359 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44251 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22179 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22125 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 8957 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 //*************************************************************** // Windows 10 10586 x64 Server Formats WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 24000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 20000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 16000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 12000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_PCM: wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 176400 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44359 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44251 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22179 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22125 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 8957 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 //*************************************************************** // Windows Server 2016 TP4 x64 Server Formats WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 24000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 20000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 16000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_AAC_MS: wFormatTag: 0xA106 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 12000 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_PCM: wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 176400 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44359 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 44100 nAvgBytesPerSec: 44251 nBlockAlign: 2048 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22179 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 22125 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 44100 nAvgBytesPerSec: 8957 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 //*************************************************************** // Windows XP SP3 x86 Server Formats WAVE_FORMAT_PCM: wFormatTag: 0x0001 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 88200 nBlockAlign: 4 wBitsPerSample: 16 cbSize: 0 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MULAW: wFormatTag: 0x0007 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 44100 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22311 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 22201 nBlockAlign: 1024 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 22050 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 22050 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MULAW: wFormatTag: 0x0007 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 22050 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MULAW: wFormatTag: 0x0007 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 22050 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 16000 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MULAW: wFormatTag: 0x0007 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 16000 nBlockAlign: 2 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11289 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 11177 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11155 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 11100 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 11025 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MULAW: wFormatTag: 0x0007 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 11025 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8192 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 8110 nBlockAlign: 512 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_ALAW: wFormatTag: 0x0006 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 8000 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MULAW: wFormatTag: 0x0007 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 8000 nBlockAlign: 1 wBitsPerSample: 8 cbSize: 0 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 7000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 7000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 6000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 6000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5644 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 5588 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 5000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 5000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4478 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_ADPCM: wFormatTag: 0x0002 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4096 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 32 WAVE_FORMAT_DVI_ADPCM: wFormatTag: 0x0011 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 4055 nBlockAlign: 256 wBitsPerSample: 4 cbSize: 2 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 4005 nBlockAlign: 186 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 16000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 4000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 3000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 22050 nAvgBytesPerSec: 2519 nBlockAlign: 117 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 2 nSamplesPerSec: 22050 nAvgBytesPerSec: 2519 nBlockAlign: 117 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2500 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 12000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 11025 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2250 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2239 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2000 nBlockAlign: 64 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 16000 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 2000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_GSM610: wFormatTag: 0x0031 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1625 nBlockAlign: 65 wBitsPerSample: 0 cbSize: 2 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 2 nSamplesPerSec: 8000 nAvgBytesPerSec: 1500 nBlockAlign: 96 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 1249 nBlockAlign: 58 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_DSPGROUP_TRUESPEECH : wFormatTag: 0x0022 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1067 nBlockAlign: 32 wBitsPerSample: 1 cbSize: 32 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 1012 nBlockAlign: 47 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1000 nBlockAlign: 64 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 12000 nAvgBytesPerSec: 1000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 11025 nAvgBytesPerSec: 1000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MPEGLAYER3: wFormatTag: 0x0055 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 1000 nBlockAlign: 1 wBitsPerSample: 0 cbSize: 12 WAVE_FORMAT_MSG723: wFormatTag: 0x0042 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 800 nBlockAlign: 24 wBitsPerSample: 0 cbSize: 10 WAVE_FORMAT_WMAUDIO2: wFormatTag: 0x0161 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 750 nBlockAlign: 48 wBitsPerSample: 16 cbSize: 47 WAVE_FORMAT_MSG723: wFormatTag: 0x0042 nChannels: 1 nSamplesPerSec: 8000 nAvgBytesPerSec: 666 nBlockAlign: 20 wBitsPerSample: 0 cbSize: 10 xrdp-0.10.1/sesman/chansrv/clipboard_file.c000644 001751 000000 00000056140 14652432047 020677 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* MS-RDPECLIP * http://msdn.microsoft.com/en-us/library/cc241066%28prot.20%29.aspx * * CLIPRDR_FILEDESCRIPTOR * http://msdn.microsoft.com/en-us/library/ff362447%28prot.20%29.aspx */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "arch.h" #include "parse.h" #include "os_calls.h" #include "string_calls.h" #include "list.h" #include "chansrv.h" #include "clipboard.h" #include "clipboard_file.h" #include "clipboard_common.h" #include "xcommon.h" #include "chansrv_fuse.h" #include "ms-rdpeclip.h" extern int g_cliprdr_chan_id; /* in chansrv.c */ extern struct clip_s2c g_clip_s2c; /* in clipboard.c */ extern struct clip_c2s g_clip_c2s; /* in clipboard.c */ extern char g_fuse_clipboard_path[]; struct cb_file_info { char pathname[256]; char filename[256]; int flags; int size; tui64 time; }; static struct list *g_files_list = 0; /* used when server is asking for file info from the client */ static int g_file_request_sent_type = 0; /* number of seconds from 1 Jan. 1601 00:00 to 1 Jan 1970 00:00 UTC */ #define CB_EPOCH_DIFF 11644473600LL /*****************************************************************************/ #if 0 static tui64 timeval2wintime(struct timeval *tv) { tui64 result; result = CB_EPOCH_DIFF; result += tv->tv_sec; result *= 10000000LL; result += tv->tv_usec * 10; return result; } #endif /*** * See MS-RDPECLIP 3.1.5.4.7 * * Sends a failure response to a CLIPRDR_FILECONTENTS_REQUEST * @param streamId Stream ID from CLIPRDR_FILECONTENTS_REQUEST * @return 0 for success */ static int clipboard_send_filecontents_response_fail(int streamId) { LOG_DEVEL(LOG_LEVEL_TRACE, "clipboardn_send_filecontents_response_fail:"); struct stream *s; int size; int rv; make_stream(s); init_stream(s, 64); out_uint16_le(s, CB_FILECONTENTS_RESPONSE); out_uint16_le(s, CB_RESPONSE_FAIL); out_uint32_le(s, 4); out_uint32_le(s, streamId); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ /* this will replace %20 or any hex with the space or correct char * returns error */ static int clipboard_check_file(char *filename) { char lfilename[256]; char jchr[8]; int lindex; int index; g_memset(lfilename, 0, 256); lindex = 0; index = 0; while (filename[index] != 0) { if (filename[index] == '%') { jchr[0] = filename[index + 1]; jchr[1] = filename[index + 2]; jchr[2] = 0; index += 3; lfilename[lindex] = g_htoi(jchr); lindex++; } else { lfilename[lindex] = filename[index]; lindex++; index++; } } LOG_DEVEL(LOG_LEVEL_DEBUG, "[%s] [%s]", filename, lfilename); g_strcpy(filename, lfilename); return 0; } /*****************************************************************************/ static int clipboard_get_file(const char *file, int bytes) { int sindex; int pindex; int flags; char full_fn[256]; /* /etc/xrdp/xrdp.ini */ char filename[256]; /* xrdp.ini */ char pathname[256]; /* /etc/xrdp */ struct cb_file_info *cfi; /* x-special/gnome-copied-files */ if ((g_strncmp(file, "copy", 4) == 0) && (bytes == 4)) { return 0; } if ((g_strncmp(file, "cut", 3) == 0) && (bytes == 3)) { return 0; } sindex = 0; flags = CB_FILE_ATTRIBUTE_ARCHIVE; /* text/uri-list */ /* x-special/gnome-copied-files */ if (g_strncmp(file, "file://", 7) == 0) { sindex = 7; } pindex = bytes; while (pindex > sindex) { if (file[pindex] == '/') { break; } pindex--; } g_memset(pathname, 0, 256); g_memset(filename, 0, 256); g_memcpy(pathname, file + sindex, pindex - sindex); if (pathname[0] == 0) { pathname[0] = '/'; } g_memcpy(filename, file + pindex + 1, (bytes - 1) - pindex); /* this should replace %20 with space */ clipboard_check_file(pathname); clipboard_check_file(filename); g_snprintf(full_fn, 255, "%s/%s", pathname, filename); /* * Before we look at the file, see if it's in the FUSE filesystem. If it is, * we can't call normal file checking functions, as these will result in * a deadlock */ if (xfuse_path_in_xfuse_fs(full_fn)) { LOG(LOG_LEVEL_ERROR, "clipboard_get_file: Can't add client-side file " "%s to clipboard", full_fn); return 1; } if (g_directory_exist(full_fn)) { LOG(LOG_LEVEL_ERROR, "clipboard_get_file: file [%s] is a directory, " "not supported", full_fn); flags |= CB_FILE_ATTRIBUTE_DIRECTORY; return 1; } if (!g_file_exist(full_fn)) { LOG(LOG_LEVEL_ERROR, "clipboard_get_file: file [%s] does not exist", full_fn); return 1; } else { cfi = (struct cb_file_info *)g_malloc(sizeof(struct cb_file_info), 1); list_add_item(g_files_list, (tintptr)cfi); g_strcpy(cfi->filename, filename); g_strcpy(cfi->pathname, pathname); cfi->size = g_file_get_size(full_fn); cfi->flags = flags; cfi->time = (g_time1() + CB_EPOCH_DIFF) * 10000000LL; LOG_DEVEL(LOG_LEVEL_DEBUG, "ok filename [%s] pathname [%s] size [%d]", cfi->filename, cfi->pathname, cfi->size); } return 0; } /*****************************************************************************/ static int clipboard_get_files(const char *files, int bytes) { int index; int file_index; char file[512]; file_index = 0; for (index = 0; index < bytes; index++) { if (files[index] == '\n' || files[index] == '\r') { if (file_index > 0) { if (clipboard_get_file(file, file_index) == 0) { } file_index = 0; } } else { file[file_index] = files[index]; file_index++; } } if (file_index > 0) { if (clipboard_get_file(file, file_index) == 0) { } } if (g_files_list->count < 1) { return 1; } return 0; } /*****************************************************************************/ /* server to client */ /* response to client asking for clipboard contents that is file list */ int clipboard_send_data_response_for_file(const char *data, int data_size) { struct stream *s; int size; int rv; int bytes_after_header; int cItems; int flags; int index; tui32 ui32; unsigned int utf8_count; unsigned int utf16_count; struct cb_file_info *cfi; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response_for_file: data_size %d", data_size); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", data, data_size); if (g_files_list == 0) { g_files_list = list_create(); g_files_list->auto_free = 1; } list_clear(g_files_list); clipboard_get_files(data, data_size); cItems = g_files_list->count; bytes_after_header = cItems * 592 + 4; make_stream(s); init_stream(s, 64 + bytes_after_header); out_uint16_le(s, CB_FORMAT_DATA_RESPONSE); /* 5 CLIPRDR_DATA_RESPONSE */ out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */ out_uint32_le(s, bytes_after_header); out_uint32_le(s, cItems); for (index = 0; index < cItems; index++) { cfi = (struct cb_file_info *)list_get_item(g_files_list, index); flags = CB_FD_ATTRIBUTES | CB_FD_FILESIZE | CB_FD_WRITESTIME | CB_FD_PROGRESSUI; out_uint32_le(s, flags); out_uint8s(s, 32); /* reserved1 */ flags = cfi->flags; out_uint32_le(s, flags); out_uint8s(s, 16); /* reserved2 */ /* file time */ /* 100-nanoseconds intervals since 1 January 1601 */ //out_uint32_le(s, 0x2c305d08); /* 25 October 2009, 21:17 */ //out_uint32_le(s, 0x01ca55f3); ui32 = cfi->time & 0xffffffff; out_uint32_le(s, ui32); ui32 = cfi->time >> 32; out_uint32_le(s, ui32); /* file size */ out_uint32_le(s, 0); out_uint32_le(s, cfi->size); /* Name is fixed-size 260 UTF-16 words */ utf8_count = strlen(cfi->filename) + 1; // Include terminator utf16_count = utf8_as_utf16_word_count(cfi->filename, utf8_count); if (utf16_count > 260) { LOG(LOG_LEVEL_ERROR, "clipboard_send_data_response_for_file:" " filename overflow (%u words)", utf16_count); utf8_count = 0; utf16_count = 0; } out_utf8_as_utf16_le(s, cfi->filename, utf8_count); out_uint8s(s, (260 - utf16_count) * 2); } out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ /* send the file size from server to the client */ static int clipboard_send_file_size(int streamId, int lindex) { struct stream *s; int size; int rv; int file_size; struct cb_file_info *cfi; if (g_files_list == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_file_size: error g_files_list is nil"); clipboard_send_filecontents_response_fail(streamId); return 1; } cfi = (struct cb_file_info *)list_get_item(g_files_list, lindex); if (cfi == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_file_size: error cfi is nil"); clipboard_send_filecontents_response_fail(streamId); return 1; } if (cfi->size < 0) { LOG(LOG_LEVEL_ERROR, "clipboard_send_file_size: error cfi->size is negative" "value [%d]", cfi->size); clipboard_send_filecontents_response_fail(streamId); return 1; } file_size = cfi->size; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_file_size: streamId %d file_size %d", streamId, file_size); make_stream(s); init_stream(s, 8192); out_uint16_le(s, CB_FILECONTENTS_RESPONSE); /* 9 */ out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */ out_uint32_le(s, 12); out_uint32_le(s, streamId); out_uint32_le(s, file_size); out_uint32_le(s, 0); out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ /* ask the client to send the file size */ int clipboard_request_file_size(int stream_id, int lindex) { struct stream *s; int size; int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_request_file_size:"); if (g_file_request_sent_type != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_request_file_size: warning, still waiting " "for CB_FILECONTENTS_RESPONSE"); } make_stream(s); init_stream(s, 8192); out_uint16_le(s, CB_FILECONTENTS_REQUEST); /* 8 */ out_uint16_le(s, 0); out_uint32_le(s, 28); out_uint32_le(s, stream_id); out_uint32_le(s, lindex); out_uint32_le(s, CB_FILECONTENTS_SIZE); out_uint32_le(s, 0); /* nPositionLow */ out_uint32_le(s, 0); /* nPositionHigh */ out_uint32_le(s, 0); /* cbRequested */ out_uint32_le(s, 0); /* clipDataId */ out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); g_file_request_sent_type = CB_FILECONTENTS_SIZE; return rv; } /*****************************************************************************/ /* send a chunk of the file from server to client */ static int clipboard_send_file_data(int streamId, int lindex, int nPositionLow, int cbRequested) { struct stream *s; int size; int rv; int fd; char full_fn[256]; struct cb_file_info *cfi; if (g_files_list == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_file_data: error g_files_list is nil"); clipboard_send_filecontents_response_fail(streamId); return 1; } cfi = (struct cb_file_info *)list_get_item(g_files_list, lindex); if (cfi == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_file_data: error cfi is nil"); clipboard_send_filecontents_response_fail(streamId); return 1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_file_data: streamId %d lindex %d " "nPositionLow %d cbRequested %d", streamId, lindex, nPositionLow, cbRequested); g_snprintf(full_fn, 255, "%s/%s", cfi->pathname, cfi->filename); fd = g_file_open_ro(full_fn); if (fd == -1) { LOG(LOG_LEVEL_ERROR, "clipboard_send_file_data: file open [%s] failed: %s", full_fn, g_get_strerror()); clipboard_send_filecontents_response_fail(streamId); return 1; } if (g_file_seek(fd, nPositionLow) < 0) { LOG(LOG_LEVEL_ERROR, "clipboard_send_file_data: seek error in file [%s]: %s", full_fn, g_get_strerror()); g_file_close(fd); clipboard_send_filecontents_response_fail(streamId); return 1; } make_stream(s); init_stream(s, cbRequested + 64); size = g_file_read(fd, s->data + 12, cbRequested); if (size < 1) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_file_data: read error, want %d got %d", cbRequested, size); free_stream(s); g_file_close(fd); clipboard_send_filecontents_response_fail(streamId); return 1; } out_uint16_le(s, CB_FILECONTENTS_RESPONSE); /* 9 */ out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */ out_uint32_le(s, size + 4); out_uint32_le(s, streamId); s->p += size; out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); g_file_close(fd); /* Log who transferred which file via clipboard for the purpose of audit */ LOG(LOG_LEVEL_INFO, "S2C: Transferred a file: filename=%s, uid=%d", full_fn, g_getuid()); return rv; } /*****************************************************************************/ /* ask the client to send the file size */ int clipboard_request_file_data(int stream_id, int lindex, int offset, int request_bytes) { struct stream *s; int size; int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_request_file_data: stream_id=%d lindex=%d off=%d request_bytes=%d", stream_id, lindex, offset, request_bytes); if (g_file_request_sent_type != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_request_file_data: warning, still waiting " "for CB_FILECONTENTS_RESPONSE"); } make_stream(s); init_stream(s, 8192); out_uint16_le(s, CB_FILECONTENTS_REQUEST); /* 8 */ out_uint16_le(s, 0); out_uint32_le(s, 28); out_uint32_le(s, stream_id); out_uint32_le(s, lindex); out_uint32_le(s, CB_FILECONTENTS_RANGE); out_uint32_le(s, offset); /* nPositionLow */ out_uint32_le(s, 0); /* nPositionHigh */ out_uint32_le(s, request_bytes); /* cbRequested */ out_uint32_le(s, 0); /* clipDataId */ out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); g_file_request_sent_type = CB_FILECONTENTS_RANGE; return rv; } /*****************************************************************************/ /* client is asking from info about a file */ int clipboard_process_file_request(struct stream *s, int clip_msg_status, int clip_msg_len) { int streamId; int lindex; int dwFlags; int nPositionLow; int cbRequested; //int clipDataId; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_file_request:"); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", s->p, clip_msg_len); in_uint32_le(s, streamId); in_uint32_le(s, lindex); in_uint32_le(s, dwFlags); in_uint32_le(s, nPositionLow); in_uint8s(s, 4); /* nPositionHigh */ in_uint32_le(s, cbRequested); //in_uint32_le(s, clipDataId); /* options, used when locking */ if (dwFlags & CB_FILECONTENTS_SIZE) { clipboard_send_file_size(streamId, lindex); } if (dwFlags & CB_FILECONTENTS_RANGE) { clipboard_send_file_data(streamId, lindex, nPositionLow, cbRequested); } return 0; } /*****************************************************************************/ /* server requested info about the file and this is the response it's either the file size or file data */ int clipboard_process_file_response(struct stream *s, int clip_msg_status, int clip_msg_len) { int streamId; int file_size; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_file_response:"); if (g_file_request_sent_type == CB_FILECONTENTS_SIZE) { g_file_request_sent_type = 0; in_uint32_le(s, streamId); in_uint32_le(s, file_size); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_file_response: streamId %d " "file_size %d", streamId, file_size); xfuse_file_contents_size(streamId, file_size); } else if (g_file_request_sent_type == CB_FILECONTENTS_RANGE) { g_file_request_sent_type = 0; in_uint32_le(s, streamId); xfuse_file_contents_range(streamId, s->p, clip_msg_len - 4); } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_process_file_response: error"); g_file_request_sent_type = 0; } return 0; } /*****************************************************************************/ /* read in CLIPRDR_FILEDESCRIPTOR [MS-RDPECLIP] 2.2.5.2.3.1 */ static int clipboard_c2s_in_file_info(struct stream *s, struct clip_file_desc *cfd) { int filename_bytes; int ex_bytes; if (!s_check_rem_and_log(s, 4 + 32 + 4 + 16 + 8 + 8 + 520, "Parsing [MS-RDPECLIP] CLIPRDR_FILEDESCRIPTOR")) { return 1; } in_uint32_le(s, cfd->flags); in_uint8s(s, 32); /* reserved1 */ in_uint32_le(s, cfd->fileAttributes); in_uint8s(s, 16); /* reserved2 */ in_uint32_le(s, cfd->lastWriteTimeLow); in_uint32_le(s, cfd->lastWriteTimeHigh); in_uint32_le(s, cfd->fileSizeHigh); in_uint32_le(s, cfd->fileSizeLow); filename_bytes = clipboard_in_utf16_le_as_utf8(s, cfd->cFileName, sizeof(cfd->cFileName)); if (filename_bytes > 520) { LOG(LOG_LEVEL_ERROR, "Filename in CLIPRDR_FILEDESCRIPTOR is too long (%d bytes)", filename_bytes); return 1; } ex_bytes = 520 - filename_bytes; in_uint8s(s, ex_bytes); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_c2s_in_file_info:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " flags 0x%8.8x", cfd->flags); LOG_DEVEL(LOG_LEVEL_DEBUG, " fileAttributes 0x%8.8x", cfd->fileAttributes); LOG_DEVEL(LOG_LEVEL_DEBUG, " lastWriteTime 0x%8.8x%8.8x", cfd->lastWriteTimeHigh, cfd->lastWriteTimeLow); LOG_DEVEL(LOG_LEVEL_DEBUG, " fileSize 0x%8.8x%8.8x", cfd->fileSizeHigh, cfd->fileSizeLow); LOG_DEVEL(LOG_LEVEL_DEBUG, " cFileName [%s]", cfd->cFileName); return 0; } /*****************************************************************************/ int clipboard_c2s_in_files(struct stream *s, char *file_list, int file_list_size, const char *fprefix) { int citems; int lindex; int str_len; struct clip_file_desc cfd; char *ptr; char *last; /* Last writeable char in buffer */ int dropped_files = 0; /* # files we can't add to buffer */ if (file_list_size < 1) { LOG(LOG_LEVEL_ERROR, "clipboard_c2s_in_files: No space in string"); return 1; } if (!s_check_rem(s, 4)) { LOG(LOG_LEVEL_ERROR, "clipboard_c2s_in_files: parse error"); return 1; } in_uint32_le(s, citems); if (citems < 0 || citems > 64 * 1024) /* sanity check */ { LOG(LOG_LEVEL_ERROR, "clipboard_c2s_in_files: " "Bad number of files in list (%d)", citems); return 1; } xfuse_clear_clip_dir(); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_c2s_in_files: cItems %d", citems); ptr = file_list; last = file_list + file_list_size - 1; for (lindex = 0; lindex < citems; lindex++) { g_memset(&cfd, 0, sizeof(struct clip_file_desc)); if (clipboard_c2s_in_file_info(s, &cfd) != 0) { return 1; } if ((g_pos(cfd.cFileName, "\\") >= 0) || (cfd.fileAttributes & CB_FILE_ATTRIBUTE_DIRECTORY)) { LOG(LOG_LEVEL_WARNING, "clipboard_c2s_in_files: skipping " "directory not supported [%s]", cfd.cFileName); continue; } /* Have we already run out of room in the list? */ if (dropped_files > 0) { dropped_files += 1; continue; } /* Room for this file? */ str_len = (ptr == file_list) ? 0 : 1; /* Delimiter */ str_len += g_strlen(fprefix); /* e.g. "file://" */ str_len += g_strlen(g_fuse_clipboard_path); str_len += 1; /* '/' */ str_len += g_strlen(cfd.cFileName); if (str_len > (last - ptr)) { dropped_files += 1; continue; } if (xfuse_add_clip_dir_item(cfd.cFileName, 0, cfd.fileSizeLow, lindex) == -1) { LOG(LOG_LEVEL_WARNING, "clipboard_c2s_in_files: " "failed to add clip dir item %s", cfd.cFileName); continue; } if (ptr > file_list) { *ptr++ = '\n'; } str_len = g_strlen(fprefix); g_strcpy(ptr, fprefix); ptr += str_len; str_len = g_strlen(g_fuse_clipboard_path); g_strcpy(ptr, g_fuse_clipboard_path); ptr += str_len; *ptr++ = '/'; str_len = g_strlen(cfd.cFileName); g_strcpy(ptr, cfd.cFileName); ptr += str_len; } *ptr = '\0'; if (dropped_files > 0) { LOG(LOG_LEVEL_WARNING, "clipboard_c2s_in_files: " "Dropped %d files from the clip buffer due to insufficient space", dropped_files); } return 0; } xrdp-0.10.1/sesman/chansrv/clipboard.h000644 001751 000000 00000001723 14652432047 017702 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2009-2013 * Copyright (C) Laxmikant Rashinkar 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(CLIPBOARD_H) #define CLIPBOARD_H #include "arch.h" #include "parse.h" int clipboard_init(void); int clipboard_deinit(void); int clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length); int clipboard_xevent(void *xevent); #endif xrdp-0.10.1/sesman/chansrv/smartcard_pcsc.h000644 001751 000000 00000006210 14652432047 020727 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2013 jay.sorg@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * smartcard redirection support, PCSC daemon standin */ #ifndef _SMARTCARD_PCSC_H #define _SMARTCARD_PCSC_H int scard_pcsc_get_wait_objs(tbus *objs, int *count, int *timeout); int scard_pcsc_check_wait_objs(void); int scard_pcsc_init(void); int scard_pcsc_deinit(void); int scard_function_establish_context_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_release_context_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_list_readers_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_transmit_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_control_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_get_status_change_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_connect_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_status_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_begin_transaction_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_end_transaction_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_is_context_valid_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_reconnect_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_disconnect_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_cancel_return(void *user_data, struct stream *in_s, int len, int status); int scard_function_get_attrib_return(void *user_data, struct stream *in_s, int len, int status); #endif /* end #ifndef _SMARTCARD_PCSC_H */ xrdp-0.10.1/sesman/chansrv/chansrv.c000644 001751 000000 00000140706 14652432047 017407 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2009-2013 * Copyright (C) Laxmikant Rashinkar 2009-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include "string_calls.h" #include "thread_calls.h" #include "trans.h" #include "chansrv.h" #include "defines.h" #include "sound.h" #include "clipboard.h" #include "devredir.h" #include "list.h" #include "file.h" #include "log.h" #include "rail.h" #include "xcommon.h" #include "chansrv_fuse.h" #include "chansrv_config.h" #include "xrdp_sockets.h" #include "audin.h" #include "ms-rdpbcgr.h" #define MAX_PATH 260 static struct trans *g_lis_trans = 0; static struct trans *g_con_trans = 0; static struct trans *g_api_lis_trans = 0; static struct list *g_api_con_trans_list = 0; /* list of apps using api functions */ static struct chan_item g_chan_items[32]; static int g_num_chan_items = 0; static int g_cliprdr_index = -1; static int g_rdpsnd_index = -1; static int g_rdpdr_index = -1; static int g_rail_index = -1; static tbus g_term_event = 0; static tintptr g_sigchld_event = 0; static tbus g_thread_done_event = 0; struct config_chansrv *g_cfg = NULL; int g_display_num = -1; int g_cliprdr_chan_id = -1; /* cliprdr */ int g_rdpsnd_chan_id = -1; /* rdpsnd */ int g_rdpdr_chan_id = -1; /* rdpdr */ int g_rail_chan_id = -1; /* rail */ char *g_exec_name; tbus g_exec_event = 0; tbus g_exec_mutex; tbus g_exec_sem; int g_exec_pid = 0; #define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x))) /* max total channel bytes size */ #define MAX_CHANNEL_BYTES (1 * 1024 * 1024 * 1024) /* 1 GB */ #define MAX_CHANNEL_FRAG_BYTES 1600 #define CHANSRV_DRDYNVC_STATUS_CLOSED 0 #define CHANSRV_DRDYNVC_STATUS_OPEN_SENT 1 #define CHANSRV_DRDYNVC_STATUS_OPEN 2 #define CHANSRV_DRDYNVC_STATUS_CLOSE_SENT 3 struct chansrv_drdynvc { int chan_id; int status; /* see CHANSRV_DRDYNVC_STATUS_* */ int flags; int pad0; int (*open_response)(int chan_id, int creation_status); int (*close_response)(int chan_id); int (*data_first)(int chan_id, char *data, int bytes, int total_bytes); int (*data)(int chan_id, char *data, int bytes); struct trans *xrdp_api_trans; }; static struct chansrv_drdynvc g_drdynvcs[256]; /* data in struct trans::callback_data */ struct xrdp_api_data { int chan_flags; int chan_id; }; struct timeout_obj { tui32 mstime; void *data; void (*callback)(void *data); struct timeout_obj *next; }; static struct timeout_obj *g_timeout_head = 0; static struct timeout_obj *g_timeout_tail = 0; /*****************************************************************************/ int add_timeout(int msoffset, void (*callback)(void *data), void *data) { struct timeout_obj *tobj; tui32 now; LOG_DEVEL(LOG_LEVEL_DEBUG, "add_timeout:"); now = g_time3(); tobj = g_new0(struct timeout_obj, 1); tobj->mstime = now + msoffset; tobj->callback = callback; tobj->data = data; if (g_timeout_tail == 0) { g_timeout_head = tobj; g_timeout_tail = tobj; } else { g_timeout_tail->next = tobj; g_timeout_tail = tobj; } return 0; } /*****************************************************************************/ static int get_timeout(int *timeout) { struct timeout_obj *tobj; tui32 now; int ltimeout; LOG_DEVEL(LOG_LEVEL_DEBUG, "get_timeout:"); ltimeout = *timeout; if (ltimeout < 1) { ltimeout = 0; } tobj = g_timeout_head; if (tobj != 0) { now = g_time3(); while (tobj != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " now %u tobj->mstime %u", now, tobj->mstime); if (now < tobj->mstime) { ltimeout = tobj->mstime - now; } tobj = tobj->next; } } if (ltimeout > 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " ltimeout %d", ltimeout); if (*timeout < 1) { *timeout = ltimeout; } else { if (*timeout > ltimeout) { *timeout = ltimeout; } } } return 0; } /*****************************************************************************/ static int check_timeout(void) { struct timeout_obj *tobj; struct timeout_obj *last_tobj; struct timeout_obj *temp_tobj; int count; tui32 now; UNUSED_VAR(count); LOG_DEVEL(LOG_LEVEL_DEBUG, "check_timeout:"); count = 0; tobj = g_timeout_head; if (tobj != 0) { last_tobj = 0; while (tobj != 0) { count++; now = g_time3(); if (now >= tobj->mstime) { tobj->callback(tobj->data); if (last_tobj == 0) { g_timeout_head = tobj->next; if (g_timeout_head == 0) { g_timeout_tail = 0; } } else { last_tobj->next = tobj->next; if (g_timeout_tail == tobj) { g_timeout_tail = last_tobj; } } temp_tobj = tobj; tobj = tobj->next; g_free(temp_tobj); } else { last_tobj = tobj; tobj = tobj->next; } } } LOG_DEVEL(LOG_LEVEL_DEBUG, " count %d", count); return 0; } /*****************************************************************************/ int g_is_term(void) { return g_is_wait_obj_set(g_term_event); } /*****************************************************************************/ /* send data to a static virtual channel size can be > MAX_CHANNEL_FRAG_BYTES, in which case, > 1 message will be sent*/ /* returns error */ int send_channel_data(int chan_id, const char *data, int size) { int sending_bytes; int chan_flags; int error; int total_size; struct stream *s; if ((chan_id < 0) || (chan_id > 31) || (data == NULL) || (size < 1) || (size > MAX_CHANNEL_BYTES)) { /* bad param */ return 1; } total_size = size; chan_flags = 1; /* first */ while (size > 0) { sending_bytes = MIN(MAX_CHANNEL_FRAG_BYTES, size); if (sending_bytes >= size) { chan_flags |= 2; /* last */ } s = trans_get_out_s(g_con_trans, 26 + sending_bytes); if (s == NULL) { return 2; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 26 + sending_bytes); out_uint32_le(s, 8); /* msg id */ out_uint32_le(s, 18 + sending_bytes); out_uint16_le(s, chan_id); out_uint16_le(s, chan_flags); out_uint16_le(s, sending_bytes); out_uint32_le(s, total_size); out_uint8a(s, data, sending_bytes); s_mark_end(s); size -= sending_bytes; data += sending_bytes; error = trans_write_copy(g_con_trans); if (error != 0) { return 3; } chan_flags = 0; } return 0; } /*****************************************************************************/ /* returns error */ int send_rail_drawing_orders(char *data, int size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::send_rail_drawing_orders: size %d", size); struct stream *s; int error; s = trans_get_out_s(g_con_trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 8 + 8 + size); /* size */ out_uint32_le(s, 10); /* msg id */ out_uint32_le(s, 8 + size); /* size */ out_uint8a(s, data, size); s_mark_end(s); error = trans_force_write(g_con_trans); if (error != 0) { return 1; } return 0; } /*****************************************************************************/ /* returns error */ static int process_message_channel_setup(struct stream *s) { int num_chans; int index; int rv; struct chan_item *ci; g_num_chan_items = 0; g_cliprdr_index = -1; g_rdpsnd_index = -1; g_rdpdr_index = -1; g_rail_index = -1; g_cliprdr_chan_id = -1; g_rdpsnd_chan_id = -1; g_rdpdr_chan_id = -1; g_rail_chan_id = -1; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_channel_setup:"); in_uint16_le(s, num_chans); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_channel_setup: num_chans %d", num_chans); for (index = 0; index < num_chans; index++) { ci = &(g_chan_items[g_num_chan_items]); g_memset(ci->name, 0, sizeof(ci->name)); in_uint8a(s, ci->name, 8); in_uint16_le(s, ci->id); in_uint16_le(s, ci->flags); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_channel_setup: chan name '%s' " "id %d flags %8.8x", ci->name, ci->id, ci->flags); if (g_strcasecmp(ci->name, CLIPRDR_SVC_CHANNEL_NAME) == 0) { g_cliprdr_index = g_num_chan_items; g_cliprdr_chan_id = ci->id; } else if (g_strcasecmp(ci->name, RDPSND_SVC_CHANNEL_NAME) == 0) { g_rdpsnd_index = g_num_chan_items; g_rdpsnd_chan_id = ci->id; } else if (g_strcasecmp(ci->name, RDPDR_SVC_CHANNEL_NAME) == 0) { g_rdpdr_index = g_num_chan_items; g_rdpdr_chan_id = ci->id; } /* disabled for now */ else if (g_strcasecmp(ci->name, RAIL_SVC_CHANNEL_NAME) == 0) { g_rail_index = g_num_chan_items; g_rail_chan_id = ci->id; } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "other %s", ci->name); } g_num_chan_items++; } rv = 0; if (g_cliprdr_index >= 0) { clipboard_init(); xfuse_init(); } if (g_rdpsnd_index >= 0) { sound_init(); } if (g_rdpdr_index >= 0) { devredir_init(); xfuse_init(); } if (g_rail_index >= 0) { rail_init(); } audin_init(); return rv; } /*****************************************************************************/ /* returns error */ static int process_message_channel_data(struct stream *s) { int chan_id; int chan_flags; int rv; int length; int total_length; int index; int found; struct stream *ls; struct trans *ltran; struct xrdp_api_data *api_data; in_uint16_le(s, chan_id); in_uint16_le(s, chan_flags); in_uint16_le(s, length); in_uint32_le(s, total_length); LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_channel_data: chan_id %d " "chan_flags %d", chan_id, chan_flags); rv = 0; if (rv == 0) { if (chan_id == g_cliprdr_chan_id) { rv = clipboard_data_in(s, chan_id, chan_flags, length, total_length); } else if (chan_id == g_rdpsnd_chan_id) { rv = sound_data_in(s, chan_id, chan_flags, length, total_length); } else if (chan_id == g_rdpdr_chan_id) { rv = devredir_data_in(s, chan_id, chan_flags, length, total_length); } else if (chan_id == g_rail_chan_id) { rv = rail_data_in(s, chan_id, chan_flags, length, total_length); } else { found = 0; for (index = 0; index < g_api_con_trans_list->count; index++) { ltran = (struct trans *) list_get_item(g_api_con_trans_list, index); if (ltran != NULL) { api_data = (struct xrdp_api_data *) (ltran->callback_data); if (api_data != NULL) { if (api_data->chan_id == chan_id) { found = 1; ls = ltran->out_s; if (chan_flags & 1) /* first */ { init_stream(ls, total_length); } out_uint8a(ls, s->p, length); if (chan_flags & 2) /* last */ { s_mark_end(ls); rv = trans_write_copy(ltran); } break; } } } } if (found == 0) { LOG_DEVEL(LOG_LEVEL_INFO, "process_message_channel_data: not found channel %d", chan_id); } } } return rv; } /*****************************************************************************/ /* returns error */ /* open response from client */ static int process_message_drdynvc_open_response(struct stream *s) { struct chansrv_drdynvc *drdynvc; int chan_id; int creation_status; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_drdynvc_open_response:"); if (!s_check_rem(s, 8)) { return 1; } in_uint32_le(s, chan_id); in_uint32_le(s, creation_status); if ((chan_id < 0) || (chan_id > 255)) { return 1; } drdynvc = g_drdynvcs + chan_id; if (drdynvc->status != CHANSRV_DRDYNVC_STATUS_OPEN_SENT) { LOG_DEVEL(LOG_LEVEL_ERROR, "process_message_drdynvc_open_response: status not right"); return 1; } if (creation_status == 0) { drdynvc->status = CHANSRV_DRDYNVC_STATUS_OPEN; } else { drdynvc->status = CHANSRV_DRDYNVC_STATUS_CLOSED; } if (drdynvc->open_response != NULL) { if (drdynvc->open_response(chan_id, creation_status) != 0) { return 1; } } return 0; } /*****************************************************************************/ /* returns error */ /* close response from client */ static int process_message_drdynvc_close_response(struct stream *s) { struct chansrv_drdynvc *drdynvc; int chan_id; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_drdynvc_close_response:"); if (!s_check_rem(s, 4)) { return 1; } in_uint32_le(s, chan_id); if ((chan_id < 0) || (chan_id > 255)) { return 1; } drdynvc = g_drdynvcs + chan_id; if (drdynvc->status != CHANSRV_DRDYNVC_STATUS_CLOSE_SENT) { LOG_DEVEL(LOG_LEVEL_ERROR, "process_message_drdynvc_close_response: status not right"); return 0; } drdynvc->status = CHANSRV_DRDYNVC_STATUS_CLOSED; if (drdynvc->close_response != NULL) { if (drdynvc->close_response(chan_id) != 0) { return 1; } } return 0; } /*****************************************************************************/ /* returns error */ /* data from client */ static int process_message_drdynvc_data_first(struct stream *s) { struct chansrv_drdynvc *drdynvc; int chan_id; int bytes; int total_bytes; char *data; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_drdynvc_data_first:"); if (!s_check_rem(s, 12)) { return 1; } in_uint32_le(s, chan_id); in_uint32_le(s, bytes); in_uint32_le(s, total_bytes); if (!s_check_rem(s, bytes)) { return 1; } in_uint8p(s, data, bytes); if ((chan_id < 0) || (chan_id > 255)) { return 1; } drdynvc = g_drdynvcs + chan_id; if (drdynvc->data_first != NULL) { if (drdynvc->data_first(chan_id, data, bytes, total_bytes) != 0) { return 1; } } return 0; } /*****************************************************************************/ /* returns error */ /* data from client */ static int process_message_drdynvc_data(struct stream *s) { struct chansrv_drdynvc *drdynvc; int chan_id; int bytes; char *data; LOG_DEVEL(LOG_LEVEL_DEBUG, "process_message_drdynvc_data:"); if (!s_check_rem(s, 8)) { return 1; } in_uint32_le(s, chan_id); in_uint32_le(s, bytes); if (!s_check_rem(s, bytes)) { return 1; } in_uint8p(s, data, bytes); drdynvc = g_drdynvcs + chan_id; if (drdynvc->data != NULL) { if (drdynvc->data(chan_id, data, bytes) != 0) { return 1; } } return 0; } /*****************************************************************************/ /* open call from chansrv */ int chansrv_drdynvc_open(const char *name, int flags, struct chansrv_drdynvc_procs *procs, int *chan_id) { struct stream *s; int name_bytes; int lchan_id; int error; lchan_id = 1; while (g_drdynvcs[lchan_id].status != CHANSRV_DRDYNVC_STATUS_CLOSED) { lchan_id++; if (lchan_id > 255) { return 1; } } s = trans_get_out_s(g_con_trans, 8192); if (s == NULL) { return 1; } name_bytes = g_strlen(name); out_uint32_le(s, 0); /* version */ out_uint32_le(s, 8 + 8 + 4 + name_bytes + 4 + 4); out_uint32_le(s, 12); /* msg id */ out_uint32_le(s, 8 + 4 + name_bytes + 4 + 4); out_uint32_le(s, name_bytes); out_uint8a(s, name, name_bytes); out_uint32_le(s, flags); out_uint32_le(s, lchan_id); s_mark_end(s); error = trans_write_copy(g_con_trans); if (error == 0) { if (chan_id != NULL) { *chan_id = lchan_id; g_drdynvcs[lchan_id].open_response = procs->open_response; g_drdynvcs[lchan_id].close_response = procs->close_response; g_drdynvcs[lchan_id].data_first = procs->data_first; g_drdynvcs[lchan_id].data = procs->data; g_drdynvcs[lchan_id].status = CHANSRV_DRDYNVC_STATUS_OPEN_SENT; } } return error; } /*****************************************************************************/ /* close call from chansrv */ int chansrv_drdynvc_close(int chan_id) { struct stream *s; int error; s = trans_get_out_s(g_con_trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 20); out_uint32_le(s, 14); /* msg id */ out_uint32_le(s, 12); out_uint32_le(s, chan_id); s_mark_end(s); error = trans_write_copy(g_con_trans); g_drdynvcs[chan_id].status = CHANSRV_DRDYNVC_STATUS_CLOSE_SENT; return error; } /*****************************************************************************/ int chansrv_drdynvc_data_first(int chan_id, const char *data, int data_bytes, int total_data_bytes) { struct stream *s; int error; //LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv_drdynvc_data_first: data_bytes %d total_data_bytes %d", // data_bytes, total_data_bytes); s = trans_get_out_s(g_con_trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 28 + data_bytes); out_uint32_le(s, 16); /* msg id */ out_uint32_le(s, 20 + data_bytes); out_uint32_le(s, chan_id); out_uint32_le(s, data_bytes); out_uint32_le(s, total_data_bytes); out_uint8a(s, data, data_bytes); s_mark_end(s); error = trans_write_copy(g_con_trans); return error; } /*****************************************************************************/ int chansrv_drdynvc_data(int chan_id, const char *data, int data_bytes) { struct stream *s; int error; // LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv_drdynvc_data: data_bytes %d", data_bytes); s = trans_get_out_s(g_con_trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, 0); /* version */ out_uint32_le(s, 24 + data_bytes); out_uint32_le(s, 18); /* msg id */ out_uint32_le(s, 16 + data_bytes); out_uint32_le(s, chan_id); out_uint32_le(s, data_bytes); out_uint8a(s, data, data_bytes); s_mark_end(s); error = trans_write_copy(g_con_trans); return error; } /*****************************************************************************/ int chansrv_drdynvc_send_data(int chan_id, const char *data, int data_bytes) { int this_send_bytes; // LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv_drdynvc_send_data: data_bytes %d", data_bytes); if (data_bytes > 1590) { if (chansrv_drdynvc_data_first(chan_id, data, 1590, data_bytes) != 0) { return 1; } data_bytes -= 1590; data += 1590; } while (data_bytes > 0) { this_send_bytes = MIN(1590, data_bytes); if (chansrv_drdynvc_data(chan_id, data, this_send_bytes) != 0) { return 1; } data_bytes -= this_send_bytes; data += this_send_bytes; } return 0; } /*****************************************************************************/ /* returns error */ static int process_message(void) { struct stream *s = (struct stream *)NULL; int size = 0; int id = 0; int rv = 0; char *next_msg = (char *)NULL; if (g_con_trans == 0) { return 1; } s = trans_get_in_s(g_con_trans); if (s == 0) { return 1; } rv = 0; while (s_check_rem(s, 8)) { next_msg = s->p; in_uint32_le(s, id); in_uint32_le(s, size); next_msg += size; switch (id) { case 3: /* channel setup */ rv = process_message_channel_setup(s); break; case 5: /* channel data */ rv = process_message_channel_data(s); break; case 13: /* drdynvc open response */ rv = process_message_drdynvc_open_response(s); break; case 15: /* drdynvc close response */ rv = process_message_drdynvc_close_response(s); break; case 17: /* drdynvc data first */ rv = process_message_drdynvc_data_first(s); break; case 19: /* drdynvc data */ rv = process_message_drdynvc_data(s); break; default: LOG_DEVEL(LOG_LEVEL_ERROR, "process_message: unknown msg %d", id); break; } if (rv != 0) { g_writeln("process_message: error rv %d id %d", rv, id); rv = 0; } s->p = next_msg; } return rv; } /*****************************************************************************/ /* returns error */ int my_trans_data_in(struct trans *trans) { struct stream *s = (struct stream *)NULL; int size = 0; int error = 0; if (trans == 0) { return 0; } if (trans != g_con_trans) { return 1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "my_trans_data_in:"); s = trans_get_in_s(trans); in_uint8s(s, 4); /* id */ in_uint32_le(s, size); error = trans_force_read(trans, size - 8); if (error == 0) { /* here, the entire message block is read in, process it */ error = process_message(); if (error == 0) { } else { g_writeln("my_trans_data_in: process_message failed"); } } else { g_writeln("my_trans_data_in: trans_force_read failed"); } return error; } /*****************************************************************************/ struct trans * get_api_trans_from_chan_id(int chan_id) { return g_drdynvcs[chan_id].xrdp_api_trans; } /*****************************************************************************/ static int my_api_open_response(int chan_id, int creation_status) { struct trans *trans; struct stream *s; //g_writeln("my_api_open_response: chan_id %d creation_status %d", // chan_id, creation_status); trans = get_api_trans_from_chan_id(chan_id); if (trans == NULL) { return 1; } s = trans_get_out_s(trans, 8192); if (s == NULL) { return 1; } out_uint32_le(s, creation_status); s_mark_end(s); if (trans_write_copy(trans) != 0) { return 1; } return 0; } /*****************************************************************************/ static int my_api_close_response(int chan_id) { //g_writeln("my_api_close_response:"); return 0; } /*****************************************************************************/ static int my_api_data_first(int chan_id, char *data, int bytes, int total_bytes) { struct trans *trans; struct stream *s; //g_writeln("my_api_data_first: bytes %d total_bytes %d", bytes, total_bytes); trans = get_api_trans_from_chan_id(chan_id); if (trans == NULL) { return 1; } s = trans_get_out_s(trans, bytes); if (s == NULL) { return 1; } out_uint8a(s, data, bytes); s_mark_end(s); if (trans_write_copy(trans) != 0) { return 1; } return 0; } /*****************************************************************************/ static int my_api_data(int chan_id, char *data, int bytes) { struct trans *trans; struct stream *s; //g_writeln("my_api_data: bytes %d", bytes); trans = get_api_trans_from_chan_id(chan_id); if (trans == NULL) { return 1; } s = trans_get_out_s(trans, bytes); if (s == NULL) { return 1; } out_uint8a(s, data, bytes); s_mark_end(s); if (trans_write_copy(trans) != 0) { return 1; } return 0; } /* * called when WTSVirtualChannelWrite() is invoked in xrdpapi.c * ******************************************************************************/ int my_api_trans_data_in(struct trans *trans) { struct stream *s; struct stream *out_s; struct xrdp_api_data *ad; int index; int rv; int bytes; int ver; struct chansrv_drdynvc_procs procs; /* * Name is limited to CHANNEL_NAME_LEN for an SVC, or MAX_PATH * bytes for a DVC */ char chan_name[MAX(CHANNEL_NAME_LEN, MAX_PATH) + 1]; unsigned int channel_name_bytes; //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: extra_flags %d", trans->extra_flags); rv = 0; ad = (struct xrdp_api_data *) (trans->callback_data); s = trans_get_in_s(trans); if (trans->extra_flags == 0) { in_uint32_le(s, bytes); in_uint32_le(s, ver); //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: bytes %d ver %d", bytes, ver); if (ver != 0) { return 1; } trans->header_size = bytes; trans->extra_flags = 1; } else if (trans->extra_flags == 1) { rv = 1; in_uint32_le(s, channel_name_bytes); //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: channel_name_bytes %d", channel_name_bytes); if (channel_name_bytes > (sizeof(chan_name) - 1)) { return 1; } in_uint8a(s, chan_name, channel_name_bytes); chan_name[channel_name_bytes] = '\0'; in_uint32_le(s, ad->chan_flags); //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: chan_name %s chan_flags 0x%8.8x", chan_name, ad->chan_flags); if (ad->chan_flags == 0) { /* SVC */ for (index = 0; index < g_num_chan_items; index++) { if (g_strcasecmp(g_chan_items[index].name, chan_name) == 0) { ad->chan_id = g_chan_items[index].id; rv = 0; break; } } if (rv == 0) { /* open ok */ out_s = trans_get_out_s(trans, 8192); if (out_s == NULL) { return 1; } out_uint32_le(out_s, 0); s_mark_end(out_s); if (trans_write_copy(trans) != 0) { return 1; } } else { /* open failed */ out_s = trans_get_out_s(trans, 8192); if (out_s == NULL) { return 1; } out_uint32_le(out_s, 1); s_mark_end(out_s); if (trans_write_copy(trans) != 0) { return 1; } } } else { /* DVS */ g_memset(&procs, 0, sizeof(procs)); procs.open_response = my_api_open_response; procs.close_response = my_api_close_response; procs.data_first = my_api_data_first; procs.data = my_api_data; rv = chansrv_drdynvc_open(chan_name, ad->chan_flags, &procs, &(ad->chan_id)); //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: chansrv_drdynvc_open rv %d " // "chan_id %d", rv, ad->chan_id); g_drdynvcs[ad->chan_id].xrdp_api_trans = trans; } init_stream(s, 0); trans->extra_flags = 2; trans->header_size = 0; } else { bytes = g_sck_recv(trans->sck, s->data, s->size, 0); if (bytes < 1) { //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: disconnect"); return 1; } if (ad->chan_flags == 0) { /* SVC */ rv = send_channel_data(ad->chan_id, s->data, bytes); } else { /* DVS */ //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_data_in: s->size %d bytes %d", s->size, bytes); rv = chansrv_drdynvc_send_data(ad->chan_id, s->data, bytes); } init_stream(s, 0); } return rv; } /*****************************************************************************/ int my_trans_conn_in(struct trans *trans, struct trans *new_trans) { if (trans == 0) { return 1; } if (trans != g_lis_trans) { return 1; } if (g_con_trans != 0) /* if already set, error */ { return 1; } if (new_trans == 0) { return 1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "my_trans_conn_in:"); g_con_trans = new_trans; g_con_trans->trans_data_in = my_trans_data_in; g_con_trans->header_size = 8; /* stop listening */ trans_delete(g_lis_trans); g_lis_trans = 0; return 0; } /* * called when WTSVirtualChannelOpenEx is invoked in xrdpapi.c * ******************************************************************************/ int my_api_trans_conn_in(struct trans *trans, struct trans *new_trans) { struct xrdp_api_data *ad; //LOG_DEVEL(LOG_LEVEL_DEBUG, "my_api_trans_conn_in:"); if ((trans == NULL) || (trans != g_api_lis_trans) || (new_trans == NULL)) { LOG_DEVEL(LOG_LEVEL_ERROR, "my_api_trans_conn_in: error"); return 1; } new_trans->trans_data_in = my_api_trans_data_in; new_trans->header_size = 8; new_trans->no_stream_init_on_data_in = 1; ad = g_new0(struct xrdp_api_data, 1); if (ad == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "my_api_trans_conn_in: error"); return 1; } new_trans->callback_data = ad; list_add_item(g_api_con_trans_list, (intptr_t) new_trans); return 0; } /*****************************************************************************/ static int setup_listen(void) { char port[XRDP_SOCKETS_MAXPATH]; int error = 0; if (g_lis_trans != 0) { trans_delete(g_lis_trans); } g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); g_lis_trans->is_term = g_is_term; g_snprintf(port, sizeof(port), XRDP_CHANSRV_STR, g_getuid(), g_display_num); g_lis_trans->trans_conn_in = my_trans_conn_in; error = trans_listen(g_lis_trans, port); if (error != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "setup_listen: trans_listen failed for port %s", port); return 1; } return 0; } /*****************************************************************************/ static int setup_api_listen(void) { char port[XRDP_SOCKETS_MAXPATH]; int error = 0; g_api_lis_trans = trans_create(TRANS_MODE_UNIX, 8192 * 4, 8192 * 4); g_api_lis_trans->is_term = g_is_term; g_snprintf(port, sizeof(port), CHANSRV_API_STR, g_getuid(), g_display_num); g_api_lis_trans->trans_conn_in = my_api_trans_conn_in; error = trans_listen(g_api_lis_trans, port); if (error != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "setup_api_listen: trans_listen failed for port %s", port); return 1; } return 0; } /*****************************************************************************/ static int api_con_trans_list_get_wait_objs_rw(intptr_t *robjs, int *rcount, intptr_t *wobjs, int *wcount, int *timeout) { int api_con_index; struct trans *ltran; for (api_con_index = g_api_con_trans_list->count - 1; api_con_index >= 0; api_con_index--) { ltran = (struct trans *) list_get_item(g_api_con_trans_list, api_con_index); if (ltran != NULL) { trans_get_wait_objs_rw(ltran, robjs, rcount, wobjs, wcount, timeout); } } return 0; } /*****************************************************************************/ static int api_con_trans_list_check_wait_objs(void) { int api_con_index; int drdynvc_index; struct trans *ltran; struct xrdp_api_data *ad; for (api_con_index = g_api_con_trans_list->count - 1; api_con_index >= 0; api_con_index--) { ltran = (struct trans *) list_get_item(g_api_con_trans_list, api_con_index); if (ltran != NULL) { if (trans_check_wait_objs(ltran) != 0) { /* disconnect */ list_remove_item(g_api_con_trans_list, api_con_index); ad = (struct xrdp_api_data *) (ltran->callback_data); if (ad->chan_flags != 0) { chansrv_drdynvc_close(ad->chan_id); } for (drdynvc_index = 0; drdynvc_index < (int) ARRAYSIZE(g_drdynvcs); drdynvc_index++) { if (g_drdynvcs[drdynvc_index].xrdp_api_trans == ltran) { g_drdynvcs[drdynvc_index].xrdp_api_trans = NULL; } } g_free(ad); trans_delete(ltran); } } } return 0; } /*****************************************************************************/ static int api_con_trans_list_remove_all(void) { int api_con_index; struct trans *ltran; for (api_con_index = g_api_con_trans_list->count - 1; api_con_index >= 0; api_con_index--) { ltran = (struct trans *) list_get_item(g_api_con_trans_list, api_con_index); if (ltran != NULL) { list_remove_item(g_api_con_trans_list, api_con_index); g_free(ltran->callback_data); trans_delete(ltran); } } return 0; } /*****************************************************************************/ THREAD_RV THREAD_CC channel_thread_loop(void *in_val) { tbus objs[32]; tbus wobjs[32]; int num_objs; int num_wobjs; int timeout; int error; THREAD_RV rv; LOG_DEVEL(LOG_LEVEL_INFO, "channel_thread_loop: thread start"); rv = 0; g_api_con_trans_list = list_create(); setup_api_listen(); error = setup_listen(); if (error == 0) { timeout = -1; num_objs = 0; num_wobjs = 0; objs[num_objs] = g_term_event; num_objs++; trans_get_wait_objs(g_lis_trans, objs, &num_objs); trans_get_wait_objs(g_api_lis_trans, objs, &num_objs); //g_writeln("timeout %d", timeout); while (g_obj_wait(objs, num_objs, wobjs, num_wobjs, timeout) == 0) { check_timeout(); if (g_is_wait_obj_set(g_term_event)) { LOG_DEVEL(LOG_LEVEL_INFO, "channel_thread_loop: g_term_event set"); clipboard_deinit(); sound_deinit(); devredir_deinit(); rail_deinit(); break; } if (g_lis_trans != 0) { if (trans_check_wait_objs(g_lis_trans) != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "channel_thread_loop: " "trans_check_wait_objs error"); } } if (g_con_trans != 0) { if (trans_check_wait_objs(g_con_trans) != 0) { LOG_DEVEL(LOG_LEVEL_INFO, "channel_thread_loop: " "trans_check_wait_objs error resetting"); clipboard_deinit(); sound_deinit(); devredir_deinit(); rail_deinit(); /* delete g_con_trans */ trans_delete(g_con_trans); g_con_trans = 0; /* create new listener */ error = setup_listen(); if (error != 0) { break; } } } if (g_api_lis_trans != 0) { if (trans_check_wait_objs(g_api_lis_trans) != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "channel_thread_loop: trans_check_wait_objs failed"); } } /* check the wait_objs in g_api_con_trans_list */ api_con_trans_list_check_wait_objs(); xcommon_check_wait_objs(); sound_check_wait_objs(); devredir_check_wait_objs(); xfuse_check_wait_objs(); timeout = -1; num_objs = 0; num_wobjs = 0; objs[num_objs] = g_term_event; num_objs++; trans_get_wait_objs_rw(g_lis_trans, objs, &num_objs, wobjs, &num_wobjs, &timeout); trans_get_wait_objs_rw(g_con_trans, objs, &num_objs, wobjs, &num_wobjs, &timeout); trans_get_wait_objs_rw(g_api_lis_trans, objs, &num_objs, wobjs, &num_wobjs, &timeout); /* get the wait_objs from in g_api_con_trans_list */ api_con_trans_list_get_wait_objs_rw(objs, &num_objs, wobjs, &num_wobjs, &timeout); xcommon_get_wait_objs(objs, &num_objs, &timeout); sound_get_wait_objs(objs, &num_objs, &timeout); devredir_get_wait_objs(objs, &num_objs, &timeout); xfuse_get_wait_objs(objs, &num_objs, &timeout); get_timeout(&timeout); } /* end while (g_obj_wait(objs, num_objs, 0, 0, timeout) == 0) */ } trans_delete(g_lis_trans); g_lis_trans = 0; trans_delete(g_con_trans); g_con_trans = 0; trans_delete(g_api_lis_trans); g_api_lis_trans = 0; api_con_trans_list_remove_all(); list_delete(g_api_con_trans_list); LOG_DEVEL(LOG_LEVEL_INFO, "channel_thread_loop: thread stop"); g_set_wait_obj(g_thread_done_event); return rv; } /*****************************************************************************/ static void term_signal_handler(int sig) { g_set_wait_obj(g_term_event); } /*****************************************************************************/ static void nil_signal_handler(int sig) { } /*****************************************************************************/ static void set_sigchld_event(int sig) { g_set_wait_obj(g_sigchld_event); } /*****************************************************************************/ static void child_signal_handler(void) { int pid; LOG_DEVEL(LOG_LEVEL_INFO, "child_signal_handler:"); while ((pid = g_waitchild(NULL)) > 0) { LOG_DEVEL(LOG_LEVEL_INFO, "child_signal_handler: child pid %d", pid); if (pid == g_exec_pid) { LOG_DEVEL(LOG_LEVEL_INFO, "child_signal_handler: found pid %d", pid); //shutdownx(); } } } /*****************************************************************************/ void segfault_signal_handler(int sig) { LOG_DEVEL(LOG_LEVEL_ERROR, "segfault_signal_handler: entered......."); xfuse_deinit(); exit(0); } /*****************************************************************************/ static void x_server_fatal_handler(void) { LOG_DEVEL(LOG_LEVEL_INFO, "xserver_fatal_handler: entered......."); /* At this point the X server has gone away. Dont make any X calls. */ xfuse_deinit(); exit(0); } /*****************************************************************************/ int main_cleanup(void) { if (g_term_event != 0) { g_delete_wait_obj(g_term_event); } if (g_sigchld_event != 0) { g_delete_wait_obj(g_sigchld_event); } if (g_thread_done_event != 0) { g_delete_wait_obj(g_thread_done_event); } if (g_exec_event != 0) { g_delete_wait_obj(g_exec_event); tc_mutex_delete(g_exec_mutex); tc_sem_delete(g_exec_sem); } log_end(); config_free(g_cfg); g_deinit(); /* os_calls */ return 0; } /*****************************************************************************/ static int get_log_path(char *path, int bytes) { char *log_path; int rv; rv = 1; log_path = g_getenv("CHANSRV_LOG_PATH"); if (log_path == 0) { log_path = g_getenv("XDG_DATA_HOME"); if (log_path != 0) { g_snprintf(path, bytes, "%s%s", log_path, "/xrdp"); if (g_directory_exist(path) || (g_mkdir(path) == 0)) { rv = 0; } } } else { g_snprintf(path, bytes, "%s", log_path); if (g_directory_exist(path) || (g_mkdir(path) == 0)) { rv = 0; } } if (rv != 0) { log_path = g_getenv("HOME"); if (log_path != 0) { g_snprintf(path, bytes, "%s%s", log_path, "/.local"); if (g_directory_exist(path) || (g_mkdir(path) == 0)) { g_snprintf(path, bytes, "%s%s", log_path, "/.local/share"); if (g_directory_exist(path) || (g_mkdir(path) == 0)) { g_snprintf(path, bytes, "%s%s", log_path, "/.local/share/xrdp"); if (g_directory_exist(path) || (g_mkdir(path) == 0)) { rv = 0; } } } } } return rv; } /*****************************************************************************/ static int run_exec(void) { int pid; LOG_DEVEL(LOG_LEVEL_DEBUG, "run_exec:"); pid = g_fork(); if (pid == 0) { trans_delete(g_con_trans); g_close_wait_obj(g_term_event); g_close_wait_obj(g_sigchld_event); g_close_wait_obj(g_thread_done_event); g_close_wait_obj(g_exec_event); tc_mutex_delete(g_exec_mutex); tc_sem_delete(g_exec_sem); g_execlp3(g_exec_name, g_exec_name, 0); g_exit(0); } g_exec_pid = pid; tc_sem_inc(g_exec_sem); return 0; } /*****************************************************************************/ int main(int argc, char **argv) { tbus waiters[4]; int pid = 0; char text[256]; const char *config_path; char log_path[256]; const char *display_text; char log_file[256]; enum logReturns error; struct log_config *logconfig; g_init("xrdp-chansrv"); /* os_calls */ g_memset(g_drdynvcs, 0, sizeof(g_drdynvcs)); log_path[255] = 0; if (get_log_path(log_path, 255) != 0) { g_writeln("error reading CHANSRV_LOG_PATH and HOME environment variable"); main_cleanup(); return 1; } display_text = g_getenv("DISPLAY"); if (display_text == NULL) { g_writeln("DISPLAY is not set"); main_cleanup(); return 1; } g_display_num = g_get_display_num_from_display(display_text); if (g_display_num < 0) { g_writeln("Unable to get display from DISPLAY='%s'", display_text); main_cleanup(); return 1; } /* * The user is unable at present to override the sysadmin-provided * sesman.ini location */ config_path = XRDP_CFG_PATH "/sesman.ini"; if ((g_cfg = config_read(0, config_path)) == NULL) { main_cleanup(); return 1; } config_dump(g_cfg); pid = g_getpid(); /* starting logging subsystem */ g_snprintf(log_file, 255, "%s/xrdp-chansrv.%d.log", log_path, g_display_num); g_writeln("chansrv::main: using log file [%s]", log_file); if (g_file_exist(log_file)) { g_file_delete(log_file); } logconfig = log_config_init_from_config(config_path, "xrdp-chansrv", "Chansrv"); if (logconfig->log_file != NULL) { g_free(logconfig->log_file); } logconfig->log_file = log_file; error = log_start_from_param(logconfig); logconfig->log_file = NULL; log_config_free(logconfig); logconfig = NULL; if (error != LOG_STARTUP_OK) { switch (error) { case LOG_ERROR_MALLOC: g_writeln("error on malloc. cannot start logging. quitting."); break; case LOG_ERROR_FILE_OPEN: g_writeln("error opening log file [%s]. quitting.", getLogFile(text, 255)); break; default: g_writeln("log_start error"); break; } main_cleanup(); return 1; } LOG_DEVEL(LOG_LEVEL_INFO, "main: app started pid %d(0x%8.8x)", pid, pid); /* set up signal handler */ g_signal_terminate(term_signal_handler); /* SIGTERM */ g_signal_user_interrupt(term_signal_handler); /* SIGINT */ g_signal_pipe(nil_signal_handler); /* SIGPIPE */ g_signal_child_stop(set_sigchld_event); /* SIGCHLD */ g_signal_segfault(segfault_signal_handler); /* Cater for the X server exiting unexpectedly */ xcommon_set_x_server_fatal_handler(x_server_fatal_handler); LOG_DEVEL(LOG_LEVEL_INFO, "main: DISPLAY env var set to %s", display_text); LOG_DEVEL(LOG_LEVEL_INFO, "main: using DISPLAY %d", g_display_num); g_snprintf(text, 255, "xrdp_chansrv_%8.8x_main_term", pid); g_term_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_chansrv_%8.8x_sigchld", pid); g_sigchld_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_chansrv_%8.8x_thread_done", pid); g_thread_done_event = g_create_wait_obj(text); g_snprintf(text, 255, "xrdp_chansrv_%8.8x_exec", pid); g_exec_event = g_create_wait_obj(text); g_exec_mutex = tc_mutex_create(); g_exec_sem = tc_sem_create(0); tc_thread_create(channel_thread_loop, 0); while (g_term_event > 0 && !g_is_wait_obj_set(g_term_event)) { waiters[0] = g_term_event; waiters[1] = g_exec_event; waiters[2] = g_sigchld_event; if (g_obj_wait(waiters, 3, 0, 0, -1) != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "main: error, g_obj_wait failed"); break; } if (g_is_wait_obj_set(g_term_event)) { break; } if (g_is_wait_obj_set(g_sigchld_event)) { g_reset_wait_obj(g_sigchld_event); child_signal_handler(); } if (g_is_wait_obj_set(g_exec_event)) { g_reset_wait_obj(g_exec_event); run_exec(); } } while (g_thread_done_event > 0 && !g_is_wait_obj_set(g_thread_done_event)) { /* wait for thread to exit */ if (g_obj_wait(&g_thread_done_event, 1, 0, 0, -1) != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "main: error, g_obj_wait failed"); break; } } /* cleanup */ main_cleanup(); LOG_DEVEL(LOG_LEVEL_INFO, "main: app exiting pid %d(0x%8.8x)", pid, pid); return 0; } xrdp-0.10.1/sesman/chansrv/clipboard_common.h000644 001751 000000 00000004524 14652432047 021254 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(CLIPBOARD_COMMON_H) #define CLIPBOARD_COMMON_H #include "arch.h" #include "parse.h" /* these are the supported general types */ #define XRDP_CB_TEXT 1 #define XRDP_CB_BITMAP 2 #define XRDP_CB_FILE 3 struct clip_s2c /* server to client, pasting from linux app to mstsc */ { int incr_in_progress; int total_bytes; char *data; Atom type; /* UTF8_STRING, image/bmp, ... */ Atom property; /* XRDP_CLIP_PROPERTY_ATOM, _QT_SELECTION, ... */ int xrdp_clip_type; /* XRDP_CB_TEXT, XRDP_CB_BITMAP, XRDP_CB_FILE, ... */ int converted; Time clip_time; }; struct clip_c2s /* client to server, pasting from mstsc to linux app */ { int incr_in_progress; int incr_bytes_done; int read_bytes_done; int total_bytes; char *data; Atom type; /* UTF8_STRING, image/bmp, ... */ Atom property; /* XRDP_CLIP_PROPERTY_ATOM, _QT_SELECTION, ... */ Window window; /* Window used in INCR transfer */ int xrdp_clip_type; /* XRDP_CB_TEXT, XRDP_CB_BITMAP, XRDP_CB_FILE, ... */ int converted; int in_request; /* a data request has been sent to client */ }; struct clip_file_desc /* CLIPRDR_FILEDESCRIPTOR */ { tui32 flags; tui32 fileAttributes; tui32 lastWriteTimeLow; tui32 lastWriteTimeHigh; tui32 fileSizeHigh; tui32 fileSizeLow; char cFileName[260 * 4]; /* Allow each UCS-16 char to become 32 bits */ }; /** * Input a terminated UTF-16 string from a stream as UTF-8. * @param s stream * @param text UTF-8 String buffer * @param text_len Length of above * @return number of bytes copied from stream */ unsigned int clipboard_in_utf16_le_as_utf8(struct stream *s, char *text, unsigned int num_chars); #endif xrdp-0.10.1/sesman/chansrv/chansrv_fuse.c000644 001751 000000 00000251031 14652432047 020423 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* FUSE mount point */ char g_fuse_root_path[256] = ""; #ifdef XRDP_FUSE static const char *g_fuse_root_path_basename; /* See xfuse_path_in_xfuse_fs() */ static int g_fuse_root_parent_dev; /* Ditto */ static int g_fuse_root_parent_ino; /* Ditto */ #endif char g_fuse_clipboard_path[256] = ""; /* for clipboard use */ #if defined(HAVE_CONFIG_H) #include #endif #ifndef XRDP_FUSE /****************************************************************************** ** ** ** when FUSE is NOT enabled in xrdp ** ** ** ******************************************************************************/ #include #include #include #include "arch.h" #include "chansrv_fuse.h" #include "chansrv_xfs.h" /* dummy calls when XRDP_FUSE is not defined */ int xfuse_init(void) { return 0; } int xfuse_deinit(void) { return 0; } int xfuse_check_wait_objs(void) { return 0; } int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout) { return 0; } int xfuse_create_share(tui32 device_id, const char *dirname) { return 0; } void xfuse_delete_share(tui32 share_id) {} int xfuse_clear_clip_dir(void) { return 0; } int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes) { return 0; } int xfuse_file_contents_size(int stream_id, int file_size) { return 0; } int xfuse_add_clip_dir_item(const char *filename, int flags, int size, int lindex) { return 0; } void xfuse_devredir_cb_enum_dir_add_entry( struct state_dirscan *fip, const char *name, const struct file_attr *fattr) {} void xfuse_devredir_cb_enum_dir_done(struct state_dirscan *fip, enum NTSTATUS IoStatus) {} void xfuse_devredir_cb_lookup_entry(struct state_lookup *fip, enum NTSTATUS IoStatus, const struct file_attr *file_info) {} void xfuse_devredir_cb_setattr(struct state_setattr *fip, enum NTSTATUS IoStatus) {} void xfuse_devredir_cb_create_file(struct state_create *fip, enum NTSTATUS IoStatus, tui32 DeviceId, tui32 FileId) {} void xfuse_devredir_cb_open_file(struct state_open *fip, enum NTSTATUS IoStatus, tui32 DeviceId, tui32 FileId) {} void xfuse_devredir_cb_read_file(struct state_read *fip, enum NTSTATUS IoStatus, const char *buf, size_t length) {} void xfuse_devredir_cb_write_file( struct state_write *fip, enum NTSTATUS IoStatus, off_t offset, size_t length) {} void xfuse_devredir_cb_rmdir_or_file(struct state_remove *fip, enum NTSTATUS IoStatus) {} void xfuse_devredir_cb_rename_file(struct state_rename *fip, enum NTSTATUS IoStatus) {} void xfuse_devredir_cb_file_close(struct state_close *fip) {} int xfuse_path_in_xfuse_fs(const char *path) { return 0; } #else /****************************************************************************** ** ** ** when FUSE is enabled in xrdp ** ** ** ******************************************************************************/ /* FUSE_USE_VERSION must be defined globally for other parts of * xrdp-chansrv which include for definitions. Check * it's actually defined here */ #ifndef FUSE_USE_VERSION #error Define FUSE_USE_VERSION in the make system and recompile #endif #include #include #include #include #include #include #include #include #include #include "arch.h" #include "os_calls.h" #include "string_calls.h" #include "clipboard_file.h" #include "chansrv_fuse.h" #include "chansrv_xfs.h" #include "chansrv.h" #include "chansrv_config.h" #include "devredir.h" #include "list.h" #include "file.h" #ifndef EREMOTEIO #define EREMOTEIO EIO #endif #define XFUSE_ATTR_TIMEOUT 5.0 #define XFUSE_ENTRY_TIMEOUT 5.0 /* Type of buffer used for fuse_add_direntry() calls */ struct dirbuf1 { char buf[4096]; size_t len; }; /* * Record type used to maintain state when running a directory scan */ struct state_dirscan { fuse_req_t req; /* Original FUSE request from opendir */ struct fuse_file_info fi; /* File info struct passed to opendir */ fuse_ino_t pinum; /* inum of parent directory */ }; /* * Record type used to maintain state when running an entry lookup */ struct state_lookup { fuse_req_t req; /* Original FUSE request from lookup */ fuse_ino_t pinum; /* inum of parent directory */ char name[XFS_MAXFILENAMELEN + 1]; /* Name to look up */ fuse_ino_t existing_inum; /* inum of an existing entry */ tui32 existing_generation; /* generation of the above */ }; /* * Record type used to maintain state when running an entry setattr */ struct state_setattr { fuse_req_t req; /* Original FUSE request from lookup */ fuse_ino_t inum; /* inum of entry */ struct file_attr fattr; /* File attributes to set */ tui32 change_mask; /* Attributes to set in fattr */ }; /* * Record type used to maintain state when running an open */ struct state_open { fuse_req_t req; /* Original FUSE request from lookup */ struct fuse_file_info fi; /* File info struct passed to open */ fuse_ino_t inum; /* inum of file to open */ }; /* * Record type used to maintain state when running a create */ struct state_create { fuse_req_t req; /* Original FUSE request from lookup */ struct fuse_file_info fi; /* File info struct passed to open */ fuse_ino_t pinum; /* inum of parent directory */ char name[XFS_MAXFILENAMELEN + 1]; /* Name of file in parent directory */ mode_t mode; /* Mode of file to create */ }; /* * Record type used to maintain state when running a read */ struct state_read { fuse_req_t req; /* Original FUSE request from lookup */ }; /* * Record type used to maintain state when running a write */ struct state_write { fuse_req_t req; /* Original FUSE request from lookup */ fuse_ino_t inum; /* inum of file we're writing */ }; /* * Record type used to maintain state when running a remove */ struct state_remove { fuse_req_t req; /* Original FUSE request from lookup */ fuse_ino_t inum; /* inum of file we're removing */ }; /* * Record type used to maintain state when running a rename */ struct state_rename { fuse_req_t req; /* Original FUSE request from lookup */ fuse_ino_t pinum; /* inum of parent of file */ fuse_ino_t new_pinum; /* inum of new parent of file */ char name[XFS_MAXFILENAMELEN + 1]; /* New name of file in new parent dir */ }; /* * Record type used to maintain state when running a close */ struct state_close { fuse_req_t req; /* Original FUSE request from lookup */ struct fuse_file_info fi; /* File info struct passed to open */ fuse_ino_t inum; /* inum of file to open */ }; struct xfuse_handle { tui32 DeviceId; tui32 FileId; int is_loc_resource; /* this is not a redirected resource */ /* a directory handle, if this xfuse_handle represents a directory. * NULL, if this xfuse_handle represents a file. * * Note: when this xfuse_handle represents a directory, then the other * fields of this structure contain invalid values. */ struct xfs_dir_handle *dir_handle; }; typedef struct xfuse_handle XFUSE_HANDLE; /* used for file data request sent to client */ struct req_list_item { fuse_req_t req; int stream_id; int lindex; int off; int size; }; extern struct config_chansrv *g_cfg; /* in chansrv.c */ static struct list *g_req_list = 0; static struct xfs_fs *g_xfs; /* an inst of xrdp file system */ static ino_t g_clipboard_inum; /* inode of clipboard dir */ static char *g_mount_point = 0; /* our FUSE mount point */ static struct fuse_lowlevel_ops g_xfuse_ops; /* setup FUSE callbacks */ static int g_xfuse_inited = 0; /* true when FUSE is inited */ static struct fuse_chan *g_ch = 0; static struct fuse_session *g_se = 0; static char *g_buffer = 0; static int g_fd = 0; static tintptr g_bufsize = 0; /* forward declarations for internal access */ static int xfuse_init_xrdp_fs(void); static int xfuse_deinit_xrdp_fs(void); static int xfuse_init_lib(struct fuse_args *args); /* forward declarations for FUSE callbacks */ static void xfuse_cb_lookup(fuse_req_t req, fuse_ino_t parent, const char *name); static void xfuse_cb_getattr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi); /* this is not a callback, but it's used by xfuse_cb_readdir() */ static int xfuse_dirbuf_add1(fuse_req_t req, struct dirbuf1 *b, XFS_INODE *xinode, off_t offset); static void xfuse_cb_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi); static void xfuse_cb_mkdir(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode); static void xfuse_cb_unlink(fuse_req_t req, fuse_ino_t parent, const char *name); static void xfuse_cb_rename(fuse_req_t req, fuse_ino_t old_parent, const char *old_name, fuse_ino_t new_parent, const char *new_name); /* Whether to create a dir of file depends on whether S_IFDIR is set in the mode field */ static void xfuse_create_dir_or_file(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, struct fuse_file_info *fi); static void xfuse_cb_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi); static void xfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi); static void xfuse_cb_read(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi); static void xfuse_cb_write(fuse_req_t req, fuse_ino_t ino, const char *buf, size_t size, off_t off, struct fuse_file_info *fi); static void xfuse_cb_create(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, struct fuse_file_info *fi); #if 0 static void xfuse_cb_fsync(fuse_req_t req, fuse_ino_t ino, int datasync, struct fuse_file_info *fi); #endif static void xfuse_cb_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, struct fuse_file_info *fi); static void xfuse_cb_opendir(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi); static void xfuse_cb_releasedir(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi); /* miscellaneous functions */ static void xfs_inode_to_fuse_entry_param(const XFS_INODE *xinode, struct fuse_entry_param *e); static void make_fuse_entry_reply(fuse_req_t req, const XFS_INODE *xinode); static void make_fuse_attr_reply(fuse_req_t req, const XFS_INODE *xinode); static const char *filename_on_device(const char *full_path); static void update_inode_file_attributes(const struct file_attr *fattr, tui32 change_mask, XFS_INODE *xinode); static char *get_name_for_entry_in_parent(fuse_ino_t parent, const char *name); static unsigned int format_user_info(char *dest, unsigned int len, const char *format); /*****************************************************************************/ int load_fuse_config(void) { return 0; } /*****************************************************************************/ XFUSE_HANDLE * xfuse_handle_create() { return g_new0(XFUSE_HANDLE, 1); } /*****************************************************************************/ void xfuse_handle_delete(XFUSE_HANDLE *self) { if (self == NULL) { return; } if (self->dir_handle != NULL) { free(self->dir_handle); } free(self); } /*****************************************************************************/ uint64_t xfuse_handle_to_fuse_handle(XFUSE_HANDLE *self) { return (uint64_t) (tintptr) self; } /*****************************************************************************/ XFUSE_HANDLE * xfuse_handle_from_fuse_handle(uint64_t handle) { return (XFUSE_HANDLE *) (tintptr) handle; } /***************************************************************************** ** ** ** public functions - can be called from any code path ** ** ** *****************************************************************************/ /** * Initialize FUSE subsystem * * @return 0 on success, -1 on failure, 1 for feature disabled *****************************************************************************/ int xfuse_init(void) { struct fuse_args args = FUSE_ARGS_INIT(0, NULL); char *p; /* if already inited, just return */ if (g_xfuse_inited) { LOG_DEVEL(LOG_LEVEL_DEBUG, "already inited"); return 0; } /* This feature may be disabled */ if (!g_cfg->enable_fuse_mount) { /* * Only log the 'disabled mounts' message one time */ static int disabled_mounts_msg_shown = 0; if (!disabled_mounts_msg_shown) { LOG(LOG_LEVEL_INFO, "FUSE mounts are disabled by config"); disabled_mounts_msg_shown = 1; } return 1; } if (g_ch != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "g_ch is not zero"); return -1; } load_fuse_config(); /* define FUSE mount point */ if (g_cfg->fuse_mount_name[0] == '/') { /* String is an absolute path to the mount point containing * %u or %U characters */ format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path), g_cfg->fuse_mount_name); } else { /* mount_name is relative to $HOME, e.g. ~/xrdp_client, * or ~/thinclient_drives */ unsigned int len = g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/", g_getenv("HOME")); if (len < sizeof(g_fuse_root_path)) { format_user_info(g_fuse_root_path + len, sizeof(g_fuse_root_path) - len, g_cfg->fuse_mount_name); } } /* Remove all trailing '/' from the root path */ p = g_fuse_root_path + g_strlen(g_fuse_root_path); while ( p > g_fuse_root_path && *(p - 1) == '/') { --p; *p = '\0'; } /* This shouldn't happen */ if (g_strlen(g_fuse_root_path) == 0) { LOG(LOG_LEVEL_ERROR, "Fuse root path is empty after removing trailing '/'"); return -1; } g_snprintf(g_fuse_clipboard_path, sizeof(g_fuse_clipboard_path), "%s/.clipboard", g_fuse_root_path); /* if FUSE mount point does not exist, create it */ if (!g_directory_exist(g_fuse_root_path)) { (void)g_create_path(g_fuse_root_path); if (!g_create_dir(g_fuse_root_path)) { LOG(LOG_LEVEL_ERROR, "mkdir %s failed (%s)", g_fuse_root_path, g_get_strerror()); return -1; } } /* Get the characteristics of the parent directory of the FUSE mount * point. Used by xfuse_path_in_xfuse_fs() */ g_fuse_root_parent_dev = -1; g_fuse_root_parent_ino = -1; p = (char *)g_strrchr(g_fuse_root_path, '/'); if (p != NULL) { /* Temporarily finish the root path at this point */ *p = '\0'; g_fuse_root_path_basename = p + 1; g_fuse_root_parent_dev = g_file_get_device_number(g_fuse_root_path); g_fuse_root_parent_ino = g_file_get_inode_num(g_fuse_root_path); *p = '/'; } if (g_fuse_root_parent_dev == -1 || g_fuse_root_parent_ino == -1) { LOG(LOG_LEVEL_ERROR, "Unable to obtain characteristics of directory containing %s", g_fuse_root_path); return -1; } /* setup xrdp file system */ if (xfuse_init_xrdp_fs()) { return -1; } /* setup FUSE callbacks */ g_memset(&g_xfuse_ops, 0, sizeof(g_xfuse_ops)); g_xfuse_ops.lookup = xfuse_cb_lookup; g_xfuse_ops.readdir = xfuse_cb_readdir; g_xfuse_ops.mkdir = xfuse_cb_mkdir; g_xfuse_ops.rmdir = xfuse_cb_unlink; g_xfuse_ops.unlink = xfuse_cb_unlink; g_xfuse_ops.rename = xfuse_cb_rename; g_xfuse_ops.open = xfuse_cb_open; g_xfuse_ops.release = xfuse_cb_release; g_xfuse_ops.read = xfuse_cb_read; g_xfuse_ops.write = xfuse_cb_write; g_xfuse_ops.create = xfuse_cb_create; //g_xfuse_ops.fsync = xfuse_cb_fsync; /* LK_TODO delete this */ g_xfuse_ops.getattr = xfuse_cb_getattr; g_xfuse_ops.setattr = xfuse_cb_setattr; g_xfuse_ops.opendir = xfuse_cb_opendir; g_xfuse_ops.releasedir = xfuse_cb_releasedir; fuse_opt_add_arg(&args, "xrdp-chansrv"); fuse_opt_add_arg(&args, g_fuse_root_path); //fuse_opt_add_arg(&args, "-s"); /* single threaded mode */ //fuse_opt_add_arg(&args, "-d"); /* debug mode */ if (xfuse_init_lib(&args)) { xfuse_deinit(); return -1; } g_xfuse_inited = 1; return 0; } /** * De-initialize FUSE subsystem * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_deinit(void) { if (g_ch != 0) { fuse_session_remove_chan(g_ch); fuse_unmount(g_mount_point, g_ch); g_ch = 0; } if (g_se != 0) { fuse_session_destroy(g_se); g_se = 0; } if (g_buffer != 0) { g_free(g_buffer); g_buffer = 0; } if (g_req_list != 0) { list_delete(g_req_list); g_req_list = 0; } xfuse_deinit_xrdp_fs(); g_xfuse_inited = 0; return 0; } /** * * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_check_wait_objs(void) { struct fuse_chan *tmpch; int rval; if (g_ch == 0) { return 0; } if (g_sck_can_recv(g_fd, 0)) { tmpch = g_ch; rval = fuse_chan_recv(&tmpch, g_buffer, g_bufsize); if (rval == -EINTR) { return -1; } if (rval == -ENODEV) { return -1; } if (rval <= 0) { return -1; } fuse_session_process(g_se, g_buffer, rval, tmpch); } return 0; } /** * * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout) { int lcount; if (g_ch == 0) { return 0; } lcount = *count; objs[lcount] = g_fd; lcount++; *count = lcount; return 0; } /** * @brief Create specified share directory. * * This code gets called from devredir * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_create_share(tui32 device_id, const char *dirname) { int result = -1; XFS_INODE *xinode; if (dirname != NULL && strlen(dirname) > 0 && xfuse_init_xrdp_fs() == 0) { xinode = xfs_add_entry(g_xfs, FUSE_ROOT_ID, dirname, (0777 | S_IFDIR)); if (xinode == NULL) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xfs_add_entry() failed"); } else { xinode->is_redirected = 1; xinode->device_id = device_id; result = 0; } } return result; } /** * @brief Remove specified share directory. * * This code gets called from devredir *****************************************************************************/ void xfuse_delete_share(tui32 device_id) { xfs_delete_redirected_entries_with_device_id(g_xfs, device_id); } /** * Clear all clipboard entries in xrdp_fs * * This function is called by clipboard code * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_clear_clip_dir(void) { int result = 0; if (g_xfs != NULL && g_clipboard_inum > 0) { xfs_remove_directory_contents(g_xfs, g_clipboard_inum); } return result; } /** * Return clipboard data to fuse * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes) { LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: stream_id=%d data_bytes=%d", stream_id, data_bytes); struct req_list_item *rli; if ((rli = (struct req_list_item *) list_get_item(g_req_list, 0)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "range error!"); return -1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "lindex=%d off=%d size=%d", rli->lindex, rli->off, rli->size); fuse_reply_buf(rli->req, data, data_bytes); list_remove_item(g_req_list, 0); if (g_req_list->count <= 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "completed all requests"); return 0; } /* send next request */ rli = (struct req_list_item *) list_get_item(g_req_list, 0); if (rli == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "range error!"); return -1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "requesting clipboard file data"); clipboard_request_file_data(rli->stream_id, rli->lindex, rli->off, rli->size); return 0; } /** * Create a file in .clipboard dir * * This function is called by clipboard code * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_add_clip_dir_item(const char *filename, int flags, int size, int lindex) { LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: filename=%s flags=%d size=%d lindex=%d", filename, flags, size, lindex); int result = -1; if (g_xfs == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "xfuse_add_clip_dir_item() called with no filesystem"); } else { /* add entry to xrdp_fs */ XFS_INODE *xinode = xfs_add_entry( g_xfs, g_clipboard_inum, /* parent inode */ filename, (0666 | S_IFREG)); if (xinode == NULL) { LOG(LOG_LEVEL_INFO, "failed to create file %s in xrdp filesystem", filename); } else { xinode->size = size; xinode->lindex = lindex; result = 0; } } return result; } /** * * * @return 0 on success, -1 on failure *****************************************************************************/ int xfuse_file_contents_size(int stream_id, int file_size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: stream_id=%d file_size=%d", stream_id, file_size); return 0; } /***************************************************************************** ** ** ** private functions - can only be called from within this file ** ** ** *****************************************************************************/ /** * Initialize FUSE library * * @return 0 on success, -1 on failure *****************************************************************************/ static int xfuse_init_lib(struct fuse_args *args) { if (fuse_parse_cmdline(args, &g_mount_point, 0, 0) < 0) { LOG(LOG_LEVEL_ERROR, "fuse_parse_cmdline() failed"); fuse_opt_free_args(args); return -1; } if ((g_ch = fuse_mount(g_mount_point, args)) == 0) { LOG(LOG_LEVEL_ERROR, "FUSE mount on %s failed." " If %s is already mounted, you must first unmount it", g_mount_point, g_mount_point); fuse_opt_free_args(args); return -1; } g_se = fuse_lowlevel_new(args, &g_xfuse_ops, sizeof(g_xfuse_ops), 0); if (g_se == 0) { LOG(LOG_LEVEL_ERROR, "fuse_lowlevel_new() failed"); fuse_unmount(g_mount_point, g_ch); g_ch = 0; fuse_opt_free_args(args); return -1; } fuse_opt_free_args(args); fuse_session_add_chan(g_se, g_ch); g_bufsize = fuse_chan_bufsize(g_ch); g_buffer = g_new0(char, g_bufsize); g_fd = fuse_chan_fd(g_ch); g_req_list = list_create(); g_req_list->auto_free = 1; return 0; } /** * Initialize xrdp file system * * @return 0 on success, -1 on failure * *****************************************************************************/ static int xfuse_init_xrdp_fs(void) { XFS_INODE *xino; int result = -1; /* Already called? */ if (g_xfs != NULL) { result = 0; } else if ((g_xfs = xfs_create_xfs_fs(0, g_getuid(), g_getgid())) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); } else { /* Need a top-level .clipboard directory */ xino = xfs_add_entry(g_xfs, FUSE_ROOT_ID, ".clipboard", (0777 | S_IFDIR)); if (xino == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); xfs_delete_xfs_fs(g_xfs); g_xfs = NULL; } else { g_clipboard_inum = xino->inum; result = 0; } } return result; } /** * zap the xrdp file system * * @return 0 on success, -1 on failure *****************************************************************************/ static int xfuse_deinit_xrdp_fs(void) { xfs_delete_xfs_fs(g_xfs); g_xfs = NULL; g_clipboard_inum = 0; return 0; } /****************************************************************************** ** ** ** callbacks for devredir ** ** ** ******************************************************************************/ /** * Add a file or directory to xrdp file system as part of a * directory request * * If the file or directory already exists, no changes are made to it. *****************************************************************************/ void xfuse_devredir_cb_enum_dir_add_entry( struct state_dirscan *fip, const char *name, const struct file_attr *fattr) { XFS_INODE *xinode = NULL; if (!xfs_get(g_xfs, fip->pinum)) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", fip->pinum); } else if ((strcmp(name, ".") == 0) || (strcmp(name, "..") == 0)) { ; /* filename is . or .. - don't add it */ } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "parent_inode=%ld name=%s", fip->pinum, name); /* Does the file already exist ? If it does it's important we * don't mess with it, as we're only enumerating the directory, and * we don't want to disrupt any existing operations on the file */ xinode = xfs_lookup_in_dir(g_xfs, fip->pinum, name); if (xinode == NULL) { /* Add a new node to the file system */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Creating name=%s in parent=%ld in xrdp_fs", name, fip->pinum); xinode = xfs_add_entry(g_xfs, fip->pinum, name, fattr->mode); if (xinode == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "xfs_add_entry() failed"); } else { xinode->size = fattr->size; xinode->atime = fattr->atime; xinode->mtime = fattr->mtime; /* Initially, set the attribute change time to the file data change time */ xinode->ctime = fattr->mtime; /* device_id is inherited from parent */ } } } } /** * This routine is called by devredir when the opendir request has * completed *****************************************************************************/ void xfuse_devredir_cb_enum_dir_done(struct state_dirscan *fip, enum NTSTATUS IoStatus) { LOG_DEVEL(LOG_LEVEL_DEBUG, "fip=%p IoStatus=0x%x", fip, IoStatus); /* * STATUS_NO_SUCH_FILE is returned for empty directories */ if (IoStatus != STATUS_SUCCESS && IoStatus != STATUS_NO_SUCH_FILE) { int status; switch (IoStatus) { case STATUS_ACCESS_DENIED: status = EACCES; break; default: status = ENOENT; } fuse_reply_err(fip->req, status); } else if (!xfs_get(g_xfs, fip->pinum)) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", fip->pinum); fuse_reply_err(fip->req, ENOENT); } else { struct fuse_file_info *fi = &fip->fi; XFUSE_HANDLE *xhandle = xfuse_handle_create(); if (xhandle == NULL || (xhandle->dir_handle = xfs_opendir(g_xfs, fip->pinum)) == NULL) { xfuse_handle_delete(xhandle); fuse_reply_err(fip->req, ENOMEM); } else { fi->fh = xfuse_handle_to_fuse_handle(xhandle); fuse_reply_open(fip->req, &fip->fi); } } free(fip); } /** * This routine is caused as a result of a devredir remote lookup * instigated by xfuse_cb_lookup() *****************************************************************************/ void xfuse_devredir_cb_lookup_entry(struct state_lookup *fip, enum NTSTATUS IoStatus, const struct file_attr *file_info) { XFS_INODE *xinode = NULL; if (IoStatus != STATUS_SUCCESS) { switch (IoStatus) { case STATUS_SHARING_VIOLATION: /* This can happen when trying to read the attributes of * some system files (e.g. pagefile.sys) */ case STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case STATUS_UNSUCCESSFUL: /* Happens if we try to lookup an illegal filename (e.g. * one with a '*' in it) */ fuse_reply_err(fip->req, ENOENT); break; case STATUS_NO_SUCH_FILE: /* Remove our copy, if any */ if (fip->existing_inum && (xinode = xfs_get(g_xfs, fip->existing_inum)) != NULL && xinode->generation == fip->existing_generation) { xfs_remove_entry(g_xfs, fip->existing_inum); } fuse_reply_err(fip->req, ENOENT); break; default: LOG_DEVEL(LOG_LEVEL_INFO, "Error code %08x - fallthrough", (int) IoStatus); fuse_reply_err(fip->req, EIO); break; } } else if (!xfs_get(g_xfs, fip->pinum)) { LOG_DEVEL(LOG_LEVEL_ERROR, "parent inode %ld is not valid", fip->pinum); fuse_reply_err(fip->req, ENOENT); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "parent_inode=%ld name=%s", fip->pinum, fip->name); /* Does the file already exist ? */ xinode = xfs_lookup_in_dir(g_xfs, fip->pinum, fip->name); if (xinode != NULL) { /* Is the existing file the same type ? */ if ((xinode->mode & (S_IFREG | S_IFDIR)) == (file_info->mode & (S_IFREG | S_IFDIR))) { LOG_DEVEL(LOG_LEVEL_DEBUG, "inode=%ld name=%s already exists in xrdp_fs as %ld", fip->pinum, fip->name, xinode->inum); if (xfs_get_file_open_count(g_xfs, xinode->inum) > 0) { /* * Don't mess with open files. The local attributes are * almost certainly more up-to-date. A worst case scenario * would be truncating a file we're currently writing * to, as the lookup value for the size is stale. */ LOG_DEVEL(LOG_LEVEL_DEBUG, "inode=%ld is open - " "preferring local attributes", xinode->inum); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "Updating attributes of inode=%ld", xinode->inum); update_inode_file_attributes(file_info, TO_SET_ALL, xinode); } } else { /* Type has changed from file to directory, or vice-versa */ LOG_DEVEL(LOG_LEVEL_DEBUG, "inode=%ld name=%s of different type in xrdp_fs" " - removing", fip->pinum, xinode->name); xfs_remove_entry(g_xfs, xinode->inum); xinode = NULL; } } if (xinode == NULL) { /* Add a new node to the file system */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Creating name=%s in parent=%ld in xrdp_fs", fip->name, fip->pinum); xinode = xfs_add_entry(g_xfs, fip->pinum, fip->name, file_info->mode); if (xinode == NULL) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xfs_add_entry() failed"); } else { xinode->size = file_info->size; xinode->atime = file_info->atime; xinode->mtime = file_info->mtime; /* Initially, set the attribute change time to the file data change time */ xinode->ctime = file_info->mtime; /* device_id is inherited from parent */ } } if (xinode != NULL) { make_fuse_entry_reply(fip->req, xinode); } else { fuse_reply_err(fip->req, EIO); } } free(fip); } /** * This routine is caused as a result of a devredir remote setattr * instigated by xfuse_cb_setattr() *****************************************************************************/ void xfuse_devredir_cb_setattr(struct state_setattr *fip, enum NTSTATUS IoStatus) { XFS_INODE *xinode; if (IoStatus != STATUS_SUCCESS) { switch (IoStatus) { case STATUS_SHARING_VIOLATION: /* This can happen when trying to read the attributes of * some system files (e.g. pagefile.sys) */ case STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case STATUS_UNSUCCESSFUL: /* Happens if we try to lookup an illegal filename */ case STATUS_NO_SUCH_FILE: fuse_reply_err(fip->req, ENOENT); break; default: LOG_DEVEL(LOG_LEVEL_INFO, "Error code %08x - fallthrough", (int) IoStatus); fuse_reply_err(fip->req, EIO); break; } } else if ((xinode = xfs_get(g_xfs, fip->inum)) == NULL) { fuse_reply_err(fip->req, ENOENT); } else { update_inode_file_attributes(&fip->fattr, fip->change_mask, xinode); make_fuse_attr_reply(fip->req, xinode); } free(fip); } /** * This routine is caused as a result of a file or directory * create request */ void xfuse_devredir_cb_create_file(struct state_create *fip, enum NTSTATUS IoStatus, tui32 DeviceId, tui32 FileId) { XFUSE_HANDLE *fh = NULL; if (IoStatus != 0) { switch (IoStatus) { case STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case STATUS_OBJECT_NAME_INVALID: case STATUS_OBJECT_NAME_NOT_FOUND: fuse_reply_err(fip->req, ENOENT); break; default: fuse_reply_err(fip->req, EIO); break; } } else { if ((fip->mode & S_IFREG) != 0) { /* We've created a regular file */ /* Allocate an XFUSE_HANDLE for future file operations */ if ((fh = xfuse_handle_create()) != NULL) { /* save file handle for later use */ fh->DeviceId = DeviceId; fh->FileId = FileId; fip->fi.fh = xfuse_handle_to_fuse_handle(fh); } } if ((fip->mode & S_IFREG) != 0 && fh == NULL) { /* We failed to allocate a file handle */ LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(fip->req, ENOMEM); } else { XFS_INODE *xinode; /* create entry in xrdp file system */ xinode = xfs_add_entry(g_xfs, fip->pinum, fip->name, fip->mode); if (xinode == NULL) { /* It's possible xfs_add_entry() has failed, as the * file has already been added (by a lookup request) * in the time between our request and the response * This can happen if an 'ls' is happening in the same * directory as this file is being created. * * We'll check for this before we fail the create */ if ((xinode = xfs_lookup_in_dir(g_xfs, fip->pinum, fip->name)) != NULL) { /* * The mode should be correct anyway, but we'll * set it to the mode requested at creation */ xinode->mode = fip->mode; } } if (xinode == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "Out of memory!"); fuse_reply_err(fip->req, ENOMEM); } else { if ((fip->mode & S_IFDIR) != 0) { make_fuse_entry_reply(fip->req, xinode); } else { struct fuse_entry_param e; xfs_inode_to_fuse_entry_param(xinode, &e); fuse_reply_create(fip->req, &e, &fip->fi); xfs_increment_file_open_count(g_xfs, xinode->inum); } } } } free(fip); } /** * This routine is caused as a result of a file open request */ void xfuse_devredir_cb_open_file(struct state_open *fip, enum NTSTATUS IoStatus, tui32 DeviceId, tui32 FileId) { XFUSE_HANDLE *fh; if (IoStatus != 0) { switch (IoStatus) { case STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; case STATUS_OBJECT_NAME_INVALID: case STATUS_OBJECT_NAME_NOT_FOUND: fuse_reply_err(fip->req, ENOENT); break; default: fuse_reply_err(fip->req, EIO); break; } } else { /* Allocate an XFUSE_HANDLE for future file operations */ if ((fh = xfuse_handle_create()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(fip->req, ENOMEM); } else { /* save file handle for later use */ fh->DeviceId = DeviceId; fh->FileId = FileId; fip->fi.fh = xfuse_handle_to_fuse_handle(fh); LOG_DEVEL(LOG_LEVEL_DEBUG, "sending fuse_reply_open(); " "DeviceId=%d FileId=%d req=%p", fh->DeviceId, fh->FileId, fip->req); /* update open count */ xfs_increment_file_open_count(g_xfs, fip->inum); fuse_reply_open(fip->req, &fip->fi); } } free(fip); } void xfuse_devredir_cb_read_file(struct state_read *fip, enum NTSTATUS IoStatus, const char *buf, size_t length) { if (IoStatus != STATUS_SUCCESS) { LOG_DEVEL(LOG_LEVEL_ERROR, "Read NTSTATUS is %d", (int) IoStatus); fuse_reply_err(fip->req, EIO); } else { fuse_reply_buf(fip->req, buf, length); } free(fip); } void xfuse_devredir_cb_write_file( struct state_write *fip, enum NTSTATUS IoStatus, off_t offset, size_t length) { XFS_INODE *xinode; if (IoStatus != STATUS_SUCCESS) { LOG_DEVEL(LOG_LEVEL_ERROR, "Write NTSTATUS is %d", (int) IoStatus); fuse_reply_err(fip->req, EIO); } else { off_t new_size = offset + length; fuse_reply_write(fip->req, length); /* update file size */ if ((xinode = xfs_get(g_xfs, fip->inum)) != NULL) { if (new_size > xinode->size) { xinode->size = new_size; } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is invalid", fip->inum); } } free(fip); } void xfuse_devredir_cb_rmdir_or_file(struct state_remove *fip, enum NTSTATUS IoStatus) { XFS_INODE *xinode = xfs_get(g_xfs, fip->inum); switch (IoStatus) { case STATUS_SUCCESS: case STATUS_NO_SUCH_FILE: xfs_remove_entry(g_xfs, xinode->inum); /* Remove local copy */ fuse_reply_err(fip->req, 0); break; case STATUS_SHARING_VIOLATION: case STATUS_ACCESS_DENIED: fuse_reply_err(fip->req, EACCES); break; default: LOG_DEVEL(LOG_LEVEL_INFO, "Error code %08x - fallthrough", (int) IoStatus); fuse_reply_err(fip->req, EBADF); break; } free(fip); } void xfuse_devredir_cb_rename_file(struct state_rename *fip, enum NTSTATUS IoStatus) { int status; if (IoStatus != STATUS_SUCCESS) { status = (IoStatus == STATUS_SHARING_VIOLATION) ? EBUSY : (IoStatus == STATUS_ACCESS_DENIED) ? EACCES : /* default */ EEXIST ; } else { status = xfs_move_entry(g_xfs, fip->pinum, fip->new_pinum, fip->name); } fuse_reply_err(fip->req, status); free(fip); } void xfuse_devredir_cb_file_close(struct state_close *fip) { fuse_reply_err(fip->req, 0); xfs_decrement_file_open_count(g_xfs, fip->inum); free(fip); } /* * Determine is a file is in the FUSE filesystem * * The whole purpose of this function is to avoid deadlocks. If we try * to determine the size (or any other attribute) of a file in the FUSE * filesystem, the kernel will block the calling thread and send a message * to libfuse. Since we're single-threaded, this will result in deadlock. * * Ideally we'd use a stat() of the file to compare with a stat() of * the mountpoint. This won't work however, for the reasons outline above. * * A simple implementation might be to compare the start of the filename * with the FUSE mount point. This will work, but can easily be defeated, * (perhaps unintentionally) by symlinks in the path. * * The approach taken here is to record the basename of the FUSE mount * point directory (e.g. 'thinclient_drives') and look for that in the * passed-in filename as a directory element. If we find it, we look * at the device name and inode number of the parent directory of the * FUSE mount point. If these match we consider the filename to be in * the FUSE filesystem. */ int xfuse_path_in_xfuse_fs(const char *path) { char *wpath = NULL; /* Writeable copy of path */ char *p; int blen = g_strlen(g_fuse_root_path_basename); int rv = 0; if ((wpath = g_strdup(path)) == NULL) { LOG(LOG_LEVEL_ERROR, "system out of memory"); } else { /* Look ahead in the string for the basename of the FUSE mount point */ for (p = wpath; (p = g_strstr(p, g_fuse_root_path_basename)) != NULL ; p = p + 1) { /* Is this string preceded by a '/' ? */ if (p == wpath || *(p - 1) != '/') { continue; } /* Is the string followed by a '/' or '\0' ? We know it's * valid to look ahead this far in the string, as g_strstr() * tells us it is */ if (*(p + blen) != '/' && *(p + blen) != '\0') { continue; } /* Temporarily terminate the string early, and check the * file system characteristics of the preceding directory */ *(p - 1) = '\0'; if (g_file_get_device_number(wpath) == g_fuse_root_parent_dev && g_file_get_inode_num(wpath) == g_fuse_root_parent_ino) { rv = 1; break; } *(p - 1) = '/'; } g_free(wpath); } return rv; } /****************************************************************************** ** ** ** callbacks for fuse ** ** ** ******************************************************************************/ /** * Look up a directory entry by name and get its attributes *****************************************************************************/ static void xfuse_cb_lookup(fuse_req_t req, fuse_ino_t parent, const char *name) { XFS_INODE *parent_xinode; XFS_INODE *xinode = NULL; LOG_DEVEL(LOG_LEVEL_DEBUG, "looking for parent=%ld name=%s", parent, name); if (strlen(name) > XFS_MAXFILENAMELEN) { fuse_reply_err(req, ENAMETOOLONG); } else if ((parent_xinode = xfs_get(g_xfs, parent)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", parent); fuse_reply_err(req, ENOENT); } else { if (!parent_xinode->is_redirected) { /* File cannot be remote - we either know about it or we don't */ if ((xinode = xfs_lookup_in_dir(g_xfs, parent, name)) != NULL) { LOG_DEVEL(LOG_LEVEL_DEBUG, "found entry for parent=%ld name=%s", parent, name); make_fuse_entry_reply(req, xinode); } else { fuse_reply_err(req, ENOENT); } } else { /* specified file resides on redirected share * * We always look these up, and relying on libfuse to do sane * caching */ struct state_lookup *fip = g_new0(struct state_lookup, 1); char *full_path = get_name_for_entry_in_parent(parent, name); if (fip == NULL || full_path == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); free(fip); free(full_path); } else { const char *cptr; fip->req = req; fip->pinum = parent; strcpy(fip->name, name); /* we want path minus 'root node of the share' */ cptr = filename_on_device(full_path); /* If the file already exists on our side, save the inum * and generation. If it's not remote any more this means we * can remove it when we get the response */ if ((xinode = xfs_lookup_in_dir(g_xfs, parent, name)) != NULL) { fip->existing_inum = xinode->inum; fip->existing_generation = xinode->generation; } LOG_DEVEL(LOG_LEVEL_DEBUG, "Looking up %s in %s on %d", name, cptr, parent_xinode->device_id); /* * If this call succeeds, further request processing happens in * xfuse_devredir_cb_lookup_entry() */ if (devredir_lookup_entry(fip, parent_xinode->device_id, cptr)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_lookup_entry() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } free(full_path); } } } } /** * Get file attributes * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_getattr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { XFS_INODE *xino; LOG_DEVEL(LOG_LEVEL_DEBUG, "req=%p ino=%ld", req, ino); /* if ino is not valid, just return */ if ((xino = xfs_get(g_xfs, ino)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else { make_fuse_attr_reply(req, xino); } } /** * *****************************************************************************/ /* * Adds an entry to the buffer, using fuse_add_direnty() * * Returns 1 for success, or zero if the entry couldn't be added */ static int xfuse_dirbuf_add1(fuse_req_t req, struct dirbuf1 *b, XFS_INODE *xinode, off_t offset) { struct stat stbuf; size_t len; int result = 0; memset(&stbuf, 0, sizeof(stbuf)); stbuf.st_ino = xinode->inum; stbuf.st_mode = xinode->mode & ~g_cfg->file_umask; /* * Try to add the entry. From the docs for fuse_add_direntry():- * "Buffer needs to be large enough to hold the entry. If it's not, * then the entry is not filled in but the size of the entry is * still returned." */ len = fuse_add_direntry(req, &b->buf[b->len], /* index where new entry will be added to buf */ sizeof(b->buf) - b->len, /* Space left */ xinode->name, /* name of entry */ &stbuf, /* file attributes */ offset /* offset of next entry */ ); if (len + b->len <= sizeof(b->buf)) { /* Entry fitted in OK */ b->len += len; result = 1; } return result; } /** * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi) { XFS_INODE *xinode; XFUSE_HANDLE *xhandle; struct xfs_dir_handle *dh; struct dirbuf1 b; LOG_DEVEL(LOG_LEVEL_DEBUG, "req=%p inode=%ld size=%zd offset=%lld", req, ino, size, (long long) off); /* On the first call, check the inode is valid */ if (off == 0 && !xfs_get(g_xfs, ino)) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if ((xhandle = xfuse_handle_from_fuse_handle(fi->fh)) == NULL || (dh = xhandle->dir_handle) == NULL) { /* something seriously wrong somewhere! */ fuse_reply_buf(req, 0, 0); } else { b.len = 0; off_t new_off = off; while ((xinode = xfs_readdir(g_xfs, dh, &new_off)) != NULL) { if (xfuse_dirbuf_add1(req, &b, xinode, new_off) == 0) { break; /* buffer is full */ } /* Make sure we get the next entry next time */ off = new_off; } fuse_reply_buf(req, b.buf, b.len); } } /** * Create a directory *****************************************************************************/ static void xfuse_cb_mkdir(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode) { XFS_INODE *xinode; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: parent_inode=%ld name=%s", parent, name); if ((xinode = xfs_lookup_in_dir(g_xfs, parent, name)) != NULL) { /* dir already exists, just return it */ make_fuse_entry_reply(req, xinode); } else { /* dir does not exist, create it */ xfuse_create_dir_or_file(req, parent, name, mode | S_IFDIR, NULL); } } /** * Remove a dir or file * *****************************************************************************/ static void xfuse_cb_unlink(fuse_req_t req, fuse_ino_t parent, const char *name) { XFS_INODE *xinode; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: parent=%ld name=%s", parent, name); if (strlen(name) > XFS_MAXFILENAMELEN) { fuse_reply_err(req, ENAMETOOLONG); } else if ((xinode = xfs_lookup_in_dir(g_xfs, parent, name)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "did not find file with pinode=%ld name=%s", parent, name); fuse_reply_err(req, ENOENT); } else if ((xinode->mode & S_IFDIR) != 0 && !xfs_is_dir_empty(g_xfs, xinode->inum)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "cannot rmdir; directory is not empty"); fuse_reply_err(req, ENOTEMPTY); } else if (!xinode->is_redirected) { /* specified file is a local resource */ //XFUSE_HANDLE *fh; LOG_DEVEL(LOG_LEVEL_DEBUG, "LK_TODO: this is still a TODO"); fuse_reply_err(req, EROFS); } else { /* specified file resides on redirected share */ struct state_remove *fip = g_new0(struct state_remove, 1); char *full_path = xfs_get_full_path(g_xfs, xinode->inum); if (!full_path || !fip) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); free(fip); } else { const char *cptr; fip->req = req; fip->inum = xinode->inum; /* we want path minus 'root node of the share' */ cptr = filename_on_device(full_path); /* get devredir to open the remote file * * If this call succeeds, further request processing happens in * xfuse_devredir_cb_rmdir_or_file() */ if (devredir_rmdir_or_file(fip, xinode->device_id, cptr)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_rmdir_or_file() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } } free(full_path); } } static void xfuse_cb_rename(fuse_req_t req, fuse_ino_t old_parent, const char *old_name, fuse_ino_t new_parent, const char *new_name) { XFS_INODE *old_xinode; XFS_INODE *new_parent_xinode; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: old_parent=%ld old_name=%s new_parent=%ld new_name=%s", old_parent, old_name, new_parent, new_name); if (strlen(old_name) > XFS_MAXFILENAMELEN || strlen(new_name) > XFS_MAXFILENAMELEN) { fuse_reply_err(req, ENAMETOOLONG); } else if (!(old_xinode = xfs_lookup_in_dir(g_xfs, old_parent, old_name))) { LOG_DEVEL(LOG_LEVEL_ERROR, "did not find file with pinode=%ld name=%s", old_parent, old_name); fuse_reply_err(req, ENOENT); } else if (!(new_parent_xinode = xfs_get(g_xfs, new_parent))) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", new_parent); fuse_reply_err(req, ENOENT); } else if (!xfs_check_move_entry(g_xfs, old_xinode->inum, new_parent, new_name)) { /* Catchall -see rename(2). Fix when logging is improved */ fuse_reply_err(req, EINVAL); } else if (new_parent_xinode->is_redirected != old_xinode->is_redirected || new_parent_xinode->device_id != old_xinode->device_id) { fuse_reply_err(req, EXDEV); } else if (!old_xinode->is_redirected) { /* specified file is a local resource */ LOG_DEVEL(LOG_LEVEL_DEBUG, "LK_TODO: this is still a TODO"); fuse_reply_err(req, EROFS); } else { /* resource is on a redirected share */ struct state_rename *fip = g_new0(struct state_rename, 1); char *old_full_path = xfs_get_full_path(g_xfs, old_xinode->inum); char *new_full_path = get_name_for_entry_in_parent(new_parent, new_name); if (!old_full_path || !new_full_path || !fip) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); free(fip); free(old_full_path); free(new_full_path); } else { const char *cptr; const char *cp; fip->req = req; fip->pinum = old_xinode->inum; fip->new_pinum = new_parent; strcpy(fip->name, new_name); /* we want path minus 'root node of the share' */ cptr = filename_on_device(old_full_path); cp = filename_on_device(new_full_path); /* * If this call succeeds, further request processing happens in * xfuse_devredir_cb_rename_file() */ if (devredir_file_rename(fip, old_xinode->device_id, cptr, cp)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_file_rename() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } free(old_full_path); free(new_full_path); } } } /** * Create a directory or file * * @param req opaque FUSE object * @param parent parent inode * @param name name of dir or file to create * @param mode creation mode * @param fi File info from fuse_lowlevel_ops.create, or NULL. * This may need to be copied if we're not replying immediately *****************************************************************************/ static void xfuse_create_dir_or_file(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, struct fuse_file_info *fi) { XFS_INODE *xinode; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: parent_ino=%ld name=%s mode=%o type=%s", parent, name, mode, (mode & S_IFDIR) ? "dir" : "file"); /* name must be valid */ if (strlen(name) > XFS_MAXFILENAMELEN) { fuse_reply_err(req, ENAMETOOLONG); } else { /* Sanitise the mode * * Currently group/world write is not allowed. */ if (mode & S_IFDIR) { mode = (mode & 0777) | S_IFDIR; } else { mode = (mode & 0777) | S_IFREG; } /* is parent inode valid? */ if (parent == FUSE_ROOT_ID) { fuse_reply_err(req, EROFS); } else if ((xinode = xfs_get(g_xfs, parent)) == NULL) { fuse_reply_err(req, ENOENT); } else if ((xinode->mode & S_IFDIR) == 0) { fuse_reply_err(req, ENOTDIR); } else if (!xinode->is_redirected) { /* specified file is a local resource */ //XFUSE_HANDLE *fh; LOG_DEVEL(LOG_LEVEL_DEBUG, "LK_TODO: this is still a TODO"); fuse_reply_err(req, EROFS); } else { struct state_create *fip = g_new0(struct state_create, 1); char *full_path = get_name_for_entry_in_parent(parent, name); if (full_path == NULL || fip == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "Out of memory"); fuse_reply_err(req, ENOMEM); free(fip); free(full_path); } else { const char *cptr; fip->req = req; if (fi != NULL) { fip->fi = *fi; } fip->pinum = parent; strcpy(fip->name, name); fip->mode = mode; /* we want path minus 'root node of the share' */ cptr = filename_on_device(full_path); /* * If this call succeeds, further request processing happens * in xfuse_devredir_cb_create_file() */ if (devredir_file_create(fip, xinode->device_id, cptr, mode)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_file_create() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } free(full_path); } } } } /** * Open specified file * * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { XFS_INODE *xinode; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: ino=%ld", ino); if (!(xinode = xfs_get(g_xfs, ino))) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if (xinode->mode & S_IFDIR) { /* Can't open directories like this */ LOG_DEVEL(LOG_LEVEL_DEBUG, "reading/writing a dir not allowed!"); fuse_reply_err(req, EISDIR); } else if ((fi->flags & O_ACCMODE) != O_RDONLY && (fi->flags & O_ACCMODE) != O_WRONLY && (fi->flags & O_ACCMODE) != O_RDWR) { LOG_DEVEL(LOG_LEVEL_DEBUG, "Invalid access mode specified"); fuse_reply_err(req, EINVAL); } else if (!xinode->is_redirected) { /* specified file is a local resource */ if ((fi->flags & O_ACCMODE) != O_RDONLY) { fuse_reply_err(req, EROFS); } else { XFUSE_HANDLE *fh = xfuse_handle_create(); fh->is_loc_resource = 1; fi->fh = xfuse_handle_to_fuse_handle(fh); fuse_reply_open(req, fi); } } else { /* specified file resides on redirected share */ struct state_open *fip = g_new0(struct state_open, 1); char *full_path = xfs_get_full_path(g_xfs, ino); if (!full_path || !fip) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); free(fip); free(full_path); } else { const char *cptr; fip->req = req; fip->fi = *fi; fip->inum = ino; /* we want path minus 'root node of the share' */ cptr = filename_on_device(full_path); /* get devredir to open the remote file * * If the caller has set O_TRUNC when writing the file, * fuse should call us back via fuse_cb_setattr() to set * the size to zero - we don't need to do this ourselves. * * If this call succeeds, further request processing happens in * xfuse_devredir_cb_open_file() */ if (devredir_file_open(fip, xinode->device_id, cptr, fi->flags)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_file_open() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } free(full_path); } } } /* * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately */ static void xfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { XFS_INODE *xinode; XFUSE_HANDLE *handle = xfuse_handle_from_fuse_handle(fi->fh); LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: ino=%ld fi=%p fi->fh=0x%llx", ino, fi, (long long) fi->fh); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if (!xinode->is_redirected) { /* specified file is a local resource */ fuse_reply_err(req, 0); } else { /* specified file resides on redirected share */ struct state_close *fip = g_new0(struct state_close, 1); if (fip == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); return; } fip->req = req; fip->inum = ino; fip->fi = *fi; fi->fh = xfuse_handle_to_fuse_handle(NULL); /* * If this call succeeds, further request processing happens in * xfuse_devredir_cb_file_close() */ if (devredir_file_close(fip, xinode->device_id, handle->FileId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_close_file() cmd"); fuse_reply_err(req, EREMOTEIO); free(fip); } xfuse_handle_delete(handle); } } /** * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_read(fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi) { XFUSE_HANDLE *fh; struct state_read *fusep; XFS_INODE *xinode; struct req_list_item *rli; LOG_DEVEL(LOG_LEVEL_DEBUG, "want_bytes %zd bytes at off %lld", size, (long long) off); if ((fh = xfuse_handle_from_fuse_handle(fi->fh)) == NULL) { fuse_reply_err(req, EINVAL); } else if (fh->is_loc_resource) { /* target file is in .clipboard dir */ LOG_DEVEL(LOG_LEVEL_DEBUG, "target file is in .clipboard dir"); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "ino does not exist in xrdp_fs"); fuse_reply_buf(req, 0, 0); return; } rli = g_new0(struct req_list_item, 1); rli->stream_id = 0; rli->req = req; rli->lindex = xinode->lindex; rli->off = off; rli->size = size; list_add_item(g_req_list, (tbus) rli); if (g_req_list->count == 1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "requesting clipboard file data lindex = %d off = %lld size = %zd", rli->lindex, (long long) off, size); clipboard_request_file_data(rli->stream_id, rli->lindex, (int) off, (int) size); } } else { /* target file is on a remote device */ fusep = g_new0(struct state_read, 1); if (fusep == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); } else { fusep->req = req; /* * If this call succeeds, further request processing happens in * xfuse_devredir_cb_read_file() */ devredir_file_read(fusep, fh->DeviceId, fh->FileId, size, off); } } } /** * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_write(fuse_req_t req, fuse_ino_t ino, const char *buf, size_t size, off_t off, struct fuse_file_info *fi) { XFUSE_HANDLE *fh; struct state_write *fusep; LOG_DEVEL(LOG_LEVEL_DEBUG, "write %zd bytes at off %lld to inode=%ld", size, (long long) off, ino); if ((fh = xfuse_handle_from_fuse_handle(fi->fh)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "file handle fi->fh is NULL"); fuse_reply_err(req, EINVAL); } else if (fh->is_loc_resource) { /* target file is in .clipboard dir */ LOG_DEVEL(LOG_LEVEL_DEBUG, "THIS IS STILL A TODO!"); fuse_reply_err(req, EROFS); } else { /* target file is on a remote device */ fusep = g_new0(struct state_write, 1); if (fusep == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); } else { fusep->req = req; fusep->inum = ino; /* * If this call succeeds, further request processing happens in * xfuse_devredir_cb_write_file() */ devredir_file_write(fusep, fh->DeviceId, fh->FileId, buf, size, off); } } } /** *****************************************************************************/ /* * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately */ static void xfuse_cb_create(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode, struct fuse_file_info *fi) { LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: parent_inode=%ld, name=%s fi=%p", parent, name, fi); xfuse_create_dir_or_file(req, parent, name, mode & ~S_IFDIR, fi); } /** *****************************************************************************/ #if 0 static void xfuse_cb_fsync(fuse_req_t req, fuse_ino_t ino, int datasync, struct fuse_file_info *fi) { LOG_DEVEL(LOG_LEVEL_DEBUG, "#################### entered: ino=%ld datasync=%d", ino, datasync); LOG_DEVEL(LOG_LEVEL_DEBUG, "function not required"); fuse_reply_err(req, EINVAL); } #endif /** * Sets attributes for a directory entry. * * If the file resides on a remote share, devredir * is asked to update it. This will result in the following * callbacks:- * - xfuse_devredir_cb_setattr() to update our copy and return status * * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, struct fuse_file_info *fi) { XFS_INODE *xinode; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered to_set=0x%x", to_set); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if (((to_set & FUSE_SET_ATTR_UID) && attr->st_uid != xinode->uid) || ((to_set & FUSE_SET_ATTR_GID) && attr->st_gid != xinode->gid)) { /* We don't allow any of these */ fuse_reply_err(req, EPERM); } else if ((to_set & FUSE_SET_ATTR_MODE) && (attr->st_mode & ~(0777 | S_IFDIR | S_IFREG)) != 0) { /* We only support standard mode bits and S_IFDIR / S_IFREG */ LOG_DEVEL(LOG_LEVEL_ERROR, "Asking for invalid mode bits 0%o to be set", attr->st_mode); fuse_reply_err(req, EINVAL); } else { struct file_attr attrs = {0}; tui32 change_mask = 0; if ((to_set & FUSE_SET_ATTR_MODE) && xinode->mode != attr->st_mode) { attrs.mode = attr->st_mode & (0777 | S_IFDIR | S_IFREG); change_mask |= TO_SET_MODE; } if ((to_set & FUSE_SET_ATTR_SIZE) && xinode->size != attr->st_size) { attrs.size = attr->st_size; change_mask |= TO_SET_SIZE; } if ((to_set & FUSE_SET_ATTR_ATIME) && xinode->atime != attr->st_atime) { attrs.atime = attr->st_atime; change_mask |= TO_SET_ATIME; } if ((to_set & FUSE_SET_ATTR_MTIME) && xinode->mtime != attr->st_mtime) { attrs.mtime = attr->st_mtime; change_mask |= TO_SET_MTIME; } if (change_mask == 0) { /* No changes have been made */ make_fuse_attr_reply(req, xinode); } else if (!xinode->is_redirected) { /* Update the local fs */ update_inode_file_attributes(&attrs, change_mask, xinode); make_fuse_attr_reply(req, xinode); } else { struct state_setattr *fip = g_new0(struct state_setattr, 1); char *full_path = xfs_get_full_path(g_xfs, ino); if (!full_path || !fip) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); fuse_reply_err(req, ENOMEM); free(fip); free(full_path); } else { const char *cptr; fip->req = req; fip->inum = ino; /* Save the important stuff so we can update our node if the * remote update is successful */ fip->fattr = attrs; fip->change_mask = change_mask; /* we want path minus 'root node of the share' */ cptr = filename_on_device(full_path); /* * If this call succeeds, further request processing happens * in xfuse_devredir_cb_setattr() */ if (devredir_setattr_for_entry(fip, xinode->device_id, cptr, &attrs, change_mask) < 0) { fuse_reply_err(req, EIO); free(fip); } free(full_path); } } } } /** * Get dir listing * * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_opendir(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { XFS_INODE *xinode; XFUSE_HANDLE *xhandle; LOG_DEVEL(LOG_LEVEL_DEBUG, "inode=%ld", ino); if ((xinode = xfs_get(g_xfs, ino)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "inode %ld is not valid", ino); fuse_reply_err(req, ENOENT); } else if (!xinode->is_redirected) { if ((xhandle = xfuse_handle_create()) == NULL) { fuse_reply_err(req, ENOMEM); } else { if ((xhandle->dir_handle = xfs_opendir(g_xfs, ino)) == NULL) { xfuse_handle_delete(xhandle); fuse_reply_err(req, ENOMEM); } else { fi->fh = xfuse_handle_to_fuse_handle(xhandle); fuse_reply_open(req, fi); } } } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "did not find entry; redirecting call to devredir"); struct state_dirscan *fip = g_new0(struct state_dirscan, 1); char *full_path = xfs_get_full_path(g_xfs, ino); if (full_path == NULL || fip == NULL) { fuse_reply_err(req, ENOMEM); free(fip); free(full_path); } else { const char *cptr; LOG_DEVEL(LOG_LEVEL_DEBUG, "dev_id=%d ino=%ld full_path=%s", xinode->device_id, ino, full_path); fip->req = req; fip->pinum = ino; fip->fi = *fi; /* we want path minus 'root node of the share' */ cptr = filename_on_device(full_path); /* * If this call succeeds, further request processing happens in:- * - xfuse_devredir_cb_enum_dir_add_entry() * Called for every file in the directory * - xfuse_devredir_cb_enum_dir_done() * Called at the end of the directory scan */ if (devredir_get_dir_listing(fip, xinode->device_id, cptr)) { LOG_DEVEL(LOG_LEVEL_ERROR, "failed to send devredir_get_dir_listing() cmd"); fuse_reply_buf(req, NULL, 0); free(fip); } free(full_path); } } } /** * GOTCHA : For FUSE 2.9 at least, the 'fi' parameter is allocated on the * stack by the caller, so must be copied if we're not using it * to reply to FUSE immediately *****************************************************************************/ static void xfuse_cb_releasedir(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { XFUSE_HANDLE *xhandle = xfuse_handle_from_fuse_handle(fi->fh); xfs_closedir(g_xfs, xhandle->dir_handle); xhandle->dir_handle = NULL; xfuse_handle_delete(xhandle); fuse_reply_err(req, 0); } /****************************************************************************** * miscellaneous functions *****************************************************************************/ static void xfs_inode_to_fuse_entry_param(const XFS_INODE *xinode, struct fuse_entry_param *e) { memset(e, 0, sizeof(*e)); e->ino = xinode->inum; e->attr_timeout = XFUSE_ATTR_TIMEOUT; e->entry_timeout = XFUSE_ENTRY_TIMEOUT; e->attr.st_ino = xinode->inum; e->attr.st_mode = xinode->mode & ~g_cfg->file_umask; e->attr.st_nlink = 1; e->attr.st_uid = xinode->uid; e->attr.st_gid = xinode->gid; e->attr.st_size = xinode->size; e->attr.st_atime = xinode->atime; e->attr.st_mtime = xinode->mtime; e->attr.st_ctime = xinode->ctime; e->generation = xinode->generation; } static void make_fuse_entry_reply(fuse_req_t req, const XFS_INODE *xinode) { struct fuse_entry_param e; xfs_inode_to_fuse_entry_param(xinode, &e); fuse_reply_entry(req, &e); } static void make_fuse_attr_reply(fuse_req_t req, const XFS_INODE *xinode) { struct stat st; memset(&st, 0, sizeof(st)); st.st_ino = xinode->inum; st.st_mode = xinode->mode & ~g_cfg->file_umask; st.st_nlink = 1; st.st_uid = xinode->uid; st.st_gid = xinode->gid; st.st_size = xinode->size; st.st_atime = xinode->atime; st.st_mtime = xinode->mtime; st.st_ctime = xinode->ctime; fuse_reply_attr(req, &st, XFUSE_ATTR_TIMEOUT); } /* * Get the name of a file on the device * * For redirected devices, the routine xfs_get_full_path() returns names * like "/C:/Windows/System32". * This routine simply returns a pointer to the part of the name following * the device specification. */ static const char *filename_on_device(const char *full_path) { const char *result = NULL; if (full_path[0] != '\0') { result = strchr(full_path + 1, '/'); } return result ? result : "/"; } /* * Updates attributes on the filesystem, and bumps the inode ctime * * This call is used to set attributes, either locally, or following a * setattr devredir call */ static void update_inode_file_attributes(const struct file_attr *fattr, tui32 change_mask, XFS_INODE *xinode) { int updated = 0; if ((change_mask & TO_SET_MODE) != 0 && xinode->mode != fattr->mode) { xinode->mode = fattr->mode; updated = 1; } if ((change_mask & TO_SET_SIZE) != 0 && xinode->size != fattr->size) { xinode->size = fattr->size; updated = 1; } if ((change_mask & TO_SET_ATIME) != 0 && xinode->atime != fattr->atime) { xinode->atime = fattr->atime; updated = 1; } if ((change_mask & TO_SET_MTIME) != 0 && xinode->mtime != fattr->mtime) { xinode->mtime = fattr->mtime; updated = 1; } if (updated) { xinode->ctime = time(0); } } /* * Gets the name for a file where we know the parent inode and the * name for the file under that inode * * Result must be freed after use */ static char *get_name_for_entry_in_parent(fuse_ino_t parent, const char *name) { char *result; if ((result = xfs_get_full_path(g_xfs, parent)) != NULL) { char *p = (char *) realloc(result, strlen(result) + 1 + strlen(name) + 1); if (p == NULL) { /* See cppcheck trac #9292 and #9437 */ /* cppcheck-suppress doubleFree symbolName=result */ free(result); result = NULL; } else { result = p; strcat(result, "/"); strcat(result, name); } } return result; } /* * Scans a user-provided string substituting %u/%U/ for UID/username * and %d/%D fordisplaynumber/DISPLAY */ static unsigned int format_user_info(char *dest, unsigned int len, const char *format) { char uidstr[64]; char username[64]; char display[64]; char displaynum[64]; const struct info_string_tag map[] = { {'u', uidstr}, {'U', username}, {'d', displaynum}, {'D', display}, INFO_STRING_END_OF_LIST }; int uid = g_getuid(); g_snprintf(uidstr, sizeof(uidstr), "%d", uid); if (g_getlogin(username, sizeof(username)) != 0) { /* Fall back to UID */ g_strncpy(username, uidstr, sizeof(username) - 1); } if (getenv("DISPLAY") == NULL) { /* if environment variable is not set, set it to empty string */ display[0] = '\0'; displaynum[0] = '\0'; } else { g_strncpy(display, getenv("DISPLAY"), sizeof(display) - 1); g_snprintf(displaynum, sizeof(displaynum), "%d", g_get_display_num_from_display(display)); } return g_format_info_string(dest, len, format, map); } #endif /* end else #ifndef XRDP_FUSE */ xrdp-0.10.1/sesman/chansrv/smartcard.c000644 001751 000000 00000236374 14652432047 017732 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * Copyright (C) Jay Sorg 2013 jay.sorg@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * @file sesman/chansrv/smartcard.c * * smartcard redirection support * * This file implements some of the PDUs detailed in [MS-RDPESC]. * * The PDUs use DCE IDL structs. These are required to be re-interpreted * in DCE NDR (Netword Data Representation) * * For more information on this subject see DCE publication C706 * "DCE 1.1: Remote Procedure Call" 1997. In particular:- * Section 4.2 : Describes the IDL * Section 14 : Describes the NDR */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "os_calls.h" #include "string_calls.h" #include "smartcard.h" #include "log.h" #include "irp.h" #include "devredir.h" #include "smartcard_pcsc.h" #include "chansrv.h" /* * TODO * * o ensure that all wide calls are handled correctly * * o need to query client for build number and determine whether we should use * SCREDIR_VERSION_XP or SCREDIR_VERSION_LONGHORN * * o need to call scard_release_resources() * * o why is win 7 sending SCARD_IOCTL_ACCESS_STARTED_EVENT first * 0000 00 01 00 00 04 00 00 00 e0 00 09 00 00 00 00 00 ................ * 0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ * 0020 28 b7 9d 02 */ /* * Notes: * * XP and Server 2003 use version SCREDIR_VERSION_XP functions 5 - 58 * Vista and Server 2008 use version SCREDIR_VERSION_LONGHORN functions 5 - 64 * if TS Client's build number is >= 4,034 use SCREDIR_VERSION_LONGHORN */ /* [MS-RDPESC] 3.1.4 */ #define SCARD_IOCTL_ESTABLISH_CONTEXT 0x00090014 /* EstablishContext */ #define SCARD_IOCTL_RELEASE_CONTEXT 0x00090018 /* ReleaseContext */ #define SCARD_IOCTL_IS_VALID_CONTEXT 0x0009001C /* IsValidContext */ #define SCARD_IOCTL_LIST_READER_GROUPS 0x00090020 /* ListReaderGroups */ #define SCARD_IOCTL_LIST_READERS_A 0x00090028 /* ListReaders ASCII */ #define SCARD_IOCTL_LIST_READERS_W 0x0009002C /* ListReaders Wide */ #define SCARD_IOCTL_INTRODUCE_READER_GROUP 0x00090050 /* IntroduceReaderGroup */ #define SCARD_IOCTL_FORGET_READER_GROUP 0x00090058 /* ForgetReader */ #define SCARD_IOCTL_INTRODUCE_READER 0x00090060 /* IntroduceReader */ #define SCARD_IOCTL_FORGET_READER 0x00090068 /* IntroduceReader */ #define SCARD_IOCTL_ADD_READER_TO_GROUP 0x00090070 /* AddReaderToGroup */ #define SCARD_IOCTL_REMOVE_READER_FROM_GROUP 0x00090078 /* RemoveReaderFromGroup*/ #define SCARD_IOCTL_GET_STATUS_CHANGE_A 0x000900A0 /* GetStatusChangeA */ #define SCARD_IOCTL_GET_STATUS_CHANGE_W 0x000900A4 /* GetStatusChangeW */ #define SCARD_IOCTL_CANCEL 0x000900A8 /* Cancel */ #define SCARD_IOCTL_CONNECT_A 0x000900AC /* ConnectA */ #define SCARD_IOCTL_CONNECT_W 0x000900B0 /* ConnectW */ #define SCARD_IOCTL_RECONNECT 0x000900B4 /* Reconnect */ #define SCARD_IOCTL_DISCONNECT 0x000900B8 /* Disconnect */ #define SCARD_IOCTL_BEGIN_TRANSACTION 0x000900BC /* BeginTransaction */ #define SCARD_IOCTL_END_TRANSACTION 0x000900C0 /* EndTransaction */ #define SCARD_IOCTL_STATE 0x000900C4 /* State */ #define SCARD_IOCTL_STATUS_A 0x000900C8 /* StatusA */ #define SCARD_IOCTL_STATUS_W 0x000900CC /* StatusW */ #define SCARD_IOCTL_TRANSMIT 0x000900D0 /* Transmit */ #define SCARD_IOCTL_CONTROL 0x000900D4 /* Control */ #define SCARD_IOCTL_GETATTRIB 0x000900D8 /* GetAttrib */ #define SCARD_IOCTL_SETATTRIB 0x000900DC /* SetAttrib */ #define SCARD_IOCTL_ACCESS_STARTED_EVENT 0x000900E0 /* SCardAccessStartedEvent */ #define SCARD_IOCTL_LOCATE_CARDS_BY_ATR 0x000900E8 /* LocateCardsByATR */ /* scope used in EstablishContextCall */ #define SCARD_SCOPE_USER 0x00000000 #define SCARD_SCOPE_TERMINAL 0x00000001 #define SCARD_SCOPE_SYSTEM 0x00000002 /* disposition - action to take on card */ #define SCARD_LEAVE_CARD 0x00000000 #define SCARD_RESET_CARD 0x00000001 #define SCARD_UNPOWER_CARD 0x00000002 #define SCARD_EJECT_CARD 0x00000003 #define MAX_SMARTCARDS 16 /* stores info about a smart card */ typedef struct smartcard { tui32 DeviceId; } SMARTCARD; /* globals */ SMARTCARD *smartcards[MAX_SMARTCARDS]; int g_smartcards_inited = 0; static tui32 g_device_id = 0; static int g_scard_index = 0; /* externs */ extern tui32 g_completion_id; extern int g_rdpdr_chan_id; /* in chansrv.c */ /****************************************************************************** ** static functions local to this file ** ******************************************************************************/ static struct stream *scard_make_new_ioctl(IRP *irp, tui32 ioctl); static int scard_add_new_device(tui32 device_id); static int scard_get_free_slot(void); static void scard_release_resources(void); static void scard_send_EstablishContext(IRP *irp, int scope); static void scard_send_ReleaseContext(IRP *irp, char *context, int context_bytes); static void scard_send_IsContextValid(IRP *irp, char *context, int context_bytes); static void scard_send_ListReaders(IRP *irp, char *context, int context_bytes, char *groups, int cchReaders, int wide); static void scard_send_GetStatusChange(IRP *irp, char *context, int context_bytes, int wide, tui32 timeout, tui32 num_readers, READER_STATE *rsa); static void scard_send_Connect(IRP *irp, char *context, int context_bytes, int wide, READER_STATE *rs); static void scard_send_Reconnect(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, READER_STATE *rs); static void scard_send_BeginTransaction(IRP *irp, char *context, int context_bytes, char *card, int card_bytes); static void scard_send_EndTransaction(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, tui32 dwDisposition); static void scard_send_Status(IRP *irp, int wide, char *context, int context_bytes, char *card, int card_bytes, int cchReaderLen, int cbAtrLen); static void scard_send_Disconnect(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, int dwDisposition); static int scard_send_Transmit(IRP *irp, char *context, int context_byte, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, struct xrdp_scard_io_request *send_ior, struct xrdp_scard_io_request *recv_ior); static int scard_send_Control(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, int control_code); static int scard_send_Cancel(IRP *irp, char *context, int context_bytes); static int scard_send_GetAttrib(IRP *irp, char *card, int card_bytes, READER_STATE *rs); /****************************************************************************** ** local callbacks into this module ** ******************************************************************************/ static void scard_handle_EstablishContext_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_ReleaseContext_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_IsContextValid_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_ListReaders_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_GetStatusChange_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Connect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Reconnect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_BeginTransaction_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_EndTransaction_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Status_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Disconnect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Transmit_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Control_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_Cancel_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); static void scard_handle_GetAttrib_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus); /****************************************************************************** ** ** ** externally accessible functions, defined in smartcard.h ** ** ** ******************************************************************************/ /** *****************************************************************************/ void scard_device_announce(tui32 device_id) { LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: device_id=%d", device_id); if (g_smartcards_inited) { LOG_DEVEL(LOG_LEVEL_ERROR, "already init"); return; } g_memset(&smartcards, 0, sizeof(smartcards)); g_smartcards_inited = 1; g_device_id = device_id; g_scard_index = scard_add_new_device(device_id); if (g_scard_index < 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_add_new_device failed with DeviceId=%d", g_device_id); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "added smartcard with DeviceId=%d to list", g_device_id); } } /** * *****************************************************************************/ int scard_get_wait_objs(tbus *objs, int *count, int *timeout) { return scard_pcsc_get_wait_objs(objs, count, timeout); } /** * *****************************************************************************/ int scard_check_wait_objs(void) { return scard_pcsc_check_wait_objs(); } /** * *****************************************************************************/ int scard_init(void) { LOG_DEVEL(LOG_LEVEL_INFO, "scard_init:"); return scard_pcsc_init(); } /** * *****************************************************************************/ int scard_deinit(void) { LOG_DEVEL(LOG_LEVEL_INFO, "scard_deinit:"); scard_pcsc_deinit(); scard_release_resources(); g_smartcards_inited = 0; return 0; } /** * *****************************************************************************/ int scard_send_establish_context(void *user_data, int scope) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_EstablishContext_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_EstablishContext(irp, scope); return 0; } /** * Release a previously established Smart Card context *****************************************************************************/ int scard_send_release_context(void *user_data, char *context, int context_bytes) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_ReleaseContext_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_ReleaseContext(irp, context, context_bytes); return 0; } /** * Checks if a previously established context is still valid *****************************************************************************/ int scard_send_is_valid_context(void *user_data, char *context, int context_bytes) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_IsContextValid_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_IsContextValid(irp, context, context_bytes); return 0; } /** * *****************************************************************************/ int scard_send_list_readers(void *user_data, char *context, int context_bytes, char *groups, int cchReaders, int wide) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_ListReaders_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_ListReaders(irp, context, context_bytes, groups, cchReaders, wide); return 0; } /** * Send get change in status command * * @param con connection to client * @param wide TRUE if unicode string * @param timeout timeout in milliseconds, -1 for infinity * @param num_readers number of entries in rsa * @param rsa array of READER_STATEs *****************************************************************************/ int scard_send_get_status_change(void *user_data, char *context, int context_bytes, int wide, tui32 timeout, tui32 num_readers, READER_STATE *rsa) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_GetStatusChange_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_GetStatusChange(irp, context, context_bytes, wide, timeout, num_readers, rsa); return 0; } /** * Open a connection to the smart card located in the reader * * @param con connection to client * @param wide TRUE if unicode string *****************************************************************************/ int scard_send_connect(void *user_data, char *context, int context_bytes, int wide, READER_STATE *rs) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Connect_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Connect(irp, context, context_bytes, wide, rs); return 0; } /** * The reconnect method re-establishes a smart card reader handle. On success, * the handle is valid once again. * * @param con connection to client * @param sc_handle handle to device * @param rs reader state where following fields are set * rs.shared_mode_flag * rs.preferred_protocol * rs.init_type *****************************************************************************/ int scard_send_reconnect(void *user_data, char *context, int context_bytes, char *card, int card_bytes, READER_STATE *rs) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Reconnect_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Reconnect(irp, context, context_bytes, card, card_bytes, rs); return 0; } /** * Lock smart card reader for exclusive access for specified smart * card reader handle. * * @param con connection to client *****************************************************************************/ int scard_send_begin_transaction(void *user_data, char *context, int context_bytes, char *card, int card_bytes) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_BeginTransaction_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_BeginTransaction(irp, context, context_bytes, card, card_bytes); return 0; } /** * Release a smart card reader after being locked by a previously * successful call to Begin Transaction * * @param con connection to client * @param sc_handle handle to smartcard *****************************************************************************/ int scard_send_end_transaction(void *user_data, char *context, int context_bytes, char *card, int card_bytes, tui32 dwDisposition) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_EndTransaction_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_EndTransaction(irp, context, context_bytes, card, card_bytes, dwDisposition); return 0; } /** * Get the status of a connection for a valid smart card reader handle * * @param con connection to client * @param wide TRUE if unicode string *****************************************************************************/ int scard_send_status(void *user_data, int wide, char *context, int context_bytes, char *card, int card_bytes, int cchReaderLen, int cbAtrLen) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Status_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Status(irp, wide, context, context_bytes, card, card_bytes, cchReaderLen, cbAtrLen); return 0; } /** * Release a smart card reader handle that was acquired in ConnectA/ConnectW * * @param con connection to client * @param sc_handle handle to smartcard *****************************************************************************/ int scard_send_disconnect(void *user_data, char *context, int context_bytes, char *card, int card_bytes, int dwDisposition) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Disconnect_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Disconnect(irp, context, context_bytes, card, card_bytes, dwDisposition); return 0; } /** * The Transmit_Call structure is used to send data to the smart card * associated with a valid context. *****************************************************************************/ int scard_send_transmit(void *user_data, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, struct xrdp_scard_io_request *send_ior, struct xrdp_scard_io_request *recv_ior) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Transmit_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Transmit(irp, context, context_bytes, card, card_bytes, send_data, send_bytes, recv_bytes, send_ior, recv_ior); return 0; } /** * Communicate directly with the smart card reader *****************************************************************************/ int scard_send_control(void *user_data, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, int control_code) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Control_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Control(irp, context, context_bytes, card, card_bytes, send_data, send_bytes, recv_bytes, control_code); return 0; } /** * Cancel any outstanding calls *****************************************************************************/ int scard_send_cancel(void *user_data, char *context, int context_bytes) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_Cancel_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_Cancel(irp, context, context_bytes); return 0; } /** * Get reader attributes *****************************************************************************/ int scard_send_get_attrib(void *user_data, char *card, int card_bytes, READER_STATE *rs) { IRP *irp; /* setup up IRP */ if ((irp = devredir_irp_new()) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return 1; } irp->scard_index = g_scard_index; irp->CompletionId = g_completion_id++; irp->DeviceId = g_device_id; irp->callback = scard_handle_GetAttrib_Return; irp->user_data = user_data; /* send IRP to client */ scard_send_GetAttrib(irp, card, card_bytes, rs); return 0; } /****************************************************************************** ** ** ** static functions local to this file ** ** ** ******************************************************************************/ /** * Create a new stream and insert specified IOCTL * * @param irp information about the I/O * @param ioctl the IOCTL code * * @return stream with IOCTL inserted in it, NULL on error *****************************************************************************/ static struct stream * scard_make_new_ioctl(IRP *irp, tui32 ioctl) { /* * format of device control request * * DeviceIoRequest * u16 RDPDR_CTYP_CORE * u16 PAKID_CORE_DEVICE_IOREQUEST * u32 DeviceId * u32 FileId * u32 CompletionId * u32 MajorFunction * u32 MinorFunction * * u32 OutputBufferLength SHOULD be 2048 * u32 InputBufferLength * u32 IoControlCode * 20 bytes padding * xx bytes InputBuffer (variable) */ struct stream *s; xstream_new(s, 1024 * 4); devredir_insert_DeviceIoRequest(s, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_DEVICE_CONTROL, IRP_MN_NONE); xstream_wr_u32_le(s, 2048); /* OutputBufferLength */ s_push_layer(s, iso_hdr, 4); /* InputBufferLength - insert later */ xstream_wr_u32_le(s, ioctl); /* Ioctl Code */ out_uint8s(s, 20); /* padding */ /* [MS-RPCE] 2.2.6.1 */ xstream_wr_u32_le(s, 0x00081001); /* len 8, LE, v1 */ xstream_wr_u32_le(s, 0xcccccccc); /* filler */ return s; } /** * Create a new smart card device entry and insert it into smartcards[] * * @param device_id DeviceId of new card * * @return index into smartcards[] on success, -1 on failure *****************************************************************************/ static int scard_add_new_device(tui32 device_id) { int index; SMARTCARD *sc; if ((index = scard_get_free_slot()) < 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_get_free_slot failed"); return -1; } sc = g_new0(SMARTCARD, 1); if (sc == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory"); return -1; } sc->DeviceId = device_id; smartcards[index] = sc; return index; } /** * Find first unused entry in smartcards * * @return index of first unused entry in smartcards or -1 if smartcards * is full *****************************************************************************/ static int scard_get_free_slot(void) { int i; for (i = 0; i < MAX_SMARTCARDS; i++) { if (smartcards[i] == NULL) { LOG_DEVEL(LOG_LEVEL_DEBUG, "found free slot at index %d", i); return i; } } LOG_DEVEL(LOG_LEVEL_ERROR, "too many smart card devices; rejecting this one"); return -1; } /** * Release resources prior to shutting down *****************************************************************************/ static void scard_release_resources(void) { int i; for (i = 0; i < MAX_SMARTCARDS; i++) { if (smartcards[i] != NULL) { g_free(smartcards[i]); smartcards[i] = NULL; } } } /** * *****************************************************************************/ static void scard_send_EstablishContext(IRP *irp, int scope) { struct stream *s; int bytes; if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_ESTABLISH_CONTEXT)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, scope); out_uint32_le(s, 0x00000000); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * Release a previously established Smart Card context *****************************************************************************/ static void scard_send_ReleaseContext(IRP *irp, char *context, int context_bytes) { /* see [MS-RDPESC] 3.1.4.2 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_RELEASE_CONTEXT)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * Checks if a previously established context is still valid *****************************************************************************/ static void scard_send_IsContextValid(IRP *irp, char *context, int context_bytes) { /* see [MS-RDPESC] 3.1.4.3 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_IS_VALID_CONTEXT)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } /* * command format * * ...... * 20 bytes padding * u32 4 bytes len 8, LE, v1 * u32 4 bytes filler * 16 bytes unused (s->p currently pointed here at unused[0]) * u32 4 bytes context len * u32 4 bytes context */ s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /*****************************************************************************/ static void align_s(struct stream *s, unsigned int boundary) { unsigned int over = (unsigned int)(s->p - s->data) % boundary; if (over != 0) { out_uint8s(s, boundary - over); } } /** * *****************************************************************************/ static void scard_send_ListReaders(IRP *irp, char *context, int context_bytes, char *groups, int cchReaders, int wide) { /* see [MS-RDPESC] 2.2.2.4 * * IDL:- * * typedef struct _REDIR_SCARDCONTEXT { * [range(0,16)] unsigned long cbContext; * [unique] [size_is(cbContext)] byte *pbContext; * } REDIR_SCARDCONTEXT; * * struct _ListReaders_Call { * REDIR_SCARDCONTEXT Context; * [range(0, 65536)] unsigned long cBytes; * [unique] [size_is(cBytes)] const byte *mszGroups; * long fmszReadersIsNULL; * unsigned long cchReaders; * } ListReaders_Call; * * Type summary:- * * Context.cbContext Unsigned 32-bit word * Context.pbContext Embedded full pointer to conformant array of bytes * cBytes Unsigned 32-bit word * mszGroups Embedded full pointer to conformant array of bytes * fmszReaders 32-bit word * cchReaders Unsigned 32-bit word * * NDL:- * * Offset Decription * 0 Context.cbContext * 4 Referent Identifier for pbContext * 8 cBytes * 12 Referent Identifier for mszGroups (or NULL) * 16 fmszReadersIsNULL * 20 cchReaders * 24 Conformant Array pointed to by pbContext * ?? Conformant Array pointed to by mszGroups * */ SMARTCARD *sc; struct stream *s; int bytes; int bytes_groups = 0; // Length of NDR for groups + 2 terminators int val = 0; // Referent Id for mszGroups (assume NULL) int groups_len = 0; // strlen(groups) tui32 ioctl; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } ioctl = (wide) ? SCARD_IOCTL_LIST_READERS_W : SCARD_IOCTL_LIST_READERS_A; if ((s = scard_make_new_ioctl(irp, ioctl)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } if (groups != NULL && *groups != '\0') { groups_len = g_strlen(groups); if (wide) { bytes_groups = (utf8_as_utf16_word_count(groups, groups_len) + 2) * 2; } else { bytes_groups = groups_len + 2; } val = 0x00020004; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); // REDIR_SCARDCONTEXT Context; out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); // [range(0, 65536)] unsigned long cBytes; out_uint32_le(s, bytes_groups); // [unique] [size_is(cBytes)] const byte *mszGroups; (pointer) out_uint32_le(s, val); // long fmszReadersIsNULL; out_uint32_le(s, 0x00000000); // unsigned long cchReaders; out_uint32_le(s, cchReaders); // At the end of the struct come the pointed-to structures // Context field pbContext is a Uni-dimensional conformant array out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); // mszGroups is also a Uni-dimensional conformant array of bytes if (bytes_groups > 0) { align_s(s, 4); out_uint32_le(s, bytes_groups); if (wide) { out_utf8_as_utf16_le(s, groups, groups_len); out_uint16_le(s, 0); out_uint16_le(s, 0); } else { out_uint8p(s, groups, groups_len); out_uint8(s, 0); out_uint8(s, 0); } } s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "scard_send_ListReaders:", s->data, bytes); free_stream(s); } /*****************************************************************************/ /** * Outputs the pointed-to-data for one of these IDL pointer types:- * [string] const wchar_t* str; (wide != 0) * [string] const char* str; (wide == 0) * * It is assumed that the referent identifier for the string has already * been sent * * @param s Output stream * @param str UTF-8 string to output * @param wide Whether to output as a wide string or ASCII * * Note that wchar_t on Windows is 16-bit * TODO: These strings have two terminators. Is this necessary? */ static void out_conformant_and_varying_string(struct stream *s, const char *str, int wide) { align_s(s, 4); unsigned int len = strlen(str); if (wide) { unsigned int num_chars = utf8_as_utf16_word_count(str, len); // Max number, offset and actual count out_uint32_le(s, num_chars + 2); out_uint32_le(s, 0); out_uint32_le(s, num_chars + 2); out_utf8_as_utf16_le(s, str, len); out_uint16_le(s, 0); // Terminate string out_uint16_le(s, 0); // ? } else { out_uint32_le(s, len + 2); out_uint32_le(s, 0); out_uint32_le(s, len + 2); out_uint8p(s, str, len); out_uint8(s, 0); out_uint8(s, 0); } } /** * Get change in status * * @param irp I/O resource pkt * @param wide TRUE if unicode string * @param timeout timeout in milliseconds, -1 for infinity * @param num_readers number of entries in rsa * @param rsa array of READER_STATEs *****************************************************************************/ static void scard_send_GetStatusChange(IRP *irp, char *context, int context_bytes, int wide, tui32 timeout, tui32 num_readers, READER_STATE *rsa) { /* see [MS-RDPESC] 2.2.2.11 for ASCII * see [MS-RDPESC] 2.2.2.12 for Wide char * * Here is a breakdown of the Wide-char variant * * IDL:- * * typedef struct _REDIR_SCARDCONTEXT { * [range(0,16)] unsigned long cbContext; * [unique] [size_is(cbContext)] byte *pbContext; * } REDIR_SCARDCONTEXT; * * typedef struct _ReaderState_Common_Call { * unsigned long dwCurrentState; * unsigned long dwEventState; * [range(0,36)] unsigned long cbAtr; * byte rgbAtr[36]; * } ReaderState_Common_Call; * * typedef struct _ReaderStateW { * [string] const wchar_t* szReader; * ReaderState_Common_Call Common; * } ReaderStateW; * * struct _GetStatusChangeW_Call { * REDIR_SCARDCONTEXT Context; * unsigned long dwTimeOut; * [range(0,11)] unsigned long cReaders; * [size_is(cReaders)] ReaderStateW* rgReaderStates; * } GetStatusChangeW_Call; * * Type summary:- * * Context.cbContext Unsigned 32-bit word * Context.pbContext Embedded full pointer to conformant array of bytes * dwTimeOut Unsigned 32-bit word * cReaders Unsigned 32-bit word * rgReaderStates * Embedded full pointer to array of rgReaderStates * rgReaderStates.szReader * Embedded full pointer to conformant and varying * string of [Windows] wchar_t * rgReaderStates.Common.dwCurrentState * Unsigned 32-bit word * rgReaderStates.Common.dwEventState * Unsigned 32-bit word * rgReaderStates.Common.cbAtr * Unsigned 32-bit word * rgReaderStates.Common.rgbAtr[36] * Uni-dimensional fixed array * * NDL:- * Offset Decription * 0 Context.cbContext * 4 Referent Identifier for pbContext * 8 dwTimeOut; * 12 cReaders; * 16 Referent Identifier for rgReaderStates * 20 Conformant Array pointed to by pbContext * ?? Conformant Array pointed to by rgReaderStates. Each element * of this array has a pointer to a string for the name * ?? String names pointed to in the above array. */ SMARTCARD *sc; READER_STATE *rs; struct stream *s; tui32 ioctl; int bytes; unsigned int i; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } ioctl = (wide) ? SCARD_IOCTL_GET_STATUS_CHANGE_W : SCARD_IOCTL_GET_STATUS_CHANGE_A; if ((s = scard_make_new_ioctl(irp, ioctl)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); // REDIR_SCARDCONTEXT Context; out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); // unsigned long dwTimeOut; out_uint32_le(s, timeout); // [range(0,11)] unsigned long cReaders; out_uint32_le(s, num_readers); // [size_is(cReaders)] ReaderStateW* rgReaderStates; out_uint32_le(s, 0x00020004); // At the end of the struct come the pointed-to structures // Context field pbContext is a Uni-dimensional conformant array out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); // rgReaderState is a Uni-dimensional conformant array align_s(s, 4); out_uint32_le(s, num_readers); /* insert card reader state */ for (i = 0; i < num_readers; i++) { rs = &rsa[i]; // [string] const wchar_t* szReader (wide) // [string] const char_t* szReader (ASCII) out_uint32_le(s, 0x00020008 + (i * 4)); // unsigned long dwCurrentState; out_uint32_le(s, rs->current_state); // unsigned long dwEventState; out_uint32_le(s, rs->event_state); // [range(0,36)] unsigned long cbAtr; out_uint32_le(s, rs->atr_len); // byte rgbAtr[36]; out_uint8p(s, rs->atr, 33); out_uint8s(s, 3); } /* insert card reader names */ for (i = 0; i < num_readers; i++) { rs = &rsa[i]; out_conformant_and_varying_string(s, rs->reader_name, wide); } s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "scard_send_GetStatusChange:", s->data, bytes); free_stream(s); } /** * Send connect command * * @param irp I/O resource pkt * @param wide TRUE if unicode string * @param rs reader state *****************************************************************************/ static void scard_send_Connect(IRP *irp, char *context, int context_bytes, int wide, READER_STATE *rs) { /* see [MS-RDPESC] 2.2.2.13 for ASCII * see [MS-RDPESC] 2.2.2.14 for Wide char * * Here is a breakdown of the Wide-char variant * * IDL:- * * typedef struct _REDIR_SCARDCONTEXT { * [range(0,16)] unsigned long cbContext; * [unique] [size_is(cbContext)] byte *pbContext; * } REDIR_SCARDCONTEXT; * * typedef struct _Connect_Common { * REDIR_SCARDCONTEXT Context; * unsigned long dwShareMode; * unsigned long dwPreferredProtocols; * } Connect_Common; * * typedef struct _ConnectW_Call { * [string] const wchar_t* szReader; * Connect_Common Common; * } ConnectW_Call; * * Type summary:- * * szReader Embedded full pointer to conformant and varying * string of [Windows] wchar_t * Common.Context.cbContext * Unsigned 32-bit word * Common.Context.pbContext * Embedded full pointer to conformant array of bytes * Common.dwShareMode Unsigned 32-bit word * Common.dwPreferredProtocols * Unsigned 32-bit word * * NDL:- * * Offset Decription * 0 Referent Identifier for szReader * 4 Context.cbContext * 8 Referent Identifier for pbContext * 12 dwShareMode * 16 dwPreferredProtocols * 20 Conformant Array pointed to by szReader * ?? Conformant Array pointed to by pbContext * */ SMARTCARD *sc; struct stream *s; tui32 ioctl; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } ioctl = (wide) ? SCARD_IOCTL_CONNECT_W : SCARD_IOCTL_CONNECT_A; if ((s = scard_make_new_ioctl(irp, ioctl)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); // [string] const wchar_t* szReader; out_uint32_le(s, 0x00020000); // REDIR_SCARDCONTEXT Context; out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020004); // unsigned long dwShareMode; out_uint32_le(s, rs->dwShareMode); // unsigned long dwPreferredProtocols; out_uint32_le(s, rs->dwPreferredProtocols); /* insert card reader name */ out_conformant_and_varying_string(s, rs->reader_name, wide); /* insert context */ align_s(s, 4); out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); out_uint32_le(s, 0); // ? s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * The reconnect method re-establishes a smart card reader handle. On success, * the handle is valid once again. * * @param con connection to client * @param sc_handle handle to device * @param rs reader state where following fields are set * rs.shared_mode_flag * rs.preferred_protocol * rs.init_type *****************************************************************************/ static void scard_send_Reconnect(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, READER_STATE *rs) { /* see [MS-RDPESC] 2.2.2.15 */ /* see [MS-RDPESC] 3.1.4.36 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_RECONNECT)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } /* * command format * * ...... * 20 bytes padding * u32 4 bytes len 8, LE, v1 * u32 4 bytes filler * 24 bytes unused (s->p currently pointed here at unused[0]) * u32 4 bytes dwShareMode * u32 4 bytes dwPreferredProtocols * u32 4 bytes dwInitialization * u32 4 bytes context length * u32 4 bytes context * u32 4 bytes handle length * u32 4 bytes handle */ xstream_seek(s, 24); /* TODO */ out_uint32_le(s, rs->dwShareMode); out_uint32_le(s, rs->dwPreferredProtocols); out_uint32_le(s, rs->init_type); out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); s_mark_end(s); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * Lock smart card reader for exclusive access for specified smart * card reader handle. * * @param con connection to client *****************************************************************************/ static void scard_send_BeginTransaction(IRP *irp, char *context, int context_bytes, char *card, int card_bytes) { /* see [MS-RDPESC] 4.9 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_BEGIN_TRANSACTION)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); out_uint32_le(s, card_bytes); out_uint32_le(s, 0x00020004); out_uint32_le(s, 0x00000000); /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); /* insert card */ out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); out_uint32_le(s, 0x00000000); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * Release a smart card reader after being locked by a previously * successful call to Begin Transaction * * @param con connection to client * @param sc_handle handle to smartcard *****************************************************************************/ static void scard_send_EndTransaction(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, tui32 dwDisposition) { /* see [MS-RDPESC] 3.1.4.32 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_END_TRANSACTION)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); out_uint32_le(s, card_bytes); out_uint32_le(s, 0x00020004); out_uint32_le(s, dwDisposition); /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); /* insert card */ out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); out_uint32_le(s, 0); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * Get the status of a connection for a valid smart card reader handle * * @param con connection to client * @param wide TRUE if unicode string *****************************************************************************/ static void scard_send_Status(IRP *irp, int wide, char *context, int context_bytes, char *card, int card_bytes, int cchReaderLen, int cbAtrLen) { /* see [MS-RDPESC] 2.2.2.18 */ SMARTCARD *sc; struct stream *s; int bytes; tui32 ioctl; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } ioctl = wide ? SCARD_IOCTL_STATUS_W : SCARD_IOCTL_STATUS_A; if ((s = scard_make_new_ioctl(irp, ioctl)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl"); return; } /* 30 00 00 00 00 00 00 00 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 00 00 00 dwReaderLen 40 00 00 00 dwAtrLen 04 00 00 00 07 00 00 00 04 00 00 00 09 00 00 00 hCard 00 00 00 00 */ s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); out_uint32_le(s, card_bytes); out_uint32_le(s, 0x00020004); out_uint32_le(s, 0x00000001); out_uint32_le(s, cchReaderLen); /* readerLen, see [MS-RDPESC] 4.11 */ out_uint32_le(s, cbAtrLen); /* atrLen, see [MS-RDPESC] 4.11 */ /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); /* insert card */ out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); out_uint32_le(s, 0); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", s->data, bytes); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * Release a smart card reader handle that was acquired in ConnectA/ConnectW * * @param con connection to client * @param sc_handle handle to smartcard *****************************************************************************/ static void scard_send_Disconnect(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, int dwDisposition) { /* see [MS-RDPESC] 3.1.4.30 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_DISCONNECT)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl failed"); return; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); out_uint32_le(s, card_bytes); out_uint32_le(s, 0x00020004); out_uint32_le(s, dwDisposition); /* insert context */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); /* insert card */ out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); out_uint32_le(s, 0x00000000); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); } /** * The Transmit_Call structure is used to send data to the smart card * associated with a valid context. *****************************************************************************/ static int scard_send_Transmit(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, struct xrdp_scard_io_request *send_ior, struct xrdp_scard_io_request *recv_ior) { /* see [MS-RDPESC] 2.2.2.19 */ SMARTCARD *sc; struct stream *s; int bytes; int val; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_TRANSMIT)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl"); return 1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "send_bytes %d recv_bytes %d send dwProtocol %d cbPciLength %d " "extra_bytes %d recv dwProtocol %d cbPciLength %d extra_bytes %d", send_bytes, recv_bytes, send_ior->dwProtocol, send_ior->cbPciLength, send_ior->extra_bytes, recv_ior->dwProtocol, recv_ior->cbPciLength, recv_ior->extra_bytes); /* * command format * * ...... * 20 bytes padding * u32 4 bytes len 8, LE, v1 * u32 4 bytes filler * 12 bytes unused (s->p currently pointed here at unused[0]) * u32 4 bytes map0 * 4 bytes unused * u32 4 bytes map1 * u32 4 bytes dwProtocol * u32 4 bytes cbPciLength * u32 4 bytes map2 * u32 4 bytes cbSendLength * u32 4 bytes map3 * u32 4 bytes map4 * u32 4 bytes map5 * u32 4 bytes map6 * u32 4 bytes cbRecvLength * u32 4 bytes len of sc_handle * u32 4 bytes sc_handle */ //g_writeln("send_bytes %d", send_bytes); //g_writeln("recv_bytes %d", recv_bytes); #if 0 s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_be(s, 0x00000000); out_uint32_be(s, 0x04000000); out_uint32_be(s, 0x00000200); // map 0 out_uint32_be(s, 0x04000000); out_uint32_be(s, 0x04000200); // map 1 out_uint32_be(s, 0x01000000); out_uint32_be(s, 0x00000000); out_uint32_be(s, 0x00000000); //out_uint32_be(s, 0x05000000); out_uint32_le(s, send_bytes); out_uint32_be(s, 0x08000200); out_uint32_be(s, 0x0c000200); out_uint32_be(s, 0x00000000); //out_uint32_be(s, 0x02010000); out_uint32_le(s, recv_bytes); out_uint32_be(s, 0x04000000); out_uint32_be(s, 0x05000000); out_uint32_be(s, 0x04000000); out_uint32_be(s, 0x0b000000); //out_uint32_be(s, 0x05000000); //out_uint32_be(s, 0x00b00704); //out_uint32_be(s, 0x10000000); out_uint32_le(s, send_bytes); out_uint8p(s, send_data, send_bytes); align_s(s, 4); out_uint32_be(s, 0x01000000); out_uint32_be(s, 0x00000000); out_uint32_be(s, 0x00000000); #else //g_printf("send cbPciLength %d\n", send_ior->cbPciLength); //g_printf("send extra_bytes %d\n", send_ior->extra_bytes); //g_printf("recv cbPciLength %d\n", recv_ior->cbPciLength); //g_printf("recv extra_bytes %d\n", recv_ior->extra_bytes); s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); /* map0 */ out_uint32_le(s, card_bytes); out_uint32_le(s, 0x00020004); /* map1 */ out_uint32_le(s, send_ior->dwProtocol); out_uint32_le(s, send_ior->cbPciLength - 8); val = send_ior->extra_bytes > 0 ? 1 : 0; out_uint32_le(s, val); /* map2 */ out_uint32_le(s, send_bytes); val = send_bytes > 0 ? 0x00020008 : 0; out_uint32_le(s, val); /* map3 */ val = recv_ior->cbPciLength > 0 ? 0x0002000c : 0; out_uint32_le(s, val); /* map 4 */ out_uint32_le(s, 0); // map5 out_uint32_le(s, recv_bytes); /* map0 */ out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); /* map1 */ out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); if (send_ior->extra_bytes > 0) { out_uint32_le(s, send_ior->extra_bytes); out_uint8a(s, send_ior->extra_data, send_ior->extra_bytes); } if (send_bytes > 0) { out_uint32_le(s, send_bytes); out_uint8a(s, send_data, send_bytes); align_s(s, 4); } if (recv_ior->cbPciLength > 0) { /* map4 */ out_uint32_le(s, recv_ior->dwProtocol); out_uint32_le(s, recv_ior->cbPciLength - 8); val = recv_ior->extra_bytes > 0 ? 1 : 0; out_uint32_le(s, val); /* map6*/ if (val) { out_uint32_le(s, recv_ior->extra_bytes); out_uint8a(s, recv_ior->extra_data, recv_ior->extra_bytes); } } #endif s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "scard_send_Transmit:", s->data, bytes); free_stream(s); return 0; } /** * Communicate directly with the smart card reader *****************************************************************************/ static int scard_send_Control(IRP *irp, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, int control_code) { /* see [MS-RDPESC] 2.2.2.19 */ SMARTCARD *sc; struct stream *s; int bytes; int val; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_CONTROL)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl"); return 1; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); /* map0 */ out_uint32_le(s, card_bytes); out_uint32_le(s, 0x00020004); /* map1 */ out_uint32_le(s, control_code); out_uint32_le(s, send_bytes); val = send_bytes > 0 ? 0x00020008 : 0; out_uint32_le(s, val); /* map2 */ out_uint32_le(s, 0x00000000); out_uint32_le(s, recv_bytes); out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); if (send_bytes > 0) { out_uint32_le(s, send_bytes); out_uint8a(s, send_data, send_bytes); } else { out_uint32_le(s, 0x00000000); } s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", s->data, bytes); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); return 0; } /** * Cancel any outstanding calls *****************************************************************************/ static int scard_send_Cancel(IRP *irp, char *context, int context_bytes) { /* see [MS-RDPESC] 3.1.4.27 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_CANCEL)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl"); return 1; } s_push_layer(s, mcs_hdr, 4); /* bytes, set later */ out_uint32_le(s, 0x00000000); out_uint32_le(s, context_bytes); out_uint32_le(s, 0x00020000); out_uint32_le(s, context_bytes); out_uint8a(s, context, context_bytes); s_mark_end(s); s_pop_layer(s, mcs_hdr); bytes = (int) (s->end - s->p); bytes -= 8; out_uint32_le(s, bytes); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); return 0; } /** * Get reader attributes *****************************************************************************/ static int scard_send_GetAttrib(IRP *irp, char *card, int card_bytes, READER_STATE *rs) { /* see [MS-RDPESC] 2.2.2.21 */ SMARTCARD *sc; struct stream *s; int bytes; if ((sc = smartcards[irp->scard_index]) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "smartcards[%d] is NULL", irp->scard_index); return 1; } if ((s = scard_make_new_ioctl(irp, SCARD_IOCTL_GETATTRIB)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "scard_make_new_ioctl"); return 1; } /* * command format * * ...... * 20 bytes padding * u32 4 bytes len 8, LE, v1 * u32 4 bytes filler * 24 bytes unused (s->p currently pointed here at unused[0]) * u32 4 bytes dwAttribId * 4 bytes unused * u32 4 bytes dwAttrLen * 8 bytes unused * u32 4 bytes handle len * u32 4 bytes handle */ xstream_seek(s, 24); /* TODO */ out_uint32_le(s, rs->dwAttribId); out_uint32_le(s, 0); out_uint32_le(s, rs->dwAttrLen); xstream_seek(s, 8); out_uint32_le(s, card_bytes); out_uint8a(s, card, card_bytes); s_mark_end(s); s_pop_layer(s, iso_hdr); bytes = (int) (s->end - s->p); bytes -= 28; out_uint32_le(s, bytes); bytes = (int) (s->end - s->data); /* send to client */ send_channel_data(g_rdpdr_chan_id, s->data, bytes); free_stream(s); return 0; } /****************************************************************************** ** ** ** local callbacks into this module ** ** ** ******************************************************************************/ /** * *****************************************************************************/ static void scard_handle_EstablishContext_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_establish_context_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_ReleaseContext_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_release_context_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_IsContextValid_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_is_context_valid_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_ListReaders_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_list_readers_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_GetStatusChange_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_get_status_change_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Connect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_connect_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Reconnect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_reconnect_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_BeginTransaction_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_begin_transaction_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_EndTransaction_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_end_transaction_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Status_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_status_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Disconnect_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_disconnect_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Transmit_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_transmit_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Control_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_control_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_Cancel_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_cancel_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } /** * *****************************************************************************/ static void scard_handle_GetAttrib_Return(struct stream *s, IRP *irp, tui32 DeviceId, tui32 CompletionId, tui32 IoStatus) { tui32 len; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* sanity check */ if ((DeviceId != irp->DeviceId) || (CompletionId != irp->CompletionId)) { LOG_DEVEL(LOG_LEVEL_ERROR, "DeviceId/CompletionId do not match those in IRP"); return; } /* get OutputBufferLen */ xstream_rd_u32_le(s, len); scard_function_get_attrib_return(irp->user_data, s, len, IoStatus); devredir_irp_delete(irp); LOG_DEVEL(LOG_LEVEL_DEBUG, "leaving"); } xrdp-0.10.1/sesman/chansrv/audin.h000644 001751 000000 00000001523 14652432047 017041 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2019 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * MS-RDPEAI * */ #ifndef _AUDIN_H_ #define _AUDIN_H_ const char * audin_wave_format_tag_to_str(int tag); int audin_init(void); int audin_deinit(void); int audin_start(void); int audin_stop(void); #endif xrdp-0.10.1/sesman/chansrv/Makefile.am000644 001751 000000 00000003234 14652432047 017625 0ustar00metawheel000000 000000 EXTRA_DIST = \ clipboard-notes.txt \ pcsc \ wave-format-server.txt AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/common CHANSRV_EXTRA_LIBS = if XRDP_FUSE AM_CPPFLAGS += -DXRDP_FUSE $(FUSE_CFLAGS) -DFUSE_USE_VERSION=26 CHANSRV_EXTRA_LIBS += $(FUSE_LIBS) endif if XRDP_FDK_AAC AM_CPPFLAGS += -DXRDP_FDK_AAC $(FDKAAC_CFLAGS) CHANSRV_EXTRA_LIBS += $(FDKAAC_LIBS) endif if XRDP_OPUS AM_CPPFLAGS += -DXRDP_OPUS CHANSRV_EXTRA_LIBS += -lopus endif if XRDP_MP3LAME AM_CPPFLAGS += -DXRDP_MP3LAME CHANSRV_EXTRA_LIBS += -lmp3lame endif if XRDP_RDPSNDAUDIN AM_CPPFLAGS += -DXRDP_RDPSNDAUDIN endif AM_CFLAGS = $(X_CFLAGS) sbin_PROGRAMS = \ xrdp-chansrv xrdp_chansrv_SOURCES = \ chansrv.c \ chansrv.h \ chansrv_common.c \ chansrv_common.h \ chansrv_config.c \ chansrv_config.h \ chansrv_fuse.c \ chansrv_fuse.h \ chansrv_xfs.c \ chansrv_xfs.h \ clipboard.c \ clipboard.h \ clipboard_common.h \ clipboard_file.c \ clipboard_file.h \ devredir.c \ devredir.h \ irp.c \ irp.h \ rail.c \ rail.h \ smartcard.c \ smartcard.h \ smartcard_pcsc.c \ smartcard_pcsc.h \ sound.c \ sound.h \ xcommon.c \ xcommon.h \ audin.c \ audin.h xrdp_chansrv_LDFLAGS = \ $(X_LIBS) xrdp_chansrv_LDADD = \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \ $(CHANSRV_EXTRA_LIBS) xrdp-0.10.1/sesman/chansrv/devredir.c000644 001751 000000 00000235005 14652432047 017544 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * xrdp device redirection - only drive redirection is currently supported * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * TODO * o there is one difference in the protocol initialization * sequence upon reconnection: if a user is already logged on, * send a SERVER_USER_LOGGED_ON msg as per section 3.3.5.1.5 * * o how to announce / delete a drive after a connection has been * established? * * o need to support multiple drives; * o for multiple drives, we cannot have global device_id's and file_id's * and all functions must be reenterant * o replace printf's with log_xxx * o mark local funcs with static */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include "arch.h" #include "parse.h" #include "os_calls.h" #include "string_calls.h" #include "log.h" #include "chansrv.h" #include "chansrv_fuse.h" #include "devredir.h" #include "smartcard.h" #include "ms-rdpefs.h" #include "ms-smb2.h" #include "ms-fscc.h" #include "ms-erref.h" /* client minor versions */ #define RDP_CLIENT_50 0x0002 #define RDP_CLIENT_51 0x0005 #define RDP_CLIENT_52 0x000a #define RDP_CLIENT_60_61 0x000c /* Windows time starts on Jan 1, 1601 */ /* Linux time starts on Jan 1, 1970 */ #define EPOCH_DIFF 11644473600LL #define WINDOWS_TO_LINUX_TIME(_t) (((_t) / 10000000) - EPOCH_DIFF); #define LINUX_TO_WINDOWS_TIME(_t) (((_t) + EPOCH_DIFF) * 10000000) /* * CompletionID types, used in IRPs to indicate I/O operation */ enum COMPLETION_TYPE { CID_CREATE_DIR_REQ = 1, CID_DIRECTORY_CONTROL, CID_CREATE_REQ, CID_OPEN_REQ, CID_READ, CID_WRITE, CID_CLOSE, CID_FILE_CLOSE, CID_RMDIR_OR_FILE, CID_RMDIR_OR_FILE_RESP, CID_RENAME_FILE, CID_RENAME_FILE_RESP, CID_LOOKUP, CID_SETATTR }; /* globals */ extern int g_rdpdr_chan_id; /* in chansrv.c */ /* Capabilities from GENERAL_CAPS_SET in Client Core Capability Response */ struct client_caps { tui32 extended_pdu; int printer_redir_supported; int port_redir_supported; int drive_redir_supported; int smartcard_redir_supported; unsigned int drive_redir_version; }; static struct client_caps g_ccap; tui32 g_completion_id = 1; tui32 g_clientID; /* unique client ID - announced by client */ tui32 g_device_id; /* unique device ID - announced by client */ tui16 g_client_rdp_version; /* returned by client */ struct stream *g_input_stream = NULL; /* * Local functions called from devredir_proc_device_iocompletion() */ static void devredir_proc_cid_rmdir_or_file(IRP *irp, enum NTSTATUS IoStatus); static void devredir_proc_cid_rmdir_or_file_resp(IRP *irp, enum NTSTATUS IoStatus); static void devredir_proc_cid_rename_file(IRP *irp, enum NTSTATUS IoStatus); static void devredir_proc_cid_rename_file_resp(IRP *irp, enum NTSTATUS IoStatus); static void devredir_proc_cid_lookup( IRP *irp, struct stream *s_in, enum NTSTATUS IoStatus); static void devredir_proc_cid_setattr( IRP *irp, struct stream *s_in, enum NTSTATUS IoStatus); /* Other local functions */ static void devredir_send_server_core_cap_req(void); static void devredir_send_server_clientID_confirm(void); static void devredir_send_server_user_logged_on(void); static int devredir_proc_client_core_cap_resp(struct stream *s); static int devredir_proc_client_devlist_announce_req(struct stream *s); static int devredir_proc_client_devlist_remove_req(struct stream *s); static int devredir_proc_device_iocompletion(struct stream *s); static int devredir_proc_query_dir_response(IRP *irp, struct stream *s_in, tui32 DeviceId, tui32 CompletionId, enum NTSTATUS IoStatus); static void devredir_cvt_slash(char *path); static int devredir_string_ends_with(const char *string, char c); /*****************************************************************************/ int devredir_init(void) { struct stream *s; int bytes; tui32 clientID; /* get a random number that will act as a unique clientID */ g_random((char *) &clientID, sizeof(clientID)); /* setup stream */ xstream_new(s, 1024); /* initiate drive redirection protocol by sending Server Announce Req */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); xstream_wr_u16_le(s, PAKID_CORE_SERVER_ANNOUNCE); xstream_wr_u16_le(s, 0x0001); /* server major ver */ xstream_wr_u16_le(s, 0x000C); /* server minor ver - pretend 2 b Win 7 */ xstream_wr_u32_le(s, clientID); /* unique ClientID */ /* send data to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); return 0; } /*****************************************************************************/ int devredir_deinit(void) { scard_deinit(); return 0; } /*****************************************************************************/ /* * Convert a COMPLETION_TYPE to a string */ const char *completion_type_to_str(enum COMPLETION_TYPE cid) { return (cid == CID_CREATE_DIR_REQ) ? "CID_CREATE_DIR_REQ" : (cid == CID_DIRECTORY_CONTROL) ? "CID_DIRECTORY_CONTROL" : (cid == CID_CREATE_REQ) ? "CID_CREATE_REQ" : (cid == CID_OPEN_REQ) ? "CID_OPEN_REQ" : (cid == CID_READ) ? "CID_READ" : (cid == CID_WRITE) ? "CID_WRITE" : (cid == CID_CLOSE) ? "CID_CLOSE" : (cid == CID_FILE_CLOSE) ? "CID_FILE_CLOSE" : (cid == CID_RMDIR_OR_FILE) ? "CID_RMDIR_OR_FILE" : (cid == CID_RMDIR_OR_FILE_RESP) ? "CID_RMDIR_OR_FILE_RESP" : (cid == CID_RENAME_FILE) ? "CID_RENAME_FILE" : (cid == CID_RENAME_FILE_RESP) ? "CID_RENAME_FILE_RESP" : (cid == CID_LOOKUP) ? "CID_LOOKUP" : (cid == CID_SETATTR) ? "CID_SETATTR" : /* default */ ""; }; /*****************************************************************************/ /* * Convert Windows permissions to Linux permissions. * * We can't currently support group or other permissions as separate from the * owner (not that there's much point). We'll assume our caller will provide * a umask if appropriate */ static tui32 WindowsToLinuxFilePerm(tui32 wperm) { tui32 result; if (wperm & W_FILE_ATTRIBUTE_DIRECTORY) { result = S_IFDIR | 0555; /* dirs are always readable and executable */ } else { result = S_IFREG | 0444; /* files are always readable */ if (wperm & W_FILE_ATTRIBUTE_SYSTEM) { result |= 0111; /* Executable */ } } if ((wperm & W_FILE_ATTRIBUTE_READONLY) == 0) { result |= 0222; } return result; } /*****************************************************************************/ static tui32 LinuxToWindowsFilePerm(tui32 lperm) { tui32 result = 0; /* Writeable flag is common to files and directories */ if ((lperm & S_IWUSR) == 0) { result |= W_FILE_ATTRIBUTE_READONLY; } if (lperm & S_IFDIR) { result |= W_FILE_ATTRIBUTE_DIRECTORY; } else { /* For normal files the system attribute is used to store the owner executable bit */ if (lperm & S_IXUSR) { result |= W_FILE_ATTRIBUTE_SYSTEM; } if (result == 0) { /* See MS-FSCC section 2.6 */ result = W_FILE_ATTRIBUTE_NORMAL; } } return result; } /** * @brief process incoming data * * @return 0 on success, -1 on failure *****************************************************************************/ int devredir_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length) { struct stream *ls; tui16 comp_type; tui16 pktID; tui16 minor_ver; int rv = 0; /* * handle packet fragmentation */ if ((chan_flags & 3) == 3) { /* all data contained in one packet */ ls = s; } else { /* is this is the first packet? */ if (chan_flags & 1) { xstream_new(g_input_stream, total_length); } xstream_copyin(g_input_stream, s->p, length); /* in last packet, chan_flags & 0x02 will be true */ if ((chan_flags & 2) == 0) { return 0; } s_mark_end(g_input_stream); g_input_stream->p = g_input_stream->data; ls = g_input_stream; } /* read header from incoming data */ if (!s_check_rem_and_log(ls, 4, "Parsing [MS-RDPEFS] RDPDR_HEADER")) { rv = -1; goto done; } xstream_rd_u16_le(ls, comp_type); xstream_rd_u16_le(ls, pktID); /* for now we only handle core type, not printers */ if (comp_type != RDPDR_CTYP_CORE) { LOG_DEVEL(LOG_LEVEL_ERROR, "invalid component type in response; expected 0x%x got 0x%x", RDPDR_CTYP_CORE, comp_type); rv = -1; goto done; } /* figure out what kind of response we have gotten */ switch (pktID) { case PAKID_CORE_CLIENTID_CONFIRM: if (!s_check_rem_and_log(ls, 6, "Parsing [MS-RDPEFS] DR_CORE_CLIENT_ANNOUNCE_RSP")) { rv = -1; } else { xstream_seek(ls, 2); /* major version, we ignore it */ xstream_rd_u16_le(ls, minor_ver); xstream_rd_u32_le(ls, g_clientID); g_client_rdp_version = minor_ver; switch (minor_ver) { case RDP_CLIENT_50: break; case RDP_CLIENT_51: break; case RDP_CLIENT_52: break; case RDP_CLIENT_60_61: break; } } break; case PAKID_CORE_CLIENT_NAME: /* client is telling us its computer name; do we even care? */ /* See 3.3.5.1.6 for sequencing rules */ if (g_client_rdp_version >= RDP_CLIENT_51) { /* let client know our capabilities */ devredir_send_server_core_cap_req(); } /* send confirm clientID */ devredir_send_server_clientID_confirm(); break; case PAKID_CORE_CLIENT_CAPABILITY: rv = devredir_proc_client_core_cap_resp(ls); if (rv == 0) { if ((g_ccap.extended_pdu & RDPDR_USER_LOGGEDON_PDU) != 0) { /* Tell client to announce remaining devices */ devredir_send_server_user_logged_on(); } else if (g_client_rdp_version >= RDP_CLIENT_51) { /* See 3.3.5.1.7 */ devredir_send_server_clientID_confirm(); } } break; case PAKID_CORE_DEVICELIST_ANNOUNCE: rv = devredir_proc_client_devlist_announce_req(ls); break; case PAKID_CORE_DEVICELIST_REMOVE: rv = devredir_proc_client_devlist_remove_req(ls); break; case PAKID_CORE_DEVICE_IOCOMPLETION: rv = devredir_proc_device_iocompletion(ls); break; default: LOG_DEVEL(LOG_LEVEL_ERROR, "got unknown response 0x%x", pktID); break; } done: if (g_input_stream) { xstream_free(g_input_stream); g_input_stream = NULL; } return rv; } /*****************************************************************************/ int devredir_get_wait_objs(tbus *objs, int *count, int *timeout) { if (g_ccap.smartcard_redir_supported) { return scard_get_wait_objs(objs, count, timeout); } return 0; } /*****************************************************************************/ int devredir_check_wait_objs(void) { if (g_ccap.smartcard_redir_supported) { return scard_check_wait_objs(); } return 0; } /** * @brief let client know our capabilities *****************************************************************************/ static void devredir_send_server_core_cap_req(void) { struct stream *s; int bytes; xstream_new(s, 1024); /* setup header */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); xstream_wr_u16_le(s, PAKID_CORE_SERVER_CAPABILITY); xstream_wr_u16_le(s, 5); /* num of caps we are sending */ xstream_wr_u16_le(s, 0x0000); /* padding */ /* setup general capability */ xstream_wr_u16_le(s, CAP_GENERAL_TYPE); /* CapabilityType */ xstream_wr_u16_le(s, 44); /* CapabilityLength - len of this */ /* CAPABILITY_SET in bytes, inc */ /* the header */ xstream_wr_u32_le(s, 2); /* Version */ xstream_wr_u32_le(s, 2); /* O.S type */ xstream_wr_u32_le(s, 0); /* O.S version */ xstream_wr_u16_le(s, 1); /* protocol major version */ xstream_wr_u16_le(s, g_client_rdp_version); /* protocol minor version */ xstream_wr_u32_le(s, 0xffff); /* I/O code 1 */ xstream_wr_u32_le(s, 0); /* I/O code 2 */ xstream_wr_u32_le(s, 7); /* Extended PDU */ xstream_wr_u32_le(s, 0); /* extra flags 1 */ xstream_wr_u32_le(s, 0); /* extra flags 2 */ xstream_wr_u32_le(s, 2); /* special type device cap */ /* setup printer capability */ xstream_wr_u16_le(s, CAP_PRINTER_TYPE); xstream_wr_u16_le(s, 8); xstream_wr_u32_le(s, 1); /* setup serial port capability */ xstream_wr_u16_le(s, CAP_PORT_TYPE); xstream_wr_u16_le(s, 8); xstream_wr_u32_le(s, 1); /* setup file system capability */ xstream_wr_u16_le(s, CAP_DRIVE_TYPE); /* CapabilityType */ xstream_wr_u16_le(s, 8); /* CapabilityLength - len of this */ /* CAPABILITY_SET in bytes, inc */ /* the header */ xstream_wr_u32_le(s, 2); /* Version */ /* setup smart card capability */ xstream_wr_u16_le(s, CAP_SMARTCARD_TYPE); xstream_wr_u16_le(s, 8); xstream_wr_u32_le(s, 1); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } static void devredir_send_server_clientID_confirm(void) { struct stream *s; int bytes; xstream_new(s, 1024); /* setup stream */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); xstream_wr_u16_le(s, PAKID_CORE_CLIENTID_CONFIRM); xstream_wr_u16_le(s, 0x0001); xstream_wr_u16_le(s, g_client_rdp_version); xstream_wr_u32_le(s, g_clientID); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } static void devredir_send_server_user_logged_on(void) { struct stream *s; int bytes; xstream_new(s, 1024); /* setup stream */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); xstream_wr_u16_le(s, PAKID_CORE_USER_LOGGEDON); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } static void devredir_send_server_device_announce_resp(tui32 device_id, enum NTSTATUS result_code) { struct stream *s; int bytes; xstream_new(s, 1024); /* setup stream */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); xstream_wr_u16_le(s, PAKID_CORE_DEVICE_REPLY); xstream_wr_u32_le(s, device_id); xstream_wr_u32_le(s, (tui32)result_code); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } /** * Create a file system object * * See [MS-RDPEFS] 2.2.1.4.1 (DR_CREATE_REQ) * * @return 0 on success, -1 on failure *****************************************************************************/ static int devredir_send_drive_create_request(tui32 device_id, const char *path, tui32 DesiredAccess, tui32 CreateOptions, tui32 FileAttributes, tui32 CreateDisposition, tui32 completion_id) { struct stream *s; int bytes; int path_len; unsigned int unicode_byte_count; tui32 SharedAccess; LOG_DEVEL(LOG_LEVEL_DEBUG, "device_id=%d path=\"%s\"" " DesiredAccess=0x%x CreateDisposition=0x%x" " FileAttributes=0x%x CreateOptions=0x%x" " CompletionId=%d", device_id, path, DesiredAccess, CreateDisposition, FileAttributes, CreateOptions, completion_id); /* Find number of bytes required for Unicode path + terminator */ path_len = strlen(path) + 1; // includes terminator unicode_byte_count = utf8_as_utf16_word_count(path, path_len) * 2; xstream_new(s, (int)(64 + unicode_byte_count)); /* FILE_SHARE_DELETE allows files to be renamed while in use (in some circumstances) */ SharedAccess = SA_FILE_SHARE_READ | SA_FILE_SHARE_WRITE | SA_FILE_SHARE_DELETE; devredir_insert_DeviceIoRequest(s, device_id, 0, completion_id, IRP_MJ_CREATE, IRP_MN_NONE); xstream_wr_u32_le(s, DesiredAccess); /* DesiredAccess */ xstream_wr_u32_le(s, 0); /* AllocationSize high unused */ xstream_wr_u32_le(s, 0); /* AllocationSize low unused */ xstream_wr_u32_le(s, FileAttributes); /* FileAttributes */ xstream_wr_u32_le(s, SharedAccess); /* SharedAccess */ xstream_wr_u32_le(s, CreateDisposition); /* CreateDisposition */ xstream_wr_u32_le(s, CreateOptions); /* CreateOptions */ xstream_wr_u32_le(s, unicode_byte_count);/* PathLength */ out_utf8_as_utf16_le(s, path, path_len); /* Path */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); return 0; } /** * Close a request previously created by devredir_send_drive_create_request() *****************************************************************************/ static int devredir_send_drive_close_request(tui16 Component, tui16 PacketId, tui32 DeviceId, tui32 FileId, tui32 CompletionId, enum IRP_MJ MajorFunction, enum IRP_MN MinorFunc, int pad_len) { struct stream *s; int bytes; xstream_new(s, 1024); devredir_insert_DeviceIoRequest(s, DeviceId, FileId, CompletionId, MajorFunction, MinorFunc); if (pad_len) { xstream_seek(s, pad_len); } /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); LOG_DEVEL(LOG_LEVEL_DEBUG, "sent close request; expect CID_FILE_CLOSE"); return 0; } /** * @brief ask client to enumerate directory * * See [MS-RDPEFS] 2.2.3.3.10 (DR_DRIVE_QUERY_DIRECTORY_REQ) *****************************************************************************/ static void devredir_send_drive_dir_request(IRP *irp, tui32 device_id, tui32 InitialQuery, char *Path) { struct stream *s; int bytes; unsigned int path_len; unsigned int unicode_byte_count; /* during Initial Query, Path cannot be NULL */ if (InitialQuery && Path != NULL) { /* Find number of words required for Unicode path */ path_len = strlen(Path) + 1; // includes terminator unicode_byte_count = utf8_as_utf16_word_count(Path, path_len) * 2; } else { path_len = 0; unicode_byte_count = 0; } xstream_new(s, (int)(64 + unicode_byte_count)); irp->completion_type = CID_DIRECTORY_CONTROL; devredir_insert_DeviceIoRequest(s, device_id, irp->FileId, irp->CompletionId, IRP_MJ_DIRECTORY_CONTROL, IRP_MN_QUERY_DIRECTORY); xstream_wr_u32_le(s, FileDirectoryInformation); /* FsInformationClass */ xstream_wr_u8(s, InitialQuery); /* InitialQuery */ xstream_wr_u32_le(s, unicode_byte_count); /* PathLength */ xstream_seek(s, 23); /* Padding */ out_utf8_as_utf16_le(s, Path, path_len); /* Path */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } /****************************************************************************** ** process data received from client ** ******************************************************************************/ /** * Process a GENERAL_CAPS_SET packet from the client * @param s Stream. CAPABILITY_HEADER is already read * @param cap_len Amount of data left in stream for the packet * @return 0 for success, -1 otherwise * * Caller is responsible for skipping unused data from this * capability in the input stream. */ static int process_client_general_caps_set(struct stream *s, unsigned int cap_len, struct client_caps *ccap) { int rv = -1; // Data we don't check at the start of the packet #define PACKET_SKIP_LENGTH ( \ 4 + /* osType */ \ 4 + /* osVersion */ \ 2 + /* protocolMajorVersion */ \ 2 + /* protocolMinorVersion */ \ 4 + /* ioCode1 */ \ 4) /* ioCode2 */ if (cap_len < (PACKET_SKIP_LENGTH + 4)) { LOG(LOG_LEVEL_ERROR, "[MS-RDPEFS] GENERAL_CAPS_SET: Short packet (%u bytes) encountered", cap_len); } else { xstream_seek(s, PACKET_SKIP_LENGTH); xstream_rd_u32_le(s, ccap->extended_pdu); rv = 0; } return rv; #undef PACKET_SKIP_LENGTH } /** * @brief process client's response to our core_capability_req() msg * * @param s stream containing client's response * @return 0 for success, -1 otherwise *****************************************************************************/ static int devredir_proc_client_core_cap_resp(struct stream *s) { #define CAPABILITY_HEADER_LEN 8 int i; tui16 num_caps; tui16 cap_type; tui16 cap_len; tui32 cap_version; // Reset to defaults memset(&g_ccap, 0, sizeof(g_ccap)); g_ccap.drive_redir_version = 1; if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CORE_CAPABLITY_RSP")) { return -1; } xstream_rd_u16_le(s, num_caps); xstream_seek(s, 2); /* padding */ for (i = 0; i < num_caps; i++) { if (!s_check_rem_and_log(s, CAPABILITY_HEADER_LEN, "Parsing [MS-RDPEFS] CAPABILITY_HEADER")) { return -1; } xstream_rd_u16_le(s, cap_type); xstream_rd_u16_le(s, cap_len); xstream_rd_u32_le(s, cap_version); /* Convert the length to a remaining length. Underflow is possible, * but this is an unsigned type so that's OK */ cap_len -= CAPABILITY_HEADER_LEN; if (!s_check_rem_and_log(s, cap_len, "Parsing [MS-RDPEFS] CAPABILITY_HEADER data")) { return -1; } // Save our stream position. iso_hdr is otherwise // unused in this stream s_push_layer(s, iso_hdr, 0); switch (cap_type) { case CAP_GENERAL_TYPE: LOG_DEVEL(LOG_LEVEL_DEBUG, "got CAP_GENERAL_TYPE"); if (process_client_general_caps_set(s, cap_len, &g_ccap) < 0) { return -1; } break; case CAP_PRINTER_TYPE: LOG_DEVEL(LOG_LEVEL_DEBUG, "got CAP_PRINTER_TYPE"); g_ccap.printer_redir_supported = 1; break; case CAP_PORT_TYPE: LOG_DEVEL(LOG_LEVEL_DEBUG, "got CAP_PORT_TYPE"); g_ccap.port_redir_supported = 1; break; case CAP_DRIVE_TYPE: LOG_DEVEL(LOG_LEVEL_DEBUG, "got CAP_DRIVE_TYPE"); g_ccap.drive_redir_supported = 1; if (cap_version == 2) { g_ccap.drive_redir_version = 2; } break; case CAP_SMARTCARD_TYPE: LOG_DEVEL(LOG_LEVEL_DEBUG, "got CAP_SMARTCARD_TYPE"); g_ccap.smartcard_redir_supported = (scard_init() == 0); break; } s_pop_layer(s, iso_hdr); // Move back to start of capability data xstream_seek(s, cap_len); } return 0; #undef CAPABILITY_HEADER_LEN } static int devredir_proc_client_devlist_announce_req(struct stream *s) { unsigned int i; int j; tui32 device_count; tui32 device_type; tui32 device_data_len; char preferred_dos_name[9]; enum NTSTATUS response_status; /* get number of devices being announced */ if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CORE_DEVICELIST_ANNOUNCE_REQ")) { return -1; } xstream_rd_u32_le(s, device_count); LOG_DEVEL(LOG_LEVEL_DEBUG, "num of devices announced: %d", device_count); for (i = 0; i < device_count; i++) { if (!s_check_rem_and_log(s, 4 + 4 + 8 + 4, "Parsing [MS-RDPEFS] DEVICE_ANNOUNCE")) { return -1; } xstream_rd_u32_le(s, device_type); xstream_rd_u32_le(s, g_device_id); /* get preferred DOS name * DOS names that are 8 chars long are not NULL terminated */ for (j = 0; j < 8; j++) { preferred_dos_name[j] = *s->p++; } preferred_dos_name[8] = 0; /* Assume this device isn't supported by us */ response_status = STATUS_NOT_SUPPORTED; /* Read the device data length from the stream */ xstream_rd_u32_le(s, device_data_len); if (device_data_len > 0 && !s_check_rem_and_log(s, device_data_len, "Parsing [MS-RDPEFS] DEVICE_ANNOUNCE devdata")) { return -1; } switch (device_type) { case RDPDR_DTYP_FILESYSTEM: /* At present we don't use the full name - see * [MS-RDPEFS] 2.2.3.1 for details of the contents */ xstream_skip_u8(s, device_data_len); LOG(LOG_LEVEL_INFO, "Detected remote drive '%s'", preferred_dos_name); LOG_DEVEL(LOG_LEVEL_DEBUG, "device_type=FILE_SYSTEM device_id=0x%x dosname=%s " "device_data_len=%d", g_device_id, preferred_dos_name, device_data_len); response_status = STATUS_SUCCESS; /* create share directory in xrdp file system; */ /* think of this as the mount point for this share */ xfuse_create_share(g_device_id, preferred_dos_name); break; case RDPDR_DTYP_SMARTCARD: xstream_skip_u8(s, device_data_len); LOG(LOG_LEVEL_INFO, "Detected remote smartcard '%s'", preferred_dos_name); LOG_DEVEL(LOG_LEVEL_DEBUG, "device_type=SMARTCARD device_id=0x%x dosname=%s", g_device_id, preferred_dos_name); response_status = STATUS_SUCCESS; scard_device_announce(g_device_id); break; default: { /* All other devices are unsupported */ const char *description = (device_type == RDPDR_DTYP_SERIAL) ? "serial port" : (device_type == RDPDR_DTYP_PARALLEL) ? "parallel port" : (device_type == RDPDR_DTYP_PRINT) ? "printer" : /* default */ "unknown device"; xstream_skip_u8(s, device_data_len); LOG(LOG_LEVEL_INFO, "Detected remote %s '%s' (not supported)", description, preferred_dos_name); LOG_DEVEL(LOG_LEVEL_DEBUG, "description=%s dosname=%s device_id=0x%x", description, preferred_dos_name, g_device_id); } break; } /* Tell the client wheth or not we're supporting this one */ devredir_send_server_device_announce_resp(g_device_id, response_status); } return 0; } static int devredir_proc_client_devlist_remove_req(struct stream *s) { unsigned int i; tui32 device_count; tui32 device_id; /* get number of devices being announced */ if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_DEVICELIST_REMOVE")) { return -1; } xstream_rd_u32_le(s, device_count); if (!s_check_rem_and_log(s, 4 * device_count, "Parsing [MS-RDPEFS] DR_DEVICELIST_REMOVE list")) { return -1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "num of devices removed: %d", device_count); { for (i = 0; i < device_count; i++) { xstream_rd_u32_le(s, device_id); xfuse_delete_share(device_id); } } return 0; } static int devredir_proc_device_iocompletion(struct stream *s) { IRP *irp = NULL; tui32 DeviceId; tui32 CompletionId; tui32 IoStatus32; tui32 Length; enum COMPLETION_TYPE comp_type; if (!s_check_rem_and_log(s, 12, "Parsing [MS-RDPEFS] DR_DEVICE_IOCOMPLETION")) { return -1; } xstream_rd_u32_le(s, DeviceId); xstream_rd_u32_le(s, CompletionId); xstream_rd_u32_le(s, IoStatus32); enum NTSTATUS IoStatus = (enum NTSTATUS) IoStatus32; /* Needed by C++ */ if ((irp = devredir_irp_find(CompletionId)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "IRP with completion ID %d not found", CompletionId); } else if (irp->callback) { /* Callback has been set - call it */ (*irp->callback)(s, irp, DeviceId, CompletionId, IoStatus); } else { comp_type = (enum COMPLETION_TYPE) irp->completion_type; /* Log something about the IRP */ if (IoStatus == STATUS_SUCCESS || IoStatus == STATUS_NO_MORE_FILES || (IoStatus == STATUS_NO_SUCH_FILE && comp_type == CID_LOOKUP)) { /* Successes or common occurrences - debug logging only */ LOG_DEVEL(LOG_LEVEL_DEBUG, "got %s", completion_type_to_str(comp_type)); } else { LOG_DEVEL(LOG_LEVEL_ERROR, "CompletionType = %s, IoStatus=%08x " "Pathname = %s", completion_type_to_str(comp_type), IoStatus, (irp->pathname) ? irp->pathname : ""); } switch (comp_type) { case CID_CREATE_DIR_REQ: if (IoStatus != STATUS_SUCCESS) { xfuse_devredir_cb_enum_dir_done( (struct state_dirscan *) irp->fuse_info, IoStatus); devredir_irp_delete(irp); } else { if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CREATE_RSP")) { return -1; } xstream_rd_u32_le(s, irp->FileId); devredir_send_drive_dir_request(irp, DeviceId, 1, irp->pathname); } break; case CID_CREATE_REQ: if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CREATE_RSP")) { return -1; } xstream_rd_u32_le(s, irp->FileId); xfuse_devredir_cb_create_file( (struct state_create *) irp->fuse_info, IoStatus, DeviceId, irp->FileId); if (irp->gen.create.creating_dir || IoStatus != STATUS_SUCCESS) { devredir_irp_delete(irp); } break; case CID_OPEN_REQ: if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CREATE_RSP")) { return -1; } xstream_rd_u32_le(s, irp->FileId); xfuse_devredir_cb_open_file((struct state_open *) irp->fuse_info, IoStatus, DeviceId, irp->FileId); if (IoStatus != STATUS_SUCCESS) { devredir_irp_delete(irp); } break; case CID_READ: if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_READ_RSP")) { return -1; } xstream_rd_u32_le(s, Length); if (!s_check_rem_and_log(s, Length, "Parsing [MS-RDPEFS] DR_READ_RSP")) { return -1; } xfuse_devredir_cb_read_file((struct state_read *) irp->fuse_info, IoStatus, s->p, Length); devredir_irp_delete(irp); break; case CID_WRITE: if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_WRITE_RSP")) { return -1; } xstream_rd_u32_le(s, Length); xfuse_devredir_cb_write_file((struct state_write *) irp->fuse_info, IoStatus, irp->gen.write.offset, Length); devredir_irp_delete(irp); break; case CID_CLOSE: devredir_irp_delete(irp); break; case CID_FILE_CLOSE: xfuse_devredir_cb_file_close((struct state_close *) irp->fuse_info); devredir_irp_delete(irp); break; case CID_DIRECTORY_CONTROL: if (devredir_proc_query_dir_response(irp, s, DeviceId, CompletionId, IoStatus) != 0) { return -1; } break; case CID_RMDIR_OR_FILE: if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CREATE_RSP")) { return -1; } xstream_rd_u32_le(s, irp->FileId); devredir_proc_cid_rmdir_or_file(irp, IoStatus); break; case CID_RMDIR_OR_FILE_RESP: devredir_proc_cid_rmdir_or_file_resp(irp, IoStatus); break; case CID_RENAME_FILE: if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEFS] DR_CREATE_RSP")) { return -1; } xstream_rd_u32_le(s, irp->FileId); devredir_proc_cid_rename_file(irp, IoStatus); break; case CID_RENAME_FILE_RESP: devredir_proc_cid_rename_file_resp(irp, IoStatus); break; case CID_LOOKUP: devredir_proc_cid_lookup(irp, s, IoStatus); break; case CID_SETATTR: devredir_proc_cid_setattr(irp, s, IoStatus); break; default: LOG_DEVEL(LOG_LEVEL_ERROR, "got unknown CompletionID: DeviceId=0x%x " "CompletionId=0x%x IoStatus=0x%x", DeviceId, CompletionId, IoStatus); break; } } return 0; } /** * Parse a query directory response * * See:- * - [MS-RDPEFS] 2.2.3.4.10 (DR_DRIVE_QUERY_DIRECTORY_RSP) * - [MS-FSCC] 2.4.10 (FileDirectoryInformation) * * return 0 on success, -1 on failure */ static int devredir_proc_query_dir_response(IRP *irp, struct stream *s_in, tui32 DeviceId, tui32 CompletionId, enum NTSTATUS IoStatus) { // Size of FILE_DIRECTORY_INFORMATION structure with a particular // filename length #define FILE_DIRECTORY_INFORMATION_SIZE(FileNameLength) \ ((4 + 4 + 8 + 8 + 8 + 8 + 8 + 8 + 4 + 4) + FileNameLength) xstream_seek(s_in, 4); /* Length */ if (IoStatus == STATUS_SUCCESS) { /* process FILE_DIRECTORY_INFORMATION structures */ while (1) { /* Can we read up to the filename? */ if (!s_check_rem_and_log(s_in, FILE_DIRECTORY_INFORMATION_SIZE(0), "FILE_DIRECTORY_INFORMATION")) { return -1; } char filename[256]; tui64 LastAccessTime; tui64 LastWriteTime; tui64 EndOfFile; tui32 NextEntryOffset; tui32 FileAttributes; tui32 FileNameLength; struct file_attr fattr; unsigned int flen; xstream_rd_u32_le(s_in, NextEntryOffset); xstream_seek(s_in, 4); /* FileIndex */ xstream_seek(s_in, 8); /* CreationTime */ xstream_rd_u64_le(s_in, LastAccessTime); xstream_rd_u64_le(s_in, LastWriteTime); xstream_seek(s_in, 8); /* ChangeTime */ xstream_rd_u64_le(s_in, EndOfFile); xstream_seek(s_in, 8); /* AllocationSize */ xstream_rd_u32_le(s_in, FileAttributes); xstream_rd_u32_le(s_in, FileNameLength); if (!s_check_rem_and_log(s_in, FileNameLength, "FILE_DIRECTORY_INFORMATION:FileName")) { return -1; } flen = in_utf16_le_fixed_as_utf8(s_in, FileNameLength / 2, filename, sizeof(filename)); if (flen > sizeof(filename)) { LOG(LOG_LEVEL_WARNING, "Buffer was %d bytes too small for filename", (int)(flen - sizeof(filename))); } //LOG_DEVEL(LOG_LEVEL_DEBUG, "LastAccessTime: 0x%llx", LastAccessTime); //LOG_DEVEL(LOG_LEVEL_DEBUG, "LastWriteTime: 0x%llx", LastWriteTime); //LOG_DEVEL(LOG_LEVEL_DEBUG, "EndOfFile: %lld", EndOfFile); //LOG_DEVEL(LOG_LEVEL_DEBUG, "FileAttributes: 0x%x", FileAttributes); //LOG_DEVEL(LOG_LEVEL_DEBUG, "FileNameLength: %d", FileNameLength); LOG_DEVEL(LOG_LEVEL_DEBUG, "FileName: %s", filename); fattr.mode = WindowsToLinuxFilePerm(FileAttributes); fattr.size = (size_t) EndOfFile; fattr.atime = WINDOWS_TO_LINUX_TIME(LastAccessTime); fattr.mtime = WINDOWS_TO_LINUX_TIME(LastWriteTime); /* add this entry to xrdp file system */ xfuse_devredir_cb_enum_dir_add_entry( (struct state_dirscan *) irp->fuse_info, filename, &fattr); /* From [MS-FSCC] * {NextEntryOffset} MUST be zero if no other entries follow * this one. An implementation MUST use this value to determine * the location of the next entry (if multiple entries are * present in a buffer). */ if (NextEntryOffset == 0) { break; } int pad = NextEntryOffset - FILE_DIRECTORY_INFORMATION_SIZE(FileNameLength); if (pad > 0) { if (!s_check_rem_and_log(s_in, pad, "FILE_DIRECTORY_INFORMATION:pad")) { return -1; } xstream_seek(s_in, pad); } } /* Ask for more directory entries */ devredir_send_drive_dir_request(irp, DeviceId, 0, NULL); } else { if (IoStatus == STATUS_NO_MORE_FILES) { IoStatus = STATUS_SUCCESS; } xfuse_devredir_cb_enum_dir_done((struct state_dirscan *)irp->fuse_info, IoStatus); irp->completion_type = CID_CLOSE; devredir_send_drive_close_request(RDPDR_CTYP_CORE, PAKID_CORE_DEVICE_IOREQUEST, DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_CLOSE, IRP_MN_NONE, 32); } return 0; #undef FILE_DIRECTORY_INFORMATION_SIZE } /** * FUSE calls this function whenever it wants us to enumerate a dir * * @param fusep opaque data struct that we just pass back to FUSE when done * @param device_id device_id of the redirected share * @param path the dir path to enumerate * * @return 0 on success, -1 on failure *****************************************************************************/ int devredir_get_dir_listing(struct state_dirscan *fusep, tui32 device_id, const char *path) { tui32 DesiredAccess; tui32 CreateOptions; tui32 CreateDisposition; int rval = -1; IRP *irp; /* * We need to be able to append two additional characters to the * path after we create the IRP */ if ((irp = devredir_irp_with_pathnamelen_new(strlen(path) + 2)) != NULL) { /* convert / to windows compatible \ */ strcpy(irp->pathname, path); devredir_cvt_slash(irp->pathname); irp->CompletionId = g_completion_id++; irp->completion_type = CID_CREATE_DIR_REQ; irp->DeviceId = device_id; irp->fuse_info = fusep; DesiredAccess = DA_FILE_READ_DATA | DA_SYNCHRONIZE; CreateOptions = CO_FILE_DIRECTORY_FILE | CO_FILE_SYNCHRONOUS_IO_NONALERT; CreateDisposition = CD_FILE_OPEN; rval = devredir_send_drive_create_request(device_id, irp->pathname, DesiredAccess, CreateOptions, 0, CreateDisposition, irp->CompletionId); LOG_DEVEL(LOG_LEVEL_DEBUG, "looking for device_id=%d path=%s", device_id, irp->pathname); /* when we get a response to devredir_send_drive_create_request(), we * call devredir_send_drive_dir_request(), which needs the following * at the end of the path argument */ if (devredir_string_ends_with(irp->pathname, '\\')) { strcat(irp->pathname, "*"); } else { strcat(irp->pathname, "\\*"); } } return rval; } /** * FUSE calls this function whenever it wants us to lookup a file or directory * * @param fusep opaque data struct that we just pass back to FUSE when done * @param device_id device_id of the redirected share * @param path the name of the directory containing the file * @param file the filename * * @return 0 on success, -1 on failure *****************************************************************************/ int devredir_lookup_entry(struct state_lookup *fusep, tui32 device_id, const char *path) { tui32 DesiredAccess; tui32 CreateOptions; tui32 CreateDisposition; int rval = -1; IRP *irp; LOG_DEVEL(LOG_LEVEL_DEBUG, "fusep=%p", fusep); if ((irp = devredir_irp_with_pathname_new(path)) != NULL) { /* convert / to windows compatible \ */ devredir_cvt_slash(irp->pathname); /* * Allocate an IRP to open the file, read the basic attributes, * read the standard attributes, and then close the file */ irp->CompletionId = g_completion_id++; irp->completion_type = CID_LOOKUP; irp->DeviceId = device_id; irp->gen.lookup.state = E_LOOKUP_GET_FH; irp->fuse_info = fusep; DesiredAccess = DA_FILE_READ_ATTRIBUTES | DA_SYNCHRONIZE; CreateOptions = 0; CreateDisposition = CD_FILE_OPEN; LOG_DEVEL(LOG_LEVEL_DEBUG, "lookup for device_id=%d path=%s CompletionId=%d", device_id, irp->pathname, irp->CompletionId); rval = devredir_send_drive_create_request(device_id, irp->pathname, DesiredAccess, CreateOptions, 0, CreateDisposition, irp->CompletionId); } return rval; } /** * FUSE calls this function whenever it wants us to set the attributes for * a file or directory. * * @param fusep opaque data struct that we just pass back to FUSE when done * @param device_id device_id of the redirected share * @param filename the name of the file * @param fattr the file attributes to set for the file * @param to_set Which bits of the file attributes have changed * * @return 0 on success, -1 on failure *****************************************************************************/ int devredir_setattr_for_entry(struct state_setattr *fusep, tui32 device_id, const char *filename, const struct file_attr *fattr, tui32 to_set) { tui32 DesiredAccess; tui32 CreateOptions; tui32 CreateDisposition; int rval = -1; IRP *irp; LOG_DEVEL(LOG_LEVEL_DEBUG, "fusep=%p", fusep); if ((irp = devredir_irp_with_pathname_new(filename)) != NULL) { /* convert / to windows compatible \ */ devredir_cvt_slash(irp->pathname); /* * Allocate an IRP to open the file, update the attributes * and close the file. */ irp->CompletionId = g_completion_id++; irp->completion_type = CID_SETATTR; irp->DeviceId = device_id; irp->fuse_info = fusep; irp->gen.setattr.state = E_SETATTR_GET_FH; irp->gen.setattr.to_set = to_set; irp->gen.setattr.fattr = *fattr; /* * Don't set DA_FILE_WRITE_DATA unless we're changing the * EndOfFile pointer. Otherwise we can't change the attributes * of read-only files! */ DesiredAccess = DA_FILE_WRITE_ATTRIBUTES; if (to_set & TO_SET_SIZE) { DesiredAccess |= DA_FILE_WRITE_DATA; } CreateOptions = 0; CreateDisposition = CD_FILE_OPEN; LOG_DEVEL(LOG_LEVEL_DEBUG, "lookup for device_id=%d path=%s", device_id, irp->pathname); rval = devredir_send_drive_create_request(device_id, irp->pathname, DesiredAccess, CreateOptions, 0, CreateDisposition, irp->CompletionId); } return rval; } int devredir_file_create(struct state_create *fusep, tui32 device_id, const char *path, int mode) { tui32 DesiredAccess; tui32 CreateOptions; tui32 FileAttributes = 0; tui32 CreateDisposition; int rval = -1; IRP *irp; LOG_DEVEL(LOG_LEVEL_DEBUG, "device_id=%d path=%s mode=0%o", device_id, path, mode); if ((irp = devredir_irp_with_pathname_new(path)) != NULL) { /* convert / to windows compatible \ */ devredir_cvt_slash(irp->pathname); irp->completion_type = CID_CREATE_REQ; irp->CompletionId = g_completion_id++; irp->DeviceId = device_id; irp->fuse_info = fusep; DesiredAccess = 0x0016019f; /* got this value from windows */ FileAttributes = LinuxToWindowsFilePerm(mode); if (mode & S_IFDIR) { LOG_DEVEL(LOG_LEVEL_DEBUG, "creating dir"); CreateOptions = CO_FILE_DIRECTORY_FILE | CO_FILE_SYNCHRONOUS_IO_NONALERT; irp->gen.create.creating_dir = 1; } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "creating file"); CreateOptions = 0x44; /* got this value from windows */ irp->gen.create.creating_dir = 0; } //CreateDisposition = CD_FILE_CREATE; CreateDisposition = 0x02; /* got this value from windows */ rval = devredir_send_drive_create_request(device_id, path, DesiredAccess, CreateOptions, FileAttributes, CreateDisposition, irp->CompletionId); } return rval; } int devredir_file_open(struct state_open *fusep, tui32 device_id, const char *path, int flags) { tui32 DesiredAccess; tui32 CreateOptions; tui32 FileAttributes = 0; tui32 CreateDisposition; int rval = -1; IRP *irp; LOG_DEVEL(LOG_LEVEL_DEBUG, "device_id=%d path=%s flags=0%x", device_id, path, flags); if ((irp = devredir_irp_with_pathname_new(path)) != NULL) { /* convert / to windows compatible \ */ devredir_cvt_slash(irp->pathname); irp->completion_type = CID_OPEN_REQ; irp->CompletionId = g_completion_id++; irp->DeviceId = device_id; irp->fuse_info = fusep; switch (flags & O_ACCMODE) { case O_RDONLY: LOG_DEVEL(LOG_LEVEL_DEBUG, "open file in O_RDONLY"); DesiredAccess = DA_FILE_READ_DATA | DA_SYNCHRONIZE; break; case O_WRONLY: LOG_DEVEL(LOG_LEVEL_DEBUG, "open file in O_WRONLY"); DesiredAccess = DA_FILE_WRITE_DATA | DA_SYNCHRONIZE; break; default: /* * The access mode could conceivably be invalid here, * but we assume this has been checked by the caller */ LOG_DEVEL(LOG_LEVEL_DEBUG, "open file in O_RDWR"); /* without the 0x00000010 rdesktop opens files in */ /* O_RDONLY instead of O_RDWR mode */ DesiredAccess = DA_FILE_READ_DATA | DA_FILE_WRITE_DATA | DA_SYNCHRONIZE | 0x00000010; } CreateOptions = CO_FILE_SYNCHRONOUS_IO_NONALERT; CreateDisposition = CD_FILE_OPEN; // WAS 1 rval = devredir_send_drive_create_request(device_id, path, DesiredAccess, CreateOptions, FileAttributes, CreateDisposition, irp->CompletionId); } return rval; } int devredir_file_close(struct state_close *fusep, tui32 device_id, tui32 FileId) { IRP *irp; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered: fusep=%p device_id=%d FileId=%d", fusep, device_id, FileId); #if 0 if ((irp = devredir_irp_new()) == NULL) { return -1; } irp->CompletionId = g_completion_id++; #else if ((irp = devredir_irp_find_by_fileid(FileId)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "no IRP found with FileId = %d", FileId); return -1; } #endif irp->completion_type = CID_FILE_CLOSE; irp->DeviceId = device_id; irp->fuse_info = fusep; return devredir_send_drive_close_request(RDPDR_CTYP_CORE, PAKID_CORE_DEVICE_IOREQUEST, device_id, FileId, irp->CompletionId, IRP_MJ_CLOSE, IRP_MN_NONE, 32); } /** * Remove (delete) a directory or file *****************************************************************************/ int devredir_rmdir_or_file(struct state_remove *fusep, tui32 device_id, const char *path) { tui32 DesiredAccess; tui32 CreateOptions; tui32 CreateDisposition; int rval = -1; IRP *irp; if ((irp = devredir_irp_with_pathname_new(path)) != NULL) { /* convert / to windows compatible \ */ devredir_cvt_slash(irp->pathname); irp->CompletionId = g_completion_id++; irp->completion_type = CID_RMDIR_OR_FILE; irp->DeviceId = device_id; irp->fuse_info = fusep; //DesiredAccess = DA_DELETE | DA_FILE_READ_ATTRIBUTES | DA_SYNCHRONIZE; DesiredAccess = 0x00100080; /* got this value from windows */ //CreateOptions = CO_FILE_DELETE_ON_CLOSE | CO_FILE_DIRECTORY_FILE | // CO_FILE_SYNCHRONOUS_IO_NONALERT; CreateOptions = 0x020; /* got this value from windows */ //CreateDisposition = CD_FILE_OPEN; // WAS 1 CreateDisposition = 0x01; /* got this value from windows */ rval = devredir_send_drive_create_request(device_id, path, DesiredAccess, CreateOptions, 0, CreateDisposition, irp->CompletionId); } return rval; } /** * Read data from previously opened file * * Errors are reported via xfuse_devredir_cb_read_file() *****************************************************************************/ void devredir_file_read(struct state_read *fusep, tui32 DeviceId, tui32 FileId, tui32 Length, tui64 Offset) { struct stream *s; IRP *irp; IRP *new_irp; int bytes; xstream_new(s, 1024); /* Check we've got an open IRP for this file already */ if ((irp = devredir_irp_find_by_fileid(FileId)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "no IRP found with FileId = %d", FileId); xfuse_devredir_cb_read_file(fusep, STATUS_UNSUCCESSFUL, NULL, 0); xstream_free(s); } /* create a new IRP for this request */ else if ((new_irp = devredir_irp_new()) == NULL) { /* system out of memory */ xfuse_devredir_cb_read_file(fusep, STATUS_UNSUCCESSFUL, NULL, 0); xstream_free(s); } else { new_irp->DeviceId = DeviceId; new_irp->FileId = FileId; new_irp->completion_type = CID_READ; new_irp->CompletionId = g_completion_id++; new_irp->fuse_info = fusep; devredir_insert_DeviceIoRequest(s, DeviceId, FileId, new_irp->CompletionId, IRP_MJ_READ, IRP_MN_NONE); xstream_wr_u32_le(s, Length); xstream_wr_u64_le(s, Offset); xstream_seek(s, 20); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } } /** * Read data from previously opened file * * Errors are reported via xfuse_devredir_cb_write_file() *****************************************************************************/ void devredir_file_write(struct state_write *fusep, tui32 DeviceId, tui32 FileId, const char *buf, int Length, tui64 Offset) { struct stream *s; IRP *irp; IRP *new_irp; int bytes; LOG_DEVEL(LOG_LEVEL_DEBUG, "DeviceId=%d FileId=%d Length=%d Offset=%lld", DeviceId, FileId, Length, (long long)Offset); xstream_new(s, 1024 + Length); if ((irp = devredir_irp_find_by_fileid(FileId)) == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "no IRP found with FileId = %d", FileId); xfuse_devredir_cb_write_file(fusep, STATUS_UNSUCCESSFUL, 0, 0); xstream_free(s); } /* create a new IRP for this request */ else if ((new_irp = devredir_irp_new()) == NULL) { /* system out of memory */ xfuse_devredir_cb_write_file(fusep, STATUS_UNSUCCESSFUL, 0, 0); xstream_free(s); } else { new_irp->DeviceId = DeviceId; new_irp->FileId = FileId; new_irp->completion_type = CID_WRITE; new_irp->CompletionId = g_completion_id++; new_irp->fuse_info = fusep; /* Offset needed after write to calculate new EOF */ new_irp->gen.write.offset = Offset; devredir_insert_DeviceIoRequest(s, DeviceId, FileId, new_irp->CompletionId, IRP_MJ_WRITE, IRP_MN_NONE); xstream_wr_u32_le(s, Length); xstream_wr_u64_le(s, Offset); xstream_seek(s, 20); /* padding */ /* now insert real data */ xstream_copyin(s, buf, Length); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } } int devredir_file_rename(struct state_rename *fusep, tui32 device_id, const char *old_name, const char *new_name) { tui32 DesiredAccess; tui32 CreateOptions; tui32 FileAttributes = 0; tui32 CreateDisposition; int rval = -1; IRP *irp; unsigned int len; LOG_DEVEL(LOG_LEVEL_DEBUG, "device_id=%d old_name=%s new_name=%s", device_id, old_name, new_name); /* * Allocate an IRP with enough space for both the old and new names. * We'll store the new name after the old name:- * * | n | a | m | e | 1 | \0 | n | a | m | e | 2 | \0 | * ^ ^ * irp->pathname ----+ | * irp->gen.rename.new_name ------------------+ */ len = strlen(old_name) + 1 + strlen(new_name); if ((irp = devredir_irp_with_pathnamelen_new(len)) != NULL) { /* Set up pointer to new name string */ irp->gen.rename.new_name = irp->pathname + strlen(old_name) + 1; /* Copy both strings, and change'/' to '\\' characters */ strcpy(irp->pathname, old_name); devredir_cvt_slash(irp->pathname); strcpy(irp->gen.rename.new_name, new_name); devredir_cvt_slash(irp->gen.rename.new_name); irp->completion_type = CID_RENAME_FILE; irp->CompletionId = g_completion_id++; irp->DeviceId = device_id; irp->fuse_info = fusep; DesiredAccess = DA_FILE_WRITE_ATTRIBUTES | DA_DELETE; CreateOptions = 0; CreateDisposition = CD_FILE_OPEN; // WAS 1 rval = devredir_send_drive_create_request(device_id, old_name, DesiredAccess, CreateOptions, FileAttributes, CreateDisposition, irp->CompletionId); } return rval; } /****************************************************************************** ** miscellaneous stuff ** ******************************************************************************/ void devredir_insert_DeviceIoRequest(struct stream *s, tui32 DeviceId, tui32 FileId, tui32 CompletionId, enum IRP_MJ MajorFunction, enum IRP_MN MinorFunction) { /* setup DR_DEVICE_IOREQUEST header */ xstream_wr_u16_le(s, RDPDR_CTYP_CORE); xstream_wr_u16_le(s, PAKID_CORE_DEVICE_IOREQUEST); xstream_wr_u32_le(s, DeviceId); xstream_wr_u32_le(s, FileId); xstream_wr_u32_le(s, CompletionId); xstream_wr_u32_le(s, MajorFunction); xstream_wr_u32_le(s, MinorFunction); } /** * Convert / to windows compatible \ *****************************************************************************/ static void devredir_cvt_slash(char *path) { char *cptr = path; while (*cptr != 0) { if (*cptr == '/') { *cptr = '\\'; } cptr++; } } static int devredir_string_ends_with(const char *string, char c) { size_t len; len = strlen(string); return (len > 0 && string[len - 1] == c) ? 1 : 0; } static void devredir_proc_cid_rmdir_or_file(IRP *irp, enum NTSTATUS IoStatus) { struct stream *s; int bytes; if (IoStatus != STATUS_SUCCESS) { xfuse_devredir_cb_rmdir_or_file((struct state_remove *) irp->fuse_info, IoStatus); devredir_irp_delete(irp); return; } xstream_new(s, 1024); irp->completion_type = CID_RMDIR_OR_FILE_RESP; devredir_insert_DeviceIoRequest(s, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_SET_INFORMATION, IRP_MN_NONE); xstream_wr_u32_le(s, FileDispositionInformation); xstream_wr_u32_le(s, 0); /* length is zero */ xstream_seek(s, 24); /* padding */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); return; } static void devredir_proc_cid_rmdir_or_file_resp(IRP *irp, enum NTSTATUS IoStatus) { xfuse_devredir_cb_rmdir_or_file((struct state_remove *)irp->fuse_info, IoStatus); if (IoStatus != STATUS_SUCCESS) { devredir_irp_delete(irp); return; } irp->completion_type = CID_CLOSE; devredir_send_drive_close_request(RDPDR_CTYP_CORE, PAKID_CORE_DEVICE_IOREQUEST, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_CLOSE, IRP_MN_NONE, 32); } /** * Rename a file on response to the create drive request * * See :- * - [MS-RDPEFS] 2.2.3.3.9 (DR_DRIVE_SET_INFORMATION_REQ)` * - [MS-RDPEFS] 2.2.3.3.9.1 (RDP_FILE_RENAME_INFORMATION) *****************************************************************************/ static void devredir_proc_cid_rename_file(IRP *irp, enum NTSTATUS IoStatus) { struct stream *s; int bytes; unsigned int flen; /* FileNameLength */ unsigned int unicode_byte_count; /* Bytes to represent new name in UTF-16 */ unsigned int sblen; /* SetBuffer length */ if (IoStatus != STATUS_SUCCESS) { LOG_DEVEL(LOG_LEVEL_DEBUG, "rename returned with IoStatus=0x%x", IoStatus); xfuse_devredir_cb_rename_file((struct state_rename *)irp->fuse_info, IoStatus); devredir_irp_delete(irp); return; } /* Find number of words required for Unicode path */ flen = strlen(irp->gen.rename.new_name) + 1; // includes terminator unicode_byte_count = utf8_as_utf16_word_count(irp->gen.rename.new_name, flen) * 2; /* Length of RDP_FILE_RENAME_INFORMATION struct */ sblen = (1 + 1 + 4) + unicode_byte_count; xstream_new(s, (int)(64 + unicode_byte_count)); irp->completion_type = CID_RENAME_FILE_RESP; devredir_insert_DeviceIoRequest(s, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_SET_INFORMATION, IRP_MN_NONE); xstream_wr_u32_le(s, FileRenameInformation); xstream_wr_u32_le(s, sblen); /* number of bytes after padding */ xstream_seek(s, 24); /* padding */ xstream_wr_u8(s, 1); /* ReplaceIfExists */ xstream_wr_u8(s, 0); /* RootDirectory */ xstream_wr_u32_le(s, unicode_byte_count); /* FileNameLength */ /* filename in Unicode */ out_utf8_as_utf16_le(s, irp->gen.rename.new_name, flen); /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); return; } static void devredir_proc_cid_rename_file_resp(IRP *irp, enum NTSTATUS IoStatus) { xfuse_devredir_cb_rename_file((struct state_rename *)irp->fuse_info, IoStatus); if (IoStatus != STATUS_SUCCESS) { devredir_irp_delete(irp); return; } irp->completion_type = CID_CLOSE; devredir_send_drive_close_request(RDPDR_CTYP_CORE, PAKID_CORE_DEVICE_IOREQUEST, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_CLOSE, IRP_MN_NONE, 32); } /* * Re-uses the specified IRP to issue a request to get file attributes * of varying types * * References : [MS-RDPEFS] 2.2.3.3.9 [MS-FSCC] 2.4 *****************************************************************************/ static void issue_lookup(IRP *irp, int lookup_type) { struct stream *s; int bytes; bytes = lookup_type == FileBasicInformation ? FILE_BASIC_INFORMATION_SIZE : lookup_type == FileStandardInformation ? FILE_STD_INFORMATION_SIZE : 0; xstream_new(s, 1024); devredir_insert_DeviceIoRequest(s, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_QUERY_INFORMATION, IRP_MN_NONE); xstream_wr_u32_le(s, lookup_type); xstream_wr_u32_le(s, bytes); /* buffer length */ xstream_seek(s, 24); /* padding */ xstream_seek(s, bytes); /* buffer */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } /* * Parses an incoming FileBasicInformation structure *****************************************************************************/ static void lookup_read_basic_attributes(IRP *irp, struct stream *s_in) { tui64 LastAccessTime; tui64 LastWriteTime; tui32 FileAttributes; LOG_DEVEL(LOG_LEVEL_DEBUG, "processing FILE_BASIC_INFORMATION"); xstream_seek(s_in, 8); /* CreationTime */ xstream_rd_u64_le(s_in, LastAccessTime); xstream_rd_u64_le(s_in, LastWriteTime); xstream_seek(s_in, 8); /* ChangeTime */ xstream_rd_u32_le(s_in, FileAttributes); //LOG_DEVEL(LOG_LEVEL_DEBUG, "LastAccessTime: 0x%llx", // (unsigned long long)LastAccessTime); //LOG_DEVEL(LOG_LEVEL_DEBUG, "LastWriteTime: 0x%llx", // (unsigned long long)LastWriteTime); //LOG_DEVEL(LOG_LEVEL_DEBUG, "ChangeTime: 0x%llx", // (unsigned long long)ChangeTime); //LOG_DEVEL(LOG_LEVEL_DEBUG, "FileAttributes: 0x%x", (unsigned int)FileAttributes); /* Save the basic attributes in the IRP */ irp->gen.lookup.fattr.mode = WindowsToLinuxFilePerm(FileAttributes); irp->gen.lookup.fattr.atime = WINDOWS_TO_LINUX_TIME(LastAccessTime); irp->gen.lookup.fattr.mtime = WINDOWS_TO_LINUX_TIME(LastWriteTime); } /* * Parses an incoming FileStandardInformation structure *****************************************************************************/ static void lookup_read_standard_attributes(IRP *irp, struct stream *s_in) { tui64 EndOfFile; LOG_DEVEL(LOG_LEVEL_DEBUG, "processing FILE_STD_INFORMATION"); xstream_seek(s_in, 8); /* AllocationSize */ xstream_rd_u64_le(s_in, EndOfFile); //LOG_DEVEL(LOG_LEVEL_DEBUG, "EndOfFile: %lld", // (unsigned long long)EndOfFile); irp->gen.lookup.fattr.size = EndOfFile; } /* * Completes a lookup request and returns status to the caller. * * Unless IoStatus is STATUS_SUCCESS, the lookup has failed. *****************************************************************************/ static void lookup_done(IRP *irp, enum NTSTATUS IoStatus) { LOG_DEVEL(LOG_LEVEL_DEBUG, "Lookup with completion_id=%d returning 0x%x", irp->CompletionId, IoStatus); xfuse_devredir_cb_lookup_entry((struct state_lookup *)irp->fuse_info, IoStatus, &irp->gen.lookup.fattr); if (irp->FileId == 0) { /* Open failed - no file handle */ devredir_irp_delete(irp); } else { /* Close the file handle */ irp->completion_type = CID_CLOSE; devredir_send_drive_close_request(RDPDR_CTYP_CORE, PAKID_CORE_DEVICE_IOREQUEST, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_CLOSE, IRP_MN_NONE, 32); } } /* * lookup has a mini state machine built-in, as it needs to issue * multiple I/O requests, but unlike lookup these are not always the same. */ static void devredir_proc_cid_lookup(IRP *irp, struct stream *s_in, enum NTSTATUS IoStatus) { tui32 Length; LOG_DEVEL(LOG_LEVEL_DEBUG, "entry state is %d", irp->gen.lookup.state); if (IoStatus != STATUS_SUCCESS) { /* This is common to all setattr states */ LOG_DEVEL(LOG_LEVEL_DEBUG, "last lookup returned with IoStatus=0x%08x", IoStatus); lookup_done(irp, IoStatus); } else { /* Read and validate any data we've got queued up */ switch (irp->gen.lookup.state) { case E_LOOKUP_GET_FH: /* We've been sent the file ID */ xstream_rd_u32_le(s_in, irp->FileId); issue_lookup(irp, FileBasicInformation); irp->gen.lookup.state = E_LOOKUP_CHECK_BASIC; break; case E_LOOKUP_CHECK_BASIC: /* Returned length what we expected? */ xstream_rd_u32_le(s_in, Length); if (Length != FILE_BASIC_INFORMATION_SIZE) { LOG_DEVEL(LOG_LEVEL_ERROR, "Expected FILE_BASIC_INFORMATION length" "%d, got len=%d", FILE_BASIC_INFORMATION_SIZE, Length); IoStatus = STATUS_UNSUCCESSFUL; lookup_done(irp, IoStatus); } else { lookup_read_basic_attributes(irp, s_in); issue_lookup(irp, FileStandardInformation); irp->gen.lookup.state = E_LOOKUP_CHECK_EOF; } break; case E_LOOKUP_CHECK_EOF: /* Returned length what we expected? */ xstream_rd_u32_le(s_in, Length); if (Length != FILE_STD_INFORMATION_SIZE) { LOG_DEVEL(LOG_LEVEL_ERROR, "Expected FILE_STD_INFORMATION length" "%d, got len=%d", FILE_STD_INFORMATION_SIZE, Length); IoStatus = STATUS_UNSUCCESSFUL; } else { lookup_read_standard_attributes(irp, s_in); } lookup_done(irp, IoStatus); break; } } } /* * Re-uses the specified IRP to issue a request to set basic file attributes * * References : [MS-RDPEFS] 2.2.3.3.9 [MS-FSCC] 2.4.7 *****************************************************************************/ static void issue_setattr_basic(IRP *irp) { struct stream *s; int bytes; const struct file_attr *fattr = &irp->gen.setattr.fattr; tui32 to_set = irp->gen.setattr.to_set; tui32 FileAttributes = 0; tui64 atime = 0; tui64 mtime = 0; if (to_set & TO_SET_MODE) { FileAttributes = LinuxToWindowsFilePerm(fattr->mode); } if (to_set & TO_SET_ATIME) { atime = LINUX_TO_WINDOWS_TIME(fattr->atime); } if (to_set & TO_SET_MTIME) { mtime = LINUX_TO_WINDOWS_TIME(fattr->mtime); } xstream_new(s, 1024); devredir_insert_DeviceIoRequest(s, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_SET_INFORMATION, IRP_MN_NONE); xstream_wr_u32_le(s, FileBasicInformation); xstream_wr_u32_le(s, FILE_BASIC_INFORMATION_SIZE); /* buffer length */ xstream_seek(s, 24); /* padding */ xstream_wr_u64_le(s, 0LL); /* CreationTime */ xstream_wr_u64_le(s, atime); /* LastAccessTime */ xstream_wr_u64_le(s, mtime); /* LastWriteTime */ xstream_wr_u64_le(s, 0LL); /* ChangeTime */ xstream_wr_u32_le(s, FileAttributes); /* FileAttributes */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } /* * Re-uses the specified IRP to issue a request to set file EOF * * References : [MS-RDPEFS] 2.2.3.3.9 [MS-FSCC] 2.4.13 *****************************************************************************/ static void issue_setattr_eof(IRP *irp) { struct stream *s; int bytes; xstream_new(s, 1024); devredir_insert_DeviceIoRequest(s, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_SET_INFORMATION, IRP_MN_NONE); xstream_wr_u32_le(s, FileEndOfFileInformation); xstream_wr_u32_le(s, FILE_END_OF_FILE_INFORMATION_SIZE); /* buffer length */ xstream_seek(s, 24); /* padding */ xstream_wr_u64_le(s, (tui64)irp->gen.setattr.fattr.size); /* File size */ /* send to client */ bytes = xstream_len(s); send_channel_data(g_rdpdr_chan_id, s->data, bytes); xstream_free(s); } /* * Completes a setattr request and returns status to the caller. *****************************************************************************/ static void setattr_done(IRP *irp, enum NTSTATUS IoStatus) { xfuse_devredir_cb_setattr((struct state_setattr *) irp->fuse_info, IoStatus); if (irp->FileId == 0) { /* Open failed - no file handle */ devredir_irp_delete(irp); } else { /* Close the file handle */ irp->completion_type = CID_CLOSE; devredir_send_drive_close_request(RDPDR_CTYP_CORE, PAKID_CORE_DEVICE_IOREQUEST, irp->DeviceId, irp->FileId, irp->CompletionId, IRP_MJ_CLOSE, IRP_MN_NONE, 32); } } /* * setattr has a mini state machine built-in, as it needs to issue * multiple I/O requests, but unlike lookup these are not always the same. */ static void devredir_proc_cid_setattr(IRP *irp, struct stream *s_in, enum NTSTATUS IoStatus) { #define TO_SET_BASIC_ATTRS (TO_SET_MODE | \ TO_SET_ATIME | TO_SET_MTIME) tui32 Length; LOG_DEVEL(LOG_LEVEL_DEBUG, "entry state is %d", irp->gen.setattr.state); if (IoStatus != STATUS_SUCCESS) { /* This is common to all setattr states */ LOG_DEVEL(LOG_LEVEL_DEBUG, "last setattr returned with IoStatus=0x%08x", IoStatus); setattr_done(irp, IoStatus); } else { /* Read and validate any data we've got queued up */ switch (irp->gen.setattr.state) { case E_SETATTR_GET_FH: /* We've been sent the file ID */ xstream_rd_u32_le(s_in, irp->FileId); break; case E_SETATTR_CHECK_BASIC: /* Returned length what we expected? */ xstream_rd_u32_le(s_in, Length); if (Length != FILE_BASIC_INFORMATION_SIZE) { LOG_DEVEL(LOG_LEVEL_ERROR, "Expected FILE_BASIC_INFORMATION length" "%d, got len=%d", FILE_BASIC_INFORMATION_SIZE, Length); } /* Clear the basic bits so we don't end up in here again */ irp->gen.setattr.to_set &= ~TO_SET_BASIC_ATTRS; break; case E_SETATTR_CHECK_EOF: /* Returned length what we expected? */ xstream_rd_u32_le(s_in, Length); if (Length != FILE_END_OF_FILE_INFORMATION_SIZE) { LOG_DEVEL(LOG_LEVEL_ERROR, "Expected FILE_END_OF_FILE_INFORMATION length" "%d, got len=%d", FILE_END_OF_FILE_INFORMATION_SIZE, Length); } /* Clear the size bits so we don't end up in here again */ irp->gen.setattr.to_set &= ~TO_SET_SIZE; break; } /* Work out the next call to issue */ if (irp->gen.setattr.to_set & TO_SET_BASIC_ATTRS) { issue_setattr_basic(irp); irp->gen.setattr.state = E_SETATTR_CHECK_BASIC; } else if (irp->gen.setattr.to_set & TO_SET_SIZE) { issue_setattr_eof(irp); irp->gen.setattr.state = E_SETATTR_CHECK_EOF; } else { setattr_done(irp, IoStatus); } } #undef TO_SET_BASIC_ATTRS } xrdp-0.10.1/sesman/chansrv/rail.c000644 001751 000000 00000200565 14652432047 016672 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* window manager info http://www.freedesktop.org/wiki/Specifications/wm-spec rail [MS-RDPERP]: Remote Desktop Protocol: Remote Programs Virtual Channel Extension http://msdn.microsoft.com/en-us/library/cc242568(v=prot.20).aspx */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "chansrv.h" #include "rail.h" #include "xcommon.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" #include "thread_calls.h" #include "list.h" extern int g_rail_chan_id; /* in chansrv.c */ extern int g_display_num; /* in chansrv.c */ extern char *g_exec_name; /* in chansrv.c */ extern tbus g_exec_event; /* in chansrv.c */ extern tbus g_exec_mutex; /* in chansrv.c */ extern tbus g_exec_sem; /* in chansrv.c */ extern Display *g_display; /* in xcommon.c */ extern Screen *g_screen; /* in xcommon.c */ extern Window g_root_window; /* in xcommon.c */ extern Atom g_wm_delete_window_atom; /* in xcommon.c */ extern Atom g_wm_protocols_atom; /* in xcommon.c */ extern Atom g_utf8_string; /* in xcommon.c */ extern Atom g_net_wm_name; /* in xcommon.c */ extern Atom g_wm_state; /* in xcommon.c */ static Atom g_rwd_atom = 0; int g_rail_up = 0; /* for rail_is_another_wm_running */ static int g_rail_running = 1; /* list of valid rail windows */ static struct list *g_window_list = 0; static int g_got_focus = 0; static int g_focus_counter = 0; static Window g_focus_win = 0; static int g_xrr_event_base = 0; /* non zero means we got extension */ static Cursor g_default_cursor = 0; static char *g_override_window_title = 0; /* used in valid field of struct rail_window_data */ #define RWD_X (1 << 0) #define RWD_Y (1 << 1) #define RWD_WIDTH (1 << 2) #define RWD_HEIGHT (1 << 3) #define RWD_TITLE (1 << 4) struct rail_window_data { int valid; /* bits for which fields are valid */ int x; int y; int width; int height; int title_crc; /* crc of title for compare */ }; /* Indicates a Client Execute PDU from client to server. */ #define TS_RAIL_ORDER_EXEC 0x0001 /* Indicates a Client Activate PDU from client to server. */ #define TS_RAIL_ORDER_ACTIVATE 0x0002 /* Indicates a Client System Parameters Update PDU from client to server or a Server System Parameters Update PDU from server to client. */ #define TS_RAIL_ORDER_SYSPARAM 0x0003 /* Indicates a Client System Command PDU from client to server. */ #define TS_RAIL_ORDER_SYSCOMMAND 0x0004 /* Indicates a bi-directional Handshake PDU. */ #define TS_RAIL_ORDER_HANDSHAKE 0x0005 /* Indicates a Client Notify Event PDU from client to server. */ #define TS_RAIL_ORDER_NOTIFY_EVENT 0x0006 /* Indicates a Client Window Move PDU from client to server. */ #define TS_RAIL_ORDER_WINDOWMOVE 0x0008 /* Indicates a Server Move/Size Start PDU and a Server Move/Size End PDU from server to client. */ #define TS_RAIL_ORDER_LOCALMOVESIZE 0x0009 /* Indicates a Server Min Max Info PDU from server to client. */ #define TS_RAIL_ORDER_MINMAXINFO 0x000a /* Indicates a Client Information PDU from client to server. */ #define TS_RAIL_ORDER_CLIENTSTATUS 0x000b /* Indicates a Client System Menu PDU from client to server. */ #define TS_RAIL_ORDER_SYSMENU 0x000c /* Indicates a Server Language Bar Information PDU from server to client, or a Client Language Bar Information PDU from client to server. */ #define TS_RAIL_ORDER_LANGBARINFO 0x000d /* Indicates a Server Execute Result PDU from server to client. */ #define TS_RAIL_ORDER_EXEC_RESULT 0x0080 /* Indicates a Client Get Application ID PDU from client to server. */ #define TS_RAIL_ORDER_GET_APPID_REQ 0x000E /* Indicates a Server Get Application ID Response PDU from server to client. */ #define TS_RAIL_ORDER_GET_APPID_RESP 0x000F /* Resize the window. */ #define SC_SIZE 0xF000 /* Move the window. */ #define SC_MOVE 0xF010 /* Minimize the window. */ #define SC_MINIMIZE 0xF020 /* Maximize the window. */ #define SC_MAXIMIZE 0xF030 /* Close the window. */ #define SC_CLOSE 0xF060 /* The ALT + SPACE key combination was pressed; display the window's system menu. */ #define SC_KEYMENU 0xF100 /* Restore the window to its original shape and size. */ #define SC_RESTORE 0xF120 /* Perform the default action of the window's system menu. */ #define SC_DEFAULT 0xF160 /* for tooltips */ #define RAIL_STYLE_TOOLTIP (0x80000000) #define RAIL_EXT_STYLE_TOOLTIP (0x00000080 | 0x00000008) /* for normal desktop windows */ #define RAIL_STYLE_NORMAL (0x00C00000 | 0x00080000 | 0x00040000 | 0x00010000 | 0x00020000) #define RAIL_EXT_STYLE_NORMAL (0x00040000) /* for dialogs */ #define RAIL_STYLE_DIALOG (0x80000000) #define RAIL_EXT_STYLE_DIALOG (0x00040000) static int rail_win_get_state(Window win); static int rail_create_window(Window window_id, Window owner_id); static int rail_win_set_state(Window win, unsigned long state); static int rail_show_window(Window window_id, int show_state); static int rail_win_send_text(Window win); /*****************************************************************************/ static int rail_send_key_esc(int window_id) { XEvent event; g_memset(&event, 0, sizeof(event)); event.type = KeyPress; event.xkey.same_screen = True; event.xkey.root = g_root_window; event.xkey.window = window_id; event.xkey.keycode = 9; XSendEvent(g_display, window_id, True, 0xfff, &event); event.type = KeyRelease; XSendEvent(g_display, window_id, True, 0xfff, &event); return 0; } /*****************************************************************************/ static struct rail_window_data * rail_get_window_data(Window window) { unsigned int bytes; Atom actual_type_return; int actual_format_return; unsigned long nitems_return; unsigned long bytes_after_return; unsigned char *prop_return; struct rail_window_data *rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_get_window_data:"); rv = 0; actual_type_return = 0; actual_format_return = 0; nitems_return = 0; prop_return = 0; bytes = sizeof(struct rail_window_data); XGetWindowProperty(g_display, window, g_rwd_atom, 0, bytes, 0, XA_STRING, &actual_type_return, &actual_format_return, &nitems_return, &bytes_after_return, &prop_return); if (prop_return == 0) { return 0; } if (nitems_return == bytes) { rv = (struct rail_window_data *)prop_return; } return rv; } /*****************************************************************************/ static int rail_set_window_data(Window window, struct rail_window_data *rwd) { int bytes; bytes = sizeof(struct rail_window_data); XChangeProperty(g_display, window, g_rwd_atom, XA_STRING, 8, PropModeReplace, (unsigned char *)rwd, bytes); return 0; } /*****************************************************************************/ /* get the rail window data, if not exist, try to create it and return */ static struct rail_window_data * rail_get_window_data_safe(Window window) { struct rail_window_data *rv; rv = rail_get_window_data(window); if (rv != 0) { return rv; } rv = g_new0(struct rail_window_data, 1); rail_set_window_data(window, rv); g_free(rv); return rail_get_window_data(window); } /******************************************************************************/ static int is_window_valid_child_of_root(unsigned int window_id) { int found; unsigned int i; unsigned int nchild; Window r; Window p; Window *children; found = 0; XQueryTree(g_display, g_root_window, &r, &p, &children, &nchild); for (i = 0; i < nchild; i++) { if (window_id == children[i]) { found = 1; break; } } XFree(children); return found; } /*****************************************************************************/ static int rail_send_init(void) { struct stream *s; int bytes; char *size_ptr; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_send_init:"); make_stream(s); init_stream(s, 8182); out_uint16_le(s, TS_RAIL_ORDER_HANDSHAKE); size_ptr = s->p; out_uint16_le(s, 0); /* size, set later */ out_uint32_le(s, 1); /* build number */ s_mark_end(s); bytes = (int)((s->end - s->data) - 4); size_ptr[0] = bytes; size_ptr[1] = bytes >> 8; bytes = (int)(s->end - s->data); send_channel_data(g_rail_chan_id, s->data, bytes); free_stream(s); return 0; } /******************************************************************************/ static int anotherWMRunning(Display *display, XErrorEvent *xe) { g_rail_running = 0; return -1; } /******************************************************************************/ static int rail_is_another_wm_running(void) { XErrorHandler old; g_rail_running = 1; old = XSetErrorHandler((XErrorHandler)anotherWMRunning); XSelectInput(g_display, g_root_window, PropertyChangeMask | StructureNotifyMask | SubstructureRedirectMask | ButtonPressMask | SubstructureNotifyMask | FocusChangeMask | EnterWindowMask | LeaveWindowMask); XSync(g_display, 0); XSetErrorHandler((XErrorHandler)old); g_rail_up = g_rail_running; if (!g_rail_up) { return 1; } return 0; } /*****************************************************************************/ int rail_init(void) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_init:"); xcommon_init(); return 0; } /*****************************************************************************/ int rail_deinit(void) { if (g_rail_up) { list_delete(g_window_list); g_window_list = 0; /* no longer window manager */ XSelectInput(g_display, g_root_window, 0); g_rail_up = 0; } return 0; } int rail_startup(void) { int dummy; int ver_maj; int ver_min; Status st; if (rail_is_another_wm_running()) { LOG(LOG_LEVEL_ERROR, "rail_init: another window manager " "is running"); } list_delete(g_window_list); g_window_list = list_create(); rail_send_init(); g_rail_up = 1; g_rwd_atom = XInternAtom(g_display, "XRDP_RAIL_WINDOW_DATA", 0); if (!XRRQueryExtension(g_display, &g_xrr_event_base, &dummy)) { g_xrr_event_base = 0; LOG(LOG_LEVEL_ERROR, "rail_init: RandR extension not found"); } if (g_xrr_event_base > 0) { LOG_DEVEL(LOG_LEVEL_INFO, "rail_init: found RandR extension"); st = XRRQueryVersion(g_display, &ver_maj, &ver_min); if (st) { LOG_DEVEL(LOG_LEVEL_INFO, "rail_init: RandR version major %d minor %d", ver_maj, ver_min); } XRRSelectInput(g_display, g_root_window, RRScreenChangeNotifyMask); } if (g_default_cursor == 0) { g_default_cursor = XCreateFontCursor(g_display, XC_left_ptr); XDefineCursor(g_display, g_root_window, g_default_cursor); } return 0; } /*****************************************************************************/ static char * read_uni(struct stream *s, unsigned int num_bytes) { char *rv = NULL; if (s_check_rem_and_log(s, num_bytes, "Reading RAIL string")) { unsigned int num_words = num_bytes / 2; unsigned int utf8len = in_utf16_le_fixed_as_utf8_length(s, num_words); // Allocate space for a back-stop terminator rv = (char *)g_malloc(utf8len + 1, 0); if (rv != NULL) { rv[utf8len] = '\0'; in_utf16_le_fixed_as_utf8(s, num_words, rv, utf8len); if ((num_bytes % 2) != 0) { /* Skip unused character */ in_uint8s(s, 1); } } } return rv; } /*****************************************************************************/ /* See [MS-RDPERP] 2.2.2.3.1 (TS_RAIL_ORDER_EXEC) */ static int rail_process_exec(struct stream *s, int size) { int rv = 1; int flags; unsigned int ExeOrFileLength; unsigned int WorkingDirLength; unsigned int ArgumentsLen; LOG_DEVEL(LOG_LEVEL_INFO, "chansrv::rail_process_exec:"); in_uint16_le(s, flags); in_uint16_le(s, ExeOrFileLength); in_uint16_le(s, WorkingDirLength); in_uint16_le(s, ArgumentsLen); // The constants below are taken from [MS-RDPERP] 2.2.2.3.1 if (ExeOrFileLength == 0 || ExeOrFileLength > 520) { LOG(LOG_LEVEL_ERROR, "ExeOrFileLength field is out of range %u", ExeOrFileLength); } else if (WorkingDirLength > 520) { LOG(LOG_LEVEL_ERROR, "WorkingDirLength field is out of range %d", WorkingDirLength); } else if (ArgumentsLen > 16000) { LOG(LOG_LEVEL_ERROR, "ArgumentsLen field is out of range %d", ArgumentsLen); } else { char *ExeOrFile = read_uni(s, ExeOrFileLength); char *WorkingDir = read_uni(s, WorkingDirLength); char *Arguments = read_uni(s, ArgumentsLen); if (ExeOrFile == NULL || WorkingDir == NULL || Arguments == NULL) { LOG(LOG_LEVEL_ERROR, "Out of memory reading TS_RAIL_ORDER_EXEC PDU"); } else { LOG(LOG_LEVEL_DEBUG, " flags 0x%8.8x ExeOrFileLength %d WorkingDirLength %d " "ArgumentsLen %d ExeOrFile [%s] WorkingDir [%s] " "Arguments [%s]", flags, ExeOrFileLength, WorkingDirLength, ArgumentsLen, ExeOrFile, WorkingDir, Arguments); rail_startup(); LOG_DEVEL(LOG_LEVEL_DEBUG, "rail_process_exec: pre"); /* ask main thread to fork */ tc_mutex_lock(g_exec_mutex); g_exec_name = ExeOrFile; g_set_wait_obj(g_exec_event); tc_sem_dec(g_exec_sem); tc_mutex_unlock(g_exec_mutex); LOG_DEVEL(LOG_LEVEL_DEBUG, "rail_process_exec: post"); rv = 0; } /* TODO : Looks like a race condition here */ g_free(ExeOrFile); g_free(WorkingDir); g_free(Arguments); } return rv; } /******************************************************************************/ static int rail_win_popdown(void) { int rv = 0; int i; unsigned int nchild; Window r; Window p; Window *children; XWindowAttributes window_attributes; /* * Check the tree of current existing X windows and dismiss * the managed rail popups by simulating a esc key, so * that the requested window can be closed properly. */ XQueryTree(g_display, g_root_window, &r, &p, &children, &nchild); for (i = nchild - 1; i >= 0; i--) { XGetWindowAttributes(g_display, children[i], &window_attributes); if (window_attributes.override_redirect && window_attributes.map_state == IsViewable && list_index_of(g_window_list, children[i]) >= 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " dismiss pop up 0x%8.8lx", children[i]); rail_send_key_esc(children[i]); rv = 1; } } XFree(children); return rv; } /******************************************************************************/ static int rail_close_window(int window_id) { XEvent ce; LOG_DEVEL(LOG_LEVEL_INFO, "chansrv::rail_close_window:"); rail_win_popdown(); g_memset(&ce, 0, sizeof(ce)); ce.xclient.type = ClientMessage; ce.xclient.message_type = g_wm_protocols_atom; ce.xclient.display = g_display; ce.xclient.window = window_id; ce.xclient.format = 32; ce.xclient.data.l[0] = g_wm_delete_window_atom; ce.xclient.data.l[1] = CurrentTime; XSendEvent(g_display, window_id, False, NoEventMask, &ce); return 0; } /*****************************************************************************/ void my_timeout(void *data) { LOG_DEVEL(LOG_LEVEL_DEBUG, "my_timeout: g_got_focus %d", g_got_focus); if (g_focus_counter == (int)(long)data) { LOG_DEVEL(LOG_LEVEL_DEBUG, "my_timeout: g_focus_counter %d", g_focus_counter); rail_win_popdown(); } } /*****************************************************************************/ static int rail_process_activate(struct stream *s, int size) { unsigned int window_id; int enabled; int index; XWindowAttributes window_attributes; Window transient_for = 0; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate:"); in_uint32_le(s, window_id); in_uint8(s, enabled); index = list_index_of(g_window_list, window_id); if (index < 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: window 0x%8.8x not in list", window_id); return 0; } g_focus_counter++; g_got_focus = enabled; LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x enabled %d", window_id, enabled); XGetWindowAttributes(g_display, window_id, &window_attributes); if (enabled) { if (g_focus_win == window_id) { /* In case that window is unmapped upon minimization and not yet mapped*/ XMapWindow(g_display, window_id); } else { rail_win_popdown(); if (window_attributes.map_state != IsViewable) { /* In case that window is unmapped upon minimization and not yet mapped */ XMapWindow(g_display, window_id); } XGetTransientForHint(g_display, window_id, &transient_for); if (transient_for > 0) { /* Owner window should be raised up as well */ XRaiseWindow(g_display, transient_for); } LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: calling XRaiseWindow 0x%8.8x", window_id); XRaiseWindow(g_display, window_id); LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: calling XSetInputFocus 0x%8.8x", window_id); XSetInputFocus(g_display, window_id, RevertToParent, CurrentTime); } LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: calling XRaiseWindow 0x%8.8x", window_id); XRaiseWindow(g_display, window_id); LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: calling XSetInputFocus 0x%8.8x", window_id); XSetInputFocus(g_display, window_id, RevertToParent, CurrentTime); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, " window attributes: override_redirect %d", window_attributes.override_redirect); add_timeout(200, my_timeout, (void *)(long)g_focus_counter); } return 0; } /*****************************************************************************/ static int rail_select_input(Window window_id) { XSelectInput(g_display, window_id, PropertyChangeMask | StructureNotifyMask | SubstructureNotifyMask | FocusChangeMask | EnterWindowMask | LeaveWindowMask); XSync(g_display, 0); return 0; } /*****************************************************************************/ static int rail_restore_windows(void) { unsigned int i; unsigned int nchild; Window r; Window p; Window *children; XQueryTree(g_display, g_root_window, &r, &p, &children, &nchild); for (i = 0; i < nchild; i++) { XWindowAttributes window_attributes; XGetWindowAttributes(g_display, children[i], &window_attributes); if (!window_attributes.override_redirect) { rail_select_input(children[i]); if (window_attributes.map_state == IsViewable) { rail_win_set_state(children[i], 0x0); /* WithdrawnState */ rail_create_window(children[i], g_root_window); rail_win_set_state(children[i], 0x1); /* NormalState */ rail_win_send_text(children[i]); } } } XFree(children); return 0; } /*****************************************************************************/ static int rail_process_system_param(struct stream *s, int size) { int system_param; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_system_param:"); in_uint32_le(s, system_param); LOG_DEVEL(LOG_LEVEL_DEBUG, " system_param 0x%8.8x", system_param); /* * Ask client to re-create the existing rail windows. This is supposed * to be done after handshake and client is initialised properly, we * consider client is ready when it sends "SET_WORKAREA" sysparam. */ if (system_param == 0x0000002F) /*SPI_SET_WORK_AREA*/ { LOG_DEVEL(LOG_LEVEL_DEBUG, " restore rail windows"); rail_restore_windows(); } return 0; } /*****************************************************************************/ static int rail_get_property(Display *display, Window target, Atom type, Atom property, unsigned char **data, unsigned long *count) { Atom atom_return; int size; unsigned long nitems, bytes_left; char *prop_name; int ret = XGetWindowProperty(display, target, property, 0l, 1l, False, type, &atom_return, &size, &nitems, &bytes_left, data); if ((ret != Success || nitems < 1) && atom_return == None) { prop_name = XGetAtomName(g_display, property); LOG_DEVEL(LOG_LEVEL_DEBUG, " rail_get_property %s: failed", prop_name); XFree(prop_name); return 1; } if (bytes_left != 0) { XFree(*data); unsigned long remain = ((size / 8) * nitems) + bytes_left; ret = XGetWindowProperty(g_display, target, property, 0l, remain, False, atom_return, &atom_return, &size, &nitems, &bytes_left, data); if (ret != Success) { return 1; } } *count = nitems; return 0; } /*****************************************************************************/ static int rail_win_get_state(Window win) { unsigned long nitems = 0; int rv = -1; char *data = 0; rail_get_property(g_display, win, g_wm_state, g_wm_state, (unsigned char **)&data, &nitems); if (data && nitems > 0) { rv = *(unsigned long *)data; XFree(data); LOG_DEVEL(LOG_LEVEL_DEBUG, " rail_win_get_state: %d", rv); } return rv; } /*****************************************************************************/ static int rail_win_set_state(Window win, unsigned long state) { int old_state; unsigned long data[2] = { state, None }; LOG_DEVEL(LOG_LEVEL_DEBUG, " rail_win_set_state: %ld", state); /* check whether WM_STATE exists */ old_state = rail_win_get_state(win); if (old_state == -1) { /* create WM_STATE property */ XChangeProperty(g_display, win, g_wm_state, g_wm_state, 32, PropModeAppend, (unsigned char *)data, 2); LOG_DEVEL(LOG_LEVEL_DEBUG, " rail_win_set_state: create WM_STATE property"); } else { XChangeProperty(g_display, win, g_wm_state, g_wm_state, 32, PropModeReplace, (unsigned char *)data, 2); } return 0; } /*****************************************************************************/ /* *data pointer that needs g_free */ static int rail_win_get_text(Window win, char **data) { int ret = 0; int i = 0; unsigned long nitems = 0; unsigned char *ldata = 0; char *lldata = 0; if (g_override_window_title != 0) { *data = g_strdup(g_override_window_title); return g_strlen(*data); } ret = rail_get_property(g_display, win, g_utf8_string, g_net_wm_name, &ldata, &nitems); if (ret != 0) { /* _NET_WM_NAME isn't set, use WM_NAME (XFetchName) instead */ XFetchName(g_display, win, &lldata); *data = g_strdup(lldata); i = g_strlen(*data); XFree(lldata); return i; } *data = 0; if (ldata) { *data = g_strdup((char *)ldata); i = g_strlen(*data); XFree(ldata); return i; } return i; } /******************************************************************************/ static int rail_minmax_window(int window_id, int max) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_minmax_window 0x%8.8x:", window_id); if (max) { } else { XUnmapWindow(g_display, window_id); /* change window state to IconicState (3) */ rail_win_set_state(window_id, 0x3); /* * TODO dismiss popups opened so far */ } return 0; } /*****************************************************************************/ static int rail_restore_window(int window_id) { XWindowAttributes window_attributes; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_restore_window 0x%8.8x:", window_id); XGetWindowAttributes(g_display, window_id, &window_attributes); if (window_attributes.map_state != IsViewable) { XMapWindow(g_display, window_id); } LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: calling XRaiseWindow 0x%8.8x", window_id); XRaiseWindow(g_display, window_id); LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_activate: calling XSetInputFocus 0x%8.8x", window_id); XSetInputFocus(g_display, window_id, RevertToParent, CurrentTime); return 0; } /*****************************************************************************/ static int rail_process_system_command(struct stream *s, int size) { int window_id; int command; int index; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_system_command:"); in_uint32_le(s, window_id); in_uint16_le(s, command); index = list_index_of(g_window_list, window_id); if (index < 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_system_command: window 0x%8.8x not in list", window_id); return 0; } switch (command) { case SC_SIZE: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_SIZE", window_id); break; case SC_MOVE: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_MOVE", window_id); break; case SC_MINIMIZE: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_MINIMIZE", window_id); rail_minmax_window(window_id, 0); break; case SC_MAXIMIZE: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_MAXIMIZE", window_id); break; case SC_CLOSE: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_CLOSE", window_id); rail_close_window(window_id); break; case SC_KEYMENU: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_KEYMENU", window_id); break; case SC_RESTORE: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_RESTORE", window_id); rail_restore_window(window_id); break; case SC_DEFAULT: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x SC_DEFAULT", window_id); break; default: LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x unknown command command %d", window_id, command); break; } return 0; } /*****************************************************************************/ static int rail_process_handshake(struct stream *s, int size) { int build_number; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_handshake:"); in_uint32_le(s, build_number); LOG(LOG_LEVEL_DEBUG, " build_number 0x%8.8x", build_number); return 0; } /*****************************************************************************/ static int rail_process_notify_event(struct stream *s, int size) { int window_id; int notify_id; int message; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_notify_event:"); in_uint32_le(s, window_id); in_uint32_le(s, notify_id); in_uint32_le(s, message); LOG(LOG_LEVEL_DEBUG, " window_id 0x%8.8x notify_id 0x%8.8x message 0x%8.8x", window_id, notify_id, message); return 0; } /*****************************************************************************/ static int rail_process_window_move(struct stream *s, int size) { int window_id; int left; int top; int right; int bottom; tsi16 si16; struct rail_window_data *rwd; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_window_move:"); in_uint32_le(s, window_id); in_uint16_le(s, si16); left = si16; in_uint16_le(s, si16); top = si16; in_uint16_le(s, si16); right = si16; in_uint16_le(s, si16); bottom = si16; LOG_DEVEL(LOG_LEVEL_DEBUG, " window_id 0x%8.8x left %d top %d right %d bottom %d width %d height %d", window_id, left, top, right, bottom, right - left, bottom - top); XMoveResizeWindow(g_display, window_id, left, top, right - left, bottom - top); rwd = (struct rail_window_data *) g_malloc(sizeof(struct rail_window_data), 1); rwd->x = left; rwd->y = top; rwd->width = right - left; rwd->height = bottom - top; rail_set_window_data(window_id, rwd); g_free(rwd); return 0; } /*****************************************************************************/ static int rail_process_local_move_size(struct stream *s, int size) { int window_id; int is_move_size_start; int move_size_type; int pos_x; int pos_y; tsi16 si16; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_local_move_size:"); in_uint32_le(s, window_id); in_uint16_le(s, is_move_size_start); in_uint16_le(s, move_size_type); in_uint16_le(s, si16); pos_x = si16; in_uint16_le(s, si16); pos_y = si16; LOG(LOG_LEVEL_DEBUG, " window_id 0x%8.8x is_move_size_start %d move_size_type %d " "pos_x %d pos_y %d", window_id, is_move_size_start, move_size_type, pos_x, pos_y); return 0; } /*****************************************************************************/ /* server to client only */ static int rail_process_min_max_info(struct stream *s, int size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_min_max_info:"); return 0; } /*****************************************************************************/ static int rail_process_client_status(struct stream *s, int size) { int flags; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_client_status:"); in_uint32_le(s, flags); LOG(LOG_LEVEL_DEBUG, " flags 0x%8.8x", flags); return 0; } /*****************************************************************************/ static int rail_process_sys_menu(struct stream *s, int size) { int window_id; int left; int top; tsi16 si16; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_sys_menu:"); in_uint32_le(s, window_id); in_uint16_le(s, si16); left = si16; in_uint16_le(s, si16); top = si16; LOG(LOG_LEVEL_DEBUG, " window_id 0x%8.8x left %d top %d", window_id, left, top); return 0; } /*****************************************************************************/ static int rail_process_lang_bar_info(struct stream *s, int size) { int language_bar_status; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_lang_bar_info:"); in_uint32_le(s, language_bar_status); LOG(LOG_LEVEL_DEBUG, " language_bar_status 0x%8.8x", language_bar_status); return 0; } /*****************************************************************************/ static int rail_process_appid_req(struct stream *s, int size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_appid_req:"); return 0; } /*****************************************************************************/ static int rail_process_appid_resp(struct stream *s, int size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_appid_resp:"); return 0; } /*****************************************************************************/ /* server to client only */ static int rail_process_exec_result(struct stream *s, int size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_process_exec_result:"); return 0; } /*****************************************************************************/ /* data in from client ( client -> xrdp -> chansrv ) */ int rail_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length) { int code; int size; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_data_in:"); in_uint8(s, code); in_uint8s(s, 1); in_uint16_le(s, size); switch (code) { case TS_RAIL_ORDER_EXEC: /* 1 */ rail_process_exec(s, size); break; case TS_RAIL_ORDER_ACTIVATE: /* 2 */ rail_process_activate(s, size); break; case TS_RAIL_ORDER_SYSPARAM: /* 3 */ rail_process_system_param(s, size); break; case TS_RAIL_ORDER_SYSCOMMAND: /* 4 */ rail_process_system_command(s, size); break; case TS_RAIL_ORDER_HANDSHAKE: /* 5 */ rail_process_handshake(s, size); break; case TS_RAIL_ORDER_NOTIFY_EVENT: /* 6 */ rail_process_notify_event(s, size); break; case TS_RAIL_ORDER_WINDOWMOVE: /* 8 */ rail_process_window_move(s, size); break; case TS_RAIL_ORDER_LOCALMOVESIZE: /* 9 */ rail_process_local_move_size(s, size); break; case TS_RAIL_ORDER_MINMAXINFO: /* 10 */ rail_process_min_max_info(s, size); break; case TS_RAIL_ORDER_CLIENTSTATUS: /* 11 */ rail_process_client_status(s, size); break; case TS_RAIL_ORDER_SYSMENU: /* 12 */ rail_process_sys_menu(s, size); break; case TS_RAIL_ORDER_LANGBARINFO: /* 13 */ rail_process_lang_bar_info(s, size); break; case TS_RAIL_ORDER_GET_APPID_REQ: /* 14 */ rail_process_appid_req(s, size); break; case TS_RAIL_ORDER_GET_APPID_RESP: /* 15 */ rail_process_appid_resp(s, size); break; case TS_RAIL_ORDER_EXEC_RESULT: /* 128 */ rail_process_exec_result(s, size); break; default: LOG_DEVEL(LOG_LEVEL_DEBUG, "rail_data_in: unknown code %d size %d", code, size); break; } XFlush(g_display); return 0; } static const unsigned int g_crc_seed = 0xffffffff; static const unsigned int g_crc_table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; #define CRC_START(in_crc) (in_crc) = g_crc_seed #define CRC_PASS(in_pixel, in_crc) \ (in_crc) = g_crc_table[((in_crc) ^ (in_pixel)) & 0xff] ^ ((in_crc) >> 8) #define CRC_END(in_crc) (in_crc) = ((in_crc) ^ g_crc_seed) /*****************************************************************************/ static int get_string_crc(const char *text) { int index; int crc; CRC_START(crc); index = 0; while (text[index] != 0) { CRC_PASS(text[index], crc); index++; } CRC_END(crc); return crc; } /*****************************************************************************/ /* returns 0, event handled, 1 unhandled */ static int rail_win_send_text(Window win) { char *data = 0; struct stream *s; int len = 0; int flags; int crc; struct rail_window_data *rwd; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_win_send_text:"); len = rail_win_get_text(win, &data); rwd = rail_get_window_data_safe(win); if (rwd != 0) { if (data != 0) { if (rwd->valid & RWD_TITLE) { crc = get_string_crc(data); if (rwd->title_crc == crc) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_win_send_text: skipping, title not changed"); g_free(data); XFree(rwd); return 0; } } } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "chansrv::rail_win_send_text: error rail_get_window_data_safe failed"); g_free(data); return 1; } if (data && len > 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_win_send_text: 0x%8.8lx text %s length %d", win, data, len); make_stream(s); init_stream(s, len + 1024); flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_FIELD_TITLE; out_uint32_le(s, 8); /* update title info */ out_uint32_le(s, win); /* window id */ out_uint32_le(s, flags); /* flags */ out_uint32_le(s, len); /* title size */ out_uint8a(s, data, len); /* title */ s_mark_end(s); send_rail_drawing_orders(s->data, (int)(s->end - s->data)); free_stream(s); /* update rail window data */ rwd->valid |= RWD_TITLE; crc = get_string_crc(data); rwd->title_crc = crc; rail_set_window_data(win, rwd); } g_free(data); XFree(rwd); return 0; } /*****************************************************************************/ static int rail_destroy_window(Window window_id) { struct stream *s; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_destroy_window 0x%8.8lx", window_id); make_stream(s); init_stream(s, 1024); out_uint32_le(s, 4); /* destroy_window */ out_uint32_le(s, window_id); s_mark_end(s); send_rail_drawing_orders(s->data, (int)(s->end - s->data)); free_stream(s); return 0; } /*****************************************************************************/ static int rail_show_window(Window window_id, int show_state) { int flags; struct stream *s; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_show_window 0x%8.8lx 0x%x", window_id, show_state); make_stream(s); init_stream(s, 1024); flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_FIELD_SHOW; out_uint32_le(s, 6); /* show_window */ out_uint32_le(s, window_id); /* window_id */ out_uint32_le(s, flags); /* flags */ out_uint32_le(s, show_state); /* show_state */ s_mark_end(s); send_rail_drawing_orders(s->data, (int)(s->end - s->data)); free_stream(s); return 0; } /*****************************************************************************/ static int rail_create_window(Window window_id, Window owner_id) { int x; int y; tui32 width; tui32 height; tui32 border; Window root; tui32 depth; char *title_bytes = 0; int title_size = 0; XWindowAttributes attributes; int style; int ext_style; int num_window_rects = 1; int num_visibility_rects = 1; int i = 0; int flags; int index; int crc; Window transient_for = 0; struct rail_window_data *rwd; struct stream *s; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_create_window 0x%8.8lx", window_id); rwd = rail_get_window_data_safe(window_id); if (rwd == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "chansrv::rail_create_window: error rail_get_window_data_safe failed"); return 0; } XGetGeometry(g_display, window_id, &root, &x, &y, &width, &height, &border, &depth); XGetWindowAttributes(g_display, window_id, &attributes); LOG_DEVEL(LOG_LEVEL_DEBUG, " x %d y %d width %d height %d border_width %d", x, y, width, height, border); index = list_index_of(g_window_list, window_id); if (index == -1) { LOG_DEVEL(LOG_LEVEL_DEBUG, " create new window"); flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_STATE_NEW; list_add_item(g_window_list, window_id); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, " update existing window"); flags = WINDOW_ORDER_TYPE_WINDOW; } title_size = 0; title_bytes = 0; XGetTransientForHint(g_display, window_id, &transient_for); if (attributes.override_redirect) { style = RAIL_STYLE_TOOLTIP; ext_style = RAIL_EXT_STYLE_TOOLTIP; /* for tooltips, we don't grab the window text */ } else if (transient_for > 0) { style = RAIL_STYLE_DIALOG; ext_style = RAIL_EXT_STYLE_DIALOG; owner_id = transient_for; title_size = rail_win_get_text(window_id, &title_bytes); } else { style = RAIL_STYLE_NORMAL; ext_style = RAIL_EXT_STYLE_NORMAL; title_size = rail_win_get_text(window_id, &title_bytes); } make_stream(s); init_stream(s, title_size + 1024 + num_window_rects * 8 + num_visibility_rects * 8); out_uint32_le(s, 2); /* create_window */ out_uint32_le(s, window_id); /* window_id */ out_uint32_le(s, owner_id); /* owner_window_id */ flags |= WINDOW_ORDER_FIELD_OWNER; out_uint32_le(s, style); /* style */ out_uint32_le(s, ext_style); /* extended_style */ flags |= WINDOW_ORDER_FIELD_STYLE; out_uint32_le(s, 0x05); /* show_state */ LOG_DEVEL(LOG_LEVEL_DEBUG, " title %s", title_bytes); flags |= WINDOW_ORDER_FIELD_SHOW; if (title_size > 0) { out_uint16_le(s, title_size); /* title_size */ out_uint8a(s, title_bytes, title_size); /* title */ rwd->valid |= RWD_TITLE; crc = get_string_crc(title_bytes); rwd->title_crc = crc; } else { out_uint16_le(s, 5); /* title_size */ out_uint8a(s, "title", 5); /* title */ rwd->valid |= RWD_TITLE; rwd->title_crc = 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, " set title info %d", title_size); flags |= WINDOW_ORDER_FIELD_TITLE; out_uint32_le(s, 0); /* client_offset_x */ out_uint32_le(s, 0); /* client_offset_y */ flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET; out_uint32_le(s, width); /* client_area_width */ out_uint32_le(s, height); /* client_area_height */ flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE; out_uint32_le(s, 0); /* rp_content */ out_uint32_le(s, g_root_window); /* root_parent_handle */ flags |= WINDOW_ORDER_FIELD_ROOT_PARENT; out_uint32_le(s, x); /* window_offset_x */ out_uint32_le(s, y); /* window_offset_y */ flags |= WINDOW_ORDER_FIELD_WND_OFFSET; out_uint32_le(s, 0); /* window_client_delta_x */ out_uint32_le(s, 0); /* window_client_delta_y */ flags |= WINDOW_ORDER_FIELD_WND_CLIENT_DELTA; out_uint32_le(s, width); /* window_width */ out_uint32_le(s, height); /* window_height */ flags |= WINDOW_ORDER_FIELD_WND_SIZE; out_uint16_le(s, num_window_rects); /* num_window_rects */ for (i = 0; i < num_window_rects; i++) { out_uint16_le(s, 0); /* left */ out_uint16_le(s, 0); /* top */ out_uint16_le(s, width); /* right */ out_uint16_le(s, height); /* bottom */ } flags |= WINDOW_ORDER_FIELD_WND_RECTS; out_uint32_le(s, x); /* visible_offset_x */ out_uint32_le(s, y); /* visible_offset_y */ flags |= WINDOW_ORDER_FIELD_VIS_OFFSET; out_uint16_le(s, num_visibility_rects); /* num_visibility_rects */ for (i = 0; i < num_visibility_rects; i++) { out_uint16_le(s, 0); /* left */ out_uint16_le(s, 0); /* top */ out_uint16_le(s, width); /* right */ out_uint16_le(s, height); /* bottom */ } flags |= WINDOW_ORDER_FIELD_VISIBILITY; out_uint32_le(s, flags); /*flags*/ s_mark_end(s); send_rail_drawing_orders(s->data, (int)(s->end - s->data)); free_stream(s); g_free(title_bytes); rail_set_window_data(window_id, rwd); XFree(rwd); return 0; } /*****************************************************************************/ /* returns 0, event handled, 1 unhandled */ int rail_configure_request_window(XConfigureRequestEvent *config) { int num_window_rects = 1; int num_visibility_rects = 1; int i = 0; int flags; int index; int window_id; int mask; int resized = 0; struct rail_window_data *rwd; struct stream *s; window_id = config->window; mask = config->value_mask; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_configure_request_window: mask %d", mask); if (mask & CWStackMode) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_configure_request_window: CWStackMode " "detail 0x%8.8x above 0x%8.8lx", config->detail, config->above); if (config->detail == Above) { LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_configure_request_window: bring to front " "window_id 0x%8.8x", window_id); /* 0x05 - Show the window in its current size and position. */ rail_show_window(window_id, 5); } } rwd = rail_get_window_data(window_id); if (rwd == 0) { rwd = (struct rail_window_data *)g_malloc(sizeof(struct rail_window_data), 1); rwd->x = config->x; rwd->y = config->y; rwd->width = config->width; rwd->height = config->height; rwd->valid |= RWD_X | RWD_Y | RWD_WIDTH | RWD_HEIGHT; rail_set_window_data(window_id, rwd); g_free(rwd); return 0; } if (!resized) { if (mask & CWX) { if (rwd->valid & RWD_X) { if (rwd->x != config->x) { resized = 1; rwd->x = config->x; } } else { resized = 1; rwd->x = config->x; rwd->valid |= RWD_X; } } } if (!resized) { if (mask & CWY) { if (rwd->valid & RWD_Y) { if (rwd->y != config->y) { resized = 1; rwd->y = config->y; } } else { resized = 1; rwd->y = config->y; rwd->valid |= RWD_Y; } } } if (!resized) { if (mask & CWWidth) { if (rwd->valid & RWD_WIDTH) { if (rwd->width != config->width) { resized = 1; rwd->width = config->width; } } else { resized = 1; rwd->width = config->width; rwd->valid |= RWD_WIDTH; } } } if (!resized) { if (mask & CWHeight) { if (rwd->valid & RWD_HEIGHT) { if (rwd->height != config->height) { resized = 1; rwd->height = config->height; } } else { resized = 1; rwd->height = config->height; rwd->valid |= RWD_HEIGHT; } } } if (resized) { rail_set_window_data(window_id, rwd); XFree(rwd); } else { XFree(rwd); return 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_configure_request_window: 0x%8.8x", window_id); LOG_DEVEL(LOG_LEVEL_DEBUG, " x %d y %d width %d height %d border_width %d", config->x, config->y, config->width, config->height, config->border_width); index = list_index_of(g_window_list, window_id); if (index == -1) { /* window isn't mapped yet */ LOG_DEVEL(LOG_LEVEL_ERROR, "chansrv::rail_configure_request_window: window not mapped"); return 0; } flags = WINDOW_ORDER_TYPE_WINDOW; make_stream(s); init_stream(s, 1024 + num_window_rects * 8 + num_visibility_rects * 8); out_uint32_le(s, 10); /* configure_window */ out_uint32_le(s, window_id); /* window_id */ out_uint32_le(s, 0); /* client_offset_x */ out_uint32_le(s, 0); /* client_offset_y */ flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET; out_uint32_le(s, config->width); /* client_area_width */ out_uint32_le(s, config->height); /* client_area_height */ flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE; out_uint32_le(s, 0); /* rp_content */ out_uint32_le(s, g_root_window); /* root_parent_handle */ flags |= WINDOW_ORDER_FIELD_ROOT_PARENT; out_uint32_le(s, config->x); /* window_offset_x */ out_uint32_le(s, config->y); /* window_offset_y */ flags |= WINDOW_ORDER_FIELD_WND_OFFSET; out_uint32_le(s, 0); /* window_client_delta_x */ out_uint32_le(s, 0); /* window_client_delta_y */ flags |= WINDOW_ORDER_FIELD_WND_CLIENT_DELTA; out_uint32_le(s, config->width); /* window_width */ out_uint32_le(s, config->height); /* window_height */ flags |= WINDOW_ORDER_FIELD_WND_SIZE; out_uint16_le(s, num_window_rects); /* num_window_rects */ for (i = 0; i < num_window_rects; i++) { out_uint16_le(s, 0); /* left */ out_uint16_le(s, 0); /* top */ out_uint16_le(s, config->width); /* right */ out_uint16_le(s, config->height); /* bottom */ } flags |= WINDOW_ORDER_FIELD_WND_RECTS; out_uint32_le(s, config->x); /* visible_offset_x */ out_uint32_le(s, config->y); /* visible_offset_y */ flags |= WINDOW_ORDER_FIELD_VIS_OFFSET; out_uint16_le(s, num_visibility_rects); /* num_visibility_rects */ for (i = 0; i < num_visibility_rects; i++) { out_uint16_le(s, 0); /* left */ out_uint16_le(s, 0); /* top */ out_uint16_le(s, config->width); /* right */ out_uint16_le(s, config->height); /* bottom */ } flags |= WINDOW_ORDER_FIELD_VISIBILITY; out_uint32_le(s, flags); /*flags*/ s_mark_end(s); send_rail_drawing_orders(s->data, (int)(s->end - s->data)); free_stream(s); return 0; } /*****************************************************************************/ /* returns 0, event handled, 1 unhandled */ int rail_configure_window(XConfigureEvent *config) { int num_window_rects = 1; int num_visibility_rects = 1; int i = 0; int flags; int index; int window_id; struct stream *s; window_id = config->window; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_configure_window 0x%8.8x", window_id); LOG_DEVEL(LOG_LEVEL_DEBUG, " x %d y %d width %d height %d border_width %d", config->x, config->y, config->width, config->height, config->border_width); index = list_index_of(g_window_list, window_id); if (index == -1) { /* window isn't mapped yet */ return 0; } flags = WINDOW_ORDER_TYPE_WINDOW; make_stream(s); init_stream(s, 1024 + num_window_rects * 8 + num_visibility_rects * 8); out_uint32_le(s, 10); /* configure_window */ out_uint32_le(s, window_id); /* window_id */ out_uint32_le(s, 0); /* client_offset_x */ out_uint32_le(s, 0); /* client_offset_y */ flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET; out_uint32_le(s, config->width); /* client_area_width */ out_uint32_le(s, config->height); /* client_area_height */ flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE; out_uint32_le(s, 0); /* rp_content */ out_uint32_le(s, g_root_window); /* root_parent_handle */ flags |= WINDOW_ORDER_FIELD_ROOT_PARENT; out_uint32_le(s, config->x); /* window_offset_x */ out_uint32_le(s, config->y); /* window_offset_y */ flags |= WINDOW_ORDER_FIELD_WND_OFFSET; out_uint32_le(s, 0); /* window_client_delta_x */ out_uint32_le(s, 0); /* window_client_delta_y */ flags |= WINDOW_ORDER_FIELD_WND_CLIENT_DELTA; out_uint32_le(s, config->width); /* window_width */ out_uint32_le(s, config->height); /* window_height */ flags |= WINDOW_ORDER_FIELD_WND_SIZE; out_uint16_le(s, num_window_rects); /* num_window_rects */ for (i = 0; i < num_window_rects; i++) { out_uint16_le(s, 0); /* left */ out_uint16_le(s, 0); /* top */ out_uint16_le(s, config->width); /* right */ out_uint16_le(s, config->height); /* bottom */ } flags |= WINDOW_ORDER_FIELD_WND_RECTS; out_uint32_le(s, config->x); /* visible_offset_x */ out_uint32_le(s, config->y); /* visible_offset_y */ flags |= WINDOW_ORDER_FIELD_VIS_OFFSET; out_uint16_le(s, num_visibility_rects); /* num_visibility_rects */ for (i = 0; i < num_visibility_rects; i++) { out_uint16_le(s, 0); /* left */ out_uint16_le(s, 0); /* top */ out_uint16_le(s, config->width); /* right */ out_uint16_le(s, config->height); /* bottom */ } flags |= WINDOW_ORDER_FIELD_VISIBILITY; out_uint32_le(s, flags); /*flags*/ s_mark_end(s); send_rail_drawing_orders(s->data, (int)(s->end - s->data)); free_stream(s); return 0; } /*****************************************************************************/ static int rail_desktop_resize(XEvent *lxevent) { LOG_DEVEL(LOG_LEVEL_INFO, "rail_desktop_resize:"); return 0; } /*****************************************************************************/ /* returns 0, event handled, 1 unhandled */ int rail_xevent(void *xevent) { XEvent *lxevent; XEvent lastevent; XWindowChanges xwc; int rv; int index; XWindowAttributes wnd_attributes; char *prop_name; LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::rail_xevent:"); if (!g_rail_up) { return 1; } rv = 1; lxevent = (XEvent *)xevent; switch (lxevent->type) { case PropertyNotify: prop_name = XGetAtomName(g_display, lxevent->xproperty.atom); LOG_DEVEL(LOG_LEVEL_DEBUG, " got PropertyNotify window_id 0x%8.8lx %s state new %d", lxevent->xproperty.window, prop_name, lxevent->xproperty.state == PropertyNewValue); if (list_index_of(g_window_list, lxevent->xproperty.window) < 0) { break; } if (g_strcmp(prop_name, "WM_NAME") == 0 || g_strcmp(prop_name, "_NET_WM_NAME") == 0) { XGetWindowAttributes(g_display, lxevent->xproperty.window, &wnd_attributes); if (wnd_attributes.map_state == IsViewable) { rail_win_send_text(lxevent->xproperty.window); rv = 0; } } XFree(prop_name); break; case ConfigureRequest: LOG_DEVEL(LOG_LEVEL_DEBUG, " got ConfigureRequest window_id 0x%8.8lx", lxevent->xconfigurerequest.window); g_memset(&xwc, 0, sizeof(xwc)); xwc.x = lxevent->xconfigurerequest.x; xwc.y = lxevent->xconfigurerequest.y; xwc.width = lxevent->xconfigurerequest.width; xwc.height = lxevent->xconfigurerequest.height; xwc.border_width = lxevent->xconfigurerequest.border_width; xwc.sibling = lxevent->xconfigurerequest.above; xwc.stack_mode = lxevent->xconfigurerequest.detail; XConfigureWindow(g_display, lxevent->xconfigurerequest.window, lxevent->xconfigurerequest.value_mask, &xwc); rail_configure_request_window(&(lxevent->xconfigurerequest)); rv = 0; break; case CreateNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got CreateNotify window 0x%8.8lx parent 0x%8.8lx", lxevent->xcreatewindow.window, lxevent->xcreatewindow.parent); rail_select_input(lxevent->xcreatewindow.window); break; case DestroyNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got DestroyNotify window 0x%8.8lx event 0x%8.8lx", lxevent->xdestroywindow.window, lxevent->xdestroywindow.event); if (lxevent->xdestroywindow.window != lxevent->xdestroywindow.event) { break; } index = list_index_of(g_window_list, lxevent->xdestroywindow.window); if (index >= 0) { rail_destroy_window(lxevent->xdestroywindow.window); list_remove_item(g_window_list, index); } rv = 0; break; case MapRequest: LOG_DEVEL(LOG_LEVEL_DEBUG, " got MapRequest window 0x%8.8lx", lxevent->xmaprequest.window); XMapWindow(g_display, lxevent->xmaprequest.window); break; case MapNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got MapNotify window 0x%8.8lx event 0x%8.8lx", lxevent->xmap.window, lxevent->xmap.event); if (lxevent->xmap.window != lxevent->xmap.event) { break; } if (!is_window_valid_child_of_root(lxevent->xmap.window)) { break; } XGetWindowAttributes(g_display, lxevent->xmap.window, &wnd_attributes); if (wnd_attributes.map_state == IsViewable) { rail_create_window(lxevent->xmap.window, g_root_window); if (!wnd_attributes.override_redirect) { rail_win_set_state(lxevent->xmap.window, 0x1); /* NormalState */ rail_win_send_text(lxevent->xmap.window); } rv = 0; } break; case UnmapNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got UnmapNotify 0x%8.8lx", lxevent->xunmap.event); if (lxevent->xunmap.window != lxevent->xunmap.event) { break; } if (is_window_valid_child_of_root(lxevent->xunmap.window)) { index = list_index_of(g_window_list, lxevent->xunmap.window); LOG_DEVEL(LOG_LEVEL_DEBUG, " window 0x%8.8lx is unmapped", lxevent->xunmap.window); if (index >= 0) { XGetWindowAttributes(g_display, lxevent->xunmap.window, &wnd_attributes); if (wnd_attributes.override_redirect) { // remove popups rail_destroy_window(lxevent->xunmap.window); list_remove_item(g_window_list, index); } else { rail_show_window(lxevent->xunmap.window, 0x0); } rv = 0; } } break; case ConfigureNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got ConfigureNotify 0x%8.8lx event 0x%8.8lx", lxevent->xconfigure.window, lxevent->xconfigure.event); rv = 0; if (lxevent->xconfigure.event != lxevent->xconfigure.window || lxevent->xconfigure.override_redirect) { break; } /* skip dup ConfigureNotify */ while (XCheckTypedWindowEvent(g_display, lxevent->xconfigure.window, ConfigureNotify, &lastevent)) { if (lastevent.xconfigure.event == lastevent.xconfigure.window && lxevent->xconfigure.override_redirect == 0) { lxevent = &lastevent; } } #if 0 rail_configure_window(&(lxevent->xconfigure)); #endif break; case FocusIn: LOG_DEVEL(LOG_LEVEL_DEBUG, " got FocusIn"); g_focus_win = lxevent->xfocus.window; break; case FocusOut: LOG_DEVEL(LOG_LEVEL_DEBUG, " got FocusOut"); break; case ButtonPress: LOG_DEVEL(LOG_LEVEL_DEBUG, " got ButtonPress"); break; case EnterNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got EnterNotify"); break; case LeaveNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got LeaveNotify"); break; case ReparentNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, " got ReparentNotify window 0x%8.8lx parent 0x%8.8lx " "event 0x%8.8lx x %d y %d override redirect %d", lxevent->xreparent.window, lxevent->xreparent.parent, lxevent->xreparent.event, lxevent->xreparent.x, lxevent->xreparent.y, lxevent->xreparent.override_redirect); if (lxevent->xreparent.window != lxevent->xreparent.event) { break; } if (lxevent->xreparent.parent != g_root_window) { index = list_index_of(g_window_list, lxevent->xreparent.window); if (index >= 0) { rail_destroy_window(lxevent->xreparent.window); list_remove_item(g_window_list, index); } } rv = 0; break; default: if (g_xrr_event_base > 0) { if (lxevent->type == g_xrr_event_base + RRScreenChangeNotify) { rail_desktop_resize(lxevent); rv = 0; break; } } } return rv; } xrdp-0.10.1/sesman/chansrv/clipboard_file.h000644 001751 000000 00000004035 14652432047 020700 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(CLIPBOARD_FILE_H) #define CLIPBOARD_FILE_H #include "arch.h" #include "parse.h" int clipboard_send_data_response_for_file(const char *data, int data_size); int clipboard_process_file_request(struct stream *s, int clip_msg_status, int clip_msg_len); int clipboard_process_file_response(struct stream *s, int clip_msg_status, int clip_msg_len); /** * Process a CLIPRDR_FILELIST - see [MS-RDPECLIP] 2.2.5.2.3 * * Files in the list are added to the xfs filesystem in the clipboard * directory. The filenames names are added to the 'file_list' for the user. * Files are prefixed with '/' and separated by '\n'. * * If the list is not big enough, whole filenames are omitted, and a warning * message is logged. This is not an error. * * @param s Input stream containing CLIPRDR_FILELIST * @param file_list Output buffer for filenames * @param file_list_size Size of buffer, including space for '\0'. * @param fprefix Prefix for each file in the file list (e.g. "file://") * * @return Zero for success. */ int clipboard_c2s_in_files(struct stream *s, char *file_list, int file_list_size, const char *fprefix); int clipboard_request_file_size(int stream_id, int lindex); int clipboard_request_file_data(int stream_id, int lindex, int offset, int request_bytes); #endif xrdp-0.10.1/sesman/chansrv/clipboard-notes.txt000644 001751 000000 00000005154 14652432047 021422 0ustar00metawheel000000 000000 LOG_LEVEL dolphin clipboard_event_selection_owner_notify: clipboard_event_selection_notify: 0x1f7 text/uri-list clipboard_event_selection_notify: 0x1f8 text/x-moz-url clipboard_event_selection_notify: 0x1f3 text/plain clipboard_event_selection_notify: 0xee UTF8_STRING clipboard_event_selection_notify: 0x1f STRING clipboard_event_selection_notify: 0x1a1 TEXT clipboard_event_selection_notify: 0x1a0 COMPOUND_TEXT clipboard_event_selection_notify: 0x1fa application/x-qiconlist clipboard_event_selection_notify: 0xec TARGETS clipboard_event_selection_notify: 0xed MULTIPLE clipboard_event_selection_notify: 0xeb TIMESTAMP clipboard_event_selection_notify: 0x183 SAVE_TARGETS thunar clipboard_event_selection_owner_notify: clipboard_event_selection_notify: 0xeb TIMESTAMP clipboard_event_selection_notify: 0xec TARGETS clipboard_event_selection_notify: 0xed MULTIPLE clipboard_event_selection_notify: 0x204 x-special/gnome-copied-files clipboard_event_selection_notify: 0xee UTF8_STRING clipboard_data_in: clipboard_data_in: 3 pcmanfm clipboard_event_selection_owner_notify: clipboard_event_selection_notify: 0xeb TIMESTAMP clipboard_event_selection_notify: 0xec TARGETS clipboard_event_selection_notify: 0xed MULTIPLE clipboard_event_selection_notify: 0x1f7 text/uri-list clipboard_event_selection_notify: 0x204 x-special/gnome-copied-files clipboard_event_selection_notify: 0x1f9 application/x-kde-cutselection clipboard_event_selection_notify: 0xee UTF8_STRING CAJA clipboard_event_selection_notify: 0x141 TIMESTAMP clipboard_event_selection_notify: 0x130 TARGETS clipboard_event_selection_notify: 0x142 MULTIPLE clipboard_event_selection_notify: 0x143 x-special/mate-copied-files clipboard_event_selection_notify: 0x144 text/uri-list clipboard_event_selection_notify: 0x0 (null) clipboard_event_selection_notify: 0x25 WM_ICON_NAME clipboard_event_selection_notify: 0x47524154 (null) clipboard_event_selection_notify: 0x50000078 (null) clipboard_event_selection_notify: 0x0 (null) clipboard_event_selection_notify: 0x25 WM_ICON_NAME nautilus clipboard_event_selection_notify: 0x141 TIMESTAMP clipboard_event_selection_notify: 0x130 TARGETS clipboard_event_selection_notify: 0x142 MULTIPLE clipboard_event_selection_notify: 0x154 x-special/gnome-copied-files clipboard_event_selection_notify: 0x144 text/uri-list clipboard_event_selection_notify: 0xfb UTF8_STRING clipboard_event_selection_notify: 0x0 (null) clipboard_event_selection_notify: 0x25 WM_ICON_NAME clipboard_event_selection_notify: 0x47524154 (null) clipboard_event_selection_notify: 0x50000078 (null) clipboard_event_selection_notify: 0x0 (null) clipboard_event_selection_notify: 0x25 WM_ICON_NAME xrdp-0.10.1/sesman/chansrv/chansrv_xfs.c000644 001751 000000 00000062522 14652432047 020266 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file implements the interface in chansrv_fuse_fs.h */ #include #include #include #include #include #include #if defined(HAVE_CONFIG_H) #include #endif #include "os_calls.h" #include "log.h" #include "chansrv_xfs.h" /* * Skip this module if FUSE is not supported. A standards-compliant C * translation unit must contain at least one declaration (C99:6.9), and we've * fulfilled that requirement by this stage. */ #ifdef XRDP_FUSE #define INODE_TABLE_ALLOCATION_INITIAL 4096 #define INODE_TABLE_ALLOCATION_GRANULARITY 100 /* inum of the delete pending directory */ #define DELETE_PENDING_ID 2 /* * A double-linked list of inodes, sorted by inum * * The elements in the list are sorted in increasing inum order, as this * allows a directory enumeration to be easily resumed if elements * are removed or added. See xfs_readdir() for details on this. */ typedef struct xfs_inode_all XFS_INODE_ALL; typedef struct xfs_list { XFS_INODE_ALL *begin; XFS_INODE_ALL *end; } XFS_LIST; /* * A complete inode, including the private elements used by the * implementation */ typedef struct xfs_inode_all { XFS_INODE pub; /* Public elements */ /* * Directory linkage elements * * Because we don't support hard-linking, elements can be stored in * one and only one directory:- */ struct xfs_inode_all *parent; /* Parent inode */ struct xfs_inode_all *next; /* Next entry in parent */ struct xfs_inode_all *previous; /* Previous entry in parent */ XFS_LIST dir; /* Directory only - children */ /* * Other private elements */ unsigned int open_count; /* Regular files only */ } XFS_INODE_ALL; /* the xrdp file system in memory * * inode_table allows for O(1) access to any file based on the inum. * Index 0 is unused, so we can use an inode of zero for * an invalid inode, and avoid off-by-one errors index * 1 is our '.' directory. * 2 is the delete pending directory, where we can place * inodes with a positive open count which are * deleted. * free_list List of free inode numbers. Allows for O(1) access to * a free node, provided the free list is not empty. */ struct xfs_fs { XFS_INODE_ALL **inode_table; /* a table of entries; can grow. */ fuse_ino_t *free_list; /* Free inodes */ unsigned int inode_count; /* Current number of inodes */ unsigned int free_count; /* Size of free_list */ unsigned int generation; /* Changes when an inode is deleted */ }; /* A directory handle * * inum inum of the directory being scanned * generation Generation of the inum we opened */ struct xfs_dir_handle { fuse_ino_t inum; tui32 generation; }; /* ------------------------------------------------------------------------ */ static int grow_xfs(struct xfs_fs *xfs, unsigned int extra_inodes) { int result = 0; unsigned int new_count = xfs->inode_count + extra_inodes; XFS_INODE_ALL **new_table; fuse_ino_t *new_free_list; new_table = (XFS_INODE_ALL **) realloc(xfs->inode_table, new_count * sizeof(new_table[0])); if (new_table != NULL) { unsigned int i; for (i = xfs->inode_count ; i < new_count ; ++i) { new_table[i] = NULL; } xfs->inode_table = new_table; new_free_list = (fuse_ino_t *) realloc(xfs->free_list, new_count * sizeof(new_free_list[0])); if (new_free_list) { /* Add the new inodes in to the new_free_list, so the lowest * number is allocated first */ i = new_count; while (i > xfs->inode_count) { new_free_list[xfs->free_count++] = --i; } xfs->free_list = new_free_list; xfs->inode_count = new_count; result = 1; } } return result; } /* ------------------------------------------------------------------------ */ static void add_inode_to_list(XFS_LIST *list, XFS_INODE_ALL *xino) { fuse_ino_t inum = xino->pub.inum; /* Find the element we need to insert after */ XFS_INODE_ALL *predecessor = list->end; while (predecessor != NULL && predecessor->pub.inum > inum) { predecessor = predecessor->previous; } if (predecessor == NULL) { /* Inserting at the beginning */ /* Set up links in node */ xino->next = list->begin; xino->previous = NULL; /* Set up back-link to node */ if (list->begin == NULL) { /* We are the last node */ list->end = xino; } else { list->begin->previous = xino; } /* Set up forward-link to node */ list->begin = xino; } else { /* Set up links in node */ xino->next = predecessor->next; xino->previous = predecessor; /* Set up back-link to node */ if (predecessor->next == NULL) { list->end = xino; } else { predecessor->next->previous = xino; } /* Set up forward-link to node */ predecessor->next = xino; } } /* ------------------------------------------------------------------------ */ static void remove_inode_from_list(XFS_LIST *list, XFS_INODE_ALL *xino) { if (xino->previous == NULL) { /* First element */ list->begin = xino->next; } else { xino->previous->next = xino->next; } if (xino->next == NULL) { /* Last element */ list->end = xino->previous; } else { xino->next->previous = xino->previous; } } /* ------------------------------------------------------------------------ */ static void link_inode_into_directory_node(XFS_INODE_ALL *dinode, XFS_INODE_ALL *xino) { xino->parent = dinode; add_inode_to_list(&dinode->dir, xino); } /* ------------------------------------------------------------------------ */ static void unlink_inode_from_parent(XFS_INODE_ALL *xino) { remove_inode_from_list(&xino->parent->dir, xino); xino->next = NULL; xino->previous = NULL; xino->parent = NULL; } /* ------------------------------------------------------------------------ */ struct xfs_fs * xfs_create_xfs_fs(mode_t umask, uid_t uid, gid_t gid) { struct xfs_fs *xfs = g_new0(struct xfs_fs, 1); XFS_INODE_ALL *xino1 = NULL; XFS_INODE_ALL *xino2 = NULL; if (xfs != NULL) { xfs->inode_count = 0; xfs->free_count = 0; xfs->inode_table = NULL; xfs->free_list = NULL; xfs->generation = 1; /* xfs->inode_table check should be superfluous here, but it * prevents cppcheck 2.2/2.3 generating a false positive nullPointer * report */ if (!grow_xfs(xfs, INODE_TABLE_ALLOCATION_INITIAL) || xfs->inode_table == NULL || (xino1 = g_new0(XFS_INODE_ALL, 1)) == NULL || (xino2 = g_new0(XFS_INODE_ALL, 1)) == NULL) { free(xino1); free(xino2); xfs_delete_xfs_fs(xfs); xfs = NULL; } else { /* * The use of grow_xfs to allocate the inode table will make * inodes 0, 1 (FUSE_ROOT_ID) and 2 (DELETE_PENDING_ID) the first * available free inodes. We can ignore these */ xfs->free_count -= 3; xfs->inode_table[0] = NULL; xfs->inode_table[FUSE_ROOT_ID] = xino1; xfs->inode_table[DELETE_PENDING_ID] = xino2; xino1->pub.inum = FUSE_ROOT_ID; xino1->pub.mode = (S_IFDIR | 0777) & ~umask; xino1->pub.uid = uid; xino1->pub.gid = gid; xino1->pub.size = 0; xino1->pub.atime = time(0); xino1->pub.mtime = xino1->pub.atime; xino1->pub.ctime = xino1->pub.atime; strcpy(xino1->pub.name, "."); xino1->pub.generation = xfs->generation; xino1->pub.is_redirected = 0; xino1->pub.device_id = 0; /* * FUSE_ROOT_ID has no parent rather than being a parent * of itself. This is intentional */ xino1->parent = NULL; xino1->next = NULL; xino1->previous = NULL; xino1->dir.begin = NULL; xino1->dir.end = NULL; xino2->pub.inum = DELETE_PENDING_ID; xino2->pub.mode = (S_IFDIR | 0777) & ~umask; xino2->pub.uid = uid; xino2->pub.gid = gid; xino2->pub.size = 0; xino2->pub.atime = time(0); xino2->pub.mtime = xino2->pub.atime; xino2->pub.ctime = xino2->pub.atime; strcpy(xino2->pub.name, ".delete-pending"); xino2->pub.generation = xfs->generation; xino2->pub.is_redirected = 0; xino2->pub.device_id = 0; xino2->parent = NULL; xino2->next = NULL; xino2->previous = NULL; xino2->dir.begin = NULL; xino2->dir.end = NULL; /* * Uncomment this line to make the .delete-pending * directory visible to the user in the root */ /* link_inode_into_directory_node(xino1, xino2); */ } } return xfs; } /* ------------------------------------------------------------------------ */ void xfs_delete_xfs_fs(struct xfs_fs *xfs) { if (xfs == NULL) { return; } if (xfs->inode_table != NULL) { size_t i; for (i = 0 ; i < xfs->inode_count; ++i) { free(xfs->inode_table[i]); } } free(xfs->inode_table); free(xfs->free_list); free(xfs); } /* ------------------------------------------------------------------------ */ XFS_INODE * xfs_add_entry(struct xfs_fs *xfs, fuse_ino_t parent_inum, const char *name, mode_t mode) { XFS_INODE *result = NULL; XFS_INODE_ALL *parent = NULL; /* Checks:- * 1) the parent exists (and is a directory) * 2) the caller is not inserting into the .delete-pending directory, * 3) Name's not too long * 4) Entry does not already exist */ if (parent_inum < xfs->inode_count && ((parent = xfs->inode_table[parent_inum]) != NULL) && (parent->pub.mode & S_IFDIR) != 0 && parent_inum != DELETE_PENDING_ID && strlen(name) <= XFS_MAXFILENAMELEN && !xfs_lookup_in_dir(xfs, parent_inum, name)) { /* Sanitise the mode so one-and-only-one of S_IFDIR and * S_IFREG is set */ if ((mode & S_IFDIR) != 0) { mode = (mode & 0777) | S_IFDIR; } else { mode = (mode & 0777) | S_IFREG; } /* Space for a new entry? */ if (xfs->free_count > 0 || grow_xfs(xfs, INODE_TABLE_ALLOCATION_GRANULARITY)) { XFS_INODE_ALL *xino = NULL; if ((xino = g_new0(XFS_INODE_ALL, 1)) != NULL) { fuse_ino_t inum = xfs->free_list[--xfs->free_count]; if (xfs->inode_table[inum] != NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "Unexpected non-NULL value in inode table " "entry %ld", inum); } xfs->inode_table[inum] = xino; xino->pub.inum = inum; xino->pub.mode = mode; xino->pub.uid = parent->pub.uid; xino->pub.gid = parent->pub.gid; if (mode & S_IFDIR) { xino->pub.size = 4096; } else { xino->pub.size = 0; } xino->pub.atime = time(0); xino->pub.mtime = xino->pub.atime; xino->pub.ctime = xino->pub.atime; strcpy(xino->pub.name, name); xino->pub.generation = xfs->generation; xino->pub.is_redirected = parent->pub.is_redirected; xino->pub.device_id = parent->pub.device_id; xino->pub.lindex = 0; xino->parent = NULL; xino->next = NULL; xino->previous = NULL; link_inode_into_directory_node(parent, xino); result = &xino->pub; } } } return result; } /* ------------------------------------------------------------------------ */ void xfs_remove_directory_contents(struct xfs_fs *xfs, fuse_ino_t inum) { XFS_INODE_ALL *xino = NULL; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && ((xino->pub.mode & S_IFDIR) != 0)) { XFS_INODE_ALL *e; while ((e = xino->dir.end) != NULL) { xfs_remove_entry(xfs, e->pub.inum); } } } /* ------------------------------------------------------------------------ */ void xfs_remove_entry(struct xfs_fs *xfs, fuse_ino_t inum) { XFS_INODE_ALL *xino = NULL; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL)) { if ((xino->pub.mode & S_IFDIR) != 0) { xfs_remove_directory_contents(xfs, inum); } unlink_inode_from_parent(xino); if ((xino->pub.mode & S_IFREG) != 0 && xino->open_count > 0) { link_inode_into_directory_node( xfs->inode_table[DELETE_PENDING_ID], xino); } else { xfs->free_list[xfs->free_count++] = inum; xfs->inode_table[inum] = NULL; /* * Bump the generation when we return an inum to the free list, * so that the caller can distinguish re-uses of the same inum. */ ++xfs->generation; free(xino); } } } /* ------------------------------------------------------------------------ */ XFS_INODE * xfs_get(struct xfs_fs *xfs, fuse_ino_t inum) { return (inum < xfs->inode_count) ? &xfs->inode_table[inum]->pub : NULL; } /* ------------------------------------------------------------------------ */ char * xfs_get_full_path(struct xfs_fs *xfs, fuse_ino_t inum) { char *result = NULL; XFS_INODE_ALL *xino = NULL; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL)) { if (xino->pub.inum == FUSE_ROOT_ID) { return strdup("/"); } else { /* * Add up the lengths of all the names up to the root, * allowing one extra char for a '/' prefix for each element */ size_t len = 0; XFS_INODE_ALL *p; for (p = xino ; p && p->pub.inum != FUSE_ROOT_ID ; p = p->parent) { len += strlen(p->pub.name); ++len; /* Allow for '/' prefix */ } result = (char *) malloc(len + 1); if (result != NULL) { /* Construct the path from the end */ char *end = result + len; *end = '\0'; for (p = xino ; p && p->pub.inum != FUSE_ROOT_ID ; p = p->parent) { len = strlen(p->pub.name); end -= (len + 1); *end = '/'; memcpy(end + 1, p->pub.name, len); } } } } return result; } /* ------------------------------------------------------------------------ */ XFS_INODE * xfs_lookup_in_dir(struct xfs_fs *xfs, fuse_ino_t inum, const char *name) { XFS_INODE_ALL *xino; XFS_INODE *result = NULL; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && (xino->pub.mode & S_IFDIR) != 0) { XFS_INODE_ALL *p; for (p = xino->dir.begin ; p != NULL; p = p->next) { if (strcmp(p->pub.name, name) == 0) { result = &p->pub; break; } } } return result; } /* ------------------------------------------------------------------------ */ int xfs_is_dir_empty(struct xfs_fs *xfs, fuse_ino_t inum) { XFS_INODE_ALL *xino = NULL; int result = 0; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && (xino->pub.mode & S_IFDIR) != 0) { result = (xino->dir.begin == NULL); } return result; } /* ------------------------------------------------------------------------ */ unsigned int xfs_is_under(struct xfs_fs *xfs, fuse_ino_t dir, fuse_ino_t entry) { unsigned int result = 0; XFS_INODE_ALL *dxino = NULL; XFS_INODE_ALL *exino = NULL; if (dir < xfs->inode_count && ((dxino = xfs->inode_table[dir]) != NULL) && (dxino->pub.mode & S_IFDIR) != 0 && entry < xfs->inode_count && ((exino = xfs->inode_table[entry]) != NULL)) { unsigned int count = 0; while (exino != NULL && exino != dxino) { ++count; exino = exino->parent; } if (exino != NULL) { result = count; } } return result; } /* ------------------------------------------------------------------------ */ struct xfs_dir_handle * xfs_opendir(struct xfs_fs *xfs, fuse_ino_t dir) { XFS_INODE_ALL *xino = NULL; struct xfs_dir_handle *result = NULL; if (dir < xfs->inode_count && ((xino = xfs->inode_table[dir]) != NULL) && (xino->pub.mode & S_IFDIR) != 0) { result = g_new0(struct xfs_dir_handle, 1); if (result) { result->inum = xino->pub.inum; result->generation = xino->pub.generation; } } return result; } /* ------------------------------------------------------------------------ */ XFS_INODE * xfs_readdir(struct xfs_fs *xfs, struct xfs_dir_handle *handle, off_t *off) { XFS_INODE_ALL *result = NULL; XFS_INODE_ALL *dxino = NULL; XFS_INODE_ALL *xino = NULL; /* Check the directory is still valid */ if (handle->inum < xfs->inode_count && ((dxino = xfs->inode_table[handle->inum]) != NULL) && (dxino->pub.mode & S_IFDIR) != 0 && handle->generation == dxino->pub.generation) { fuse_ino_t inum; if (*off == (off_t) -1) { /* We're at the end already */ } else if ((inum = *off) == 0) { /* First call */ result = dxino->dir.begin; } else if (inum < xfs->inode_count && (xino = xfs->inode_table[inum]) != 0 && xino->parent == dxino) { /* The node we're pointing to is still valid */ result = xino; } else { /* * The file we wanted has been pulled out from under us. * We will look forward in the inode table to try to * discover the next inode in the directory. Because * files are stored in inode order, this guarantees * we'll meet POSIX requirements. */ for (inum = inum + 1 ; inum < xfs->inode_count ; ++inum) { if ((xino = xfs->inode_table[inum]) != 0 && xino->parent == dxino) { result = xino; break; } } } } /* Update the offset */ if (result == NULL || result->next == NULL) { /* We're done */ *off = (off_t) -1; } else { *off = (off_t)result->next->pub.inum; } /* Caller only sees public interface to the result */ return (result) ? &result->pub : NULL; } /* ------------------------------------------------------------------------ */ void xfs_closedir(struct xfs_fs *xfs, struct xfs_dir_handle *handle) { free(handle); } /* ------------------------------------------------------------------------ */ void xfs_increment_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum) { XFS_INODE_ALL *xino; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && (xino->pub.mode & S_IFREG) != 0) { ++xino->open_count; } } /* ------------------------------------------------------------------------ */ void xfs_decrement_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum) { XFS_INODE_ALL *xino; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && (xino->pub.mode & S_IFREG) != 0) { if (xino->open_count > 0) { --xino->open_count; } if (xino->open_count == 0 && xino->parent == xfs->inode_table[DELETE_PENDING_ID]) { /* We can get rid of this one now */ xfs_remove_entry(xfs, inum); } } } /* ------------------------------------------------------------------------ */ unsigned int xfs_get_file_open_count(struct xfs_fs *xfs, fuse_ino_t inum) { unsigned int result = 0; XFS_INODE_ALL *xino; if (inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && (xino->pub.mode & S_IFREG) != 0) { result = xino->open_count; } return result; } /* ------------------------------------------------------------------------ */ void xfs_delete_redirected_entries_with_device_id(struct xfs_fs *xfs, tui32 device_id) { fuse_ino_t inum; XFS_INODE_ALL *xino; /* Using xfs_remove_entry() is convenient, but it recurses * in to directories. To make sure all entries are removed, set the * open_count of all affected files to 0 first */ for (inum = FUSE_ROOT_ID; inum < xfs->inode_count; ++inum) { if ((xino = xfs->inode_table[inum]) != NULL && xino->pub.is_redirected != 0 && xino->pub.device_id == device_id && (xino->pub.mode & S_IFREG) != 0) { xino->open_count = 0; } } /* Now we can be sure everything will be deleted correctly */ for (inum = FUSE_ROOT_ID; inum < xfs->inode_count; ++inum) { if ((xino = xfs->inode_table[inum]) != NULL && xino->pub.is_redirected != 0 && xino->pub.device_id == device_id) { xfs_remove_entry(xfs, xino->pub.inum); } } } /* ------------------------------------------------------------------------ */ int xfs_check_move_entry(struct xfs_fs *xfs, fuse_ino_t inum, fuse_ino_t new_parent_inum, const char *name) { XFS_INODE_ALL *xino; XFS_INODE_ALL *parent; return (strlen(name) <= XFS_MAXFILENAMELEN && inum < xfs->inode_count && ((xino = xfs->inode_table[inum]) != NULL) && new_parent_inum != DELETE_PENDING_ID && new_parent_inum < xfs->inode_count && ((parent = xfs->inode_table[new_parent_inum]) != NULL) && (parent->pub.mode & S_IFDIR) != 0 && xfs_is_under(xfs, inum, new_parent_inum) == 0); } /* ------------------------------------------------------------------------ */ int xfs_move_entry(struct xfs_fs *xfs, fuse_ino_t inum, fuse_ino_t new_parent_inum, const char *name) { int result = EINVAL; XFS_INODE_ALL *xino; XFS_INODE_ALL *parent; XFS_INODE *dest; if (xfs_check_move_entry(xfs, inum, new_parent_inum, name)) { xino = xfs->inode_table[inum]; parent = xfs->inode_table[new_parent_inum]; if (xino->parent != parent) { /* We're moving between directories */ /* Does the target name already exist in the destination? */ if ((dest = xfs_lookup_in_dir(xfs, new_parent_inum, name)) != NULL) { xfs_remove_entry(xfs, dest->inum); } unlink_inode_from_parent(xino); link_inode_into_directory_node(parent, xino); strcpy(xino->pub.name, name); } else if (strcmp(xino->pub.name, name) != 0) { /* Same directory, but name has changed */ if ((dest = xfs_lookup_in_dir(xfs, new_parent_inum, name)) != NULL) { xfs_remove_entry(xfs, dest->inum); } strcpy(xino->pub.name, name); } result = 0; } return result; } #endif /* XRDP_FUSE */ xrdp-0.10.1/sesman/chansrv/chansrv_config.c000644 001751 000000 00000023124 14652432047 020726 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file implements the interface in chansrv_config.h */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "arch.h" #include "list.h" #include "log.h" #include "file.h" #include "os_calls.h" #include "chansrv_common.h" #include "chansrv_config.h" #include "string_calls.h" #include "sesman_clip_restrict.h" /* Default settings */ #define DEFAULT_RESTRICT_OUTBOUND_CLIPBOARD 0 #define DEFAULT_RESTRICT_INBOUND_CLIPBOARD 0 #define DEFAULT_ENABLE_FUSE_MOUNT 1 #define DEFAULT_FUSE_MOUNT_NAME "xrdp-client" #define DEFAULT_FILE_UMASK 077 #define DEFAULT_USE_NAUTILUS3_FLIST_FORMAT 0 #define DEFAULT_NUM_SILENT_FRAMES_AAC 4 #define DEFAULT_NUM_SILENT_FRAMES_MP3 2 #define DEFAULT_MSEC_DO_NOT_SEND 1000 /** * Type used for passing a logging function about */ typedef printflike(2, 3) enum logReturns (*log_func_t)(const enum logLevels lvl, const char *msg, ...); /***************************************************************************//** * @brief Error logging function to use to log to stdout * * Has the same signature as the log_message() function */ static enum logReturns log_to_stdout(const enum logLevels lvl, const char *msg, ...) { char buff[256]; va_list ap; va_start(ap, msg); vsnprintf(buff, sizeof(buff), msg, ap); va_end(ap); g_writeln("%s", buff); return LOG_STARTUP_OK; } /***************************************************************************//** * Reads the config values we need from the [Security] section * * @param logmsg Function to use to log messages * @param names List of definitions in the section * @params values List of corresponding values for the names * @params cfg Pointer to structure we're filling in * * @return 0 for success */ static int read_config_security(log_func_t logmsg, struct list *names, struct list *values, struct config_chansrv *cfg) { int error = 0; int index; for (index = 0; index < names->count; ++index) { const char *name = (const char *)list_get_item(names, index); const char *value = (const char *)list_get_item(values, index); char unrecognised[256]; if (g_strcasecmp(name, "RestrictOutboundClipboard") == 0) { cfg->restrict_outbound_clipboard = sesman_clip_restrict_string_to_bitmask( value, unrecognised, sizeof(unrecognised)); if (unrecognised[0] != '\0') { LOG(LOG_LEVEL_WARNING, "Unrecognised tokens parsing 'RestrictOutboundClipboard' %s", unrecognised); } } if (g_strcasecmp(name, "RestrictInboundClipboard") == 0) { cfg->restrict_inbound_clipboard = sesman_clip_restrict_string_to_bitmask( value, unrecognised, sizeof(unrecognised)); if (unrecognised[0] != '\0') { LOG(LOG_LEVEL_WARNING, "Unrecognised tokens parsing 'RestrictInboundClipboard' %s", unrecognised); } } } return error; } /***************************************************************************//** * Reads the config values we need from the [Chansrv] section * * @param logmsg Function to use to log messages * @param names List of definitions in the section * @params values List of corresponding values for the names * @params cfg Pointer to structure we're filling in * * @return 0 for success */ static int read_config_chansrv(log_func_t logmsg, struct list *names, struct list *values, struct config_chansrv *cfg) { int error = 0; int index; for (index = 0; index < names->count; ++index) { const char *name = (const char *)list_get_item(names, index); const char *value = (const char *)list_get_item(values, index); if (g_strcasecmp(name, "EnableFuseMount") == 0) { cfg->enable_fuse_mount = g_text2bool(value); } else if (g_strcasecmp(name, "FuseMountName") == 0) { g_free(cfg->fuse_mount_name); cfg->fuse_mount_name = g_strdup(value); if (cfg->fuse_mount_name == NULL) { logmsg(LOG_LEVEL_ERROR, "Can't alloc FuseMountName"); error = 1; break; } } else if (g_strcasecmp(name, "FileUmask") == 0) { cfg->file_umask = strtol(value, NULL, 0); } else if (g_strcasecmp(name, "UseNautilus3FlistFormat") == 0) { cfg->use_nautilus3_flist_format = g_text2bool(value); } else if (g_strcasecmp(name, "SoundNumSilentFramesAAC") == 0) { cfg->num_silent_frames_aac = strtoul(value, NULL, 0); } else if (g_strcasecmp(name, "SoundNumSilentFramesMP3") == 0) { cfg->num_silent_frames_mp3 = strtoul(value, NULL, 0); } else if (g_strcasecmp(name, "SoundMsecDoNotSend") == 0) { cfg->msec_do_not_send = strtoul(value, NULL, 0); } } return error; } /***************************************************************************//** * @brief returns a config block with default values * * @return Block, or NULL for no memory */ static struct config_chansrv * new_config(void) { /* Do all the allocations at the beginning, then check them together */ struct config_chansrv *cfg = g_new0(struct config_chansrv, 1); char *fuse_mount_name = g_strdup(DEFAULT_FUSE_MOUNT_NAME); if (cfg == NULL || fuse_mount_name == NULL) { /* At least one memory allocation failed */ g_free(fuse_mount_name); g_free(cfg); cfg = NULL; } else { cfg->enable_fuse_mount = DEFAULT_ENABLE_FUSE_MOUNT; cfg->restrict_outbound_clipboard = DEFAULT_RESTRICT_OUTBOUND_CLIPBOARD; cfg->restrict_inbound_clipboard = DEFAULT_RESTRICT_INBOUND_CLIPBOARD; cfg->fuse_mount_name = fuse_mount_name; cfg->file_umask = DEFAULT_FILE_UMASK; cfg->use_nautilus3_flist_format = DEFAULT_USE_NAUTILUS3_FLIST_FORMAT; cfg->num_silent_frames_aac = DEFAULT_NUM_SILENT_FRAMES_AAC; cfg->num_silent_frames_mp3 = DEFAULT_NUM_SILENT_FRAMES_MP3; cfg->msec_do_not_send = DEFAULT_MSEC_DO_NOT_SEND; } return cfg; } /******************************************************************************/ struct config_chansrv * config_read(int use_logger, const char *sesman_ini) { int error = 0; struct config_chansrv *cfg = NULL; log_func_t logmsg = (use_logger) ? log_message : log_to_stdout; int fd; fd = g_file_open_ro(sesman_ini); if (fd < 0) { logmsg(LOG_LEVEL_ERROR, "Can't open config file %s", sesman_ini); error = 1; } else { if ((cfg = new_config()) == NULL) { logmsg(LOG_LEVEL_ERROR, "Can't alloc config block"); error = 1; } else { struct list *names = list_create(); struct list *values = list_create(); names->auto_free = 1; values->auto_free = 1; if (!error && file_read_section(fd, "Security", names, values) == 0) { error = read_config_security(logmsg, names, values, cfg); } if (!error && file_read_section(fd, "Chansrv", names, values) == 0) { error = read_config_chansrv(logmsg, names, values, cfg); } list_delete(names); list_delete(values); } g_file_close(fd); } if (error) { config_free(cfg); cfg = NULL; } return cfg; } /******************************************************************************/ void config_dump(struct config_chansrv *config) { g_writeln("Global configuration:"); char buf[256]; g_writeln("\nSecurity configuration:"); sesman_clip_restrict_mask_to_string( config->restrict_outbound_clipboard, buf, sizeof(buf)); g_writeln(" RestrictOutboundClipboard: %s", buf); sesman_clip_restrict_mask_to_string( config->restrict_inbound_clipboard, buf, sizeof(buf)); g_writeln(" RestrictInboundClipboard: %s", buf); g_writeln("\nChansrv configuration:"); g_writeln(" EnableFuseMount %s", g_bool2text(config->enable_fuse_mount)); g_writeln(" FuseMountName: %s", config->fuse_mount_name); g_writeln(" FileMask: 0%o", config->file_umask); g_writeln(" Nautilus 3 Flist Format: %s", g_bool2text(config->use_nautilus3_flist_format)); } /******************************************************************************/ void config_free(struct config_chansrv *cc) { if (cc != NULL) { g_free(cc->fuse_mount_name); g_free(cc); } } xrdp-0.10.1/sesman/chansrv/xcommon.c000644 001751 000000 00000012415 14652432047 017416 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "arch.h" #include "parse.h" #include "os_calls.h" #include "chansrv.h" #include "log.h" #include "clipboard.h" #include "rail.h" #include "xcommon.h" extern int g_clip_up; /* in clipboard.c */ extern int g_rail_up; /* in rail.c */ Display *g_display = 0; int g_x_socket = 0; tbus g_x_wait_obj = 0; Screen *g_screen = 0; int g_screen_num = 0; Window g_root_window = 0; Atom g_wm_delete_window_atom = 0; Atom g_wm_protocols_atom = 0; Atom g_utf8_string = 0; Atom g_net_wm_name = 0; Atom g_wm_state = 0; static x_server_fatal_cb_type x_server_fatal_handler = 0; /*****************************************************************************/ static int xcommon_error_handler(Display *dis, XErrorEvent *xer) { char text[256]; XGetErrorText(dis, xer->error_code, text, 255); LOG_DEVEL(LOG_LEVEL_ERROR, "X error [%s](%d) opcodes %d/%d " "resource 0x%lx", text, xer->error_code, xer->request_code, xer->minor_code, xer->resourceid); return 0; } /*****************************************************************************/ /* Allow the caller to be notified on X server failure Specified callback can do any cleanup that needs to be done on exit, like removing temporary files. This is the last function called. Don't worry about memory leaks */ void xcommon_set_x_server_fatal_handler(x_server_fatal_cb_type handler) { x_server_fatal_handler = handler; } /*****************************************************************************/ /* The X server had an internal error */ static int xcommon_fatal_handler(Display *dis) { if (x_server_fatal_handler) { x_server_fatal_handler(); } return 0; } /*****************************************************************************/ /* returns time in milliseconds this is like g_time2 in os_calls, but not milliseconds since machine was up, something else this is a time value similar to what the xserver uses */ int xcommon_get_local_time(void) { return g_time3(); } /******************************************************************************/ /* this should be called first */ int xcommon_init(void) { if (g_display != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xcommon_init: xcommon_init already called"); return 0; } g_display = XOpenDisplay(0); if (g_display == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "xcommon_init: error, XOpenDisplay failed"); return 1; } LOG_DEVEL(LOG_LEVEL_INFO, "xcommon_init: connected to display ok"); /* setting the error handlers can cause problem when shutting down chansrv on some xlibs */ XSetErrorHandler(xcommon_error_handler); XSetIOErrorHandler(xcommon_fatal_handler); g_x_socket = XConnectionNumber(g_display); if (g_x_socket == 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "xcommon_init: XConnectionNumber failed"); return 1; } g_x_wait_obj = g_create_wait_obj_from_socket(g_x_socket, 0); g_screen_num = DefaultScreen(g_display); g_screen = ScreenOfDisplay(g_display, g_screen_num); g_root_window = RootWindowOfScreen(g_screen); g_wm_delete_window_atom = XInternAtom(g_display, "WM_DELETE_WINDOW", 0); g_wm_protocols_atom = XInternAtom(g_display, "WM_PROTOCOLS", 0); g_utf8_string = XInternAtom(g_display, "UTF8_STRING", 0); g_net_wm_name = XInternAtom(g_display, "_NET_WM_NAME", 0); g_wm_state = XInternAtom(g_display, "WM_STATE", 0); return 0; } /*****************************************************************************/ /* returns error this is called to get any wait objects for the main loop timeout can be nil */ int xcommon_get_wait_objs(tbus *objs, int *count, int *timeout) { int lcount; if (((!g_clip_up) && (!g_rail_up)) || (objs == 0) || (count == 0)) { return 0; } lcount = *count; objs[lcount] = g_x_wait_obj; lcount++; *count = lcount; return 0; } /*****************************************************************************/ int xcommon_check_wait_objs(void) { XEvent xevent; int clip_rv; int rail_rv; if ((!g_clip_up) && (!g_rail_up)) { return 0; } while (XPending(g_display) > 0) { g_memset(&xevent, 0, sizeof(xevent)); XNextEvent(g_display, &xevent); clip_rv = clipboard_xevent(&xevent); rail_rv = rail_xevent(&xevent); if ((clip_rv == 1) && (rail_rv == 1)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xcommon_check_wait_objs unknown xevent type %d", xevent.type); } } return 0; } xrdp-0.10.1/sesman/chansrv/irp.c000644 001751 000000 00000014466 14652432047 016540 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * manage I/O for redirected file system and devices */ #if defined(HAVE_CONFIG_H) #include #endif #include "chansrv.h" #include "parse.h" #include "os_calls.h" #include "string_calls.h" #include "irp.h" IRP *g_irp_head = NULL; /** * Create a new IRP and append to linked list * * @return new IRP or NULL on error *****************************************************************************/ IRP *devredir_irp_new(void) { IRP *irp; IRP *irp_last; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* create new IRP */ irp = g_new0(IRP, 1); if (irp == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory!"); return NULL; } /* insert at end of linked list */ if ((irp_last = devredir_irp_get_last()) == NULL) { /* list is empty, this is the first entry */ g_irp_head = irp; } else { irp_last->next = irp; irp->prev = irp_last; } LOG_DEVEL(LOG_LEVEL_DEBUG, "new IRP=%p", irp); return irp; } /** * Create a new IRP with a copied pathname, and append to linked list. * * Allocation is made in such a way that the IRP can be freed with a single * free() operation * * @return new IRP or NULL on error *****************************************************************************/ IRP *devredir_irp_with_pathname_new(const char *pathname) { unsigned int len = g_strlen(pathname); IRP *irp = devredir_irp_with_pathnamelen_new(len); if (irp != NULL) { g_strcpy(irp->pathname, pathname); } return irp; } /** * Create a new IRP with space allocated for a pathname, and append to * linked list. * * Allocation is made in such a way that the IRP can be freed with a single * free() operation * * @return new IRP or NULL on error *****************************************************************************/ IRP *devredir_irp_with_pathnamelen_new(unsigned int pathnamelen) { IRP *irp; IRP *irp_last; LOG_DEVEL(LOG_LEVEL_DEBUG, "entered"); /* create new IRP with space on end for the pathname and a terminator */ irp = (IRP *)g_malloc(sizeof(IRP) + (pathnamelen + 1), 1); if (irp == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "system out of memory!"); return NULL; } irp->pathname = (char *)irp + sizeof(IRP); /* Initialise pathname pointer */ /* insert at end of linked list */ if ((irp_last = devredir_irp_get_last()) == NULL) { /* list is empty, this is the first entry */ g_irp_head = irp; } else { irp_last->next = irp; irp->prev = irp_last; } LOG_DEVEL(LOG_LEVEL_DEBUG, "new IRP=%p", irp); return irp; } /** * Delete specified IRP from linked list * * @return 0 on success, -1 on failure *****************************************************************************/ int devredir_irp_delete(IRP *irp) { IRP *lirp = g_irp_head; if ((irp == NULL) || (lirp == NULL)) { return -1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "irp=%p completion_id=%d type=%d", irp, irp->CompletionId, irp->completion_type); devredir_irp_dump(); // LK_TODO while (lirp) { if (lirp == irp) { break; } lirp = lirp->next; } if (lirp == NULL) { return -1; /* did not find specified irp */ } if (lirp->prev == NULL) { /* we are at head of linked list */ if (lirp->next == NULL) { /* only one element in list */ g_free(lirp); g_irp_head = NULL; devredir_irp_dump(); // LK_TODO return 0; } lirp->next->prev = NULL; g_irp_head = lirp->next; g_free(lirp); } else if (lirp->next == NULL) { /* we are at tail of linked list */ lirp->prev->next = NULL; g_free(lirp); } else { /* we are in between */ lirp->prev->next = lirp->next; lirp->next->prev = lirp->prev; g_free(lirp); } devredir_irp_dump(); // LK_TODO return 0; } /** * Return IRP containing specified completion_id *****************************************************************************/ IRP *devredir_irp_find(tui32 completion_id) { IRP *irp = g_irp_head; while (irp) { if (irp->CompletionId == completion_id) { LOG_DEVEL(LOG_LEVEL_DEBUG, "returning irp=%p", irp); return irp; } irp = irp->next; } LOG_DEVEL(LOG_LEVEL_DEBUG, "returning irp=NULL"); return NULL; } IRP *devredir_irp_find_by_fileid(tui32 FileId) { IRP *irp = g_irp_head; while (irp) { if (irp->FileId == FileId) { LOG_DEVEL(LOG_LEVEL_DEBUG, "returning irp=%p", irp); return irp; } irp = irp->next; } LOG_DEVEL(LOG_LEVEL_DEBUG, "returning irp=NULL"); return NULL; } /** * Return last IRP in linked list *****************************************************************************/ IRP *devredir_irp_get_last(void) { IRP *irp = g_irp_head; while (irp) { if (irp->next == NULL) { break; } irp = irp->next; } LOG_DEVEL(LOG_LEVEL_DEBUG, "returning irp=%p", irp); return irp; } void devredir_irp_dump(void) { IRP *irp = g_irp_head; LOG_DEVEL(LOG_LEVEL_DEBUG, "------- dumping IRPs --------"); while (irp) { LOG_DEVEL(LOG_LEVEL_DEBUG, " completion_id=%d\tcompletion_type=%d\tFileId=%d", irp->CompletionId, irp->completion_type, irp->FileId); irp = irp->next; } LOG_DEVEL(LOG_LEVEL_DEBUG, "------- dumping IRPs done ---"); } xrdp-0.10.1/sesman/chansrv/chansrv_common.c000644 001751 000000 00000004140 14652432047 020746 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2009-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "chansrv_common.h" /** * Assemble fragmented incoming packets into one stream * * @param src stream that contains partial data * @param dest stream that contains entire data * @param chan_flags fragmentation flags * @param length bytes in this packet * @param total_length total length of assembled packet * * @return 1 when all data has been assembled, 0 otherwise * * NOTE: it is the responsibility of the caller to free dest stream ****************************************************************************/ int read_entire_packet(struct stream *src, struct stream **dest, int chan_flags, int length, int total_length) { struct stream *ls; if ((chan_flags & 3) == 3) { /* packet not fragmented */ xstream_new(ls, total_length); xstream_copyin(ls, src->p, length); s_mark_end(ls); ls->p = ls->data; *dest = ls; return 1; } /* is this the first fragmented packet? */ if (chan_flags & 1) { xstream_new(ls, total_length); *dest = ls; } else { ls = *dest; } xstream_copyin(ls, src->p, length); /* in last packet, chan_flags & 0x02 will be true */ if (chan_flags & 0x02) { /* terminate and rewind stream */ s_mark_end(ls); ls->p = ls->data; return 1; } return 0; } xrdp-0.10.1/sesman/chansrv/sound.h000644 001751 000000 00000003354 14652432047 017075 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2009-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _SOUND_H_ #define _SOUND_H_ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "chansrv.h" #include "trans.h" #define SNDC_CLOSE 0x01 #define SNDC_WAVE 0x02 #define SNDC_SETVOLUME 0x03 #define SNDC_SETPITCH 0x04 #define SNDC_WAVECONFIRM 0x05 #define SNDC_TRAINING 0x06 #define SNDC_FORMATS 0x07 #define SNDC_CRYPTKEY 0x08 #define SNDC_WAVEENCRYPT 0x09 #define SNDC_UDPWAVE 0x0A #define SNDC_UDPWAVELAST 0x0B #define SNDC_QUALITYMODE 0x0C /* used for sound input (mic) */ #define SNDC_REC_NEGOTIATE 39 #define SNDC_REC_START 40 #define SNDC_REC_STOP 41 #define SNDC_REC_DATA 42 #define SNDC_REC_SET_VOLUME 43 /* commands recvd from pulseaudio source */ #define PA_CMD_START_REC 1 #define PA_CMD_STOP_REC 2 #define PA_CMD_SEND_DATA 3 int sound_init(void); int sound_deinit(void); int sound_get_wait_objs(tbus *objs, int *count, int *timeout); int sound_check_wait_objs(void); int sound_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length); #endif xrdp-0.10.1/sesman/chansrv/devredir.h000644 001751 000000 00000005745 14652432047 017557 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * xrdp device redirection - we mainly use it for drive redirection * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(DEVREDIR_H) #define DEVREDIR_H #include "irp.h" #include "ms-rdpefs.h" int devredir_init(void); int devredir_deinit(void); int devredir_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length); int devredir_get_wait_objs(tbus *objs, int *count, int *timeout); int devredir_check_wait_objs(void); /* misc stuff */ void devredir_insert_DeviceIoRequest(struct stream *s, tui32 DeviceId, tui32 FileId, tui32 CompletionId, enum IRP_MJ MajorFunction, enum IRP_MN MinorFunction); /* State pointer types (opaque outside this module), used for * callback data */ struct state_dirscan; struct state_lookup; struct state_setattr; struct state_open; struct state_create; struct state_read; struct state_write; struct state_remove; struct state_close; /* called from FUSE module */ int devredir_get_dir_listing(struct state_dirscan *fusep, tui32 device_id, const char *path); int devredir_lookup_entry(struct state_lookup *fusep, tui32 device_id, const char *path); int devredir_setattr_for_entry( struct state_setattr *fusep, tui32 device_id, const char *filename, const struct file_attr *fattr, tui32 to_set); int devredir_file_create( struct state_create *fusep, tui32 device_id, const char *path, int mode); int devredir_file_open(struct state_open *fusep, tui32 device_id, const char *path, int flags); int devredir_file_close(struct state_close *fusep, tui32 device_id, tui32 file_id); void devredir_file_read(struct state_read *fusep, tui32 device_id, tui32 FileId, tui32 Length, tui64 Offset); void devredir_file_write(struct state_write *fusep, tui32 DeviceId, tui32 FileId, const char *buf, int Length, tui64 Offset); int devredir_file_rename( struct state_rename *fusep, tui32 device_id, const char *old_name, const char *new_name); int devredir_rmdir_or_file(struct state_remove *fusep, tui32 device_id, const char *path); #endif xrdp-0.10.1/sesman/chansrv/smartcard.h000644 001751 000000 00000014066 14652432047 017727 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * smartcard redirection support */ #ifndef _SMARTCARD_C #define _SMARTCARD_C #include "parse.h" #include "irp.h" #include "trans.h" #define SCARD_SHARE_EXCLUSIVE 0x00000001 #define SCARD_SHARE_SHARED 0x00000002 #define SCARD_SHARE_DIRECT 0x00000003 /* see [MS-RDPESC] 2.2.5 protocol identifier - Table A */ #define SCARD_PROTOCOL_UNDEFINED 0x00000000 #define SCARD_PROTOCOL_T0 0x00000001 #define SCARD_PROTOCOL_T1 0x00000002 #define SCARD_PROTOCOL_Tx 0x00000003 #define SCARD_PROTOCOL_RAW 0x00010000 /* see [MS-RDPESC] 2.2.5 protocol identifier - Table B */ #define SCARD_PROTOCOL_DEFAULT 0x80000000 #define SCARD_PROTOCOL_OPTIMAL 0x00000000 /* initialization type */ #define SCARD_LEAVE_CARD 0x00000000 /* do not do anything */ #define SCARD_RESET_CARD 0x00000001 /* reset smart card */ #define SCARD_UNPOWER_CARD 0x00000002 /* turn off and reset card */ struct xrdp_scard_io_request { tui32 dwProtocol; tui32 cbPciLength; int extra_bytes; char *extra_data; }; typedef struct reader_state { char reader_name[128]; tui32 current_state; tui32 event_state; tui32 atr_len; /* number of bytes in atr[] */ tui8 atr[36]; /* * share mode flag, can be one of: * SCARD_SHARE_EXCLUSIVE app not willing to share smartcard with other apps * SCARD_SHARE_SHARED app willing to share smartcard with other apps * SCARD_SHARE_DIRECT app demands direct control of smart card, hence * it is not available to other readers */ tui32 dwShareMode; /* * This field MUST have a value from Table A which is logically * OR'ed with a value from Table B. */ tui32 dwPreferredProtocols; /* * initialization type, must be one of the initialization type * defined above */ tui32 init_type; /* required by scard_send_transmit(), scard_send_control() */ tui32 map0; tui32 map1; tui32 map2; tui32 map3; tui32 map4; tui32 map5; tui32 map6; tui32 dwProtocol; tui32 cbPciLength; tui32 cbSendLength; tui32 cbRecvLength; tui32 dwControlCode; tui32 cbOutBufferSize; tui32 dwAttribId; tui32 dwAttrLen; } READER_STATE; void scard_device_announce(tui32 device_id); int scard_get_wait_objs(tbus *objs, int *count, int *timeout); int scard_check_wait_objs(void); int scard_init(void); int scard_deinit(void); int scard_send_establish_context(void *user_data, int scope); int scard_send_release_context(void *user_data, char *context, int context_bytes); int scard_send_is_valid_context(void *user_data, char *context, int context_bytes); int scard_send_list_readers(void *user_data, char *context, int context_bytes, char *groups, int cchReaders, int wide); int scard_send_get_status_change(void *user_data, char *context, int context_bytes, int wide, tui32 timeout, tui32 num_readers, READER_STATE *rsa); int scard_send_connect(void *user_data, char *context, int context_bytes, int wide, READER_STATE *rs); int scard_send_reconnect(void *user_data, char *context, int context_bytes, char *card, int card_bytes, READER_STATE *rs); int scard_send_begin_transaction(void *user_data, char *context, int context_bytes, char *card, int card_bytes); int scard_send_end_transaction(void *user_data, char *context, int context_bytes, char *card, int card_bytes, tui32 dwDisposition); int scard_send_status(void *user_data, int wide, char *context, int context_bytes, char *card, int card_bytes, int cchReaderLen, int cbAtrLen); int scard_send_disconnect(void *user_data, char *context, int context_bytes, char *card, int card_bytes, int dwDisposition); int scard_send_transmit(void *user_data, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, struct xrdp_scard_io_request *send_ior, struct xrdp_scard_io_request *recv_ior); int scard_send_control(void *user_data, char *context, int context_bytes, char *card, int card_bytes, char *send_data, int send_bytes, int recv_bytes, int control_code); int scard_send_cancel(void *user_data, char *context, int context_bytes); int scard_send_get_attrib(void *user_data, char *card, int card_bytes, READER_STATE *rs); /* * Notes: * SCardTransmit - partially done * SCardControl - partially done * SCardListReaderGroups - not supported * SCardSetAttrib - not supported */ #endif /* end #ifndef _SMARTCARD_C */ xrdp-0.10.1/sesman/chansrv/audin.c000644 001751 000000 00000037136 14652432047 017045 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2019 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * MS-RDPEAI * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "os_calls.h" #include "chansrv.h" #include "log.h" #include "xrdp_constants.h" #include "fifo.h" #define MSG_SNDIN_VERSION 1 #define MSG_SNDIN_FORMATS 2 #define MSG_SNDIN_OPEN 3 #define MSG_SNDIN_OPEN_REPLY 4 #define MSG_SNDIN_DATA_INCOMING 5 #define MSG_SNDIN_DATA 6 #define MSG_SNDIN_FORMATCHANGE 7 #define AUDIN_VERSION 0x00000001 #define AUDIN_NAME "AUDIO_INPUT" #define AUDIN_FLAGS 1 /* WTS_CHANNEL_OPTION_DYNAMIC */ extern struct fifo *g_in_fifo; /* in sound.c */ extern int g_bytes_in_fifo; /* in sound.c */ struct xr_wave_format_ex { int wFormatTag; int nChannels; int nSamplesPerSec; int nAvgBytesPerSec; int nBlockAlign; int wBitsPerSample; int cbSize; uint8_t *data; }; static uint8_t g_pcm_44100_data[] = { 0 }; static struct xr_wave_format_ex g_pcm_44100 = { WAVE_FORMAT_PCM, /* wFormatTag */ 2, /* num of channels */ 44100, /* samples per sec */ 176400, /* avg bytes per sec */ 4, /* block align */ 16, /* bits per sample */ 0, /* data size */ g_pcm_44100_data /* data */ }; static struct chansrv_drdynvc_procs g_audin_info; static int g_audin_chanid; static struct stream *g_in_s; static struct xr_wave_format_ex *g_server_formats[] = { &g_pcm_44100, NULL }; static struct xr_wave_format_ex **g_client_formats = NULL; static int g_current_format = 0; /* index in g_client_formats */ /*****************************************************************************/ /* * This can be called from sound.c because it includes audin.h. */ const char * audin_wave_format_tag_to_str(int tag) { return (tag == WAVE_FORMAT_PCM) ? "WAVE_FORMAT_PCM" : (tag == WAVE_FORMAT_ADPCM) ? "WAVE_FORMAT_ADPCM" : (tag == WAVE_FORMAT_ALAW) ? "WAVE_FORMAT_ALAW" : (tag == WAVE_FORMAT_MULAW) ? "WAVE_FORMAT_MULAW" : (tag == WAVE_FORMAT_MULAW) ? "WAVE_FORMAT_MULAW" : (tag == WAVE_FORMAT_MPEGLAYER3) ? "WAVE_FORMAT_MPEGLAYER3" : (tag == WAVE_FORMAT_OPUS) ? "WAVE_FORMAT_OPUS" : (tag == WAVE_FORMAT_AAC) ? "WAVE_FORMAT_AAC" : "UNKNOWN"; } /*****************************************************************************/ static int cleanup_client_formats(void) { int index; if (g_client_formats == NULL) { return 0; } index = 0; while (g_client_formats[index] != NULL) { g_free(g_client_formats[index]->data); g_free(g_client_formats[index]); index++; } g_free(g_client_formats); g_client_formats = NULL; return 0; } /*****************************************************************************/ static int audin_send_version(int chan_id) { int error; int bytes; struct stream *s; LOG_DEVEL(LOG_LEVEL_INFO, "audin_send_version:"); make_stream(s); init_stream(s, 32); out_uint8(s, MSG_SNDIN_VERSION); out_uint32_le(s, AUDIN_VERSION); s_mark_end(s); bytes = (int) (s->end - s->data); error = chansrv_drdynvc_data(chan_id, s->data, bytes); free_stream(s); return error; } /*****************************************************************************/ static int audin_send_formats(int chan_id) { int error; int bytes; int num_formats; int index; struct stream *s; struct xr_wave_format_ex *wf; LOG_DEVEL(LOG_LEVEL_INFO, "audin_send_formats:"); num_formats = sizeof(g_server_formats) / sizeof(g_server_formats[0]) - 1; make_stream(s); init_stream(s, 8192 * num_formats); out_uint8(s, MSG_SNDIN_FORMATS); out_uint32_le(s, num_formats); out_uint32_le(s, 0); /* cbSizeFormatsPacket */ for (index = 0; index < num_formats; index++) { wf = g_server_formats[index]; LOG_DEVEL(LOG_LEVEL_INFO, "audin_send_formats: sending format wFormatTag 0x%4.4x " "nChannels %d nSamplesPerSec %d", wf->wFormatTag, wf->nChannels, wf->nSamplesPerSec); out_uint16_le(s, wf->wFormatTag); out_uint16_le(s, wf->nChannels); out_uint32_le(s, wf->nSamplesPerSec); out_uint32_le(s, wf->nAvgBytesPerSec); out_uint16_le(s, wf->nBlockAlign); out_uint16_le(s, wf->wBitsPerSample); out_uint16_le(s, wf->cbSize); if (wf->cbSize > 0) { out_uint8p(s, wf->data, wf->cbSize); } } s_mark_end(s); bytes = (int) (s->end - s->data); error = chansrv_drdynvc_data(chan_id, s->data, bytes); free_stream(s); return error; } /*****************************************************************************/ static int audin_send_open(int chan_id) { int error; int bytes; struct stream *s; struct xr_wave_format_ex *wf = g_client_formats[g_current_format]; LOG_DEVEL(LOG_LEVEL_INFO, "audin_send_open:"); make_stream(s); /* wf->cbSize was checked when the format was received */ init_stream(s, wf->cbSize + 64); out_uint8(s, MSG_SNDIN_OPEN); out_uint32_le(s, 2048); /* FramesPerPacket */ out_uint32_le(s, g_current_format); /* initialFormat */ out_uint16_le(s, wf->wFormatTag); out_uint16_le(s, wf->nChannels); out_uint32_le(s, wf->nSamplesPerSec); out_uint32_le(s, wf->nAvgBytesPerSec); out_uint16_le(s, wf->nBlockAlign); out_uint16_le(s, wf->wBitsPerSample); bytes = wf->cbSize; out_uint16_le(s, bytes); if (bytes > 0) { out_uint8p(s, wf->data, bytes); } s_mark_end(s); bytes = (int) (s->end - s->data); error = chansrv_drdynvc_data(chan_id, s->data, bytes); free_stream(s); return error; } /*****************************************************************************/ static int audin_process_version(int chan_id, struct stream *s) { int version; LOG_DEVEL(LOG_LEVEL_INFO, "audin_process_version:"); if (!s_check_rem(s, 4)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_version: parse error"); return 1; } in_uint32_le(s, version); LOG(LOG_LEVEL_INFO, "audin_process_version: version %d", version); return audin_send_formats(chan_id); } /*****************************************************************************/ static int audin_process_formats(int chan_id, struct stream *s) { int index; int num_formats; struct xr_wave_format_ex *wf; LOG_DEVEL(LOG_LEVEL_INFO, "audin_process_formats:"); cleanup_client_formats(); if (!s_check_rem(s, 8)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_formats: parse error"); return 1; } in_uint32_le(s, num_formats); in_uint8s(s, 4); /* cbSizeFormatsPacket */ g_client_formats = g_new0(struct xr_wave_format_ex *, num_formats + 1); for (index = 0; index < num_formats; index++) { if (!s_check_rem(s, 18)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_formats: parse error"); return 1; } wf = g_new0(struct xr_wave_format_ex, 1); g_client_formats[index] = wf; in_uint16_le(s, wf->wFormatTag); in_uint16_le(s, wf->nChannels); in_uint32_le(s, wf->nSamplesPerSec); in_uint32_le(s, wf->nAvgBytesPerSec); in_uint16_le(s, wf->nBlockAlign); in_uint16_le(s, wf->wBitsPerSample); in_uint16_le(s, wf->cbSize); LOG(LOG_LEVEL_INFO, "audin_process_formats:"); LOG(LOG_LEVEL_INFO, " wFormatNo %d", index); LOG(LOG_LEVEL_INFO, " wFormatTag %s", audin_wave_format_tag_to_str(wf->wFormatTag)); LOG(LOG_LEVEL_INFO, " nChannels %d", wf->nChannels); LOG(LOG_LEVEL_INFO, " nSamplesPerSec %d", wf->nSamplesPerSec); LOG(LOG_LEVEL_INFO, " nAvgBytesPerSec %d", wf->nAvgBytesPerSec); LOG(LOG_LEVEL_INFO, " nBlockAlign %d", wf->nBlockAlign); LOG(LOG_LEVEL_INFO, " wBitsPerSample %d", wf->wBitsPerSample); LOG(LOG_LEVEL_INFO, " cbSize %d", wf->cbSize); if (wf->cbSize > 0) { if (!s_check_rem(s, wf->cbSize)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_formats: parse error"); return 1; } wf->data = g_new0(uint8_t, wf->cbSize); in_uint8a(s, wf->data, wf->cbSize); } } audin_send_open(chan_id); return 0; } /*****************************************************************************/ static int audin_process_open_reply(int chan_id, struct stream *s) { int result; if (!s_check_rem(s, 4)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_open_reply: parse error"); return 1; } in_uint32_le(s, result); LOG(LOG_LEVEL_INFO, "audin_process_open_reply: result 0x%8.8x", result); return 0; } /*****************************************************************************/ static int audin_process_incoming_data(int chan_id, struct stream *s) { LOG_DEVEL(LOG_LEVEL_DEBUG, "audin_process_incoming_data:"); return 0; } /*****************************************************************************/ static int audin_process_data(int chan_id, struct stream *s) { int data_bytes; struct stream *ls; data_bytes = (int) (s->end - s->p); LOG_DEVEL(LOG_LEVEL_DEBUG, "audin_process_data: data_bytes %d", data_bytes); xstream_new(ls, data_bytes); g_memcpy(ls->data, s->p, data_bytes); ls->p += data_bytes; s_mark_end(ls); fifo_add_item(g_in_fifo, (void *) ls); g_bytes_in_fifo += data_bytes; return 0; } /*****************************************************************************/ static int audin_process_format_change(int chan_id, struct stream *s) { LOG_DEVEL(LOG_LEVEL_INFO, "audin_process_format_change:"); if (!s_check_rem(s, 4)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_format_change: parse error"); return 1; } in_uint32_le(s, g_current_format); LOG_DEVEL(LOG_LEVEL_INFO, "audin_process_format_change: g_current_format %d", g_current_format); return 0; } /*****************************************************************************/ static int audin_process_msg(int chan_id, struct stream *s) { int code; LOG_DEVEL(LOG_LEVEL_DEBUG, "audin_process_msg:"); if (!s_check_rem(s, 1)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_msg: parse error"); return 1; } in_uint8(s, code); LOG_DEVEL(LOG_LEVEL_DEBUG, "audin_process_msg: code %d", code); switch (code) { case MSG_SNDIN_VERSION: return audin_process_version(chan_id, s); case MSG_SNDIN_FORMATS: return audin_process_formats(chan_id, s); case MSG_SNDIN_OPEN_REPLY: return audin_process_open_reply(chan_id, s); case MSG_SNDIN_DATA_INCOMING: return audin_process_incoming_data(chan_id, s); case MSG_SNDIN_DATA: return audin_process_data(chan_id, s); case MSG_SNDIN_FORMATCHANGE: return audin_process_format_change(chan_id, s); default: LOG_DEVEL(LOG_LEVEL_ERROR, "audin_process_msg: unprocessed code %d", code); break; } return 0; } /*****************************************************************************/ static int audin_open_response(int chan_id, int creation_status) { LOG_DEVEL(LOG_LEVEL_INFO, "audin_open_response: creation_status 0x%8.8x", creation_status); if (creation_status == 0) { return audin_send_version(chan_id); } return 0; } /*****************************************************************************/ static int audin_close_response(int chan_id) { LOG_DEVEL(LOG_LEVEL_INFO, "audin_close_response:"); g_audin_chanid = 0; cleanup_client_formats(); free_stream(g_in_s); g_in_s = NULL; return 0; } /*****************************************************************************/ static int audin_data_fragment(int chan_id, char *data, int bytes) { int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "audin_data_fragment:"); if (!s_check_rem(g_in_s, bytes)) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_data_fragment: error bytes %d left %d", bytes, (int) (g_in_s->end - g_in_s->p)); return 1; } out_uint8a(g_in_s, data, bytes); if (g_in_s->p == g_in_s->end) { g_in_s->p = g_in_s->data; rv = audin_process_msg(chan_id, g_in_s); free_stream(g_in_s); g_in_s = NULL; return rv; } return 0; } /*****************************************************************************/ static int audin_data_first(int chan_id, char *data, int bytes, int total_bytes) { LOG_DEVEL(LOG_LEVEL_DEBUG, "audin_data_first:"); if (g_in_s != NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "audin_data_first: warning g_in_s is not nil"); free_stream(g_in_s); } make_stream(g_in_s); init_stream(g_in_s, total_bytes); g_in_s->end = g_in_s->data + total_bytes; return audin_data_fragment(chan_id, data, bytes); } /*****************************************************************************/ static int audin_data(int chan_id, char *data, int bytes) { struct stream ls; LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "audin_data:", data, bytes); if (g_in_s == NULL) { g_memset(&ls, 0, sizeof(ls)); ls.data = data; ls.p = ls.data; ls.end = ls.p + bytes; return audin_process_msg(chan_id, &ls); } return audin_data_fragment(chan_id, data, bytes); } /*****************************************************************************/ int audin_init(void) { LOG_DEVEL(LOG_LEVEL_INFO, "audin_init:"); g_memset(&g_audin_info, 0, sizeof(g_audin_info)); g_audin_info.open_response = audin_open_response; g_audin_info.close_response = audin_close_response; g_audin_info.data_first = audin_data_first; g_audin_info.data = audin_data; g_audin_chanid = 0; g_in_s = NULL; return 0; } /*****************************************************************************/ int audin_deinit(void) { LOG_DEVEL(LOG_LEVEL_INFO, "audin_deinit:"); return 0; } /*****************************************************************************/ int audin_start(void) { int error; LOG_DEVEL(LOG_LEVEL_INFO, "audin_start:"); if (g_audin_chanid != 0 || g_in_fifo == NULL) { return 1; } /* if there is any data in FIFO, discard it */ fifo_clear(g_in_fifo, NULL); g_bytes_in_fifo = 0; error = chansrv_drdynvc_open(AUDIN_NAME, AUDIN_FLAGS, &g_audin_info, /* callback functions */ &g_audin_chanid); /* chansrv chan_id */ LOG_DEVEL(LOG_LEVEL_ERROR, "audin_start: error %d g_audin_chanid %d", error, g_audin_chanid); return error; } /*****************************************************************************/ int audin_stop(void) { LOG_DEVEL(LOG_LEVEL_INFO, "audin_stop:"); chansrv_drdynvc_close(g_audin_chanid); return 0; } xrdp-0.10.1/sesman/chansrv/clipboard.c000644 001751 000000 00000257332 14652432047 017706 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2009-2012 * Copyright (C) Laxmikant Rashinkar 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* for help see http://tronche.com/gui/x/icccm/sec-2.html#s-2 .../kde/kdebase/workspace/klipper/clipboardpoll.cpp Revision: Aug 05, 2012: Laxmikant Rashinkar (LK dot Rashinkar at gmail.com) added clipboard support for BMP images http://msdn.microsoft.com/en-us/library/cc241066%28v=prot.20%29.aspx */ /* TARGETS MULTIPLE image/tiff image/jpeg image/x-MS-bmp image/x-bmp image/bmp image/png SAVE_TARGETS TIMESTAMP wininfo - show window info xlsatoms - dump atoms dolphin 1.4 KDE 4.4.5 (debian 6) copy one file text/uri-list text/x-moz-url text/plain UTF8_STRING STRING TEXT COMPOUND_TEXT application/x-qiconlist TARGETS MULTIPLE TIMESTAMP SAVE_TARGETS dolphin 1.6.1 KDE 4.6.5 (kubuntu 11.04) copy one file text/uri-list text/x-moz-url text/plain UTF8_STRING STRING TEXT COMPOUND_TEXT application/x-qiconlist TARGETS MULTIPLE TIMESTAMP SAVE_TARGETS kolourpaint 4.4.5 KDE 4.4.5 copy image area application/x-kolourpaint-selection-400 application/x-qt-image image/png image/bw image/eps image/epsf image/epsi image/pcx image/rgb image/rgba image/sgi image/tga image/bmp image/ico image/jp2 image/jpeg image/jpg image/ppm PIXMAP image/tif image/tiff image/xbm image/xpm image/xv TARGETS MULTIPLE TIMESTAMP SAVE_TARGETS kate 3.4.5 KDE 4.4.5 copy text text/plain UTF8_STRING STRING TEXT COMPOUND_TEXT TARGETS MULTIPLE TIMESTAMP SAVE_TARGETS gimp 2.6.10 copy image area TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS image/png image/bmp image/x-bmp image/x-MS-bmp image/tiff image/x-icon image/x-ico image/x-win-bitmap image/jpeg thunar 1.2.1 copy a file TIMESTAMP TARGETS MULTIPLE x-special/gnome-copied-files UTF8_STRING dolphin 1.6.1 KDE 4.6.5 (kubuntu 11.04) copy two files text/uri-list /home/jay/temp/jetstream1.txt /home/jay/temp/jpeg64x64.jpg 0000 66 69 6c 65 3a 2f 2f 2f 68 6f 6d 65 2f 6a 61 79 file:///home/jay 0010 2f 74 65 6d 70 2f 6a 65 74 73 74 72 65 61 6d 31 /temp/jetstream1 0020 2e 74 78 74 0d 0a 66 69 6c 65 3a 2f 2f 2f 68 6f .txt..file:///ho 0030 6d 65 2f 6a 61 79 2f 74 65 6d 70 2f 6a 70 65 67 me/jay/temp/jpeg 0040 36 34 78 36 34 2e 6a 70 67 64x64.jpg thunar 1.2.1 (kubuntu 11.04) copy two files x-special/gnome-copied-files /home/jay/temp/jetstream1.txt /home/jay/temp/jpeg64x64.jpg 0000 63 6f 70 79 0a 66 69 6c 65 3a 2f 2f 2f 68 6f 6d copy.file:///hom 0010 65 2f 6a 61 79 2f 74 65 6d 70 2f 6a 65 74 73 74 e/jay/temp/jetst 0020 72 65 61 6d 31 2e 74 78 74 0d 0a 66 69 6c 65 3a ream1.txt..file: 0030 2f 2f 2f 68 6f 6d 65 2f 6a 61 79 2f 74 65 6d 70 ///home/jay/temp 0040 2f 6a 70 65 67 36 34 78 36 34 2e 6a 70 67 0d 0a /jpeg64x64.jpg.. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "arch.h" #include "parse.h" #include "os_calls.h" #include "string_calls.h" #include "chansrv.h" #include "chansrv_common.h" #include "chansrv_config.h" #include "clipboard.h" #include "clipboard_file.h" #include "clipboard_common.h" #include "xcommon.h" #include "chansrv_fuse.h" #include "ms-rdpeclip.h" #include "xrdp_constants.h" #define BMPFILEHEADER_LEN 14 #define BMPINFOHEADER_LEN 40 extern int g_cliprdr_chan_id; /* in chansrv.c */ extern Display *g_display; /* in xcommon.c */ extern int g_x_socket; /* in xcommon.c */ extern tbus g_x_wait_obj; /* in xcommon.c */ extern Screen *g_screen; /* in xcommon.c */ extern int g_screen_num; /* in xcommon.c */ extern struct config_chansrv *g_cfg; /* in chansrv.c */ int g_clip_up = 0; static Atom g_clipboard_atom = 0; /* CLIPBOARD */ static Atom g_clip_property_atom = 0; /* XRDP_CLIP_PROPERTY_ATOM */ static Atom g_timestamp_atom = 0; /* TIMESTAMP */ static Atom g_multiple_atom = 0; /* MULTIPLE */ static Atom g_targets_atom = 0; /* TARGETS */ static Atom g_primary_atom = 0; /* PRIMARY */ static Atom g_secondary_atom = 0; /* SECONDARY */ static Atom g_get_time_atom = 0; /* XRDP_GET_TIME_ATOM */ static Atom g_utf8_atom = 0; /* UTF8_STRING */ static Atom g_image_bmp_atom = 0; /* image/bmp */ static Atom g_file_atom1 = 0; /* text/uri-list */ static Atom g_file_atom2 = 0; /* x-special/gnome-copied-files */ static Atom g_incr_atom = 0; /* INCR */ static Window g_wnd = 0; static int g_xfixes_event_base = 0; static int g_got_selection = 0; /* boolean */ static Time g_selection_time = 0; static struct stream *g_ins = 0; /* for image data */ static XSelectionRequestEvent g_saved_selection_req_event; /* xserver maximum request size in bytes */ static int g_incr_max_req_size = 0; /* server to client, pasting from linux app to mstsc */ struct clip_s2c g_clip_s2c; /* client to server, pasting from mstsc to linux app */ struct clip_c2s g_clip_c2s; /* default version and flags */ static int g_cliprdr_version = CB_CAPS_VERSION_2; static int g_cliprdr_flags = CB_USE_LONG_FORMAT_NAMES | CB_STREAM_FILECLIP_ENABLED | CB_FILECLIP_NO_FILE_PATHS; /* from client to server */ /* last received CLIPRDR_FORMAT_LIST(CLIPRDR_FORMAT_ANNOUNCE) */ static int g_formatIds[16]; static int g_num_formatIds = 0; /* Format ID assigned to "FileGroupDescriptorW" by the client */ static int g_file_group_descriptor_format_id = -1; static char g_last_atom_name[256] = ""; /* * Values for the named formats we send to the client in * a Format List PDU */ enum { CB_FORMAT_FILE_GROUP_DESCRIPTOR = 0xc0bc }; /*****************************************************************************/ static char * get_atom_text(Atom atom) { char *name; int failed; failed = 0; /* sanity check */ if ((atom < 1) || (atom > 512)) { failed = 1; } if (!failed) { name = XGetAtomName(g_display, atom); if (name == 0) { failed = 1; } } if (failed) { g_snprintf(g_last_atom_name, 255, "unknown atom 0x%8.8x", (int)atom); return g_last_atom_name; } g_strncpy(g_last_atom_name, name, 255); XFree(name); return g_last_atom_name; } /*****************************************************************************/ /* this is one way to get the current time from the x server */ static Time clipboard_get_server_time(void) { XEvent xevent; unsigned char no_text[4]; /* append nothing */ no_text[0] = 0; XChangeProperty(g_display, g_wnd, g_get_time_atom, XA_STRING, 8, PropModeAppend, no_text, 0); /* wait for PropertyNotify */ do { XMaskEvent(g_display, PropertyChangeMask, &xevent); } while (xevent.type != PropertyNotify); return xevent.xproperty.time; } /*****************************************************************************/ static int clipboard_find_format_id(int format_id) { int index; for (index = 0; index < g_num_formatIds; index++) { if (g_formatIds[index] == format_id) { return index; } } return -1; } /*****************************************************************************/ /* returns error */ int clipboard_init(void) { struct stream *s; int size; int rv; int input_mask; int dummy; int ver_maj; int ver_min; Status st; LOG_DEVEL(LOG_LEVEL_INFO, "clipboard_init:"); if (g_clip_up) { return 0; } xfuse_init(); xcommon_init(); g_incr_max_req_size = XMaxRequestSize(g_display) * 4 - 24; g_memset(&g_clip_c2s, 0, sizeof(g_clip_c2s)); g_memset(&g_clip_s2c, 0, sizeof(g_clip_s2c)); rv = 0; if (rv == 0) { g_clipboard_atom = XInternAtom(g_display, "CLIPBOARD", False); if (g_clipboard_atom == None) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_init: XInternAtom failed"); rv = 3; } } if (rv == 0) { if (!XFixesQueryExtension(g_display, &g_xfixes_event_base, &dummy)) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_init: no xfixes"); rv = 5; } } if (rv == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_init: g_xfixes_event_base %d", g_xfixes_event_base); st = XFixesQueryVersion(g_display, &ver_maj, &ver_min); LOG(LOG_LEVEL_DEBUG, "clipboard_init st %d, maj %d min %d", st, ver_maj, ver_min); g_clip_property_atom = XInternAtom(g_display, "XRDP_CLIP_PROPERTY_ATOM", False); g_get_time_atom = XInternAtom(g_display, "XRDP_GET_TIME_ATOM", False); g_timestamp_atom = XInternAtom(g_display, "TIMESTAMP", False); g_targets_atom = XInternAtom(g_display, "TARGETS", False); g_multiple_atom = XInternAtom(g_display, "MULTIPLE", False); g_primary_atom = XInternAtom(g_display, "PRIMARY", False); g_secondary_atom = XInternAtom(g_display, "SECONDARY", False); g_utf8_atom = XInternAtom(g_display, "UTF8_STRING", False); g_image_bmp_atom = XInternAtom(g_display, "image/bmp", False); g_file_atom1 = XInternAtom(g_display, "text/uri-list", False); g_file_atom2 = XInternAtom(g_display, "x-special/gnome-copied-files", False); g_incr_atom = XInternAtom(g_display, "INCR", False); if (g_image_bmp_atom == None) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_init: g_image_bmp_atom was " "not allocated"); } g_wnd = XCreateSimpleWindow(g_display, RootWindowOfScreen(g_screen), 0, 0, 4, 4, 0, 0, 0); input_mask = StructureNotifyMask | PropertyChangeMask; XSelectInput(g_display, g_wnd, input_mask); //XMapWindow(g_display, g_wnd); XFixesSelectSelectionInput(g_display, g_wnd, g_clipboard_atom, XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask); } make_stream(s); if (rv == 0) { /* set clipboard caps first */ init_stream(s, 8192); /* CLIPRDR_HEADER */ out_uint16_le(s, CB_CLIP_CAPS); /* msgType */ out_uint16_le(s, 0); /* msgFlags */ out_uint32_le(s, 16); /* dataLen */ out_uint16_le(s, 1); /* cCapabilitiesSets */ out_uint16_le(s, 0); /* pad1 */ /* CLIPRDR_GENERAL_CAPABILITY */ out_uint16_le(s, CB_CAPSTYPE_GENERAL); /* capabilitySetType */ out_uint16_le(s, 12); /* lengthCapability */ out_uint32_le(s, g_cliprdr_version); /* version */ out_uint32_le(s, g_cliprdr_flags); /* generalFlags */ out_uint32_le(s, 0); /* extra 4 bytes ? */ s_mark_end(s); size = (int)(s->end - s->data); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_init: data out, sending " "CB_CLIP_CAPS (clip_msg_id = 1)"); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); if (rv != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_init: send_channel_data failed " "rv = %d", rv); rv = 4; } } if (rv == 0) { /* report clipboard ready */ init_stream(s, 8192); out_uint16_le(s, CB_MONITOR_READY); /* msgType */ out_uint16_le(s, 0); /* msgFlags */ out_uint32_le(s, 0); /* dataLen */ out_uint32_le(s, 0); /* extra 4 bytes ? */ s_mark_end(s); size = (int)(s->end - s->data); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_init: data out, sending " "CB_MONITOR_READY (clip_msg_id = 1)"); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); if (rv != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_init: send_channel_data failed " "rv = %d", rv); rv = 4; } } free_stream(s); if (rv == 0) { g_clip_up = 1; make_stream(g_ins); init_stream(g_ins, 8192); } else { LOG_DEVEL(LOG_LEVEL_ERROR, "xrdp-chansrv: clipboard_init: error on exit"); } return rv; } /*****************************************************************************/ int clipboard_deinit(void) { LOG_DEVEL(LOG_LEVEL_INFO, "clipboard_deinit:"); if (g_wnd != 0) { XDestroyWindow(g_display, g_wnd); g_wnd = 0; } xfuse_deinit(); g_free(g_clip_c2s.data); g_clip_c2s.data = 0; g_free(g_clip_s2c.data); g_clip_s2c.data = 0; free_stream(g_ins); g_ins = 0; g_clip_up = 0; return 0; } /*****************************************************************************/ static int clipboard_send_data_request(int format_id) { struct stream *s; int size; int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_request:"); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_request: %d", format_id); g_clip_c2s.in_request = 1; make_stream(s); init_stream(s, 8192); out_uint16_le(s, CB_FORMAT_DATA_REQUEST); /* 4 CLIPRDR_DATA_REQUEST */ out_uint16_le(s, 0); /* status */ out_uint32_le(s, 4); /* length */ out_uint32_le(s, format_id); out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_request: data out, sending " "CLIPRDR_DATA_REQUEST (clip_msg_id = 4)"); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ static int clipboard_send_format_ack(void) { struct stream *s; int size; int rv; make_stream(s); init_stream(s, 8192); out_uint16_le(s, CB_FORMAT_LIST_RESPONSE); /* 3 CLIPRDR_FORMAT_ACK */ out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */ out_uint32_le(s, 0); /* length */ out_uint32_le(s, 0); /* extra 4 bytes */ s_mark_end(s); size = (int)(s->end - s->data); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_ack: data out, sending " "CLIPRDR_FORMAT_ACK (clip_msg_id = 3)"); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ /** * Output null-terminated string as Unicode with a null terminator * @param s stream * @param text UTF-8 String */ static void clipboard_out_utf8_as_utf16_le(struct stream *s, const char *text) { out_utf8_as_utf16_le(s, text, strlen(text) + 1); } /*****************************************************************************/ unsigned int clipboard_in_utf16_le_as_utf8(struct stream *s, char *text, unsigned int num_chars) { char *orig_p = s->p; unsigned int needed_chars; if ((num_chars < 1) || (text == 0)) { return 0; } needed_chars = in_utf16_le_terminated_as_utf8(s, text, num_chars); if (needed_chars > num_chars) { LOG(LOG_LEVEL_WARNING, "UTF-16 string was truncated on input"); } return s->p - orig_p; } static char windows_native_format[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*****************************************************************************/ static int clipboard_send_format_announce(int xrdp_clip_type) { struct stream *s; int size; int rv; char *holdp; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce:"); make_stream(s); init_stream(s, 8192); out_uint16_le(s, CB_FORMAT_LIST); /* 2 CLIPRDR_FORMAT_ANNOUNCE */ out_uint16_le(s, 0); /* status */ holdp = s->p; out_uint32_le(s, 0); /* set later */ if (g_cliprdr_flags & CB_USE_LONG_FORMAT_NAMES) { switch (xrdp_clip_type) { case XRDP_CB_FILE: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: XRDP_CB_FILE"); /* canned response for "file" */ out_uint32_le(s, CB_FORMAT_FILE_GROUP_DESCRIPTOR); clipboard_out_utf8_as_utf16_le(s, "FileGroupDescriptorW"); out_uint32_le(s, 0x0000c0ba); clipboard_out_utf8_as_utf16_le(s, "FileContents"); out_uint32_le(s, 0x0000c0c1); clipboard_out_utf8_as_utf16_le(s, "DropEffect"); break; case XRDP_CB_BITMAP: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: XRDP_CB_BITMAP"); /* canned response for "bitmap" */ out_uint32_le(s, 0x0000c004); clipboard_out_utf8_as_utf16_le(s, "Native"); out_uint32_le(s, 0x00000003); clipboard_out_utf8_as_utf16_le(s, ""); out_uint32_le(s, 0x00000008); clipboard_out_utf8_as_utf16_le(s, ""); out_uint32_le(s, 0x00000011); clipboard_out_utf8_as_utf16_le(s, ""); break; case XRDP_CB_TEXT: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: XRDP_CB_TEXT"); /* canned response for "bitmap" */ out_uint32_le(s, 0x0000000d); clipboard_out_utf8_as_utf16_le(s, ""); out_uint32_le(s, 0x00000010); clipboard_out_utf8_as_utf16_le(s, ""); out_uint32_le(s, 0x00000001); clipboard_out_utf8_as_utf16_le(s, ""); out_uint32_le(s, 0x00000007); clipboard_out_utf8_as_utf16_le(s, ""); break; default: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: unknown " "xrdp_clip_type %d", xrdp_clip_type); break; } } else /* old method */ { switch (xrdp_clip_type) { case XRDP_CB_FILE: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: XRDP_CB_FILE"); /* canned response for "file" */ out_uint32_le(s, CB_FORMAT_FILE_GROUP_DESCRIPTOR); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x0000c0ba); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x0000c0c1); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); break; case XRDP_CB_BITMAP: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: XRDP_CB_BITMAP"); /* canned response for "bitmap" */ out_uint32_le(s, 0x0000c004); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x00000003); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x00000008); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x00000011); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); break; case XRDP_CB_TEXT: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: XRDP_CB_TEXT"); /* canned response for "bitmap" */ out_uint32_le(s, 0x0000000d); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x00000010); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x00000001); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); out_uint32_le(s, 0x00000007); out_uint8p(s, windows_native_format, sizeof(windows_native_format)); break; default: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: unknown " "xrdp_clip_type %d", xrdp_clip_type); break; } } size = (int)(s->p - holdp); size -= 4; holdp[0] = (size >> 0) & 0xff; holdp[1] = (size >> 8) & 0xff; holdp[2] = (size >> 16) & 0xff; holdp[3] = (size >> 24) & 0xff; out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "clipboard data:", s->data, size); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_format_announce: data out, sending " "CLIPRDR_FORMAT_ANNOUNCE (clip_msg_id = 2)"); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ static int clipboard_send_data_response_for_image(const char *data, int data_size) { struct stream *s; int size; int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response_for_image: data_size %d", data_size); make_stream(s); init_stream(s, 64 + data_size); out_uint16_le(s, CB_FORMAT_DATA_RESPONSE); /* 5 CLIPRDR_DATA_RESPONSE */ out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */ out_uint32_le(s, data_size); /* length */ out_uint8p(s, data, data_size); out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ static int clipboard_send_data_response_for_text(const char *data, int data_size) { struct stream *s; int size; int rv; int num_words; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response_for_text: data_size %d", data_size); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "clipboard send data response:", data, data_size); num_words = utf8_as_utf16_word_count(data, data_size); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response_for_text: data_size %d " "num_words %d", data_size, num_words); make_stream(s); init_stream(s, 64 + num_words * 2); out_uint16_le(s, CB_FORMAT_DATA_RESPONSE); /* 5 CLIPRDR_DATA_RESPONSE */ out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */ out_uint32_le(s, num_words * 2 + 2); /* length */ out_utf8_as_utf16_le(s, data, data_size); out_uint16_le(s, 0); /* nil for string */ out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response_for_text: data out, " "sending CLIPRDR_DATA_RESPONSE (clip_msg_id = 5) size %d " "num_words %d", size, num_words); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ static int clipboard_send_data_response(int xrdp_clip_type, const char *data, int data_size) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response:"); if (data != 0) { if (xrdp_clip_type == XRDP_CB_FILE) { return clipboard_send_data_response_for_file(data, data_size); } else if (xrdp_clip_type == XRDP_CB_BITMAP) { return clipboard_send_data_response_for_image(data, data_size); } else if (xrdp_clip_type == XRDP_CB_TEXT) { return clipboard_send_data_response_for_text(data, data_size); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_send_data_response: unknown " "xrdp_clip_type %d", xrdp_clip_type); } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_data_response: data is nil"); } return 0; } /*****************************************************************************/ static int clipboard_set_selection_owner(void) { Window owner; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_set_selection_owner:"); g_selection_time = clipboard_get_server_time(); XSetSelectionOwner(g_display, g_clipboard_atom, g_wnd, g_selection_time); owner = XGetSelectionOwner(g_display, g_clipboard_atom); if (owner != g_wnd) { g_got_selection = 0; return 1; } g_got_selection = 1; return 0; } /*****************************************************************************/ static int clipboard_provide_selection_c2s(XSelectionRequestEvent *req, Atom type) { XEvent xev; long val1[2]; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_provide_selection_c2s: bytes %d", g_clip_c2s.total_bytes); if (g_clip_c2s.total_bytes < g_incr_max_req_size) { XChangeProperty(g_display, req->requestor, req->property, type, 8, PropModeReplace, (tui8 *)g_clip_c2s.data, g_clip_c2s.total_bytes); g_memset(&xev, 0, sizeof(xev)); xev.xselection.type = SelectionNotify; xev.xselection.send_event = True; xev.xselection.display = req->display; xev.xselection.requestor = req->requestor; xev.xselection.selection = req->selection; xev.xselection.target = req->target; xev.xselection.property = req->property; xev.xselection.time = req->time; XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); } else { /* start the INCR process */ g_clip_c2s.incr_in_progress = 1; g_clip_c2s.incr_bytes_done = 0; g_clip_c2s.type = type; g_clip_c2s.property = req->property; g_clip_c2s.window = req->requestor; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_provide_selection_c2s: start INCR property %s " "type %s", get_atom_text(req->property), get_atom_text(type)); val1[0] = g_clip_c2s.total_bytes; val1[1] = 0; XChangeProperty(g_display, req->requestor, req->property, g_incr_atom, 32, PropModeReplace, (tui8 *)val1, 1); /* we need events from that other window */ XSelectInput(g_display, req->requestor, PropertyChangeMask); g_memset(&xev, 0, sizeof(xev)); xev.xselection.type = SelectionNotify; xev.xselection.send_event = True; xev.xselection.display = req->display; xev.xselection.requestor = req->requestor; xev.xselection.selection = req->selection; xev.xselection.target = req->target; xev.xselection.property = req->property; xev.xselection.time = req->time; XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); } return 0; } /*****************************************************************************/ static int clipboard_provide_selection(XSelectionRequestEvent *req, Atom type, int format, char *data, int length) { XEvent xev; int bytes; bytes = FORMAT_TO_BYTES(format); bytes *= length; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_provide_selection: bytes %d", bytes); if (bytes < g_incr_max_req_size) { XChangeProperty(g_display, req->requestor, req->property, type, format, PropModeReplace, (tui8 *)data, length); g_memset(&xev, 0, sizeof(xev)); xev.xselection.type = SelectionNotify; xev.xselection.send_event = True; xev.xselection.display = req->display; xev.xselection.requestor = req->requestor; xev.xselection.selection = req->selection; xev.xselection.target = req->target; xev.xselection.property = req->property; xev.xselection.time = req->time; XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); return 0; } return 1; } /*****************************************************************************/ static int clipboard_refuse_selection(XSelectionRequestEvent *req) { XEvent xev; g_memset(&xev, 0, sizeof(xev)); xev.xselection.type = SelectionNotify; xev.xselection.send_event = True; xev.xselection.display = req->display; xev.xselection.requestor = req->requestor; xev.xselection.selection = req->selection; xev.xselection.target = req->target; xev.xselection.property = None; xev.xselection.time = req->time; XSendEvent(g_display, req->requestor, False, NoEventMask, &xev); return 0; } /*****************************************************************************/ /* sent by client or server when its local system clipboard is updated with new clipboard data; contains Clipboard Format ID and name pairs of new Clipboard Formats on the clipboard. */ static int clipboard_process_format_announce(struct stream *s, int clip_msg_status, int clip_msg_len) { int formatId; int bytes; char desc[256]; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_format_announce: " "CLIPRDR_FORMAT_ANNOUNCE"); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_format_announce %d", clip_msg_len); clipboard_send_format_ack(); xfuse_clear_clip_dir(); g_clip_c2s.converted = 0; desc[0] = 0; g_num_formatIds = 0; while (clip_msg_len > 3) { in_uint32_le(s, formatId); clip_msg_len -= 4; if (g_cliprdr_flags & CB_USE_LONG_FORMAT_NAMES) { /* CLIPRDR_LONG_FORMAT_NAME */ bytes = clipboard_in_utf16_le_as_utf8(s, desc, sizeof(desc)); clip_msg_len -= bytes; } else { /* CLIPRDR_SHORT_FORMAT_NAME */ /* 32 ASCII 8 characters or 16 Unicode characters */ in_utf16_le_fixed_as_utf8(s, 16, desc, sizeof(desc)); desc[15] = 0; clip_msg_len -= 32; } LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_format_announce: formatId 0x%8.8x " "wszFormatName [%s] clip_msg_len %d", formatId, desc, clip_msg_len); if (g_num_formatIds <= 15) { g_formatIds[g_num_formatIds] = formatId; g_num_formatIds++; } if (g_num_formatIds > 15) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_format_announce: max formats"); } /* format id for file copy copy is dynamic and announced by the * client */ if (g_strcmp(desc, "FileGroupDescriptorW") == 0) { g_file_group_descriptor_format_id = formatId; } } if ((g_num_formatIds > 0) && (g_clip_c2s.incr_in_progress == 0) && /* don't interrupt incr */ (g_clip_s2c.incr_in_progress == 0)) { if (clipboard_set_selection_owner() != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_process_format_announce: " "XSetSelectionOwner failed"); } } return 0; } /*****************************************************************************/ /* response to CB_FORMAT_LIST; used to indicate whether processing of the Format List PDU was successful */ static int clipboard_process_format_ack(struct stream *s, int clip_msg_status, int clip_msg_len) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_format_ack: CLIPRDR_FORMAT_ACK"); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_format_ack:"); return 0; } /*****************************************************************************/ static int clipboard_send_data_response_failed(void) { struct stream *s; int size; int rv; LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_send_data_response_failed:"); make_stream(s); init_stream(s, 64); out_uint16_le(s, CB_FORMAT_DATA_RESPONSE); /* 5 CLIPRDR_DATA_RESPONSE */ out_uint16_le(s, CB_RESPONSE_FAIL); /* 2 status */ out_uint32_le(s, 0); s_mark_end(s); size = (int)(s->end - s->data); rv = send_channel_data(g_cliprdr_chan_id, s->data, size); free_stream(s); return rv; } /*****************************************************************************/ /* sent from server to client * sent by recipient of CB_FORMAT_LIST; used to request data for one * of the formats that was listed in CB_FORMAT_LIST */ static int clipboard_process_data_request(struct stream *s, int clip_msg_status, int clip_msg_len) { int requestedFormatId; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: " "CLIPRDR_DATA_REQUEST"); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " %d", g_clip_s2c.xrdp_clip_type); in_uint32_le(s, requestedFormatId); switch (requestedFormatId) { case CB_FORMAT_FILE_GROUP_DESCRIPTOR: if ((g_clip_s2c.xrdp_clip_type == XRDP_CB_FILE) && g_clip_s2c.converted) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: CB_FORMAT_FILE_GROUP_DESCRIPTOR"); clipboard_send_data_response(XRDP_CB_FILE, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: CB_FORMAT_FILE_GROUP_DESCRIPTOR, " "calling XConvertSelection to g_utf8_atom"); g_clip_s2c.xrdp_clip_type = XRDP_CB_FILE; XConvertSelection(g_display, g_clipboard_atom, g_clip_s2c.type, g_clip_property_atom, g_wnd, CurrentTime); } break; case CF_DIB: if ((g_clip_s2c.xrdp_clip_type == XRDP_CB_BITMAP) && g_clip_s2c.converted) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: CF_DIB"); clipboard_send_data_response(XRDP_CB_BITMAP, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: CF_DIB, " "calling XConvertSelection to g_image_bmp_atom"); g_clip_s2c.xrdp_clip_type = XRDP_CB_BITMAP; XConvertSelection(g_display, g_clipboard_atom, g_image_bmp_atom, g_clip_property_atom, g_wnd, CurrentTime); } break; case CF_UNICODETEXT: if ((g_clip_s2c.xrdp_clip_type == XRDP_CB_TEXT) && g_clip_s2c.converted) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: CF_UNICODETEXT"); clipboard_send_data_response(XRDP_CB_TEXT, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: CF_UNICODETEXT, " "calling XConvertSelection to g_utf8_atom"); g_clip_s2c.xrdp_clip_type = XRDP_CB_TEXT; XConvertSelection(g_display, g_clipboard_atom, g_utf8_atom, g_clip_property_atom, g_wnd, CurrentTime); } break; default: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_request: unknown type %d", requestedFormatId); clipboard_send_data_response_failed(); break; } return 0; } /**************************************************************************//** * Process a CB_FORMAT_DATA_RESPONSE for an X client requesting an image * * @param s Stream containing CLIPRDR_FILELIST ([MS-RDPECLIP]) * @param clip_msg_status msgFlags from Clipboard PDU Header * @param clip_msg_len dataLen from Clipboard PDU Header * * @return Status */ static int clipboard_process_data_response_for_image(struct stream *s, int clip_msg_status, int clip_msg_len) { XSelectionRequestEvent *lxev; int len; struct stream *bmp_hs; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_response_for_image: " "CLIPRDR_DATA_RESPONSE_FOR_IMAGE"); lxev = &g_saved_selection_req_event; len = (int)(s->end - s->p); if (len < 1) { return 0; } if (g_clip_c2s.type != g_image_bmp_atom) { return 0; } g_free(g_clip_c2s.data); g_clip_c2s.data = (char *) g_malloc(len + BMPFILEHEADER_LEN, 0); if (g_clip_c2s.data == 0) { g_clip_c2s.total_bytes = 0; return 0; } g_clip_c2s.total_bytes = len + BMPFILEHEADER_LEN; g_clip_c2s.read_bytes_done = g_clip_c2s.total_bytes; /* * Assemble bitmap file header * https://en.wikipedia.org/wiki/BMP_file_format#Bitmap_file_header */ make_stream(bmp_hs); if (bmp_hs == 0) { g_free(g_clip_c2s.data); g_clip_c2s.total_bytes = 0; return 0; } init_stream(bmp_hs, BMPFILEHEADER_LEN); out_uint8(bmp_hs, 'B'); out_uint8(bmp_hs, 'M'); out_uint32_le(bmp_hs, g_clip_c2s.total_bytes); out_uint16_le(bmp_hs, 0); out_uint16_le(bmp_hs, 0); out_uint32_le(bmp_hs, BMPFILEHEADER_LEN + BMPINFOHEADER_LEN); /* Copy header and data to output stream */ g_memcpy(g_clip_c2s.data, bmp_hs->data, BMPFILEHEADER_LEN); in_uint8a(s, g_clip_c2s.data + BMPFILEHEADER_LEN, len); free_stream(bmp_hs); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_response_for_image: calling " "clipboard_provide_selection_c2s"); clipboard_provide_selection_c2s(lxev, lxev->target); return 0; } /**************************************************************************//** * Process a CB_FORMAT_DATA_RESPONSE for an X client requesting a file list * * @param s Stream containing CLIPRDR_FILELIST ([MS-RDPECLIP]) * @param clip_msg_status msgFlags from Clipboard PDU Header * @param clip_msg_len dataLen from Clipboard PDU Header * * @return Status */ static int clipboard_process_data_response_for_file(struct stream *s, int clip_msg_status, int clip_msg_len) { XSelectionRequestEvent *lxev; int rv = 0; LOG_DEVEL(LOG_LEVEL_TRACE, "clipboard_process_data_response_for_file: "); lxev = &g_saved_selection_req_event; const int flist_size = 1024 * 1024; g_free(g_clip_c2s.data); g_clip_c2s.data = (char *)g_malloc(flist_size, 0); if (g_clip_c2s.data == NULL) { LOG(LOG_LEVEL_ERROR, "clipboard_process_data_response_for_file: " "Can't allocate memory"); rv = 1; } /* text/uri-list */ else if (g_clip_c2s.type == g_file_atom1) { rv = clipboard_c2s_in_files(s, g_clip_c2s.data, flist_size, "file://"); } /* x-special/gnome-copied-files */ else if (g_clip_c2s.type == g_file_atom2) { g_strcpy(g_clip_c2s.data, "copy\n"); rv = clipboard_c2s_in_files(s, g_clip_c2s.data + 5, flist_size - 5, "file://"); } else if ((g_clip_c2s.type == XA_STRING) || (g_clip_c2s.type == g_utf8_atom)) { if (g_cfg->use_nautilus3_flist_format) { /* * This file list format is only used by GNOME 3 * versions >= 3.29.92. It is not used by GNOME 4. Remove * this workaround when GNOME 3 is no longer supported by * long-term distros */ #define LIST_PREFIX "x-special/nautilus-clipboard\ncopy\n" #define LIST_PREFIX_LEN (sizeof(LIST_PREFIX) - 1) g_strcpy(g_clip_c2s.data, LIST_PREFIX); rv = clipboard_c2s_in_files(s, g_clip_c2s.data + LIST_PREFIX_LEN, flist_size - LIST_PREFIX_LEN - 1, "file://"); g_strcat(g_clip_c2s.data, "\n"); #undef LIST_PREFIX_LEN #undef LIST_PREFIX } else { rv = clipboard_c2s_in_files(s, g_clip_c2s.data, flist_size, ""); } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_process_data_response_for_file: " "Unrecognised target"); rv = 1; } if (rv != 0 && g_clip_c2s.data != NULL) { g_clip_c2s.data[0] = '\0'; } g_clip_c2s.total_bytes = (g_clip_c2s.data == NULL) ? 0 : g_strlen(g_clip_c2s.data); g_clip_c2s.read_bytes_done = g_clip_c2s.total_bytes; clipboard_provide_selection_c2s(lxev, lxev->target); return rv; } /**************************************************************************//** * Process a CB_FORMAT_DATA_RESPONSE for an X client requesting text * * @param s Stream containing CLIPRDR_FILELIST ([MS-RDPECLIP]) * @param clip_msg_status msgFlags from Clipboard PDU Header * @param clip_msg_len dataLen from Clipboard PDU Header * * @return Status */ static int clipboard_process_data_response_for_text(struct stream *s, int clip_msg_status, int clip_msg_len) { XSelectionRequestEvent *lxev = &g_saved_selection_req_event; unsigned int byte_count; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_response_for_text: "); /* Get the buffer size we need */ byte_count = in_utf16_le_terminated_as_utf8_length(s); g_free(g_clip_c2s.data); g_clip_c2s.total_bytes = 0; if ((g_clip_c2s.data = (char *)g_malloc(byte_count, 0)) == NULL) { LOG(LOG_LEVEL_ERROR, "Can't allocate %u bytes for text clip response", byte_count); clipboard_refuse_selection(lxev); } else { /* Re-parse the data into the allocated buffer */ in_utf16_le_terminated_as_utf8(s, g_clip_c2s.data, byte_count); --byte_count; /* Ignore the terminator at the end */ g_clip_c2s.total_bytes = byte_count; g_clip_c2s.read_bytes_done = byte_count; clipboard_provide_selection_c2s(lxev, lxev->target); } return 0; } /*****************************************************************************/ /* client to server */ /* sent as a reply to CB_FORMAT_DATA_REQUEST; used to indicate whether processing of the CB_FORMAT_DATA_REQUEST was successful; if processing was successful, CB_FORMAT_DATA_RESPONSE includes contents of requested clipboard data. */ /*****************************************************************************/ static int clipboard_process_data_response(struct stream *s, int clip_msg_status, int clip_msg_len) { int rv = 0; XSelectionRequestEvent *lxev = &g_saved_selection_req_event; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_data_response:"); g_clip_c2s.in_request = 0; if ((clip_msg_status & CB_RESPONSE_FAIL) != 0) { /* Requested data was not returned from the client. Most likely * the client has lost the selection between announcing it and * responding to our request */ clipboard_refuse_selection(lxev); } else if ((clip_msg_status & CB_RESPONSE_OK) == 0) { /* One of CB_RESPONSE_FAIL or CB_RESPONSE_OK MUST be set in * a CLIPRDR_FORMAT_DATA_RESPONSE msg */ LOG(LOG_LEVEL_ERROR, "CLIPRDR_FORMAT_DATA_RESPONSE is badly formed"); clipboard_refuse_selection(lxev); } else if (g_clip_c2s.xrdp_clip_type == XRDP_CB_BITMAP) { clipboard_process_data_response_for_image(s, clip_msg_status, clip_msg_len); } else if (g_clip_c2s.xrdp_clip_type == XRDP_CB_FILE) { clipboard_process_data_response_for_file(s, clip_msg_status, clip_msg_len); } else { clipboard_process_data_response_for_text(s, clip_msg_status, clip_msg_len); } return rv; } /*****************************************************************************/ static int clipboard_process_clip_caps(struct stream *s, int clip_msg_status, int clip_msg_len) { int cCapabilitiesSets; int capabilitySetType; int lengthCapability; int index; int version; int flags; char *holdp; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_clip_caps:"); //LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", s->p, s->end - s->p); in_uint16_le(s, cCapabilitiesSets); in_uint8s(s, 2); /* pad */ for (index = 0; index < cCapabilitiesSets; index++) { holdp = s->p; in_uint16_le(s, capabilitySetType); in_uint16_le(s, lengthCapability); switch (capabilitySetType) { case CB_CAPSTYPE_GENERAL: in_uint32_le(s, version); /* version */ in_uint32_le(s, flags); /* generalFlags */ LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_clip_caps: " "g_cliprdr_version %d version %d " "g_cliprdr_flags 0x%x flags 0x%x", g_cliprdr_version, version, g_cliprdr_flags, flags); if (version < g_cliprdr_version) { g_cliprdr_version = version; } g_cliprdr_flags &= flags; break; default: LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_process_clip_caps: unknown " "capabilitySetType %d", capabilitySetType); break; } s->p = holdp + lengthCapability; } return 0; } /*****************************************************************************/ int clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length, int total_length) { int clip_msg_id; int clip_msg_len; int clip_msg_status; int rv; struct stream *ls; if (!g_clip_up) { LOG_DEVEL(LOG_LEVEL_ERROR, "aborting clipboard_data_in - clipboard has not " "been initialized"); /* we return 0 here to indicate no protocol problem occurred */ return 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_data_in: chan_id %d " "chan_flags 0x%x length %d total_length %d " "in_request %d g_ins->size %d", chan_id, chan_flags, length, total_length, g_clip_c2s.in_request, g_ins->size); if ((chan_flags & 3) == 3) { ls = s; } else { if (chan_flags & 1) { init_stream(g_ins, total_length); } in_uint8a(s, g_ins->end, length); g_ins->end += length; if ((chan_flags & 2) == 0) { return 0; } ls = g_ins; } in_uint16_le(ls, clip_msg_id); in_uint16_le(ls, clip_msg_status); in_uint32_le(ls, clip_msg_len); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_data_in: clip_msg_id %d " "clip_msg_status %d clip_msg_len %d", clip_msg_id, clip_msg_status, clip_msg_len); rv = 0; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_data_in: %d", clip_msg_id); switch (clip_msg_id) { /* sent by client or server when its local system clipboard is */ /* updated with new clipboard data; contains Clipboard Format ID */ /* and name pairs of new Clipboard Formats on the clipboard. */ case CB_FORMAT_LIST: /* 2 CLIPRDR_FORMAT_ANNOUNCE */ rv = clipboard_process_format_announce(ls, clip_msg_status, clip_msg_len); break; /* response to CB_FORMAT_LIST; used to indicate whether */ /* processing of the Format List PDU was successful */ case CB_FORMAT_LIST_RESPONSE: /* 3 CLIPRDR_FORMAT_ACK */ rv = clipboard_process_format_ack(ls, clip_msg_status, clip_msg_len); break; /* sent by recipient of CB_FORMAT_LIST; used to request data for one */ /* of the formats that was listed in CB_FORMAT_LIST */ case CB_FORMAT_DATA_REQUEST: /* 4 CLIPRDR_DATA_REQUEST */ rv = clipboard_process_data_request(ls, clip_msg_status, clip_msg_len); break; /* sent as a reply to CB_FORMAT_DATA_REQUEST; used to indicate */ /* whether processing of the CB_FORMAT_DATA_REQUEST was */ /* successful; if processing was successful, */ /* CB_FORMAT_DATA_RESPONSE includes contents of requested */ /* clipboard data. */ case CB_FORMAT_DATA_RESPONSE: /* 5 CLIPRDR_DATA_RESPONSE */ rv = clipboard_process_data_response(ls, clip_msg_status, clip_msg_len); break; case CB_CLIP_CAPS: /* 7 */ rv = clipboard_process_clip_caps(ls, clip_msg_status, clip_msg_len); break; case CB_FILECONTENTS_REQUEST: /* 8 */ rv = clipboard_process_file_request(ls, clip_msg_status, clip_msg_len); break; case CB_FILECONTENTS_RESPONSE: /* 9 */ rv = clipboard_process_file_response(ls, clip_msg_status, clip_msg_len); break; default: LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_data_in: unknown clip_msg_id %d", clip_msg_id); break; } XFlush(g_display); return rv; } /*****************************************************************************/ /* this happens when a new app copies something to the clipboard 'CLIPBOARD' Atom typedef struct { int type; unsigned long serial; Bool send_event; Display *display; Window window; int subtype; Window owner; Atom selection; Time timestamp; Time selection_timestamp; } XFixesSelectionNotifyEvent; */ static int clipboard_event_selection_owner_notify(XEvent *xevent) { XFixesSelectionNotifyEvent *lxevent; lxevent = (XFixesSelectionNotifyEvent *)xevent; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_owner_notify: 0x%lx", lxevent->owner); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_owner_notify: " "window %ld subtype %d owner %ld g_wnd %ld", lxevent->window, lxevent->subtype, lxevent->owner, g_wnd); if (lxevent->owner == g_wnd) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_owner_notify: matches g_wnd"); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_owner_notify: skipping, " "owner == g_wnd"); g_got_selection = 1; return 0; } g_got_selection = 0; if (lxevent->owner != 0) /* nil owner comes when selection */ { /* window is closed */ XConvertSelection(g_display, g_clipboard_atom, g_targets_atom, g_clip_property_atom, g_wnd, lxevent->timestamp); } return 0; } /*****************************************************************************/ /* returns error get a window property from wnd */ static int clipboard_get_window_property(Window wnd, Atom prop, Atom *type, int *fmt, int *n_items, char **xdata, int *xdata_size) { int lfmt; int lxdata_size; unsigned long ln_items; unsigned long llen_after; tui8 *lxdata; Atom ltype; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_get_window_property:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " prop %ld name %s", prop, get_atom_text(prop)); lxdata = 0; ltype = 0; XGetWindowProperty(g_display, wnd, prop, 0, 0, 0, AnyPropertyType, <ype, &lfmt, &ln_items, &llen_after, &lxdata); if (lxdata != 0) { XFree(lxdata); } if (ltype == 0) { /* XGetWindowProperty failed */ return 4; } if (llen_after < 1) { /* no data, ok */ return 0; } lxdata = 0; ltype = 0; XGetWindowProperty(g_display, wnd, prop, 0, (llen_after + 3) / 4, 0, AnyPropertyType, <ype, &lfmt, &ln_items, &llen_after, &lxdata); if (ltype == 0) { /* XGetWindowProperty failed */ if (lxdata != 0) { XFree(lxdata); } return 1; } lxdata_size = FORMAT_TO_BYTES(lfmt); lxdata_size *= ln_items; if (lxdata_size < 1) { /* should not happen */ if (lxdata != 0) { XFree(lxdata); } return 2; } if (llen_after > 0) { /* should not happen */ if (lxdata != 0) { XFree(lxdata); } return 3; } if (xdata != 0) { *xdata = (char *) g_malloc(lxdata_size, 0); g_memcpy(*xdata, lxdata, lxdata_size); } if (lxdata != 0) { XFree(lxdata); } if (xdata_size != 0) { *xdata_size = lxdata_size; } if (fmt != 0) { *fmt = (int)lfmt; } if (n_items != 0) { *n_items = (int)ln_items; } if (type != 0) { *type = ltype; } return 0; } /*****************************************************************************/ /* returns error process the SelectionNotify X event, uses XSelectionEvent typedef struct { int type; // SelectionNotify unsigned long serial; // # of last request processed by server Bool send_event; // true if this came from a SendEvent request Display *display; // Display the event was read from Window requestor; Atom selection; Atom target; Atom property; // atom or None Time time; } XSelectionEvent; */ static int clipboard_event_selection_notify(XEvent *xevent) { XSelectionEvent *lxevent; char *data; int data_size; int n_items; int fmt; int rv; int index; int got_string; int got_utf8; int got_bmp_image; int send_format_announce; Atom got_file_atom; Atom atom; Atom *atoms; Atom type; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify:"); data_size = 0; n_items = 0; fmt = 0; got_string = 0; got_utf8 = 0; got_bmp_image = 0; got_file_atom = 0; send_format_announce = 0; rv = 0; data = 0; type = 0; lxevent = (XSelectionEvent *)xevent; if (lxevent->property == None) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_selection_notify: clip could " "not be converted"); rv = 1; } if (rv == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: wnd 0x%lx prop %s", lxevent->requestor, get_atom_text(lxevent->property)); rv = clipboard_get_window_property(lxevent->requestor, lxevent->property, &type, &fmt, &n_items, &data, &data_size); if (rv != 0) { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_selection_notify: " "clipboard_get_window_property failed error %d", rv); return 0; } //LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", data, data_size); XDeleteProperty(g_display, lxevent->requestor, lxevent->property); if (type == g_incr_atom) { /* nothing more to do here, the data is coming in through PropertyNotify */ LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: type is INCR " "data_size %d property name %s type %s", data_size, get_atom_text(lxevent->property), get_atom_text(lxevent->type)); g_clip_s2c.incr_in_progress = 1; g_clip_s2c.property = lxevent->property; g_clip_s2c.type = lxevent->target; g_clip_s2c.total_bytes = 0; g_free(g_clip_s2c.data); g_clip_s2c.data = 0; //LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", data, sizeof(long)); g_free(data); return 0; } } if (rv == 0) { if (lxevent->selection == g_clipboard_atom) { if (lxevent->target == g_targets_atom) { /* 32 implies long */ if ((type == XA_ATOM) && (fmt == 32)) { atoms = (Atom *)data; for (index = 0; index < n_items; index++) { atom = atoms[index]; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: 0x%lx %s 0x%lx", atom, get_atom_text(atom), XA_STRING); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: 0x%lx %s", atom, get_atom_text(atom)); if (atom == g_utf8_atom) { got_utf8 = 1; } else if (atom == XA_STRING) { got_string = 1; } else if (atom == g_image_bmp_atom) { got_bmp_image = 1; } else if ((atom == g_file_atom1) || (atom == g_file_atom2)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: file"); got_file_atom = atom; } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_selection_notify: unknown atom 0x%lx", atom); } } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_selection_notify: error, " "target is 'TARGETS' and type[%ld] or fmt[%d] not right, " "should be type[%ld], fmt[%d]", type, fmt, XA_ATOM, 32); } } else if (lxevent->target == g_utf8_atom) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: UTF8_STRING " "data_size %d", data_size); if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 0)) { g_free(g_clip_s2c.data); g_clip_s2c.total_bytes = data_size; g_clip_s2c.data = (char *) g_malloc(g_clip_s2c.total_bytes + 1, 0); g_memcpy(g_clip_s2c.data, data, g_clip_s2c.total_bytes); g_clip_s2c.data[g_clip_s2c.total_bytes] = 0; if (g_clip_s2c.xrdp_clip_type == XRDP_CB_FILE) { if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(file) UTF8_STRING(%s) is restricted because of config", g_clip_s2c.data); } else { clipboard_send_data_response_for_file(g_clip_s2c.data, g_clip_s2c.total_bytes); } } else { if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_TEXT) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(text) UTF8_STRING(%s) is restricted because of config", g_clip_s2c.data); } else { clipboard_send_data_response_for_text(g_clip_s2c.data, g_clip_s2c.total_bytes); } } } } else if (lxevent->target == XA_STRING) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: XA_STRING " "data_size %d", data_size); if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 0)) { g_free(g_clip_s2c.data); g_clip_s2c.total_bytes = data_size; g_clip_s2c.data = (char *) g_malloc(g_clip_s2c.total_bytes + 1, 0); g_memcpy(g_clip_s2c.data, data, g_clip_s2c.total_bytes); g_clip_s2c.data[g_clip_s2c.total_bytes] = 0; if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_TEXT) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(text) XA_STRING(%s) is restricted because of config", g_clip_s2c.data); } else { clipboard_send_data_response_for_text(g_clip_s2c.data, g_clip_s2c.total_bytes); } } } else if (lxevent->target == g_image_bmp_atom) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: image/bmp " "data_size %d", data_size); if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 14)) { g_free(g_clip_s2c.data); if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_IMAGE) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(image) image/bmp is restricted because of config"); } else { g_clip_s2c.total_bytes = data_size; g_clip_s2c.data = (char *) g_malloc(data_size, 0); g_memcpy(g_clip_s2c.data, data, data_size); clipboard_send_data_response_for_image(g_clip_s2c.data + 14, data_size - 14); } } } else if (lxevent->target == g_file_atom1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: text/uri-list " "data_size %d", data_size); if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 0)) { g_free(g_clip_s2c.data); g_clip_s2c.total_bytes = data_size; g_clip_s2c.data = (char *) g_malloc(g_clip_s2c.total_bytes + 1, 0); g_memcpy(g_clip_s2c.data, data, g_clip_s2c.total_bytes); g_clip_s2c.data[g_clip_s2c.total_bytes] = 0; if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(file) text/uri-list(%s) is restricted because of config", g_clip_s2c.data); } else { clipboard_send_data_response_for_file(g_clip_s2c.data, g_clip_s2c.total_bytes); } } } else if (lxevent->target == g_file_atom2) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: x-special/gnome-copied-files " "data_size %d", data_size); if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 0)) { g_free(g_clip_s2c.data); g_clip_s2c.total_bytes = data_size; g_clip_s2c.data = (char *) g_malloc(g_clip_s2c.total_bytes + 1, 0); g_memcpy(g_clip_s2c.data, data, g_clip_s2c.total_bytes); g_clip_s2c.data[g_clip_s2c.total_bytes] = 0; if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(file) x-special/gnome-copied-files(%s) is restricted because of config", g_clip_s2c.data); } else { clipboard_send_data_response_for_file(g_clip_s2c.data, g_clip_s2c.total_bytes); } } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_selection_notify: " "unknown target"); } } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_selection_notify: " "unknown selection"); } } if (got_file_atom != 0) { /* text/uri-list or x-special/gnome-copied-files */ if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(file) is restricted because of config"); } else { g_clip_s2c.type = got_file_atom; g_clip_s2c.xrdp_clip_type = XRDP_CB_FILE; g_clip_s2c.converted = 0; g_clip_s2c.clip_time = lxevent->time; send_format_announce = 1; } } else if (got_utf8) { if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_TEXT) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(text) is restricted because of config"); } else { g_clip_s2c.type = g_utf8_atom; g_clip_s2c.xrdp_clip_type = XRDP_CB_TEXT; g_clip_s2c.converted = 0; g_clip_s2c.clip_time = lxevent->time; send_format_announce = 1; } } else if (got_string) { /* * In most cases, when copying text, TARGETS atom and UTF8_STRING atom exists, * it means that this code block which checks STRING atom might not be never executed * in recent platforms. * Use echo foo | xclip -selection clipboard -noutf8 to reproduce it. */ if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_TEXT) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(text) is restricted because of config"); } else { g_clip_s2c.type = XA_STRING; g_clip_s2c.xrdp_clip_type = XRDP_CB_TEXT; g_clip_s2c.converted = 0; g_clip_s2c.clip_time = lxevent->time; send_format_announce = 1; } } else if (got_bmp_image) { if (g_cfg->restrict_outbound_clipboard & CLIP_RESTRICT_IMAGE) { LOG(LOG_LEVEL_DEBUG, "outbound clipboard(image) is restricted because of config"); } else { g_clip_s2c.type = g_image_bmp_atom; g_clip_s2c.xrdp_clip_type = XRDP_CB_BITMAP; g_clip_s2c.converted = 0; g_clip_s2c.clip_time = lxevent->time; send_format_announce = 1; } } if (send_format_announce) { if (clipboard_send_format_announce(g_clip_s2c.xrdp_clip_type) != 0) { rv = 4; } } g_free(data); return rv; } /*****************************************************************************/ /* returns error process the SelectionRequest X event, uses XSelectionRequestEvent typedef struct { int type; // SelectionRequest unsigned long serial; // # of last request processed by server Bool send_event; // true if this came from a SendEvent request Display *display; // Display the event was read from Window owner; Window requestor; Atom selection; Atom target; Atom property; Time time; } XSelectionRequestEvent; */ /* * When XGetWindowProperty and XChangeProperty talk about "format 32" it * doesn't mean a 32bit value, but actually a long. So 32 means 4 bytes on * a 32bit machine and 8 bytes on a 64 machine */ static int clipboard_event_selection_request(XEvent *xevent) { XSelectionRequestEvent *lxev; Atom atom_buf[10]; Atom type; int atom_count; int fmt; int n_items; int xdata_size; char *xdata; lxev = (XSelectionRequestEvent *)xevent; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: 0x%lx", lxev->property); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: g_wnd %ld, " ".requestor %ld .owner %ld .selection %ld '%s' .target %ld .property %ld", g_wnd, lxev->requestor, lxev->owner, lxev->selection, get_atom_text(lxev->selection), lxev->target, lxev->property); if (lxev->property == None) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: " "lxev->property is None"); } else if (lxev->target == g_targets_atom) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: g_targets_atom"); /* requestor is asking what the selection can be converted to */ LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: " "g_targets_atom"); atom_buf[0] = g_targets_atom; atom_buf[1] = g_timestamp_atom; atom_buf[2] = g_multiple_atom; atom_count = 3; /* Only announce text if the client is advertising text, or * a file list */ if (clipboard_find_format_id(CF_UNICODETEXT) >= 0 || clipboard_find_format_id(CF_OEMTEXT) >= 0 || clipboard_find_format_id(CF_TEXT) >= 0 || clipboard_find_format_id(g_file_group_descriptor_format_id) >= 0) { if ((g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_TEXT) == 0) { atom_buf[atom_count] = XA_STRING; atom_count++; atom_buf[atom_count] = g_utf8_atom; atom_count++; } } if (clipboard_find_format_id(CF_DIB) >= 0 && (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_IMAGE) == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " reporting image/bmp"); atom_buf[atom_count] = g_image_bmp_atom; atom_count++; } if (clipboard_find_format_id(g_file_group_descriptor_format_id) >= 0 && (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_FILE) == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, " reporting text/uri-list"); atom_buf[atom_count] = g_file_atom1; atom_count++; LOG_DEVEL(LOG_LEVEL_DEBUG, " reporting x-special/gnome-copied-files"); atom_buf[atom_count] = g_file_atom2; atom_count++; } atom_buf[atom_count] = 0; LOG_DEVEL(LOG_LEVEL_DEBUG, " reporting %d formats", atom_count); return clipboard_provide_selection(lxev, XA_ATOM, 32, (char *)atom_buf, atom_count); } else if (lxev->target == g_timestamp_atom) { /* requestor is asking the time I got the selection */ LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: " "g_timestamp_atom"); atom_buf[0] = g_selection_time; atom_buf[1] = 0; return clipboard_provide_selection(lxev, XA_INTEGER, 32, (char *)atom_buf, 1); } else if (lxev->target == g_multiple_atom) { /* target, property pairs */ LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: " "g_multiple_atom"); xdata = 0; if (clipboard_get_window_property(lxev->requestor, lxev->property, &type, &fmt, &n_items, &xdata, &xdata_size) == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: g_multiple_atom " "n_items %d", n_items); /* todo */ g_free(xdata); } } else if ((lxev->target == XA_STRING) || (lxev->target == g_utf8_atom)) { if (clipboard_find_format_id(g_file_group_descriptor_format_id) >= 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: " "text requested when files available"); if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard %s is restricted because of config", lxev->target == XA_STRING ? "XA_STRING" : "UTF8_STRING"); clipboard_refuse_selection(lxev); } else { g_memcpy(&g_saved_selection_req_event, lxev, sizeof(g_saved_selection_req_event)); g_clip_c2s.type = lxev->target; g_clip_c2s.xrdp_clip_type = XRDP_CB_FILE; clipboard_send_data_request(g_file_group_descriptor_format_id); } } else { if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_TEXT) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard %s is restricted because of config", lxev->target == XA_STRING ? "XA_STRING" : "UTF8_STRING"); clipboard_refuse_selection(lxev); } else { /* The client may have advertised CF_TEXT or CF_OEMTEXT, * but the Windows clipboard will convert these formats * to Unicode if asked */ g_memcpy(&g_saved_selection_req_event, lxev, sizeof(g_saved_selection_req_event)); g_clip_c2s.type = lxev->target; g_clip_c2s.xrdp_clip_type = XRDP_CB_TEXT; clipboard_send_data_request(CF_UNICODETEXT); } } return 0; } else if (lxev->target == g_image_bmp_atom) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: image/bmp"); if ((g_clip_c2s.type == lxev->target) && g_clip_c2s.converted) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: -------------------------------------------"); if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_IMAGE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard image/bmp converted is restricted because of config"); clipboard_refuse_selection(lxev); } else { clipboard_provide_selection_c2s(lxev, lxev->target); } return 0; } if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_IMAGE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard image/bmp is restricted because of config"); clipboard_refuse_selection(lxev); } else { g_memcpy(&g_saved_selection_req_event, lxev, sizeof(g_saved_selection_req_event)); g_clip_c2s.type = g_image_bmp_atom; g_clip_c2s.xrdp_clip_type = XRDP_CB_BITMAP; clipboard_send_data_request(CF_DIB); } return 0; } else if (lxev->target == g_file_atom1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: g_file_atom1"); if ((g_clip_c2s.type == lxev->target) && g_clip_c2s.converted) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: -------------------------------------------"); if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard text/uri-list is restricted because of config"); clipboard_refuse_selection(lxev); return 0; } else { clipboard_provide_selection_c2s(lxev, lxev->target); return 0; } } if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard text/uri-list is restricted because of config"); clipboard_refuse_selection(lxev); return 0; } else { g_memcpy(&g_saved_selection_req_event, lxev, sizeof(g_saved_selection_req_event)); g_clip_c2s.type = g_file_atom1; g_clip_c2s.xrdp_clip_type = XRDP_CB_FILE; clipboard_send_data_request(g_file_group_descriptor_format_id); return 0; } } else if (lxev->target == g_file_atom2) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: g_file_atom2"); if ((g_clip_c2s.type == lxev->target) && g_clip_c2s.converted) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_request: -------------------------------------------"); if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard x-special/gnome-copied-files converted is restricted because of config"); clipboard_refuse_selection(lxev); return 0; } else { clipboard_provide_selection_c2s(lxev, lxev->target); return 0; } } if (g_cfg->restrict_inbound_clipboard & CLIP_RESTRICT_FILE) { LOG(LOG_LEVEL_DEBUG, "inbound clipboard x-special/gnome-copied-files is restricted because of config"); clipboard_refuse_selection(lxev); return 0; } else { g_memcpy(&g_saved_selection_req_event, lxev, sizeof(g_saved_selection_req_event)); g_clip_c2s.type = g_file_atom2; g_clip_c2s.xrdp_clip_type = XRDP_CB_FILE; clipboard_send_data_request(g_file_group_descriptor_format_id); return 0; } } else { LOG(LOG_LEVEL_ERROR, "clipboard_event_selection_request: unknown " "target %s", get_atom_text(lxev->target)); } clipboard_refuse_selection(lxev); return 0; } /*****************************************************************************/ /* returns error process the SelectionClear X event, uses XSelectionClearEvent typedef struct { int type; // SelectionClear unsigned long serial; // # of last request processed by server Bool send_event; // true if this came from a SendEvent request Display *display; // Display the event was read from Window window; Atom selection; Time time; } XSelectionClearEvent; */ static int clipboard_event_selection_clear(XEvent *xevent) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_clear:"); return 0; } /*****************************************************************************/ /* returns error typedef struct { int type; // PropertyNotify unsigned long serial; // # of last request processed by server Bool send_event; // true if this came from a SendEvent request Display *display; // Display the event was read from Window window; Atom atom; Time time; int state; // PropertyNewValue or PropertyDelete } XPropertyEvent; */ static int clipboard_event_property_notify(XEvent *xevent) { Atom actual_type_return; int actual_format_return; unsigned long nitems_returned; unsigned long bytes_left; unsigned char *data; int rv; int format_in_bytes; int new_data_len; int data_bytes; char *cptr; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: PropertyNotify .window %ld " ".state %d .atom %ld %s", xevent->xproperty.window, xevent->xproperty.state, xevent->xproperty.atom, get_atom_text(xevent->xproperty.atom)); if (g_clip_c2s.incr_in_progress && (xevent->xproperty.window == g_clip_c2s.window) && (xevent->xproperty.atom == g_clip_c2s.property) && (xevent->xproperty.state == PropertyDelete)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: INCR PropertyDelete"); /* this is used for when copying a large clipboard to the other app, it will delete the property so we know to send the next one */ if ((g_clip_c2s.data == 0) || (g_clip_c2s.total_bytes < 1)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: INCR error"); return 0; } data = (tui8 *)(g_clip_c2s.data + g_clip_c2s.incr_bytes_done); data_bytes = g_clip_c2s.read_bytes_done - g_clip_c2s.incr_bytes_done; if ((data_bytes < 1) && (g_clip_c2s.read_bytes_done < g_clip_c2s.total_bytes)) { g_clip_c2s.incr_in_progress = 0; return 0; } if (data_bytes > g_incr_max_req_size) { data_bytes = g_incr_max_req_size; } g_clip_c2s.incr_bytes_done += data_bytes; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: data_bytes %d", data_bytes); XChangeProperty(xevent->xproperty.display, xevent->xproperty.window, xevent->xproperty.atom, g_clip_c2s.type, 8, PropModeReplace, data, data_bytes); if (data_bytes < 1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: INCR done"); g_clip_c2s.incr_in_progress = 0; /* we no longer need property notify */ XSelectInput(xevent->xproperty.display, xevent->xproperty.window, NoEventMask); g_clip_c2s.converted = 1; } } if (g_clip_s2c.incr_in_progress && (xevent->xproperty.window == g_wnd) && (xevent->xproperty.atom == g_clip_s2c.property) && (xevent->xproperty.state == PropertyNewValue)) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: INCR PropertyNewValue"); rv = XGetWindowProperty(g_display, g_wnd, g_clip_s2c.property, 0, 0, 0, AnyPropertyType, &actual_type_return, &actual_format_return, &nitems_returned, &bytes_left, &data); if (rv != Success) { return 1; } if (data != 0) { XFree(data); data = 0; } if (bytes_left <= 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: INCR done"); /* clipboard INCR cycle has completed */ g_clip_s2c.incr_in_progress = 0; if (g_clip_s2c.type == g_image_bmp_atom) { g_clip_s2c.xrdp_clip_type = XRDP_CB_BITMAP; //LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", g_last_clip_data, 64); /* skip header */ clipboard_send_data_response(g_clip_s2c.xrdp_clip_type, g_clip_s2c.data + 14, g_clip_s2c.total_bytes - 14); } else if ((g_clip_s2c.type == XA_STRING) || (g_clip_s2c.type == g_utf8_atom)) { g_clip_s2c.xrdp_clip_type = XRDP_CB_TEXT; clipboard_send_data_response(g_clip_s2c.xrdp_clip_type, g_clip_s2c.data, g_clip_s2c.total_bytes); } else { LOG_DEVEL(LOG_LEVEL_ERROR, "clipboard_event_property_notify: error unknown type %ld", g_clip_s2c.type); clipboard_send_data_response_failed(); } XDeleteProperty(g_display, g_wnd, g_clip_s2c.property); } else { rv = XGetWindowProperty(g_display, g_wnd, g_clip_s2c.property, 0, bytes_left, 0, AnyPropertyType, &actual_type_return, &actual_format_return, &nitems_returned, &bytes_left, &data); if (rv != Success) { return 1; } format_in_bytes = FORMAT_TO_BYTES(actual_format_return); new_data_len = nitems_returned * format_in_bytes; cptr = (char *) g_malloc(g_clip_s2c.total_bytes + new_data_len, 0); if (cptr == NULL) { /* cannot add any more data */ g_free(g_clip_s2c.data); g_clip_s2c.data = 0; if (data != 0) { XFree(data); } XDeleteProperty(g_display, g_wnd, g_clip_s2c.property); return 0; } g_memcpy(cptr, g_clip_s2c.data, g_clip_s2c.total_bytes); g_free(g_clip_s2c.data); LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_property_notify: new_data_len %d", new_data_len); g_clip_s2c.data = cptr; if (data) { g_memcpy(g_clip_s2c.data + g_clip_s2c.total_bytes, data, new_data_len); g_clip_s2c.total_bytes += new_data_len; XFree(data); } XDeleteProperty(g_display, g_wnd, g_clip_s2c.property); } } return 0; } /*****************************************************************************/ /* returns 0, event handled, 1 unhandled */ int clipboard_xevent(void *xevent) { XEvent *lxevent; LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_xevent: event detected"); if (!g_clip_up) { return 1; } lxevent = (XEvent *)xevent; switch (lxevent->type) { case SelectionNotify: clipboard_event_selection_notify(lxevent); break; case SelectionRequest: clipboard_event_selection_request(lxevent); break; case SelectionClear: clipboard_event_selection_clear(lxevent); break; case MappingNotify: break; case PropertyNotify: clipboard_event_property_notify(lxevent); break; case UnmapNotify: LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::clipboard_xevent: got UnmapNotify"); break; case ClientMessage: LOG_DEVEL(LOG_LEVEL_DEBUG, "chansrv::clipboard_xevent: got ClientMessage"); break; default: if (lxevent->type == g_xfixes_event_base + XFixesSetSelectionOwnerNotify) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_xevent: got XFixesSetSelectionOwnerNotify"); clipboard_event_selection_owner_notify(lxevent); break; } if (lxevent->type == g_xfixes_event_base + XFixesSelectionWindowDestroyNotify) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_xevent: got XFixesSelectionWindowDestroyNotify"); break; } if (lxevent->type == g_xfixes_event_base + XFixesSelectionClientCloseNotify) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_xevent: got XFixesSelectionClientCloseNotify"); break; } /* we didn't handle this message */ return 1; } return 0; } xrdp-0.10.1/sesman/chansrv/smartcard_pcsc.c000644 001751 000000 00000201432 14652432047 020725 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2013 jay.sorg@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * smartcard redirection support, PCSC daemon standin * this will act like pcsc daemon * pcsc lib and daemon write struct on unix domain socket for communication * * Currently this file implements some of the PDUs detailed in [MS-RDPESC]. * * The PDUs use DCE IDL structs. These are required to be re-interpreted * in DCE NDR (Netword Data Representation) * * For more information on this subject see DCE publication C706 * "DCE 1.1: Remote Procedure Call" 1997. In particular:- * Section 4.2 : Describes the IDL * Section 14 : Describes the NDR */ #if defined(HAVE_CONFIG_H) #include #endif #define JAY_TODO_CONTEXT 0 #define JAY_TODO_WIDE 1 #define PCSC_STANDIN 1 #include "os_calls.h" #include "string_calls.h" #include "smartcard.h" #include "log.h" #include "irp.h" #include "devredir.h" #include "trans.h" #include "chansrv.h" #include "list.h" #if PCSC_STANDIN extern int g_display_num; /* in chansrv.c */ static int g_autoinc = 0; /* general purpose autoinc */ struct pcsc_card /* item for list of open cards in one context */ { tui32 app_card; /* application card, always 4 bytes */ int card_bytes; /* client card bytes */ char card[16]; /* client card */ }; struct pcsc_context { tui32 app_context; /* application context, always 4 byte */ int context_bytes; /* client context bytes */ char context[16]; /* client context */ struct list *cards; /* these need to be released on close */ }; /*****************************************************************************/ struct pcsc_uds_client { int uds_client_id; /* unique id represents each app */ struct trans *con; /* the connection to the app */ struct list *contexts; /* list of struct pcsc_context */ struct pcsc_context *connect_context; }; static struct list *g_uds_clients = 0; /* struct pcsc_uds_client */ static struct trans *g_lis = 0; static char g_pcsclite_ipc_dir[256] = ""; static char g_pcsclite_ipc_file[256] = ""; /*****************************************************************************/ /* got a new unix domain socket connection */ static struct pcsc_uds_client * create_uds_client(struct trans *con) { struct pcsc_uds_client *uds_client; LOG_DEVEL(LOG_LEVEL_DEBUG, "create_uds_client:"); if (con == 0) { return 0; } uds_client = g_new0(struct pcsc_uds_client, 1); if (uds_client == 0) { return 0; } g_autoinc++; uds_client->uds_client_id = g_autoinc; uds_client->con = con; con->callback_data = uds_client; return uds_client; } /*****************************************************************************/ static struct pcsc_uds_client * get_uds_client_by_id(int uds_client_id) { struct pcsc_uds_client *uds_client; int index; LOG_DEVEL(LOG_LEVEL_DEBUG, "get_uds_client_by_id:"); if (uds_client_id == 0) { LOG(LOG_LEVEL_ERROR, "get_uds_client_by_id: uds_client_id is zero"); return 0; } if (g_uds_clients == 0) { LOG(LOG_LEVEL_ERROR, "get_uds_client_by_id: g_uds_clients is nil"); return 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, " count %d", g_uds_clients->count); for (index = 0; index < g_uds_clients->count; index++) { uds_client = (struct pcsc_uds_client *) list_get_item(g_uds_clients, index); if (uds_client->uds_client_id == uds_client_id) { return uds_client; } } LOG(LOG_LEVEL_ERROR, "get_uds_client_by_id: can't find uds_client_id %d", uds_client_id); return 0; } /*****************************************************************************/ struct pcsc_context * get_pcsc_context_by_app_context(struct pcsc_uds_client *uds_client, tui32 app_context) { struct pcsc_context *rv; int index; if (uds_client == 0) { return 0; } if (uds_client->contexts == 0) { return 0; } for (index = 0; index < uds_client->contexts->count; index++) { rv = (struct pcsc_context *) list_get_item(uds_client->contexts, index); if (rv->app_context == app_context) { return rv; } } return 0; } /*****************************************************************************/ struct pcsc_card * get_pcsc_card_by_app_card(struct pcsc_uds_client *uds_client, tui32 app_card, struct pcsc_context **acontext) { struct pcsc_card *lcard; struct pcsc_context *lcontext; int index; int index1; LOG_DEVEL(LOG_LEVEL_DEBUG, "get_pcsc_card_by_app_card: app_card %d", app_card); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "get_pcsc_card_by_app_card: uds_client is null"); return 0; } if (uds_client->contexts == 0) { LOG(LOG_LEVEL_ERROR, "get_pcsc_card_by_app_card: uds_client->contexts is null"); return 0; } for (index = 0; index < uds_client->contexts->count; index++) { lcontext = (struct pcsc_context *) list_get_item(uds_client->contexts, index); if (lcontext != 0) { if (lcontext->cards != 0) { for (index1 = 0; index1 < lcontext->cards->count; index1++) { lcard = (struct pcsc_card *) list_get_item(lcontext->cards, index1); if (lcard != 0) { if (lcard->app_card == app_card) { if (acontext != 0) { *acontext = lcontext; } return lcard; } } } } } } LOG(LOG_LEVEL_ERROR, "get_pcsc_card_by_app_card: app_card %d " "not found in uds_client->contexts->cards", app_card); return 0; } /*****************************************************************************/ static int free_uds_client(struct pcsc_uds_client *uds_client) { int i; int j; struct pcsc_context *context; struct pcsc_card *card; LOG_DEVEL(LOG_LEVEL_DEBUG, "free_uds_client:"); if (uds_client == 0) { return 0; } if (uds_client->contexts != 0) { for (i = 0; i < uds_client->contexts->count; i++) { context = (struct pcsc_context *) list_get_item(uds_client->contexts, i); if (context != 0) { if (context->cards != 0) { for (j = 0; j < context->cards->count; j++) { card = (struct pcsc_card *) list_get_item(context->cards, j); if (card != 0) { /* TODO: send free card to client */ g_free(card); } } list_delete(context->cards); } LOG_DEVEL(LOG_LEVEL_DEBUG, " left over context %p", context->context); scard_send_cancel(0, context->context, context->context_bytes); scard_send_release_context(0, context->context, context->context_bytes); g_free(context); } } list_delete(uds_client->contexts); } trans_delete(uds_client->con); g_free(uds_client); return 0; } /*****************************************************************************/ static struct pcsc_context * uds_client_add_context(struct pcsc_uds_client *uds_client, char *context, int context_bytes) { struct pcsc_context *pcscContext; LOG_DEVEL(LOG_LEVEL_DEBUG, "uds_client_add_context:"); pcscContext = (struct pcsc_context *) g_malloc(sizeof(struct pcsc_context), 1); if (pcscContext == 0) { LOG(LOG_LEVEL_ERROR, "uds_client_add_context: failed to allocate memory for pcsc_context"); return 0; } g_autoinc++; pcscContext->app_context = g_autoinc; pcscContext->context_bytes = context_bytes; g_memcpy(pcscContext->context, context, context_bytes); if (uds_client->contexts == 0) { uds_client->contexts = list_create(); if (uds_client->contexts == 0) { LOG(LOG_LEVEL_ERROR, "uds_client_add_context: failed to allocate memory for " "uds_client->contexts"); return 0; } } list_add_item(uds_client->contexts, (tintptr) pcscContext); return pcscContext; } /*****************************************************************************/ static int uds_client_remove_context(struct pcsc_uds_client *uds_client, struct pcsc_context *acontext) { int index; if (uds_client->contexts == 0) { LOG(LOG_LEVEL_ERROR, "uds_client_remove_context: uds_client->contexts is null"); return 1; } index = list_index_of(uds_client->contexts, (tintptr) acontext); if (index < 0) { LOG(LOG_LEVEL_ERROR, "uds_client_remove_context: pcsc_context not found in uds_client->contexts"); return 1; } list_remove_item(uds_client->contexts, index); g_free(acontext); // TODO free cards return 0; } /*****************************************************************************/ static struct pcsc_card * context_add_card(struct pcsc_uds_client *uds_client, struct pcsc_context *acontext, char *card, int card_bytes) { struct pcsc_card *pcscCard; LOG_DEVEL(LOG_LEVEL_DEBUG, "context_add_card: card_bytes %d", card_bytes); pcscCard = (struct pcsc_card *) g_malloc(sizeof(struct pcsc_card), 1); if (pcscCard == 0) { LOG(LOG_LEVEL_ERROR, "context_add_card: failed to allocate memory for pcsc_card"); return 0; } g_autoinc++; pcscCard->app_card = g_autoinc; pcscCard->card_bytes = card_bytes; g_memcpy(pcscCard->card, card, card_bytes); if (acontext->cards == 0) { acontext->cards = list_create(); if (acontext->cards == 0) { LOG(LOG_LEVEL_ERROR, "context_add_card: failed to allocate " "memory for uds_client->contexts->cards"); return 0; } } list_add_item(acontext->cards, (tintptr) pcscCard); LOG_DEVEL(LOG_LEVEL_DEBUG, " new app_card %d", pcscCard->app_card); return pcscCard; } /*****************************************************************************/ int scard_pcsc_get_wait_objs(tbus *objs, int *count, int *timeout) { struct pcsc_uds_client *uds_client; int index; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_pcsc_get_wait_objs:"); if (g_lis != 0) { trans_get_wait_objs(g_lis, objs, count); } if (g_uds_clients != 0) { for (index = 0; index < g_uds_clients->count; index++) { uds_client = (struct pcsc_uds_client *) list_get_item(g_uds_clients, index); if (uds_client != 0) { trans_get_wait_objs(uds_client->con, objs, count); } } } return 0; } /*****************************************************************************/ int scard_pcsc_check_wait_objs(void) { struct pcsc_uds_client *uds_client; int index; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_pcsc_check_wait_objs:"); if (g_lis != 0) { if (trans_check_wait_objs(g_lis) != 0) { LOG(LOG_LEVEL_ERROR, "scard_pcsc_check_wait_objs: g_lis trans_check_wait_objs error"); } } if (g_uds_clients != 0) { index = 0; while (index < g_uds_clients->count) { uds_client = (struct pcsc_uds_client *) list_get_item(g_uds_clients, index); if (uds_client != 0) { if (trans_check_wait_objs(uds_client->con) != 0) { free_uds_client(uds_client); list_remove_item(g_uds_clients, index); continue; } } index++; } } return 0; } /*****************************************************************************/ /* returns error */ int scard_process_establish_context(struct trans *con, struct stream *in_s) { int dwScope; struct pcsc_uds_client *uds_client; void *user_data; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_establish_context:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, dwScope); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_establish_context: dwScope 0x%8.8x", dwScope); user_data = (void *) (tintptr) (uds_client->uds_client_id); scard_send_establish_context(user_data, dwScope); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_establish_context_return(void *user_data, struct stream *in_s, int len, int status) { int bytes; int uds_client_id; int context_bytes; int app_context; char context[16]; struct stream *out_s; struct pcsc_uds_client *uds_client; struct trans *con; struct pcsc_context *lcontext; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_establish_context_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_establish_context_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; lcontext = 0; app_context = 0; g_memset(context, 0, 16); if (status == 0) { in_uint8s(in_s, 28); in_uint32_le(in_s, context_bytes); if (context_bytes > 16) { LOG(LOG_LEVEL_ERROR, "scard_function_establish_context_return: opps " "context_bytes %d", context_bytes); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "", in_s->p, context_bytes); return 1; } in_uint8a(in_s, context, context_bytes); lcontext = uds_client_add_context(uds_client, context, context_bytes); app_context = lcontext->app_context; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_establish_context_return: " "app_context %d", app_context); } out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, app_context); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x01); /* SCARD_ESTABLISH_CONTEXT 0x01 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_release_context(struct trans *con, struct stream *in_s) { int hContext; struct pcsc_uds_client *uds_client; struct pcsc_context *lcontext; void *user_data; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_release_context:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hContext); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_release_context: hContext 0x%8.8x", hContext); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcontext = get_pcsc_context_by_app_context(uds_client, hContext); if (lcontext == 0) { LOG(LOG_LEVEL_ERROR, "scard_process_release_context: " "get_pcsc_context_by_app_context failed"); return 1; } scard_send_release_context(user_data, lcontext->context, lcontext->context_bytes); uds_client_remove_context(uds_client, lcontext); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_release_context_return(void *user_data, struct stream *in_s, int len, int status) { int bytes; int uds_client_id; struct stream *out_s; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_release_context_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_release_context_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x02); /* SCARD_RELEASE_CONTEXT 0x02 */ return trans_force_write(con); } /*****************************************************************************/ struct pcsc_list_readers { int uds_client_id; int cchReaders; }; /*****************************************************************************/ /* returns error */ int scard_process_list_readers(struct trans *con, struct stream *in_s) { int hContext; unsigned int bytes_groups; int cchReaders; /* * At the time of writing, the groups strings which can be sent * over this interface are all small:- * * "SCard$AllReaders", "SCard$DefaultReaders", "SCard$LocalReaders" and * "SCard$SystemReaders" * * We'll allow a bit extra in case the interface changes */ char groups[256]; struct pcsc_uds_client *uds_client; struct pcsc_context *lcontext; struct pcsc_list_readers *pcscListReaders; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_list_readers:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hContext); in_uint32_le(in_s, bytes_groups); if (bytes_groups > (sizeof(groups) - 1)) { LOG(LOG_LEVEL_ERROR, "scard_process_list_readers: Unreasonable string length %u", bytes_groups); return 1; } in_uint8a(in_s, groups, bytes_groups); groups[bytes_groups] = '\0'; in_uint32_le(in_s, cchReaders); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_list_readers: hContext 0x%8.8x cchReaders %d", hContext, cchReaders); lcontext = get_pcsc_context_by_app_context(uds_client, hContext); if (lcontext == 0) { LOG(LOG_LEVEL_ERROR, "scard_process_list_readers: " "get_pcsc_context_by_app_context failed"); return 1; } pcscListReaders = g_new0(struct pcsc_list_readers, 1); pcscListReaders->uds_client_id = uds_client->uds_client_id; pcscListReaders->cchReaders = cchReaders; scard_send_list_readers(pcscListReaders, lcontext->context, lcontext->context_bytes, groups, cchReaders, 1); return 0; } /*****************************************************************************/ /** * Counts the number of non-NULL strings in a multistring * * [MS-RDPESC] A multistring is "A series of null-terminated character * strings terminated by a final null character stored in a contiguous * block of memory." * * The string is guaranteed to have at least the returned number of NULL * characters in it */ unsigned int count_multistring_elements(const char *str, unsigned int len) { unsigned int rv = 0; if (str != NULL) { while (len > 0) { // Look for a terminator const char *p = (const char *)memchr(str, '\0', len); if (!p || p == str) { // No terminator, or an empty string encountered */ break; } ++rv; ++p; // Skip terminator len -= (p - str); str = p; } } return rv; } /*****************************************************************************/ int scard_function_list_readers_return(void *user_data, struct stream *in_s, int len, int status) { /* see [MS-RDPESC] 2.2.3.4 * * IDL:- * * typedef struct _longAndMultiString_Return { * long ReturnCode; * [range(0,65536)] unsigned long cBytes; * [unique] [size_is(cBytes)] byte *msz; * } ListReaderGroups_Return, ListReaders_Return; * * Type summary:- * * ReturnCode 32-bit word * CBytes Unsigned 32-bit word * msz Embedded full pointer to conformant array of bytes * * NDR:- * * Offset Decription * 0 ReturnCode * 4 cBytes * 8 msz pointer Referent Identifier * 12 length of multistring in bytes * 16 Multistring data */ struct stream *out_s; int readers; int index; int bytes; int cchReaders; int llen; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; struct pcsc_list_readers *pcscListReaders; char *msz_readers = NULL; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_list_readers_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); pcscListReaders = (struct pcsc_list_readers *) user_data; if (pcscListReaders == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_list_readers_return: " "pcscListReaders is nil"); return 1; } uds_client_id = pcscListReaders->uds_client_id; cchReaders = pcscListReaders->cchReaders; g_free(pcscListReaders); uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_list_readers_return: " "get_uds_client_by_id failed, could not find id %d", uds_client_id); return 1; } con = uds_client->con; readers = 0; llen = 0; if (status == 0) { // Skip [C706] PDU Header in_uint8s(in_s, 16); // Move to length of multistring in bytes in_uint8s(in_s, 12); in_uint32_le(in_s, llen); if (cchReaders > 0) { // Convert the wide multistring to a UTF-8 multistring unsigned int u8len; u8len = in_utf16_le_fixed_as_utf8_length(in_s, len / 2); msz_readers = (char *)malloc(u8len); if (msz_readers == NULL) { LOG(LOG_LEVEL_ERROR, "scard_function_list_readers_return: " "Can't allocate %u bytes of memory", u8len); readers = 0; } else { in_utf16_le_fixed_as_utf8(in_s, len / 2, msz_readers, u8len); readers = count_multistring_elements(msz_readers, u8len); } } } out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, llen); out_uint32_le(out_s, readers); { const char *p = msz_readers; for (index = 0; index < readers; index++) { unsigned int slen = strlen(p); if (slen < 100) { out_uint8a(out_s, p, slen); out_uint8s(out_s, 100 - slen); } else { out_uint8a(out_s, p, 99); out_uint8s(out_s, 1); } p += (slen + 1); } } free(msz_readers); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x03); /* SCARD_LIST_READERS 0x03 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_connect(struct trans *con, struct stream *in_s) { int hContext; READER_STATE rs; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_context *lcontext; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_connect:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); g_memset(&rs, 0, sizeof(rs)); in_uint32_le(in_s, hContext); in_uint8a(in_s, rs.reader_name, 100); in_uint32_le(in_s, rs.dwShareMode); in_uint32_le(in_s, rs.dwPreferredProtocols); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_connect: rs.reader_name %s dwShareMode 0x%8.8x " "dwPreferredProtocols 0x%8.8x", rs.reader_name, rs.dwShareMode, rs.dwPreferredProtocols); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcontext = get_pcsc_context_by_app_context(uds_client, hContext); if (lcontext == 0) { LOG(LOG_LEVEL_ERROR, "scard_process_connect: " "get_pcsc_context_by_app_context failed"); return 1; } uds_client->connect_context = lcontext; scard_send_connect(user_data, lcontext->context, lcontext->context_bytes, 1, &rs); return 0; } /*****************************************************************************/ int scard_function_connect_return(void *user_data, struct stream *in_s, int len, int status) { int dwActiveProtocol; int hCard; int bytes; int uds_client_id; struct stream *out_s; struct pcsc_uds_client *uds_client; struct trans *con; char *card; int card_bytes; struct pcsc_card *lcard; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_connect_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_connect_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; dwActiveProtocol = 0; hCard = 0; if (status == 0) { in_uint8s(in_s, 36); in_uint32_le(in_s, dwActiveProtocol); if (len > 40) { in_uint32_le(in_s, card_bytes); in_uint8p(in_s, card, card_bytes); lcard = context_add_card(uds_client, uds_client->connect_context, card, card_bytes); hCard = lcard->app_card; LOG_DEVEL(LOG_LEVEL_DEBUG, " hCard %d dwActiveProtocol %d", hCard, dwActiveProtocol); } else { status = 0x8010000F; /* SCARD_E_PROTO_MISMATCH */ } } out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, hCard); out_uint32_le(out_s, dwActiveProtocol); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x04); /* SCARD_CONNECT 0x04 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_disconnect(struct trans *con, struct stream *in_s) { int hCard; int dwDisposition; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_context *lcontext; struct pcsc_card *lcard; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_disconnect:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hCard); in_uint32_le(in_s, dwDisposition); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcontext == 0) || (lcard == 0)) { LOG(LOG_LEVEL_ERROR, "scard_process_disconnect: " "get_pcsc_card_by_app_card failed"); return 1; } scard_send_disconnect(user_data, lcontext->context, lcontext->context_bytes, lcard->card, lcard->card_bytes, dwDisposition); return 0; } /*****************************************************************************/ int scard_function_disconnect_return(void *user_data, struct stream *in_s, int len, int status) { int bytes; int uds_client_id; struct stream *out_s; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_disconnect_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_disconnect_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x06); /* SCARD_DISCONNECT 0x06 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_begin_transaction(struct trans *con, struct stream *in_s) { int hCard; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_card *lcard; struct pcsc_context *lcontext; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_begin_transaction:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hCard); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_begin_transaction: hCard 0x%8.8x", hCard); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcard == 0) || (lcontext == 0)) { LOG(LOG_LEVEL_ERROR, "scard_process_begin_transaction: " "get_pcsc_card_by_app_card failed"); return 1; } scard_send_begin_transaction(user_data, lcontext->context, lcontext->context_bytes, lcard->card, lcard->card_bytes); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_begin_transaction_return(void *user_data, struct stream *in_s, int len, int status) { struct stream *out_s; int bytes; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_begin_transaction_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_begin_transaction_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x07); /* SCARD_BEGIN_TRANSACTION 0x07 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_end_transaction(struct trans *con, struct stream *in_s) { int hCard; int dwDisposition; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_card *lcard; struct pcsc_context *lcontext; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_end_transaction:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hCard); in_uint32_le(in_s, dwDisposition); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_end_transaction: hCard 0x%8.8x", hCard); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcard == 0) || (lcontext == 0)) { LOG(LOG_LEVEL_ERROR, "scard_process_end_transaction: " "get_pcsc_card_by_app_card failed"); return 1; } scard_send_end_transaction(user_data, lcontext->context, lcontext->context_bytes, lcard->card, lcard->card_bytes, dwDisposition); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_end_transaction_return(void *user_data, struct stream *in_s, int len, int status) { struct stream *out_s; int bytes; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_end_transaction_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_end_transaction_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x08); /* SCARD_END_TRANSACTION 0x08 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_function_get_attrib_return(void *user_data, struct stream *in_s, int len, int status) { return 0; } /*****************************************************************************/ struct pcsc_transmit { int uds_client_id; struct xrdp_scard_io_request recv_ior; int cbRecvLength; }; /*****************************************************************************/ /* returns error */ int scard_process_transmit(struct trans *con, struct stream *in_s) { int hCard; int recv_bytes; int send_bytes; char *send_data; struct xrdp_scard_io_request send_ior; struct xrdp_scard_io_request recv_ior; struct pcsc_uds_client *uds_client; struct pcsc_card *lcard; struct pcsc_context *lcontext; struct pcsc_transmit *pcscTransmit; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_transmit:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_transmit:"); in_uint32_le(in_s, hCard); in_uint32_le(in_s, send_ior.dwProtocol); in_uint32_le(in_s, send_ior.cbPciLength); in_uint32_le(in_s, send_ior.extra_bytes); in_uint8p(in_s, send_ior.extra_data, send_ior.extra_bytes); in_uint32_le(in_s, send_bytes); in_uint8p(in_s, send_data, send_bytes); in_uint32_le(in_s, recv_ior.dwProtocol); in_uint32_le(in_s, recv_ior.cbPciLength); in_uint32_le(in_s, recv_ior.extra_bytes); in_uint8p(in_s, recv_ior.extra_data, recv_ior.extra_bytes); in_uint32_le(in_s, recv_bytes); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_transmit: send dwProtocol %d cbPciLength %d " "recv dwProtocol %d cbPciLength %d send_bytes %d ", send_ior.dwProtocol, send_ior.cbPciLength, recv_ior.dwProtocol, recv_ior.cbPciLength, send_bytes); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_transmit: recv_bytes %d", recv_bytes); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcard == 0) || (lcontext == 0)) { LOG(LOG_LEVEL_ERROR, "scard_process_transmit: " "get_pcsc_card_by_app_card failed"); return 1; } pcscTransmit = (struct pcsc_transmit *) g_malloc(sizeof(struct pcsc_transmit), 1); pcscTransmit->uds_client_id = uds_client->uds_client_id; pcscTransmit->recv_ior = recv_ior; pcscTransmit->cbRecvLength = recv_bytes; scard_send_transmit(pcscTransmit, lcontext->context, lcontext->context_bytes, lcard->card, lcard->card_bytes, send_data, send_bytes, recv_bytes, &send_ior, &recv_ior); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_transmit_return(void *user_data, struct stream *in_s, int len, int status) { struct stream *out_s; int bytes; int val; int cbRecvLength; char *recvBuf; struct xrdp_scard_io_request recv_ior; struct pcsc_uds_client *uds_client; struct trans *con; struct pcsc_transmit *pcscTransmit; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_transmit_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); pcscTransmit = (struct pcsc_transmit *) user_data; recv_ior = pcscTransmit->recv_ior; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(pcscTransmit->uds_client_id); g_free(pcscTransmit); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_transmit_return: " "get_uds_client_by_id failed"); return 1; } con = uds_client->con; cbRecvLength = 0; recvBuf = 0; if (status == 0) { in_uint8s(in_s, 20); in_uint32_le(in_s, val); if (val != 0) { /* pioRecvPci */ in_uint8s(in_s, 8); in_uint32_le(in_s, recv_ior.dwProtocol); in_uint32_le(in_s, recv_ior.cbPciLength); recv_ior.cbPciLength += 8; in_uint32_le(in_s, recv_ior.extra_bytes); if (recv_ior.extra_bytes > 0) { in_uint8p(in_s, recv_ior.extra_data, recv_ior.extra_bytes); } } in_uint8s(in_s, 4); in_uint32_le(in_s, val); if (val != 0) { in_uint32_le(in_s, cbRecvLength); in_uint8p(in_s, recvBuf, cbRecvLength); } } LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_transmit_return: cbRecvLength %d", cbRecvLength); out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, recv_ior.dwProtocol); out_uint32_le(out_s, recv_ior.cbPciLength); out_uint32_le(out_s, recv_ior.extra_bytes); out_uint8a(out_s, recv_ior.extra_data, recv_ior.extra_bytes); out_uint32_le(out_s, cbRecvLength); out_uint8a(out_s, recvBuf, cbRecvLength); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x09); /* SCARD_TRANSMIT 0x09 */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_control(struct trans *con, struct stream *in_s) { int hCard; int send_bytes; int recv_bytes; int control_code; char *send_data; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_context *lcontext; struct pcsc_card *lcard; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_control:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_control:"); in_uint32_le(in_s, hCard); in_uint32_le(in_s, control_code); in_uint32_le(in_s, send_bytes); in_uint8p(in_s, send_data, send_bytes); in_uint32_le(in_s, recv_bytes); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcard == 0) || (lcontext == 0)) { LOG(LOG_LEVEL_ERROR, "scard_process_control: " "get_pcsc_card_by_app_card failed"); return 1; } scard_send_control(user_data, lcontext->context, lcontext->context_bytes, lcard->card, lcard->card_bytes, send_data, send_bytes, recv_bytes, control_code); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_control_return(void *user_data, struct stream *in_s, int len, int status) { struct stream *out_s; int bytes; int cbRecvLength; char *recvBuf; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_control_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_control_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; cbRecvLength = 0; recvBuf = 0; if (status == 0) { in_uint8s(in_s, 28); in_uint32_le(in_s, cbRecvLength); in_uint8p(in_s, recvBuf, cbRecvLength); } LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_control_return: cbRecvLength %d", cbRecvLength); out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, cbRecvLength); out_uint8a(out_s, recvBuf, cbRecvLength); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x0A); /* SCARD_CONTROL 0x0A */ return trans_force_write(con); } /*****************************************************************************/ struct pcsc_status { int uds_client_id; int cchReaderLen; }; /*****************************************************************************/ /* returns error */ int scard_process_status(struct trans *con, struct stream *in_s) { int hCard; int cchReaderLen; int cbAtrLen; struct pcsc_uds_client *uds_client; struct pcsc_card *lcard; struct pcsc_context *lcontext; struct pcsc_status *pcscStatus; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_status:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hCard); in_uint32_le(in_s, cchReaderLen); in_uint32_le(in_s, cbAtrLen); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_status: hCard 0x%8.8x cchReaderLen %d " "cbAtrLen %d", hCard, cchReaderLen, cbAtrLen); lcard = get_pcsc_card_by_app_card(uds_client, hCard, &lcontext); if ((lcard == 0) || (lcontext == 0)) { LOG(LOG_LEVEL_ERROR, "scard_process_status: " "get_pcsc_card_by_app_card failed"); return 1; } pcscStatus = (struct pcsc_status *) g_malloc(sizeof(struct pcsc_status), 1); pcscStatus->uds_client_id = uds_client->uds_client_id; pcscStatus->cchReaderLen = cchReaderLen; scard_send_status(pcscStatus, 1, lcontext->context, lcontext->context_bytes, lcard->card, lcard->card_bytes, cchReaderLen, cbAtrLen); return 0; } #define MS_SCARD_UNKNOWN 0 #define MS_SCARD_ABSENT 1 #define MS_SCARD_PRESENT 2 #define MS_SCARD_SWALLOWED 3 #define MS_SCARD_POWERED 4 #define MS_SCARD_NEGOTIABLE 5 #define MS_SCARD_SPECIFIC 6 #define PC_SCARD_UNKNOWN 0x0001 /**< Unknown state */ #define PC_SCARD_ABSENT 0x0002 /**< Card is absent */ #define PC_SCARD_PRESENT 0x0004 /**< Card is present */ #define PC_SCARD_SWALLOWED 0x0008 /**< Card not powered */ #define PC_SCARD_POWERED 0x0010 /**< Card is powered */ #define PC_SCARD_NEGOTIABLE 0x0020 /**< Ready for PTS */ #define PC_SCARD_SPECIFIC 0x0040 /**< PTS has been set */ static int g_ms2pc[] = { PC_SCARD_UNKNOWN, PC_SCARD_ABSENT, PC_SCARD_PRESENT, PC_SCARD_SWALLOWED, PC_SCARD_POWERED, PC_SCARD_NEGOTIABLE, PC_SCARD_SPECIFIC }; /*****************************************************************************/ /* returns error */ int scard_function_status_return(void *user_data, struct stream *in_s, int len, int status) { /* see [MS-RDPESC] 2.2.3.10 * * IDL:- * * typedef struct _Status_Return { * long ReturnCode; * unsigned long cBytes; * [unique] [size_is(cBytes)] byte *mszReaderNames; * unsigned long dwState; * unsigned long dwProtocol; * byte pbAtr[32]; * [range(0,32)] unsigned long cbAtrLen; * } Status_Return; * * NDR:- * * Offset Decription * 0 ReturnCode * 4 cBytes * 8 Referent Identifier for mszReaderNames; * 12 dwState * 16 dwProtocol * 20 pbAtr * 52 cbAtrLen * 56 length of multistring in bytes (same as cBytes) * 60 Multistring data */ struct stream *out_s; int bytes; int dwReaderLen; int dwState; int dwProtocol; int dwAtrLen; char attr[32]; char lreader_name[100]; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; struct pcsc_status *pcscStatus; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_status_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); pcscStatus = (struct pcsc_status *) user_data; if (pcscStatus == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_status_return: pcscStatus is nil"); return 1; } uds_client_id = pcscStatus->uds_client_id; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_status_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); g_free(pcscStatus); return 1; } g_free(pcscStatus); con = uds_client->con; dwReaderLen = 0; dwState = 0; dwProtocol = 0; dwAtrLen = 0; lreader_name[0] = 0; if (status == 0) { in_uint8s(in_s, 16); // Skip [C706] PDU Header in_uint8s(in_s, 4); // ReturnCode in_uint32_le(in_s, dwReaderLen); in_uint8s(in_s, 4); // Referent Identifier in_uint32_le(in_s, dwState); dwState = g_ms2pc[dwState % 6]; in_uint32_le(in_s, dwProtocol); in_uint8a(in_s, attr, 32); in_uint32_le(in_s, dwAtrLen); // Length of multistring and multistring data if (dwReaderLen <= 0) { lreader_name[0] = '\0'; } else { in_uint8s(in_s, 4); // Skip length of msz in bytes // TODO: why are we just returning the first name of the card? in_utf16_le_terminated_as_utf8(in_s, lreader_name, sizeof(lreader_name)); } } LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_status_return: dwAtrLen %d dwReaderLen %d " "dwProtocol %d dwState %d name %s", dwAtrLen, dwReaderLen, dwProtocol, dwState, lreader_name); out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); dwReaderLen = g_strlen(lreader_name); out_uint32_le(out_s, dwReaderLen); out_uint8a(out_s, lreader_name, dwReaderLen); out_uint32_le(out_s, dwState); out_uint32_le(out_s, dwProtocol); out_uint32_le(out_s, dwAtrLen); out_uint8a(out_s, attr, dwAtrLen); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x0B); /* SCARD_STATUS 0x0B */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_get_status_change(struct trans *con, struct stream *in_s) { int index; int hContext; int dwTimeout; int cReaders; READER_STATE *rsa; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_context *lcontext; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_get_status_change:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hContext); in_uint32_le(in_s, dwTimeout); in_uint32_le(in_s, cReaders); if ((cReaders < 0) || (cReaders > 16)) { LOG(LOG_LEVEL_ERROR, "scard_process_get_status_change: bad cReaders %d", cReaders); return 1; } rsa = (READER_STATE *) g_malloc(sizeof(READER_STATE) * cReaders, 1); for (index = 0; index < cReaders; index++) { in_uint8a(in_s, rsa[index].reader_name, 100); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_get_status_change: reader_name %s", rsa[index].reader_name); in_uint32_le(in_s, rsa[index].current_state); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_get_status_change: current_state %d", rsa[index].current_state); in_uint32_le(in_s, rsa[index].event_state); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_get_status_change: event_state %d", rsa[index].event_state); in_uint32_le(in_s, rsa[index].atr_len); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_get_status_change: atr_len %d", rsa[index].atr_len); in_uint8a(in_s, rsa[index].atr, 36); } LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_get_status_change: hContext 0x%8.8x dwTimeout " "%d cReaders %d", hContext, dwTimeout, cReaders); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcontext = get_pcsc_context_by_app_context(uds_client, hContext); if (lcontext == 0) { LOG(LOG_LEVEL_ERROR, "scard_process_get_status_change: " "get_pcsc_context_by_app_context failed"); g_free(rsa); return 1; } scard_send_get_status_change(user_data, lcontext->context, lcontext->context_bytes, 1, dwTimeout, cReaders, rsa); g_free(rsa); return 0; } /*****************************************************************************/ int scard_function_get_status_change_return(void *user_data, struct stream *in_s, int len, int status) { int bytes; int index; int cReaders; tui32 current_state; tui32 event_state; tui32 atr_len; /* number of bytes in atr[] */ tui8 atr[36]; struct stream *out_s; int uds_client_id; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_get_status_change_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_get_status_change_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); if (status != 0) { out_uint32_le(out_s, 0); /* cReaders */ out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ } else { in_uint8s(in_s, 28); in_uint32_le(in_s, cReaders); LOG_DEVEL(LOG_LEVEL_DEBUG, " cReaders %d", cReaders); out_uint32_le(out_s, cReaders); if (cReaders > 0) { for (index = 0; index < cReaders; index++) { in_uint32_le(in_s, current_state); out_uint32_le(out_s, current_state); in_uint32_le(in_s, event_state); out_uint32_le(out_s, event_state); in_uint32_le(in_s, atr_len); out_uint32_le(out_s, atr_len); in_uint8a(in_s, atr, 36); out_uint8a(out_s, atr, 36); } } out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ } s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x0C); /* SCARD_ESTABLISH_CONTEXT 0x0C */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_process_cancel(struct trans *con, struct stream *in_s) { int hContext; struct pcsc_uds_client *uds_client; void *user_data; struct pcsc_context *lcontext; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_cancel:"); uds_client = (struct pcsc_uds_client *) (con->callback_data); in_uint32_le(in_s, hContext); LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_cancel: hContext 0x%8.8x", hContext); user_data = (void *) (tintptr) (uds_client->uds_client_id); lcontext = get_pcsc_context_by_app_context(uds_client, hContext); if (lcontext == 0) { LOG(LOG_LEVEL_ERROR, "scard_process_cancel: " "get_pcsc_context_by_app_context failed"); return 1; } scard_send_cancel(user_data, lcontext->context, lcontext->context_bytes); return 0; } /*****************************************************************************/ /* returns error */ int scard_function_cancel_return(void *user_data, struct stream *in_s, int len, int status) { int bytes; int uds_client_id; struct stream *out_s; struct pcsc_uds_client *uds_client; struct trans *con; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_function_cancel_return:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " status 0x%8.8x", status); uds_client_id = (int) (tintptr) user_data; uds_client = (struct pcsc_uds_client *) get_uds_client_by_id(uds_client_id); if (uds_client == 0) { LOG(LOG_LEVEL_ERROR, "scard_function_cancel_return: " "get_uds_client_by_id failed to find uds_client_id %d", uds_client_id); return 1; } con = uds_client->con; out_s = trans_get_out_s(con, 8192); if (out_s == NULL) { return 1; } s_push_layer(out_s, iso_hdr, 8); out_uint32_le(out_s, status); /* SCARD_S_SUCCESS status */ s_mark_end(out_s); bytes = (int) (out_s->end - out_s->data); s_pop_layer(out_s, iso_hdr); out_uint32_le(out_s, bytes - 8); out_uint32_le(out_s, 0x0D); /* SCARD_CANCEL 0x0D */ return trans_force_write(con); } /*****************************************************************************/ /* returns error */ int scard_function_is_context_valid_return(void *user_data, struct stream *in_s, int len, int status) { return 0; } /*****************************************************************************/ /* returns error */ int scard_function_reconnect_return(void *user_data, struct stream *in_s, int len, int status) { return 0; } /*****************************************************************************/ /* returns error */ int scard_process_msg(struct trans *con, struct stream *in_s, int command) { int rv; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_process_msg: command 0x%4.4x", command); rv = 0; switch (command) { case 0x01: /* SCARD_ESTABLISH_CONTEXT */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_ESTABLISH_CONTEXT"); rv = scard_process_establish_context(con, in_s); break; case 0x02: /* SCARD_RELEASE_CONTEXT */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_RELEASE_CONTEXT"); rv = scard_process_release_context(con, in_s); break; case 0x03: /* SCARD_LIST_READERS */ /* This is only called from xrdp_pcsc.c */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_LIST_READERS"); rv = scard_process_list_readers(con, in_s); break; case 0x04: /* SCARD_CONNECT */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_CONNECT"); rv = scard_process_connect(con, in_s); break; case 0x05: /* SCARD_RECONNECT */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_RECONNECT"); break; case 0x06: /* SCARD_DISCONNECT */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_DISCONNECT"); rv = scard_process_disconnect(con, in_s); break; case 0x07: /* SCARD_BEGIN_TRANSACTION */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_BEGIN_TRANSACTION"); rv = scard_process_begin_transaction(con, in_s); break; case 0x08: /* SCARD_END_TRANSACTION */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_END_TRANSACTION"); rv = scard_process_end_transaction(con, in_s); break; case 0x09: /* SCARD_TRANSMIT */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_TRANSMIT"); rv = scard_process_transmit(con, in_s); break; case 0x0A: /* SCARD_CONTROL */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_CONTROL"); rv = scard_process_control(con, in_s); break; case 0x0B: /* SCARD_STATUS */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_STATUS"); rv = scard_process_status(con, in_s); break; case 0x0C: /* SCARD_GET_STATUS_CHANGE */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_GET_STATUS_CHANGE"); rv = scard_process_get_status_change(con, in_s); break; case 0x0D: /* SCARD_CANCEL */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_CANCEL"); rv = scard_process_cancel(con, in_s); break; case 0x0E: /* SCARD_CANCEL_TRANSACTION */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_CANCEL_TRANSACTION"); break; case 0x0F: /* SCARD_GET_ATTRIB */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_GET_ATTRIB"); break; case 0x10: /* SCARD_SET_ATTRIB */ LOG_DEVEL(LOG_LEVEL_INFO, "scard_process_msg: SCARD_SET_ATTRIB"); break; default: LOG_DEVEL(LOG_LEVEL_WARNING, "scard_process_msg: unknown mtype 0x%4.4x", command); rv = 1; break; } return rv; } /*****************************************************************************/ /* returns error */ int my_pcsc_trans_data_in(struct trans *trans) { struct stream *s; int size; int command; int error; LOG_DEVEL(LOG_LEVEL_DEBUG, "my_pcsc_trans_data_in:"); if (trans == 0) { return 0; } s = trans_get_in_s(trans); in_uint32_le(s, size); in_uint32_le(s, command); LOG_DEVEL(LOG_LEVEL_DEBUG, "my_pcsc_trans_data_in: size %d command %d", size, command); error = trans_force_read(trans, size); if (error == 0) { error = scard_process_msg(trans, s, command); } return error; } /*****************************************************************************/ /* got a new connection from libpcsclite */ int my_pcsc_trans_conn_in(struct trans *trans, struct trans *new_trans) { struct pcsc_uds_client *uds_client; LOG_DEVEL(LOG_LEVEL_DEBUG, "my_pcsc_trans_conn_in:"); if (trans == 0) { return 1; } if (trans != g_lis) { return 1; } if (new_trans == 0) { return 1; } uds_client = create_uds_client(new_trans); if (uds_client == 0) { return 1; } uds_client->con->trans_data_in = my_pcsc_trans_data_in; uds_client->con->header_size = 8; if (g_uds_clients == 0) { g_uds_clients = list_create(); } list_add_item(g_uds_clients, (tbus)uds_client); return 0; } /*****************************************************************************/ int scard_pcsc_init(void) { char *home; int disp; int error; LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_pcsc_init:"); if (g_lis == 0) { g_lis = trans_create(2, 8192, 8192); // TODO: See #2501. Use needs a way to move PCSCLITE_CSOCK_NAME // to a location not under $HOME. home = g_getenv("HOME"); disp = g_display_num; g_snprintf(g_pcsclite_ipc_dir, 255, "%s/.pcsc%d", home, disp); if (g_directory_exist(g_pcsclite_ipc_dir)) { if (!g_remove_dir(g_pcsclite_ipc_dir)) { LOG_DEVEL(LOG_LEVEL_WARNING, "scard_pcsc_init: g_remove_dir failed"); } } if (!g_directory_exist(g_pcsclite_ipc_dir)) { if (!g_create_dir(g_pcsclite_ipc_dir)) { if (!g_directory_exist(g_pcsclite_ipc_dir)) { LOG_DEVEL(LOG_LEVEL_WARNING, "scard_pcsc_init: g_create_dir failed"); } } } /* Only the current user should be able to access the remote * smartcard */ g_chmod_hex(g_pcsclite_ipc_dir, 0x700); g_snprintf(g_pcsclite_ipc_file, 255, "%s/pcscd.comm", g_pcsclite_ipc_dir); g_lis->trans_conn_in = my_pcsc_trans_conn_in; error = trans_listen(g_lis, g_pcsclite_ipc_file); if (error != 0) { LOG(LOG_LEVEL_ERROR, "scard_pcsc_init: trans_listen failed for port %s", g_pcsclite_ipc_file); return 1; } } return 0; } /*****************************************************************************/ int scard_pcsc_deinit(void) { LOG_DEVEL(LOG_LEVEL_DEBUG, "scard_pcsc_deinit:"); if (g_lis != 0) { trans_delete(g_lis); g_lis = 0; } if (g_pcsclite_ipc_dir[0] != 0) { g_file_delete(g_pcsclite_ipc_file); if (!g_remove_dir(g_pcsclite_ipc_dir)) { LOG_DEVEL(LOG_LEVEL_WARNING, "scard_pcsc_deinit: g_remove_dir failed"); } g_pcsclite_ipc_dir[0] = 0; } return 0; } #else int scard_pcsc_get_wait_objs(tbus *objs, int *count, int *timeout) { return 0; } int scard_pcsc_check_wait_objs(void) { return 0; } int scard_pcsc_init(void) { return 0; } int scard_pcsc_deinit(void) { return 0; } #endif xrdp-0.10.1/sesman/chansrv/chansrv.h000644 001751 000000 00000005032 14652432047 017404 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2009-2013 * Copyright (C) Laxmikant Rashinkar 2009-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(CHANSRV_H) #define CHANSRV_H #include "arch.h" #include "parse.h" #include "log.h" struct chan_item { int id; int flags; char name[16]; }; int g_is_term(void); int send_channel_data(int chan_id, const char *data, int size); int send_rail_drawing_orders(char *data, int size); int main_cleanup(void); int add_timeout(int msoffset, void (*callback)(void *data), void *data); #ifndef GSET_UINT8 #define GSET_UINT8(_ptr, _offset, _data) \ *((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))) = (unsigned char)(_data) #define GGET_UINT8(_ptr, _offset) \ (*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset)))) #define GSET_UINT16(_ptr, _offset, _data) \ GSET_UINT8(_ptr, _offset, _data); \ GSET_UINT8(_ptr, (_offset) + 1, (_data) >> 8) #define GGET_UINT16(_ptr, _offset) \ (GGET_UINT8(_ptr, _offset)) | \ ((GGET_UINT8(_ptr, (_offset) + 1)) << 8) #define GSET_UINT32(_ptr, _offset, _data) \ GSET_UINT16(_ptr, _offset, _data); \ GSET_UINT16(_ptr, (_offset) + 2, (_data) >> 16) #define GGET_UINT32(_ptr, _offset) \ (GGET_UINT16(_ptr, _offset)) | \ ((GGET_UINT16(_ptr, (_offset) + 2)) << 16) #endif struct chansrv_drdynvc_procs { int (*open_response)(int chan_id, int creation_status); int (*close_response)(int chan_id); int (*data_first)(int chan_id, char *data, int bytes, int total_bytes); int (*data)(int chan_id, char *data, int bytes); }; int chansrv_drdynvc_open(const char *name, int flags, struct chansrv_drdynvc_procs *procs, int *chan_id); int chansrv_drdynvc_close(int chan_id); int chansrv_drdynvc_data_first(int chan_id, const char *data, int data_bytes, int total_data_bytes); int chansrv_drdynvc_data(int chan_id, const char *data, int data_bytes); int chansrv_drdynvc_send_data(int chan_id, const char *data, int data_bytes); #endif xrdp-0.10.1/sesman/chansrv/chansrv_fuse.h000644 001751 000000 00000010314 14652432047 020425 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _CHANSRV_FUSE_H #define _CHANSRV_FUSE_H #include #include #include "arch.h" #include "ms-erref.h" /* Used to pass file info back to chansrv_fuse from devredir */ struct file_attr { tui32 mode; /* File mode. */ off_t size; /* Size of file, in bytes. */ time_t atime; /* Time of last access. */ time_t mtime; /* Time of last modification. */ }; /* Bitmask values used to identify individual elements in * struct file_attr */ #define TO_SET_MODE (1<<0) #define TO_SET_SIZE (1<<1) #define TO_SET_ATIME (1<<2) #define TO_SET_MTIME (1<<3) #define TO_SET_ALL (TO_SET_MODE | TO_SET_SIZE | TO_SET_ATIME | TO_SET_MTIME) /* Private type passed into and back-from devredir */ typedef struct xfuse_info XFUSE_INFO; int xfuse_init(void); int xfuse_deinit(void); int xfuse_check_wait_objs(void); int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout); int xfuse_create_share(tui32 share_id, const char *dirname); void xfuse_delete_share(tui32 share_id); int xfuse_clear_clip_dir(void); int xfuse_file_contents_range(int stream_id, const char *data, int data_bytes); int xfuse_file_contents_size(int stream_id, int file_size); int xfuse_add_clip_dir_item(const char *filename, int flags, int size, int lindex); /* State pointer types (opaque outside this module), used for * callback data */ struct state_dirscan; struct state_lookup; struct state_setattr; struct state_open; struct state_create; struct state_read; struct state_write; struct state_remove; struct state_rename; struct state_close; /* functions that are invoked from devredir */ void xfuse_devredir_cb_enum_dir_add_entry( struct state_dirscan *fip, const char *name, const struct file_attr *fattr); void xfuse_devredir_cb_enum_dir_done(struct state_dirscan *fip, enum NTSTATUS IoStatus); void xfuse_devredir_cb_lookup_entry(struct state_lookup *fip, enum NTSTATUS IoStatus, const struct file_attr *file_info); void xfuse_devredir_cb_setattr(struct state_setattr *fip, enum NTSTATUS IoStatus); void xfuse_devredir_cb_create_file(struct state_create *fip, enum NTSTATUS IoStatus, tui32 DeviceId, tui32 FileId); void xfuse_devredir_cb_open_file(struct state_open *fip, enum NTSTATUS IoStatus, tui32 DeviceId, tui32 FileId); void xfuse_devredir_cb_read_file(struct state_read *fip, enum NTSTATUS IoStatus, const char *buf, size_t length); void xfuse_devredir_cb_write_file( struct state_write *fip, enum NTSTATUS IoStatus, off_t offset, size_t length); void xfuse_devredir_cb_rmdir_or_file(struct state_remove *fip, enum NTSTATUS IoStatus); void xfuse_devredir_cb_rename_file(struct state_rename *fip, enum NTSTATUS IoStatus); void xfuse_devredir_cb_file_close(struct state_close *fip); /* * Returns true if a filesystem path lies in the FUSE filesystem * * Use to prevent deadlocks. For example, if chansrv tries to open * a file in the FUSE filesystem it will fail, as it will call back * into itself to handle the I/O */ int xfuse_path_in_xfuse_fs(const char *path); #endif xrdp-0.10.1/sesman/chansrv/pcsc/Makefile000644 001751 000000 00000000266 14652432047 020163 0ustar00metawheel000000 000000 OBJS = xrdp_pcsc.o CFLAGS = -Wall -O2 -fPIC all: libpcsclite.so libpcsclite.so: $(OBJS) $(CC) $(LDFLAGS) -shared -o libpcsclite.so $(OBJS) clean: rm -f $(OBJS) libpcsclite.so xrdp-0.10.1/sesman/chansrv/pcsc/dumps/000755 001751 000000 00000000000 14652432047 017647 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/chansrv/pcsc/.gitignore000644 001751 000000 00000000012 14652432047 020500 0ustar00metawheel000000 000000 !Makefile xrdp-0.10.1/sesman/chansrv/pcsc/xrdp_pcsc.c000644 001751 000000 00000113520 14652432047 020652 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "string_calls.h" #define PCSC_API typedef unsigned char BYTE; typedef BYTE *LPBYTE; #ifdef __APPLE__ typedef int LONG; typedef unsigned int DWORD; #else typedef long LONG; typedef unsigned long DWORD; #endif typedef DWORD *LPDWORD; typedef const void *LPCVOID; typedef const char *LPCSTR; typedef char *LPSTR; typedef void *LPVOID; typedef const BYTE *LPCBYTE; typedef LONG SCARDCONTEXT; typedef SCARDCONTEXT *LPSCARDCONTEXT; typedef LONG SCARDHANDLE; typedef SCARDHANDLE *LPSCARDHANDLE; #define MAX_ATR_SIZE 33 typedef struct _SCARD_READERSTATE { const char *szReader; void *pvUserData; DWORD dwCurrentState; DWORD dwEventState; DWORD cbAtr; unsigned char rgbAtr[MAX_ATR_SIZE]; } SCARD_READERSTATE, *LPSCARD_READERSTATE; typedef struct _SCARD_IO_REQUEST { unsigned long dwProtocol; unsigned long cbPciLength; } SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST; #define SCARD_PROTOCOL_T0 0x0001 /**< T=0 active protocol. */ #define SCARD_PROTOCOL_T1 0x0002 /**< T=1 active protocol. */ #define SCARD_PROTOCOL_RAW 0x0004 /**< Raw active protocol. */ PCSC_API SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }; PCSC_API SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }; PCSC_API SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }; #define LLOG_LEVEL 5 #define LLOGLN(_level, _args) \ do { if (_level < LLOG_LEVEL) { printf _args ; printf("\n"); } } while (0) #define LHEXDUMP(_level, _args) \ do { if (_level < LLOG_LEVEL) { lhexdump _args ; } } while (0) #define SCARD_ESTABLISH_CONTEXT 0x01 #define SCARD_RELEASE_CONTEXT 0x02 #define SCARD_LIST_READERS 0x03 #define SCARD_CONNECT 0x04 #define SCARD_RECONNECT 0x05 #define SCARD_DISCONNECT 0x06 #define SCARD_BEGIN_TRANSACTION 0x07 #define SCARD_END_TRANSACTION 0x08 #define SCARD_TRANSMIT 0x09 #define SCARD_CONTROL 0x0A #define SCARD_STATUS 0x0B #define SCARD_GET_STATUS_CHANGE 0x0C #define SCARD_CANCEL 0x0D #define SCARD_CANCEL_TRANSACTION 0x0E #define SCARD_GET_ATTRIB 0x0F #define SCARD_SET_ATTRIB 0x10 #define SCARD_S_SUCCESS 0x00000000 #define SCARD_F_INTERNAL_ERROR ((LONG)0x80100001) #define SET_UINT32(_data, _offset, _val) do { \ (((BYTE*)(_data)) + (_offset))[0] = ((_val) >> 0) & 0xff; \ (((BYTE*)(_data)) + (_offset))[1] = ((_val) >> 8) & 0xff; \ (((BYTE*)(_data)) + (_offset))[2] = ((_val) >> 16) & 0xff; \ (((BYTE*)(_data)) + (_offset))[3] = ((_val) >> 24) & 0xff; } while (0) #define GET_UINT32(_data, _offset) \ ((((BYTE*)(_data)) + (_offset))[0] << 0) | \ ((((BYTE*)(_data)) + (_offset))[1] << 8) | \ ((((BYTE*)(_data)) + (_offset))[2] << 16) | \ ((((BYTE*)(_data)) + (_offset))[3] << 24) #define LMIN(_val1, _val2) (_val1) < (_val2) ? (_val1) : (_val2) #define LMAX(_val1, _val2) (_val1) > (_val2) ? (_val1) : (_val2) static int g_sck = -1; /* unix domain socket */ static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; /* for pcsc_stringify_error */ static char g_error_str[512]; /*****************************************************************************/ /* produce a hex dump */ static void lhexdump(void *p, int len) { unsigned char *line; int i; int thisline; int offset; line = (unsigned char *)p; offset = 0; while (offset < len) { printf("%04x ", offset); thisline = len - offset; if (thisline > 16) { thisline = 16; } for (i = 0; i < thisline; i++) { printf("%02x ", line[i]); } for (; i < 16; i++) { printf(" "); } for (i = 0; i < thisline; i++) { printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); } printf("\n"); offset += thisline; line += thisline; } } /*****************************************************************************/ static int connect_to_chansrv(void) { int bytes; int dis; int error; char *xrdp_session; char *xrdp_display; char *home_str; struct sockaddr_un saddr; struct sockaddr *psaddr; if (g_sck != -1) { /* already connected */ return 0; } xrdp_session = getenv("XRDP_SESSION"); if (xrdp_session == NULL) { /* XRDP_SESSION must be set */ LLOGLN(0, ("connect_to_chansrv: error, not xrdp session")); return 1; } xrdp_display = getenv("DISPLAY"); if (xrdp_display == NULL) { /* DISPLAY must be set */ LLOGLN(0, ("connect_to_chansrv: error, display not set")); return 1; } home_str = getenv("HOME"); if (home_str == NULL) { /* HOME must be set */ LLOGLN(0, ("connect_to_chansrv: error, home not set")); return 1; } dis = g_get_display_num_from_display(xrdp_display); if (dis < 0) { LLOGLN(0, ("connect_to_chansrv: error, don't understand DISPLAY='%s'", xrdp_display)); return 1; } g_sck = socket(PF_LOCAL, SOCK_STREAM, 0); if (g_sck == -1) { LLOGLN(0, ("connect_to_chansrv: error, socket failed")); return 1; } memset(&saddr, 0, sizeof(struct sockaddr_un)); saddr.sun_family = AF_UNIX; bytes = sizeof(saddr.sun_path); snprintf(saddr.sun_path, bytes, "%s/.pcsc%d/pcscd.comm", home_str, dis); saddr.sun_path[bytes - 1] = 0; LLOGLN(10, ("connect_to_chansrv: connecting to %s", saddr.sun_path)); psaddr = (struct sockaddr *) &saddr; bytes = sizeof(struct sockaddr_un); error = connect(g_sck, psaddr, bytes); if (error == 0) { } else { perror("connect_to_chansrv"); close(g_sck); g_sck = -1; LLOGLN(0, ("connect_to_chansrv: error, open %s", saddr.sun_path)); return 1; } return 0; } /*****************************************************************************/ static int send_message(int code, char *data, int bytes) { char header[8]; pthread_mutex_lock(&g_mutex); SET_UINT32(header, 0, bytes); SET_UINT32(header, 4, code); if (send(g_sck, header, 8, 0) != 8) { pthread_mutex_unlock(&g_mutex); return 1; } if (send(g_sck, data, bytes, 0) != bytes) { pthread_mutex_unlock(&g_mutex); return 1; } LLOGLN(10, ("send_message:")); LHEXDUMP(10, (data, bytes)); pthread_mutex_unlock(&g_mutex); return 0; } /*****************************************************************************/ static int get_message(int *code, char *data, int *bytes) { char header[8]; int max_bytes; int error; int recv_rv; int lcode; struct pollfd pollfd; LLOGLN(10, ("get_message:")); while (1) { LLOGLN(10, ("get_message: loop")); pollfd.fd = g_sck; pollfd.events = POLLIN; pollfd.revents = 0; error = poll(&pollfd, 1, 1000); if (error == 1) { pthread_mutex_lock(&g_mutex); pollfd.fd = g_sck; pollfd.events = POLLIN; pollfd.revents = 0; error = poll(&pollfd, 1, 0); if (error == 1) { /* just take a look at the next message */ recv_rv = recv(g_sck, header, 8, MSG_PEEK); if (recv_rv == 8) { lcode = GET_UINT32(header, 4); if (lcode == *code) { /* still have mutex lock */ break; } else { LLOGLN(10, ("get_message: lcode %d *code %d", lcode, *code)); } } else if (recv_rv == 0) { pthread_mutex_unlock(&g_mutex); LLOGLN(0, ("get_message: recv_rv 0, disconnect")); return 1; } else { LLOGLN(10, ("get_message: recv_rv %d", recv_rv)); } } else { LLOGLN(10, ("get_message: select return %d", error)); } pthread_mutex_unlock(&g_mutex); usleep(1000); } } if (recv(g_sck, header, 8, 0) != 8) { pthread_mutex_unlock(&g_mutex); return 1; } max_bytes = *bytes; *bytes = GET_UINT32(header, 0); *code = GET_UINT32(header, 4); if (*bytes > max_bytes) { pthread_mutex_unlock(&g_mutex); return 1; } if (recv(g_sck, data, *bytes, 0) != *bytes) { pthread_mutex_unlock(&g_mutex); return 1; } pthread_mutex_unlock(&g_mutex); return 0; } /*****************************************************************************/ PCSC_API LONG SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) { char msg[256]; DWORD context; int code; int bytes; int status; LLOGLN(10, ("SCardEstablishContext:")); if (g_sck == -1) { if (connect_to_chansrv() != 0) { LLOGLN(0, ("SCardEstablishContext: error, can not connect " "to chansrv")); return SCARD_F_INTERNAL_ERROR; } } SET_UINT32(msg, 0, dwScope); if (send_message(SCARD_ESTABLISH_CONTEXT, msg, 4) != 0) { LLOGLN(0, ("SCardEstablishContext: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_ESTABLISH_CONTEXT; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardEstablishContext: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if ((code != SCARD_ESTABLISH_CONTEXT) || (bytes != 8)) { LLOGLN(0, ("SCardEstablishContext: error, bad code")); return SCARD_F_INTERNAL_ERROR; } context = GET_UINT32(msg, 0); status = GET_UINT32(msg, 4); LLOGLN(10, ("SCardEstablishContext: got context 0x%8.8x", (int)context)); *phContext = context; return status; } /*****************************************************************************/ PCSC_API LONG SCardReleaseContext(SCARDCONTEXT hContext) { char msg[256]; int code; int bytes; int status; LLOGLN(10, ("SCardReleaseContext:")); if (g_sck == -1) { LLOGLN(0, ("SCardReleaseContext: error, not connected")); return SCARD_F_INTERNAL_ERROR; } SET_UINT32(msg, 0, hContext); if (send_message(SCARD_RELEASE_CONTEXT, msg, 4) != 0) { LLOGLN(0, ("SCardReleaseContext: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_RELEASE_CONTEXT; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardReleaseContext: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if ((code != SCARD_RELEASE_CONTEXT) || (bytes != 4)) { LLOGLN(0, ("SCardReleaseContext: error, bad code")); return SCARD_F_INTERNAL_ERROR; } status = GET_UINT32(msg, 0); LLOGLN(10, ("SCardReleaseContext: got status 0x%8.8x", status)); return status; } /*****************************************************************************/ PCSC_API LONG SCardIsValidContext(SCARDCONTEXT hContext) { LLOGLN(10, ("SCardIsValidContext:")); if (g_sck == -1) { LLOGLN(0, ("SCardIsValidContext: error, not connected")); return SCARD_F_INTERNAL_ERROR; } return SCARD_S_SUCCESS; } /*****************************************************************************/ PCSC_API LONG SCardConnect(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { char msg[256]; int code; int bytes; int status; int offset; LLOGLN(10, ("SCardConnect:")); LLOGLN(10, ("SCardConnect: hContext 0x%8.8x szReader %s dwShareMode %d " "dwPreferredProtocols %d", (int)hContext, szReader, (int)dwShareMode, (int)dwPreferredProtocols)); if (g_sck == -1) { LLOGLN(0, ("SCardConnect: error, not connected")); return SCARD_F_INTERNAL_ERROR; } offset = 0; SET_UINT32(msg, offset, hContext); offset += 4; bytes = strlen(szReader); if (bytes > 99) { LLOGLN(0, ("SCardConnect: error, name too long")); return SCARD_F_INTERNAL_ERROR; } memcpy(msg + offset, szReader, bytes); memset(msg + offset + bytes, 0, 100 - bytes); offset += 100; SET_UINT32(msg, offset, dwShareMode); offset += 4; SET_UINT32(msg, offset, dwPreferredProtocols); offset += 4; if (send_message(SCARD_CONNECT, msg, offset) != 0) { LLOGLN(0, ("SCardConnect: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_CONNECT; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardConnect: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if (code != SCARD_CONNECT) { LLOGLN(0, ("SCardConnect: error, bad code")); return SCARD_F_INTERNAL_ERROR; } *phCard = GET_UINT32(msg, 0); *pdwActiveProtocol = GET_UINT32(msg, 4); status = GET_UINT32(msg, 8); LLOGLN(10, ("SCardConnect: got status 0x%8.8x hCard 0x%8.8x " "dwActiveProtocol %d", status, (int)*phCard, (int)*pdwActiveProtocol)); return status; } /*****************************************************************************/ PCSC_API LONG SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol) { LLOGLN(0, ("SCardReconnect:")); if (g_sck == -1) { LLOGLN(0, ("SCardReconnect: error, not connected")); return SCARD_F_INTERNAL_ERROR; } return SCARD_S_SUCCESS; } /*****************************************************************************/ PCSC_API LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition) { char msg[256]; int code; int bytes; int status; LLOGLN(10, ("SCardDisconnect: hCard 0x%8.8x dwDisposition %d", (int)hCard, (int)dwDisposition)); if (g_sck == -1) { LLOGLN(0, ("SCardDisconnect: error, not connected")); return SCARD_F_INTERNAL_ERROR; } SET_UINT32(msg, 0, hCard); SET_UINT32(msg, 4, dwDisposition); if (send_message(SCARD_DISCONNECT, msg, 8) != 0) { LLOGLN(0, ("SCardDisconnect: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_DISCONNECT; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardDisconnect: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if ((code != SCARD_DISCONNECT) || (bytes != 4)) { LLOGLN(0, ("SCardDisconnect: error, bad code")); return SCARD_F_INTERNAL_ERROR; } status = GET_UINT32(msg, 0); LLOGLN(10, ("SCardDisconnect: got status 0x%8.8x", status)); return status; } /*****************************************************************************/ PCSC_API LONG SCardBeginTransaction(SCARDHANDLE hCard) { char msg[256]; int code; int bytes; int status; LLOGLN(10, ("SCardBeginTransaction: hCard 0x%8.8x", (int)hCard)); if (hCard == 0) { LLOGLN(0, ("SCardBeginTransaction: error, bad hCard")); return SCARD_F_INTERNAL_ERROR; } if (g_sck == -1) { LLOGLN(0, ("SCardBeginTransaction: error, not connected")); return SCARD_F_INTERNAL_ERROR; } SET_UINT32(msg, 0, hCard); if (send_message(SCARD_BEGIN_TRANSACTION, msg, 4) != 0) { LLOGLN(0, ("SCardBeginTransaction: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_BEGIN_TRANSACTION; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardBeginTransaction: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if ((code != SCARD_BEGIN_TRANSACTION) || (bytes != 4)) { LLOGLN(0, ("SCardBeginTransaction: error, bad code")); return SCARD_F_INTERNAL_ERROR; } status = GET_UINT32(msg, 0); LLOGLN(10, ("SCardBeginTransaction: got status 0x%8.8x", status)); return status; } /*****************************************************************************/ PCSC_API LONG SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition) { char msg[256]; int code; int bytes; int status; LLOGLN(10, ("SCardEndTransaction:")); if (g_sck == -1) { LLOGLN(0, ("SCardEndTransaction: error, not connected")); return SCARD_F_INTERNAL_ERROR; } SET_UINT32(msg, 0, hCard); SET_UINT32(msg, 4, dwDisposition); if (send_message(SCARD_END_TRANSACTION, msg, 8) != 0) { LLOGLN(0, ("SCardEndTransaction: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_END_TRANSACTION; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardEndTransaction: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if ((code != SCARD_END_TRANSACTION) || (bytes != 4)) { LLOGLN(0, ("SCardEndTransaction: error, bad code")); return SCARD_F_INTERNAL_ERROR; } status = GET_UINT32(msg, 0); LLOGLN(10, ("SCardEndTransaction: got status 0x%8.8x", status)); return status; } /*****************************************************************************/ PCSC_API LONG SCardStatus(SCARDHANDLE hCard, LPSTR mszReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { char *msg; int code; int bytes; int status; int offset; int cchReaderLen; int to_copy; LLOGLN(10, ("SCardStatus:")); if (hCard == 0) { LLOGLN(10, ("SCardStatus: error, bad hCard")); return SCARD_F_INTERNAL_ERROR; } if (g_sck == -1) { LLOGLN(0, ("SCardStatus: error, not connected")); return SCARD_F_INTERNAL_ERROR; } LLOGLN(10, (" hCard 0x%8.8x", (int)hCard)); LLOGLN(10, (" cchReaderLen %d", (int)*pcchReaderLen)); LLOGLN(10, (" cbAtrLen %d", (int)*pcbAtrLen)); cchReaderLen = *pcchReaderLen; msg = (char *) malloc(8192); SET_UINT32(msg, 0, hCard); SET_UINT32(msg, 4, cchReaderLen); SET_UINT32(msg, 8, *pcbAtrLen); if (send_message(SCARD_STATUS, msg, 12) != 0) { LLOGLN(0, ("SCardStatus: error, send_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } bytes = 8192; code = SCARD_STATUS; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardStatus: error, get_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } if (code != SCARD_STATUS) { LLOGLN(0, ("SCardStatus: error, bad code")); free(msg); return SCARD_F_INTERNAL_ERROR; } LLOGLN(10, ("SCardStatus: cchReaderLen in %d", (int)*pcchReaderLen)); offset = 0; *pcchReaderLen = GET_UINT32(msg, offset); LLOGLN(10, ("SCardStatus: cchReaderLen out %d", (int)*pcchReaderLen)); offset += 4; if (cchReaderLen > 0) { to_copy = cchReaderLen - 1; if (*pcchReaderLen < to_copy) { to_copy = *pcchReaderLen; } memcpy(mszReaderName, msg + offset, to_copy); mszReaderName[to_copy] = 0; } LLOGLN(10, ("SCardStatus: mszReaderName out %s", mszReaderName)); offset += *pcchReaderLen; *pdwState = GET_UINT32(msg, offset); if (*pdwState == 1) { *pdwState = 0x34; } LLOGLN(10, ("SCardStatus: dwState %d", (int)*pdwState)); offset += 4; *pdwProtocol = GET_UINT32(msg, offset); LLOGLN(10, ("SCardStatus: dwProtocol %d", (int)*pdwProtocol)); offset += 4; *pcbAtrLen = GET_UINT32(msg, offset); offset += 4; LLOGLN(10, ("SCardStatus: cbAtrLen %d", (int)*pcbAtrLen)); memcpy(pbAtr, msg + offset, *pcbAtrLen); offset += *pcbAtrLen; status = GET_UINT32(msg, offset); LLOGLN(10, ("SCardStatus: status %d", status)); offset += 4; free(msg); return status; } /*****************************************************************************/ PCSC_API LONG SCardGetStatusChange(SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATE rgReaderStates, DWORD cReaders) { char *msg; const char *rname; int bytes; int code; int index; int offset; int str_len; int status; int dwCurrentState; int dwEventState; int cbAtr; char atr[36]; LLOGLN(10, ("SCardGetStatusChange:")); LLOGLN(10, (" dwTimeout %d cReaders %d", (int)dwTimeout, (int)cReaders)); if (g_sck == -1) { LLOGLN(0, ("SCardGetStatusChange: error, not connected")); return SCARD_F_INTERNAL_ERROR; } msg = (char *) malloc(8192); SET_UINT32(msg, 0, hContext); SET_UINT32(msg, 4, dwTimeout); SET_UINT32(msg, 8, cReaders); offset = 12; for (index = 0; index < cReaders; index++) { rgReaderStates[index].dwCurrentState &= ~2; rgReaderStates[index].dwEventState &= ~2; rname = rgReaderStates[index].szReader; if (strcmp(rname, "\\\\?PnP?\\Notification") == 0) { LLOGLN(10, (" \\\\?PnP?\\Notification present")); dwCurrentState = 0; dwEventState = 0; cbAtr = 0; memset(atr, 0, 36); } else { dwCurrentState = rgReaderStates[index].dwCurrentState; dwEventState = rgReaderStates[index].dwEventState; cbAtr = rgReaderStates[index].cbAtr; memset(atr, 0, 36); memcpy(atr, rgReaderStates[index].rgbAtr, 33); } str_len = strlen(rname); str_len = LMIN(str_len, 99); memset(msg + offset, 0, 100); memcpy(msg + offset, rname, str_len); LLOGLN(10, (" in szReader %s", rname)); offset += 100; LLOGLN(10, (" in dwCurrentState 0x%8.8x", dwCurrentState)); SET_UINT32(msg, offset, dwCurrentState); offset += 4; LLOGLN(10, (" in dwEventState 0x%8.8x", dwEventState)); SET_UINT32(msg, offset, dwEventState); offset += 4; LLOGLN(10, (" in cbAtr %d", cbAtr)); SET_UINT32(msg, offset, cbAtr); offset += 4; memcpy(msg + offset, atr, 36); offset += 36; } if (send_message(SCARD_GET_STATUS_CHANGE, msg, offset) != 0) { LLOGLN(0, ("SCardGetStatusChange: error, send_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } bytes = 8192; code = SCARD_GET_STATUS_CHANGE; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardGetStatusChange: error, get_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } if (code != SCARD_GET_STATUS_CHANGE) { LLOGLN(0, ("SCardGetStatusChange: error, bad code")); free(msg); return SCARD_F_INTERNAL_ERROR; } cReaders = GET_UINT32(msg, 0); offset = 4; LLOGLN(10, ("SCardGetStatusChange: got back cReaders %d", (int)cReaders)); for (index = 0; index < cReaders; index++) { rname = rgReaderStates[index].szReader; #if 1 if (strcmp(rname, "\\\\?PnP?\\Notification") == 0) { LLOGLN(10, (" out szReader %s", rgReaderStates[index].szReader)); dwCurrentState = GET_UINT32(msg, offset); rgReaderStates[index].dwCurrentState = dwCurrentState; offset += 4; LLOGLN(10, (" out dwCurrentState 0x%8.8x", dwCurrentState)); // disable PnP for now dwEventState = 4; // GET_UINT32(msg, offset); rgReaderStates[index].dwEventState = dwEventState; offset += 4; LLOGLN(10, (" out dwEventState 0x%8.8x", dwEventState)); cbAtr = GET_UINT32(msg, offset); rgReaderStates[index].cbAtr = cbAtr; offset += 4; LLOGLN(10, (" out cbAtr %d", cbAtr)); memcpy(rgReaderStates[index].rgbAtr, msg + offset, 33); offset += 36; } else #endif { LLOGLN(10, (" out szReader %s", rgReaderStates[index].szReader)); dwCurrentState = GET_UINT32(msg, offset); rgReaderStates[index].dwCurrentState = dwCurrentState; offset += 4; LLOGLN(10, (" out dwCurrentState 0x%8.8x", dwCurrentState)); dwEventState = GET_UINT32(msg, offset); rgReaderStates[index].dwEventState = dwEventState; offset += 4; LLOGLN(10, (" out dwEventState 0x%8.8x", dwEventState)); cbAtr = GET_UINT32(msg, offset); rgReaderStates[index].cbAtr = cbAtr; offset += 4; LLOGLN(10, (" out cbAtr %d", cbAtr)); memcpy(rgReaderStates[index].rgbAtr, msg + offset, 33); offset += 36; } } status = GET_UINT32(msg, offset); offset += 4; free(msg); return status; } /*****************************************************************************/ PCSC_API LONG SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned) { char *msg; int bytes; int code; int offset; int status = 0; LLOGLN(10, ("SCardControl:")); if (g_sck == -1) { LLOGLN(0, ("SCardControl: error, not connected")); return SCARD_F_INTERNAL_ERROR; } LLOGLN(10, (" hCard 0x%8.8x", (int)hCard)); LLOGLN(10, (" dwControlCode 0x%8.8x", (int)dwControlCode)); LLOGLN(10, (" cbSendLength %d", (int)cbSendLength)); LLOGLN(10, (" cbRecvLength %d", (int)cbRecvLength)); /* #define SCARD_CTL_CODE(code) (0x42000000 + (code)) control_code = (control_code & 0x3ffc) >> 2; control_code = SCARD_CTL_CODE(control_code); */ /* PCSC to Windows control code conversion */ dwControlCode = dwControlCode - 0x42000000; dwControlCode = dwControlCode << 2; dwControlCode = dwControlCode | (49 << 16); LLOGLN(10, (" MS dwControlCode 0x%8.8d", (int)dwControlCode)); msg = (char *) malloc(8192); offset = 0; SET_UINT32(msg, offset, hCard); offset += 4; SET_UINT32(msg, offset, dwControlCode); offset += 4; SET_UINT32(msg, offset, cbSendLength); offset += 4; memcpy(msg + offset, pbSendBuffer, cbSendLength); offset += cbSendLength; SET_UINT32(msg, offset, cbRecvLength); offset += 4; if (send_message(SCARD_CONTROL, msg, offset) != 0) { LLOGLN(0, ("SCardControl: error, send_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } bytes = 8192; code = SCARD_CONTROL; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardControl: error, get_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } if (code != SCARD_CONTROL) { LLOGLN(0, ("SCardControl: error, bad code")); free(msg); return SCARD_F_INTERNAL_ERROR; } offset = 0; *lpBytesReturned = GET_UINT32(msg, offset); LLOGLN(10, (" cbRecvLength %d", (int)*lpBytesReturned)); offset += 4; memcpy(pbRecvBuffer, msg + offset, *lpBytesReturned); offset += *lpBytesReturned; status = GET_UINT32(msg, offset); free(msg); return status; } /*****************************************************************************/ PCSC_API LONG SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, SCARD_IO_REQUEST *pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength) { char *msg; int bytes; int code; int offset; int status; int extra_len; int got_recv_pci; LLOGLN(10, ("SCardTransmit:")); if (g_sck == -1) { LLOGLN(0, ("SCardTransmit: error, not connected")); return SCARD_F_INTERNAL_ERROR; } LLOGLN(10, (" hCard 0x%8.8x", (int)hCard)); LLOGLN(10, (" cbSendLength %d", (int)cbSendLength)); LLOGLN(10, (" cbRecvLength %d", (int)*pcbRecvLength)); LLOGLN(10, (" pioSendPci->dwProtocol %d", (int)(pioSendPci->dwProtocol))); LLOGLN(10, (" pioSendPci->cbPciLength %d", (int)(pioSendPci->cbPciLength))); LLOGLN(10, (" pioRecvPci %p", pioRecvPci)); if (pioRecvPci != 0) { LLOGLN(10, (" pioRecvPci->dwProtocol %d", (int)(pioRecvPci->dwProtocol))); LLOGLN(10, (" pioRecvPci->cbPciLength %d", (int)(pioRecvPci->cbPciLength))); } msg = (char *) malloc(8192); offset = 0; SET_UINT32(msg, offset, hCard); offset += 4; SET_UINT32(msg, offset, pioSendPci->dwProtocol); offset += 4; /* SET_UINT32(msg, offset, pioSendPci->cbPciLength); */ SET_UINT32(msg, offset, 8); offset += 4; /* extra_len = pioSendPci->cbPciLength - 8; */ extra_len = 0; SET_UINT32(msg, offset, extra_len); offset += 4; memcpy(msg + offset, pioSendPci + 1, extra_len); offset += extra_len; SET_UINT32(msg, offset, cbSendLength); offset += 4; memcpy(msg + offset, pbSendBuffer, cbSendLength); offset += cbSendLength; got_recv_pci = (pioRecvPci != NULL) && (pioRecvPci->cbPciLength >= 8); // TODO figure out why recv pci does not work got_recv_pci = 0; if (got_recv_pci == 0) { SET_UINT32(msg, offset, 0); /* dwProtocol */ offset += 4; SET_UINT32(msg, offset, 0); /* cbPciLength */ offset += 4; SET_UINT32(msg, offset, 0); /* extra_len */ offset += 4; } else { SET_UINT32(msg, offset, pioRecvPci->dwProtocol); offset += 4; SET_UINT32(msg, offset, pioRecvPci->cbPciLength); offset += 4; extra_len = pioRecvPci->cbPciLength - 8; SET_UINT32(msg, offset, extra_len); offset += 4; memcpy(msg + offset, pioRecvPci + 1, extra_len); offset += extra_len; } SET_UINT32(msg, offset, *pcbRecvLength); offset += 4; if (send_message(SCARD_TRANSMIT, msg, offset) != 0) { LLOGLN(0, ("SCardTransmit: error, send_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } bytes = 8192; code = SCARD_TRANSMIT; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardTransmit: error, get_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } if (code != SCARD_TRANSMIT) { LLOGLN(0, ("SCardTransmit: error, bad code")); free(msg); return SCARD_F_INTERNAL_ERROR; } offset = 0; if (got_recv_pci == 0) { offset += 8; extra_len = GET_UINT32(msg, offset); offset += 4; offset += extra_len; } else { pioRecvPci->dwProtocol = GET_UINT32(msg, offset); offset += 4; pioRecvPci->cbPciLength = GET_UINT32(msg, offset); offset += 4; extra_len = GET_UINT32(msg, offset); offset += 4; offset += extra_len; } *pcbRecvLength = GET_UINT32(msg, offset); offset += 4; LLOGLN(10, (" cbRecvLength %d", (int)*pcbRecvLength)); memcpy(pbRecvBuffer, msg + offset, *pcbRecvLength); LHEXDUMP(10, (pbRecvBuffer, *pcbRecvLength)); offset += *pcbRecvLength; status = GET_UINT32(msg, offset); free(msg); return status; } /*****************************************************************************/ PCSC_API LONG SCardListReaderGroups(SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups) { LLOGLN(10, ("SCardListReaderGroups:")); if (g_sck == -1) { LLOGLN(0, ("SCardListReaderGroups: error, not connected")); return SCARD_F_INTERNAL_ERROR; } return SCARD_S_SUCCESS; } /*****************************************************************************/ PCSC_API LONG SCardListReaders(SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) { char *msg; char *reader_names; int reader_names_index; int code; int bytes; int num_readers; int status; int offset; int index; int val; int llen; char reader[100]; LLOGLN(10, ("SCardListReaders:")); LLOGLN(10, ("SCardListReaders: mszGroups %s", mszGroups)); LLOGLN(10, ("SCardListReaders: *pcchReaders %d", (int)*pcchReaders)); if (g_sck == -1) { LLOGLN(0, ("SCardListReaders: error, not connected")); return SCARD_F_INTERNAL_ERROR; } if ((mszGroups == NULL) && (mszReaders == NULL)) { *pcchReaders = 0; } msg = (char *) malloc(8192); offset = 0; SET_UINT32(msg, offset, hContext); offset += 4; if (mszGroups != 0) { unsigned int bytes_groups = strlen(mszGroups); SET_UINT32(msg, offset, bytes_groups); offset += 4; memcpy(msg + offset, mszGroups, bytes_groups); offset += bytes_groups; } else { SET_UINT32(msg, offset, 0); offset += 4; } val = *pcchReaders; SET_UINT32(msg, offset, val); offset += 4; if (send_message(SCARD_LIST_READERS, msg, offset) != 0) { LLOGLN(0, ("SCardListReaders: error, send_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } bytes = 8192; code = SCARD_LIST_READERS; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardListReaders: error, get_message")); free(msg); return SCARD_F_INTERNAL_ERROR; } if (code != SCARD_LIST_READERS) { LLOGLN(0, ("SCardListReaders: error, bad code")); free(msg); return SCARD_F_INTERNAL_ERROR; } offset = 0; llen = GET_UINT32(msg, offset); offset += 4; num_readers = GET_UINT32(msg, offset); offset += 4; LLOGLN(10, ("SCardListReaders: mszReaders %p pcchReaders %p num_readers %d", mszReaders, pcchReaders, num_readers)); reader_names = (char *) malloc(8192); reader_names_index = 0; for (index = 0; index < num_readers; index++) { memcpy(reader, msg + offset, 100); bytes = strlen(reader); memcpy(reader_names + reader_names_index, reader, bytes); reader_names_index += bytes; reader_names[reader_names_index] = 0; reader_names_index++; offset += 100; LLOGLN(10, ("SCardListReaders: readername %s", reader)); } reader_names[reader_names_index] = 0; reader_names_index++; status = GET_UINT32(msg, offset); LLOGLN(10, ("SCardListReaders: status 0x%8.8x", status)); offset += 4; if (mszReaders == 0) { reader_names_index = llen / 2; } if (pcchReaders != 0) { *pcchReaders = reader_names_index; } if (mszReaders != 0) { memcpy(mszReaders, reader_names, reader_names_index); } free(msg); free(reader_names); return status; } /*****************************************************************************/ PCSC_API LONG SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem) { LLOGLN(0, ("SCardFreeMemory:")); if (g_sck == -1) { LLOGLN(0, ("SCardFreeMemory: error, not connected")); return SCARD_F_INTERNAL_ERROR; } return SCARD_S_SUCCESS; } /*****************************************************************************/ PCSC_API LONG SCardCancel(SCARDCONTEXT hContext) { char msg[256]; int code; int bytes; int status; LLOGLN(10, ("SCardCancel:")); if (g_sck == -1) { LLOGLN(0, ("SCardCancel: error, not connected")); return SCARD_F_INTERNAL_ERROR; } SET_UINT32(msg, 0, hContext); if (send_message(SCARD_CANCEL, msg, 4) != 0) { LLOGLN(0, ("SCardCancel: error, send_message")); return SCARD_F_INTERNAL_ERROR; } bytes = 256; code = SCARD_CANCEL; if (get_message(&code, msg, &bytes) != 0) { LLOGLN(0, ("SCardCancel: error, get_message")); return SCARD_F_INTERNAL_ERROR; } if ((code != SCARD_RELEASE_CONTEXT) || (bytes != 4)) { LLOGLN(0, ("SCardCancel: error, bad code")); return SCARD_F_INTERNAL_ERROR; } status = GET_UINT32(msg, 0); LLOGLN(10, ("SCardCancel: got status 0x%8.8x", status)); return status; } /*****************************************************************************/ PCSC_API LONG SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen) { LLOGLN(0, ("SCardGetAttrib:")); if (g_sck == -1) { LLOGLN(0, ("SCardGetAttrib: error, not connected")); return SCARD_F_INTERNAL_ERROR; } return SCARD_S_SUCCESS; } /*****************************************************************************/ PCSC_API LONG SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen) { LLOGLN(0, ("SCardSetAttrib:")); if (g_sck == -1) { LLOGLN(0, ("SCardSetAttrib: error, not connected")); return SCARD_F_INTERNAL_ERROR; } return SCARD_S_SUCCESS; } /*****************************************************************************/ PCSC_API char * pcsc_stringify_error(const long code) { LLOGLN(10, ("pcsc_stringify_error: 0x%8.8x", (int)code)); switch (code) { case SCARD_S_SUCCESS: snprintf(g_error_str, 511, "Command successful."); break; case SCARD_F_INTERNAL_ERROR: snprintf(g_error_str, 511, "Internal error."); break; default: snprintf(g_error_str, 511, "error 0x%8.8x", (int)code); break; } g_error_str[511] = 0; return g_error_str; } xrdp-0.10.1/sesman/chansrv/pcsc/wrapper/000755 001751 000000 00000000000 14652432047 020177 5ustar00metawheel000000 000000 xrdp-0.10.1/sesman/chansrv/pcsc/wrapper/winscard.c000644 001751 000000 00000071670 14652432047 022170 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include "winscard-funcs.h" #define LUNUSED(_param) (void) _param static tSCardEstablishContext aSCardEstablishContext; static tSCardReleaseContext aSCardReleaseContext; static tSCardIsValidContext aSCardIsValidContext; static tSCardListReaderGroupsA aSCardListReaderGroupsA; static tSCardListReaderGroupsW aSCardListReaderGroupsW; static tSCardListReadersA aSCardListReadersA; static tSCardListReadersW aSCardListReadersW; static tSCardListCardsA aSCardListCardsA; static tSCardListCardsW aSCardListCardsW; static tSCardListInterfacesA aSCardListInterfacesA; static tSCardListInterfacesW aSCardListInterfacesW; static tSCardGetProviderIdA aSCardGetProviderIdA; static tSCardGetProviderIdW aSCardGetProviderIdW; static tSCardGetCardTypeProviderNameA aSCardGetCardTypeProviderNameA; static tSCardGetCardTypeProviderNameW aSCardGetCardTypeProviderNameW; static tSCardIntroduceReaderGroupA aSCardIntroduceReaderGroupA; static tSCardIntroduceReaderGroupW aSCardIntroduceReaderGroupW; static tSCardForgetReaderGroupA aSCardForgetReaderGroupA; static tSCardForgetReaderGroupW aSCardForgetReaderGroupW; static tSCardIntroduceReaderA aSCardIntroduceReaderA; static tSCardIntroduceReaderW aSCardIntroduceReaderW; static tSCardForgetReaderA aSCardForgetReaderA; static tSCardForgetReaderW aSCardForgetReaderW; static tSCardAddReaderToGroupA aSCardAddReaderToGroupA; static tSCardAddReaderToGroupW aSCardAddReaderToGroupW; static tSCardRemoveReaderFromGroupA aSCardRemoveReaderFromGroupA; static tSCardRemoveReaderFromGroupW aSCardRemoveReaderFromGroupW; static tSCardIntroduceCardTypeA aSCardIntroduceCardTypeA; static tSCardIntroduceCardTypeW aSCardIntroduceCardTypeW; static tSCardSetCardTypeProviderNameA aSCardSetCardTypeProviderNameA; static tSCardSetCardTypeProviderNameW aSCardSetCardTypeProviderNameW; static tSCardForgetCardTypeA aSCardForgetCardTypeA; static tSCardForgetCardTypeW aSCardForgetCardTypeW; static tSCardFreeMemory aSCardFreeMemory; static tSCardLocateCardsA aSCardLocateCardsA; static tSCardLocateCardsW aSCardLocateCardsW; static tSCardGetStatusChangeA aSCardGetStatusChangeA; static tSCardGetStatusChangeW aSCardGetStatusChangeW; static tSCardCancel aSCardCancel; static tSCardConnectA aSCardConnectA; static tSCardConnectW aSCardConnectW; static tSCardReconnect aSCardReconnect; static tSCardDisconnect aSCardDisconnect; static tSCardBeginTransaction aSCardBeginTransaction; static tSCardEndTransaction aSCardEndTransaction; static tSCardCancelTransaction aSCardCancelTransaction; static tSCardState aSCardState; static tSCardStatusA aSCardStatusA; static tSCardStatusW aSCardStatusW; static tSCardTransmit aSCardTransmit; static tSCardControl aSCardControl; static tSCardGetAttrib aSCardGetAttrib; static tSCardSetAttrib aSCardSetAttrib; //__declspec(dllexport) const SCARD_IO_REQUEST g_rgSCardT0Pci = { 0 }; //__declspec(dllexport) const SCARD_IO_REQUEST g_rgSCardT1Pci = { 0 }; //__declspec(dllexport) const SCARD_IO_REQUEST g_rgSCardRawPci = { 0 }; static int g_true = 1; #define LLOGLN(_level, _args) do { if ((_level < 11) && g_true) { writeln _args ; } } while (0) /*****************************************************************************/ static int writeln(const char *format, ...) { va_list ap; char text[256]; va_start(ap, format); vsnprintf(text, 255, format, ap); va_end(ap); OutputDebugString(text); return 0; } #define LLOAD(_func, _type, _name) \ do { \ _func = (_type) GetProcAddress(lib, _name); \ if (_func == 0) \ { \ writeln("LLOAD error %s", _name); \ } \ } while (0) static int g_funcs_loaded = 0; /*****************************************************************************/ static int __fastcall load_funcs(void) { HMODULE lib; if (g_funcs_loaded) { return 0; } g_funcs_loaded = 1; lib = LoadLibrary("winscard-org.dll"); LLOGLN(0, ("load_funcs: lib %p", lib)); LLOAD(aSCardEstablishContext, tSCardEstablishContext, "SCardEstablishContext"); LLOAD(aSCardReleaseContext, tSCardReleaseContext, "SCardReleaseContext"); LLOAD(aSCardIsValidContext, tSCardIsValidContext, "SCardIsValidContext"); LLOAD(aSCardListReaderGroupsA, tSCardListReaderGroupsA, "SCardListReaderGroupsA"); LLOAD(aSCardListReaderGroupsW, tSCardListReaderGroupsW, "SCardListReaderGroupsW"); LLOAD(aSCardListReadersA, tSCardListReadersA, "SCardListReadersA"); LLOAD(aSCardListReadersW, tSCardListReadersW, "SCardListReadersW"); LLOAD(aSCardListCardsA, tSCardListCardsA, "SCardListCardsA"); LLOAD(aSCardListCardsW, tSCardListCardsW, "SCardListCardsW"); LLOAD(aSCardListInterfacesA, tSCardListInterfacesA, "SCardListInterfacesA"); LLOAD(aSCardListInterfacesW, tSCardListInterfacesW, "SCardListInterfacesW"); LLOAD(aSCardGetProviderIdA, tSCardGetProviderIdA, "SCardGetProviderIdA"); LLOAD(aSCardGetProviderIdW, tSCardGetProviderIdW, "SCardGetProviderIdW"); LLOAD(aSCardGetCardTypeProviderNameA, tSCardGetCardTypeProviderNameA, "SCardGetCardTypeProviderNameA"); LLOAD(aSCardGetCardTypeProviderNameW, tSCardGetCardTypeProviderNameW, "SCardGetCardTypeProviderNameW"); LLOAD(aSCardIntroduceReaderGroupA, tSCardIntroduceReaderGroupA, "SCardIntroduceReaderGroupA"); LLOAD(aSCardIntroduceReaderGroupW, tSCardIntroduceReaderGroupW, "SCardIntroduceReaderGroupW"); LLOAD(aSCardForgetReaderGroupA, tSCardForgetReaderGroupA, "SCardForgetReaderGroupA"); LLOAD(aSCardForgetReaderGroupW, tSCardForgetReaderGroupW, "SCardForgetReaderGroupW"); LLOAD(aSCardIntroduceReaderA, tSCardIntroduceReaderA, "SCardIntroduceReaderA"); LLOAD(aSCardIntroduceReaderW, tSCardIntroduceReaderW, "SCardIntroduceReaderW"); LLOAD(aSCardForgetReaderA, tSCardForgetReaderA, "SCardForgetReaderA"); LLOAD(aSCardForgetReaderW, tSCardForgetReaderW, "SCardForgetReaderW"); LLOAD(aSCardAddReaderToGroupA, tSCardAddReaderToGroupA, "SCardAddReaderToGroupA"); LLOAD(aSCardAddReaderToGroupW, tSCardAddReaderToGroupW, "SCardAddReaderToGroupW"); LLOAD(aSCardRemoveReaderFromGroupA, tSCardRemoveReaderFromGroupA, "SCardRemoveReaderFromGroupA"); LLOAD(aSCardRemoveReaderFromGroupW, tSCardRemoveReaderFromGroupW, "SCardRemoveReaderFromGroupW"); LLOAD(aSCardIntroduceCardTypeA, tSCardIntroduceCardTypeA, "SCardIntroduceCardTypeA"); LLOAD(aSCardIntroduceCardTypeW, tSCardIntroduceCardTypeW, "SCardIntroduceCardTypeW"); LLOAD(aSCardSetCardTypeProviderNameA, tSCardSetCardTypeProviderNameA, "SCardSetCardTypeProviderNameA"); LLOAD(aSCardSetCardTypeProviderNameW, tSCardSetCardTypeProviderNameW, "SCardSetCardTypeProviderNameW"); LLOAD(aSCardForgetCardTypeA, tSCardForgetCardTypeA, "SCardForgetCardTypeA"); LLOAD(aSCardForgetCardTypeW, tSCardForgetCardTypeW, "SCardForgetCardTypeW"); LLOAD(aSCardFreeMemory, tSCardFreeMemory, "SCardFreeMemory"); LLOAD(aSCardLocateCardsA, tSCardLocateCardsA, "SCardLocateCardsA"); LLOAD(aSCardLocateCardsW, tSCardLocateCardsW, "SCardLocateCardsW"); LLOAD(aSCardGetStatusChangeA, tSCardGetStatusChangeA, "SCardGetStatusChangeA"); LLOAD(aSCardGetStatusChangeW, tSCardGetStatusChangeW, "SCardGetStatusChangeW"); LLOAD(aSCardCancel, tSCardCancel, "SCardCancel"); LLOAD(aSCardConnectA, tSCardConnectA, "SCardConnectA"); LLOAD(aSCardConnectW, tSCardConnectW, "SCardConnectW"); LLOAD(aSCardReconnect, tSCardReconnect, "SCardReconnect"); LLOAD(aSCardDisconnect, tSCardDisconnect, "SCardDisconnect"); LLOAD(aSCardBeginTransaction, tSCardBeginTransaction, "SCardBeginTransaction"); LLOAD(aSCardEndTransaction, tSCardEndTransaction, "SCardEndTransaction"); LLOAD(aSCardCancelTransaction, tSCardCancelTransaction, "SCardCancelTransaction"); LLOAD(aSCardState, tSCardState, "SCardState"); LLOAD(aSCardStatusA, tSCardStatusA, "SCardStatusA"); LLOAD(aSCardStatusW, tSCardStatusW, "SCardStatusW"); LLOAD(aSCardTransmit, tSCardTransmit, "SCardTransmit"); LLOAD(aSCardControl, tSCardControl, "SCardControl"); LLOAD(aSCardGetAttrib, tSCardGetAttrib, "SCardGetAttrib"); LLOAD(aSCardSetAttrib, tSCardSetAttrib, "SCardSetAttrib"); return 0; } /*****************************************************************************/ BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { BOOL rv; LUNUSED(hinstDLL); LUNUSED(lpvReserved); LLOGLN(10, ("DllEntryPoint: hinstDLL %p fdwReason %d", hinstDLL, fdwReason)); rv = FALSE; switch (fdwReason) { case DLL_PROCESS_ATTACH: LLOGLN(0, ("DllEntryPoint: DLL_PROCESS_ATTACH")); load_funcs(); rv = TRUE; break; case DLL_THREAD_ATTACH: LLOGLN(10, ("DllEntryPoint: DLL_THREAD_ATTACH")); rv = TRUE; break; case DLL_THREAD_DETACH: LLOGLN(10, ("DllEntryPoint: DLL_THREAD_DETACH")); rv = TRUE; break; case DLL_PROCESS_DETACH: LLOGLN(0, ("DllEntryPoint: DLL_PROCESS_DETACH")); rv = TRUE; break; default: LLOGLN(0, ("DllEntryPoint: unknown fdwReason %d", fdwReason)); break; } return rv; } /*****************************************************************************/ LONG WINAPI SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) { LLOGLN(0, ("SCardEstablishContext:")); return aSCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext); } /*****************************************************************************/ LONG WINAPI SCardReleaseContext(SCARDCONTEXT hContext) { LLOGLN(0, ("SCardReleaseContext:")); return aSCardReleaseContext(hContext); } /*****************************************************************************/ LONG WINAPI SCardIsValidContext(SCARDCONTEXT hContext) { LLOGLN(0, ("SCardIsValidContext:")); return aSCardIsValidContext(hContext); } /*****************************************************************************/ LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups) { LLOGLN(0, ("SCardListReaderGroupsA:")); return aSCardListReaderGroupsA(hContext, mszGroups, pcchGroups); } /*****************************************************************************/ LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups, LPDWORD pcchGroups) { LLOGLN(0, ("SCardListReaderGroupsW:")); return aSCardListReaderGroupsW(hContext, mszGroups, pcchGroups); } /*****************************************************************************/ LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) { LLOGLN(0, ("SCardListReadersA:")); return aSCardListReadersA(hContext, mszGroups, mszReaders, pcchReaders); } /*****************************************************************************/ LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders) { char text[256]; LONG rv; DWORD cchReaders; text[0] = 0; if (mszGroups != 0) { wcstombs(text, mszGroups, 255); } cchReaders = *pcchReaders; LLOGLN(0, ("SCardListReadersW: mszGroups [%s] cchReaders [%d]", text, *pcchReaders)); rv = aSCardListReadersW(hContext, mszGroups, mszReaders, pcchReaders); text[0] = 0; if (cchReaders > 0) { wcstombs(text, mszReaders, 255); } LLOGLN(0, (" mszReaders [%s] cchReaders [%d]", text, *pcchReaders)); return rv; } /*****************************************************************************/ LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, LPSTR mszCards, LPDWORD pcchCards) { LLOGLN(0, ("SCardListCardsA:")); return aSCardListCardsA(hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); } /*****************************************************************************/ LONG WINAPI SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, LPWSTR mszCards, LPDWORD pcchCards) { LLOGLN(0, ("SCardListCardsW:")); return aSCardListCardsW(hContext, pbAtr, rgquidInterfaces, cguidInterfaceCount, mszCards, pcchCards); } /*****************************************************************************/ LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) { LLOGLN(0, ("SCardListInterfacesA:")); return aSCardListInterfacesA(hContext, szCard, pguidInterfaces, pcguidInterfaces); } /*****************************************************************************/ LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces) { LLOGLN(0, ("SCardListInterfacesW:")); return aSCardListInterfacesW(hContext, szCard, pguidInterfaces, pcguidInterfaces); } /*****************************************************************************/ LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidProviderId) { LLOGLN(0, ("SCardGetProviderIdA:")); return aSCardGetProviderIdA(hContext, szCard, pguidProviderId); } /****************************************************************************/ LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidProviderId) { LLOGLN(0, ("SCardGetProviderIdW:")); return aSCardGetProviderIdW(hContext, szCard, pguidProviderId); } /****************************************************************************/ LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, LPSTR szProvider, LPDWORD pcchProvider) { LLOGLN(0, ("SCardGetCardTypeProviderNameA:")); return aSCardGetCardTypeProviderNameA(hContext, szCardName, dwProviderId, szProvider, pcchProvider); } /*****************************************************************************/ LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, LPWSTR szProvider, LPDWORD pcchProvider) { LLOGLN(0, ("SCardGetCardTypeProviderNameW:")); return aSCardGetCardTypeProviderNameW(hContext, szCardName, dwProviderId, szProvider, pcchProvider); } /*****************************************************************************/ LONG WINAPI SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName) { LLOGLN(0, ("SCardIntroduceReaderGroupA:")); return aSCardIntroduceReaderGroupA(hContext, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName) { LLOGLN(0, ("SCardIntroduceReaderGroupW:")); return aSCardIntroduceReaderGroupW(hContext, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardForgetReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName) { LLOGLN(0, ("SCardForgetReaderGroupA:")); return aSCardForgetReaderGroupA(hContext, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName) { LLOGLN(0, ("SCardForgetReaderGroupW:")); return aSCardForgetReaderGroupW(hContext, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szDeviceName) { LLOGLN(0, ("SCardIntroduceReaderA:")); return aSCardIntroduceReaderA(hContext, szReaderName, szDeviceName); } /*****************************************************************************/ LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szDeviceName) { LLOGLN(0, ("SCardIntroduceReaderW:")); return aSCardIntroduceReaderW(hContext, szReaderName, szDeviceName); } /*****************************************************************************/ LONG WINAPI SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName) { LLOGLN(0, ("SCardForgetReaderA:")); return aSCardForgetReaderA(hContext, szReaderName); } /*****************************************************************************/ LONG WINAPI SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName) { LLOGLN(0, ("SCardForgetReaderW:")); return aSCardForgetReaderW(hContext, szReaderName); } /*****************************************************************************/ LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName) { LLOGLN(0, ("SCardAddReaderToGroupA:")); return aSCardAddReaderToGroupA(hContext, szReaderName, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName) { LLOGLN(0, ("SCardAddReaderToGroupW:")); return aSCardAddReaderToGroupW(hContext, szReaderName, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName) { LLOGLN(0, ("SCardRemoveReaderFromGroupA:")); return aSCardRemoveReaderFromGroupA(hContext, szReaderName, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName) { LLOGLN(0, ("SCardRemoveReaderFromGroupW:")); return aSCardRemoveReaderFromGroupW(hContext, szReaderName, szGroupName); } /*****************************************************************************/ LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) { LLOGLN(0, ("SCardIntroduceCardTypeA:")); return aSCardIntroduceCardTypeA(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); } /*****************************************************************************/ LONG WINAPI SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen) { LLOGLN(0, ("SCardIntroduceCardTypeW:")); return aSCardIntroduceCardTypeW(hContext, szCardName, pguidPrimaryProvider, rgguidInterfaces, dwInterfaceCount, pbAtr, pbAtrMask, cbAtrLen); } /*****************************************************************************/ LONG WINAPI SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider) { LLOGLN(0, ("SCardSetCardTypeProviderNameA:")); return aSCardSetCardTypeProviderNameA(hContext, szCardName, dwProviderId, szProvider); } /*****************************************************************************/ LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider) { LLOGLN(0, ("SCardSetCardTypeProviderNameW:")); return aSCardSetCardTypeProviderNameW(hContext, szCardName, dwProviderId, szProvider); } /*****************************************************************************/ LONG WINAPI SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName) { LLOGLN(0, ("SCardForgetCardTypeA:")); return aSCardForgetCardTypeA(hContext, szCardName); } /*****************************************************************************/ LONG WINAPI SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName) { LLOGLN(0, ("SCardForgetCardTypeW:")); return aSCardForgetCardTypeW(hContext, szCardName); } /*****************************************************************************/ LONG WINAPI SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem) { LLOGLN(0, ("SCardFreeMemory:")); return aSCardFreeMemory(hContext, pvMem); } /*****************************************************************************/ LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) { LLOGLN(0, ("SCardLocateCardsA:")); return aSCardLocateCardsA(hContext, mszCards, rgReaderStates, cReaders); } /*****************************************************************************/ LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) { LLOGLN(0, ("SCardLocateCardsW:")); return aSCardLocateCardsW(hContext, mszCards, rgReaderStates, cReaders); } /*****************************************************************************/ LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders) { LLOGLN(0, ("SCardGetStatusChangeA:")); return aSCardGetStatusChangeA(hContext, dwTimeout, rgReaderStates, cReaders); } /*****************************************************************************/ LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders) { LLOGLN(0, ("SCardGetStatusChangeW:")); return aSCardGetStatusChangeW(hContext, dwTimeout, rgReaderStates, cReaders); } /*****************************************************************************/ LONG WINAPI SCardCancel(SCARDCONTEXT hContext) { LLOGLN(0, ("SCardCancel:")); return aSCardCancel(hContext); } /*****************************************************************************/ LONG WINAPI SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { LLOGLN(0, ("SCardConnectA:")); return aSCardConnectA(hContext, szReader, dwShareMode, dwPreferredProtocols, phCard, pdwActiveProtocol); } /*****************************************************************************/ LONG WINAPI SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) { LLOGLN(0, ("SCardConnectW:")); return aSCardConnectW(hContext, szReader, dwShareMode, dwPreferredProtocols, phCard, pdwActiveProtocol); } /*****************************************************************************/ LONG WINAPI SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol) { LLOGLN(0, ("SCardReconnect:")); return SCardReconnect(hCard, dwShareMode, dwPreferredProtocols, dwInitialization, pdwActiveProtocol); } /*****************************************************************************/ LONG WINAPI SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition) { LLOGLN(0, ("SCardDisconnect:")); return aSCardDisconnect(hCard, dwDisposition); } /*****************************************************************************/ LONG WINAPI SCardBeginTransaction(SCARDHANDLE hCard) { LLOGLN(0, ("SCardBeginTransaction:")); return aSCardBeginTransaction(hCard); } /*****************************************************************************/ LONG WINAPI SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition) { LLOGLN(0, ("SCardEndTransaction:")); return aSCardEndTransaction(hCard, dwDisposition); } /*****************************************************************************/ LONG WINAPI SCardCancelTransaction(SCARDHANDLE hCard) { LLOGLN(0, ("SCardCancelTransaction:")); return aSCardCancelTransaction(hCard); } /*****************************************************************************/ LONG WINAPI SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { LLOGLN(0, ("SCardState:")); return aSCardState(hCard, pdwState, pdwProtocol, pbAtr, pcbAtrLen); } /*****************************************************************************/ LONG WINAPI SCardStatusA(SCARDHANDLE hCard, LPSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { LLOGLN(0, ("SCardStatusA:")); return aSCardStatusA(hCard, szReaderName, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen); } /*****************************************************************************/ LONG WINAPI SCardStatusW(SCARDHANDLE hCard, LPWSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) { LONG rv; LLOGLN(0, ("SCardStatusW:")); LLOGLN(0, (" cchReaderLen %d", *pcchReaderLen)); LLOGLN(0, (" cbAtrLen %d", *pcbAtrLen)); rv = aSCardStatusW(hCard, szReaderName, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen); LLOGLN(0, (" rv %d cchReaderLen %d", rv, *pcchReaderLen)); return rv; } /*****************************************************************************/ LONG WINAPI SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength) { LONG rv; LLOGLN(10, ("SCardTransmit:")); LLOGLN(10, (" hCard %p", hCard)); LLOGLN(10, (" cbSendLength %d", cbSendLength)); LLOGLN(10, (" cbRecvLength %d", *pcbRecvLength)); LLOGLN(10, (" pioSendPci->dwProtocol %d", pioSendPci->dwProtocol)); LLOGLN(10, (" pioSendPci->cbPciLength %d", pioSendPci->cbPciLength)); LLOGLN(10, (" pioRecvPci %p", pioRecvPci)); if (pioRecvPci != NULL) { LLOGLN(10, (" pioRecvPci->dwProtocol %d", pioRecvPci->dwProtocol)); LLOGLN(10, (" pioRecvPci->cbPciLength %d", pioRecvPci->cbPciLength)); } rv = aSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength, pioRecvPci, pbRecvBuffer, pcbRecvLength); LLOGLN(10, (" rv %d cbRecvLength %d", rv, *pcbRecvLength)); return rv; } /*****************************************************************************/ LONG WINAPI SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned) { LONG rv; LLOGLN(10, ("SCardControl:")); LLOGLN(10, (" hCard %p", hCard)); LLOGLN(10, (" dwControlCode 0x%8.8x", dwControlCode)); LLOGLN(10, (" lpInBuffer %p", lpInBuffer)); LLOGLN(10, (" nInBufferSize %d", nInBufferSize)); LLOGLN(10, (" lpOutBuffer %p", lpOutBuffer)); LLOGLN(10, (" nOutBufferSize %d", nOutBufferSize)); LLOGLN(10, (" lpBytesReturned %p", lpBytesReturned)); rv = aSCardControl(hCard, dwControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned); LLOGLN(10, (" rv %d BytesReturned %d", rv, *lpBytesReturned)); return rv; } /*****************************************************************************/ LONG WINAPI SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen) { LLOGLN(0, ("SCardGetAttrib:")); return aSCardGetAttrib(hCard, dwAttrId, pbAttr, pcbAttrLen); } /*****************************************************************************/ LONG WINAPI SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen) { LLOGLN(0, ("SCardSetAttrib:")); return aSCardSetAttrib(hCard, dwAttrId, pbAttr, cbAttrLen); } xrdp-0.10.1/sesman/chansrv/pcsc/wrapper/winscard-func-names.txt000644 001751 000000 00000003156 14652432047 024611 0ustar00metawheel000000 000000 ClassInstall32 SCardAccessNewReaderEvent SCardReleaseAllEvents SCardReleaseNewReaderEvent SCardAccessStartedEvent done SCardAddReaderToGroupA done SCardAddReaderToGroupW done SCardBeginTransaction done SCardCancel done SCardConnectA done SCardConnectW done SCardControl done SCardDisconnect done SCardEndTransaction done SCardEstablishContext done SCardForgetCardTypeA done SCardForgetCardTypeW done SCardForgetReaderA done SCardForgetReaderGroupA done SCardForgetReaderGroupW done SCardForgetReaderW done SCardFreeMemory done SCardGetAttrib done SCardGetCardTypeProviderNameA done SCardGetCardTypeProviderNameW done SCardGetProviderIdA done SCardGetProviderIdW done SCardGetStatusChangeA done SCardGetStatusChangeW SCardGetTransmitCount done SCardIntroduceCardTypeA done SCardIntroduceCardTypeW done SCardIntroduceReaderA done SCardIntroduceReaderGroupA done SCardIntroduceReaderGroupW done SCardIntroduceReaderW done SCardIsValidContext done SCardListCardsA done SCardListCardsW done SCardListInterfacesA done SCardListInterfacesW done SCardListReaderGroupsA done SCardListReaderGroupsW done SCardListReadersA done SCardListReadersW done SCardLocateCardsA SCardLocateCardsByATRA SCardLocateCardsByATRW done SCardLocateCardsW SCardReadCacheA SCardReadCacheW done SCardReconnect done SCardReleaseContext SCardReleaseStartedEvent done SCardRemoveReaderFromGroupA done SCardRemoveReaderFromGroupW done SCardSetAttrib done SCardSetCardTypeProviderNameA done SCardSetCardTypeProviderNameW done SCardState done SCardStatusA done SCardStatusW done SCardTransmit SCardWriteCacheA SCardWriteCacheW g_rgSCardRawPci g_rgSCardT0Pci g_rgSCardT1Pci xrdp-0.10.1/sesman/chansrv/pcsc/wrapper/winscard-funcs.h000644 001751 000000 00000017516 14652432047 023310 0ustar00metawheel000000 000000 #ifndef _WINSCARD_FUNCS_H #define _WINSCARD_FUNCS_H typedef LONG WINAPI (*tSCardEstablishContext)(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext); typedef LONG WINAPI (*tSCardReleaseContext)(SCARDCONTEXT hContext); typedef LONG WINAPI (*tSCardIsValidContext)(SCARDCONTEXT hContext); typedef LONG WINAPI (*tSCardListReaderGroupsA)(SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups); typedef LONG WINAPI (*tSCardListReaderGroupsW)(SCARDCONTEXT hContext, LPWSTR mszGroups, LPDWORD pcchGroups); typedef LONG WINAPI (*tSCardListReadersA)(SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders); typedef LONG WINAPI (*tSCardListReadersW)(SCARDCONTEXT hContext, LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders); typedef LONG WINAPI (*tSCardListCardsA)(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, LPSTR mszCards, LPDWORD pcchCards); typedef LONG WINAPI (*tSCardListCardsW)(SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, LPWSTR mszCards, LPDWORD pcchCards); typedef LONG WINAPI (*tSCardListInterfacesA)(SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); typedef LONG WINAPI (*tSCardListInterfacesW)(SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces); typedef LONG WINAPI (*tSCardGetProviderIdA)(SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidProviderId); typedef LONG WINAPI (*tSCardGetProviderIdW)(SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidProviderId); typedef LONG WINAPI (*tSCardGetCardTypeProviderNameA)(SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, LPSTR szProvider, LPDWORD pcchProvider); typedef LONG WINAPI (*tSCardGetCardTypeProviderNameW)(SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, LPWSTR szProvider, LPDWORD pcchProvider); typedef LONG WINAPI (*tSCardIntroduceReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName); typedef LONG WINAPI (*tSCardIntroduceReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName); typedef LONG WINAPI (*tSCardForgetReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName); typedef LONG WINAPI (*tSCardForgetReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName); typedef LONG WINAPI (*tSCardIntroduceReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szDeviceName); typedef LONG WINAPI (*tSCardIntroduceReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szDeviceName); typedef LONG WINAPI (*tSCardForgetReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName); typedef LONG WINAPI (*tSCardForgetReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName); typedef LONG WINAPI (*tSCardAddReaderToGroupA)(SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName); typedef LONG WINAPI (*tSCardAddReaderToGroupW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName); typedef LONG WINAPI (*tSCardRemoveReaderFromGroupA)(SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName); typedef LONG WINAPI (*tSCardRemoveReaderFromGroupW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName); typedef LONG WINAPI (*tSCardIntroduceCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); typedef LONG WINAPI (*tSCardIntroduceCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); typedef LONG WINAPI (*tSCardSetCardTypeProviderNameA)(SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider); typedef LONG WINAPI (*tSCardSetCardTypeProviderNameW)(SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider); typedef LONG WINAPI (*tSCardForgetCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName); typedef LONG WINAPI (*tSCardForgetCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName); typedef LONG WINAPI (*tSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem); typedef LONG WINAPI (*tSCardLocateCardsA)(SCARDCONTEXT hContext, LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); typedef LONG WINAPI (*tSCardLocateCardsW)(SCARDCONTEXT hContext, LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); typedef LONG WINAPI (*tSCardGetStatusChangeA)(SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders); typedef LONG WINAPI (*tSCardGetStatusChangeW)(SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders); typedef LONG WINAPI (*tSCardCancel)(SCARDCONTEXT hContext); typedef LONG WINAPI (*tSCardConnectA)(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); typedef LONG WINAPI (*tSCardConnectW)(SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); typedef LONG WINAPI (*tSCardReconnect)(SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol); typedef LONG WINAPI (*tSCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition); typedef LONG WINAPI (*tSCardBeginTransaction)(SCARDHANDLE hCard); typedef LONG WINAPI (*tSCardEndTransaction)(SCARDHANDLE hCard, DWORD dwDisposition); typedef LONG WINAPI (*tSCardCancelTransaction)(SCARDHANDLE hCard); typedef LONG WINAPI (*tSCardState)(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); typedef LONG WINAPI (*tSCardStatusA)(SCARDHANDLE hCard, LPSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); typedef LONG WINAPI (*tSCardStatusW)(SCARDHANDLE hCard, LPWSTR szReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); typedef LONG WINAPI (*tSCardTransmit)(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength); typedef LONG WINAPI (*tSCardControl)(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned); typedef LONG WINAPI (*tSCardGetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen); typedef LONG WINAPI (*tSCardSetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen); #endif xrdp-0.10.1/sesman/chansrv/pcsc/wrapper/Makefile000644 001751 000000 00000000232 14652432047 021634 0ustar00metawheel000000 000000 CC=bcc32.exe CFLAGS=-O2 OBJS=winscard.obj winscard.dll: $(OBJS) $(CC) -ewinscard.dll -tWD $(OBJS) clean: -del winscard.dll -del *.obj -del *.tds xrdp-0.10.1/sesman/chansrv/pcsc/wrapper/winscard.def000644 001751 000000 00000002051 14652432047 022467 0ustar00metawheel000000 000000 EXPORTS SCardEstablishContext SCardReleaseContext SCardIsValidContext SCardListReaderGroupsA SCardListReaderGroupsW SCardListReadersA SCardListReadersW SCardListCardsA SCardListCardsW SCardListInterfacesA SCardListInterfacesW SCardGetProviderIdA SCardGetProviderIdW SCardGetCardTypeProviderNameA SCardGetCardTypeProviderNameW SCardIntroduceReaderGroupA SCardIntroduceReaderGroupW SCardForgetReaderGroupA SCardForgetReaderGroupW SCardIntroduceReaderA SCardIntroduceReaderW SCardForgetReaderA SCardForgetReaderW SCardAddReaderToGroupA SCardAddReaderToGroupW SCardRemoveReaderFromGroupA SCardRemoveReaderFromGroupW SCardIntroduceCardTypeA SCardIntroduceCardTypeW SCardSetCardTypeProviderNameA SCardSetCardTypeProviderNameW SCardForgetCardTypeA SCardForgetCardTypeW SCardFreeMemory SCardLocateCardsA SCardLocateCardsW SCardGetStatusChangeA SCardGetStatusChangeW SCardCancel SCardConnectA SCardConnectW SCardReconnect SCardDisconnect SCardBeginTransaction SCardEndTransaction SCardState SCardStatusA SCardStatusW SCardTransmit SCardControl SCardGetAttrib SCardSetAttrib xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-connect.txt000644 001751 000000 00000003466 14652432047 023144 0ustar00metawheel000000 000000 TS_SCardConnect: 0000 03 00 00 cb 02 f0 80 68 00 01 03 ed f0 80 bc 08 .......h........ 0010 00 00 00 7b 28 f8 7e 5c c8 16 e8 a8 00 00 00 03 ...{(.~\........ 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 70 ...............p 0040 00 00 00 b0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 60 00 00 00 00 00 00 00 00 00 02 00 04 ...`............ 0070 00 00 00 04 00 02 00 02 00 00 00 03 00 00 00 19 ................ 0080 00 00 00 00 00 00 00 19 00 00 00 47 00 65 00 6d ...........G.e.m 0090 00 70 00 6c 00 75 00 73 00 20 00 47 00 65 00 6d .p.l.u.s. .G.e.m 00a0 00 50 00 43 00 20 00 54 00 77 00 69 00 6e 00 20 .P.C. .T.w.i.n. 00b0 00 30 00 30 00 20 00 30 00 30 00 00 00 00 00 04 .0.0. .0.0...... 00c0 00 00 00 01 00 00 00 00 00 00 00 ........... TS_SCardConnect: 0000 03 00 00 cb 02 f0 80 68 00 01 03 ed f0 80 bc 08 .......h........ 0010 00 00 00 7b 28 f8 7e 5c c8 16 e8 a8 00 00 00 03 ...{(.~\........ 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 70 ...............p 0040 00 00 00 b0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 60 00 00 00 00 00 00 00 00 00 02 00 04 ...`............ 0070 00 00 00 04 00 02 00 02 00 00 00 03 00 00 00 19 ................ 0080 00 00 00 00 00 00 00 19 00 00 00 47 00 65 00 6d ...........G.e.m 0090 00 70 00 6c 00 75 00 73 00 20 00 47 00 65 00 6d .p.l.u.s. .G.e.m 00a0 00 50 00 43 00 20 00 54 00 77 00 69 00 6e 00 20 .P.C. .T.w.i.n. 00b0 00 30 00 30 00 20 00 30 00 30 00 00 00 00 00 04 .0.0. .0.0...... 00c0 00 00 00 01 00 00 00 00 00 00 00 ........... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-list-readers.txt000644 001751 000000 00000013535 14652432047 024107 0ustar00metawheel000000 000000 TS_SCardListReaders: 0000 03 00 00 b3 02 f0 80 68 00 01 03 ed f0 80 a4 08 .......h........ 0010 00 00 00 07 b5 7d d1 ba 7c 7e e9 90 00 00 00 03 .....}..|~...... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 58 ...............X 0040 00 00 00 2c 00 09 00 00 00 00 00 00 00 00 00 00 ...,............ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 48 00 00 00 00 00 00 00 04 00 00 00 00 ...H............ 0070 00 02 00 24 00 00 00 04 00 02 00 00 00 00 00 ff ...$............ 0080 ff ff ff 04 00 00 00 01 00 00 00 24 00 00 00 53 ...........$...S 0090 00 43 00 61 00 72 00 64 00 24 00 41 00 6c 00 6c .C.a.r.d.$.A.l.l 00a0 00 52 00 65 00 61 00 64 00 65 00 72 00 73 00 00 .R.e.a.d.e.r.s.. 00b0 00 00 00 ... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ef be 3f 08 43 ae 89 9b 68 00 00 00 03 00 ....?.C...h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 78 0a 67 31 92 fc d0 29 68 00 00 00 03 00 ..x.g1...)h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 .......... TS_SCardListReaders: 0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|.. 0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0. 0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(............. 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. ............. 0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................ 0080 00 00 04 00 00 00 02 00 00 00 xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-release-context.txt000644 001751 000000 00000001053 14652432047 024603 0ustar00metawheel000000 000000 0000 03 00 00 7a 02 f0 80 68 00 01 03 ed f0 6c 08 00 ...z...h.....l.. 0010 00 00 c9 9d 01 9e ec 30 a3 4c 58 00 00 00 03 00 .......0.LX..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 20 00 .............. . 0040 00 00 18 00 09 00 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 10 00 00 00 00 00 00 00 04 00 00 00 00 00 ................ 0070 02 00 04 00 00 00 02 00 00 00 .......... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-begin-tranaction.txt000644 001751 000000 00000001312 14652432047 024723 0ustar00metawheel000000 000000 TS_SCardBeginTransaction: 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 0010 00 00 00 de 14 5c 5a 9e 86 37 2b 70 00 00 00 03 .....\Z..7+p.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 0040 00 00 00 bc 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 0080 00 00 00 02 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 0090 00 00 00 ... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-transmit.txt000644 001751 000000 00000003722 14652432047 023347 0ustar00metawheel000000 000000 TS_SCardTransmit: 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 0020 01 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................ 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 0050 07 00 00 00 00 a4 02 0c 02 ef 0f 00 01 00 00 00 ................ 0060 00 00 00 00 00 00 00 00 ........ TS_SCardTransmit: 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 0020 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 ................ 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 0050 05 00 00 00 00 b0 07 5b 10 00 00 00 01 00 00 00 .......[........ 0060 00 00 00 00 00 00 00 00 ........ TS_SCardTransmit: 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 0020 01 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................ 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 0050 07 00 00 00 00 a4 02 0c 02 ef 10 00 01 00 00 00 ................ 0060 00 00 00 00 00 00 00 00 ........ TS_SCardTransmit: 0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X....... 0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................ 0020 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 ................ 0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................ 0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................ 0050 05 00 00 00 00 b0 07 04 10 00 00 00 01 00 00 00 ................ 0060 00 00 00 00 00 00 00 00 ........ xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-control.txt000644 001751 000000 00000007437 14652432047 023175 0ustar00metawheel000000 000000 TS_SCardControl: 0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........ 0010 00 00 00 05 18 7c 3e ca 9f 03 76 80 00 00 00 03 .....|>...v..... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H 0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............ 0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51.. 0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................ 0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................ 00a0 00 00 00 ... TS_SCardControl: 0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........ 0010 00 00 00 99 4c 06 de f1 41 78 64 80 00 00 00 03 ....L...Axd..... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H 0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............ 0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51.. 0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................ 0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................ 00a0 00 00 00 ... TS_SCardControl: 0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........ 0010 00 00 00 05 18 7c 3e ca 9f 03 76 80 00 00 00 03 .....|>...v..... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H 0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............ 0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51.. 0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................ 0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................ 00a0 00 00 00 ... TS_SCardControl: 0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........ 0010 00 00 00 99 4c 06 de f1 41 78 64 80 00 00 00 03 ....L...Axd..... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H 0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............ 0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51.. 0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................ 0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................ 00a0 00 00 00 ... TS_SCardControl: 0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........ 0010 00 00 00 87 62 bd 62 13 81 8a d6 80 00 00 00 03 ....b.b......... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H 0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............ 0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51.. 0080 00 00 00 00 00 00 00 00 00 00 00 02 01 00 00 04 ................ 0090 00 00 00 07 00 00 00 04 00 00 00 0b 00 00 00 00 ................ 00a0 00 00 00 ... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-end-tranaction.txt000644 001751 000000 00000004127 14652432047 024414 0ustar00metawheel000000 000000 TS_SCardEndTransaction: 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 0010 00 00 00 51 1c 06 7b 0a 94 e3 7f 70 00 00 00 03 ...Q..{....p.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 0090 00 00 00 ... TS_SCardEndTransaction: 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 0010 00 00 00 51 1c 06 7b 0a 94 e3 7f 70 00 00 00 03 ...Q..{....p.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 0090 00 00 00 ... TS_SCardEndTransaction: 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 0010 00 00 00 fe 1c ea fb 2e a3 58 a6 70 00 00 00 03 .........X.p.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................ 0090 00 00 00 ... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-status.txt000644 001751 000000 00000017216 14652432047 023034 0ustar00metawheel000000 000000 TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 0e 8b f9 50 1f 35 28 35 78 00 00 00 03 ......P.5(5x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 cc 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 ff ................ 0080 ff ff ff 20 00 00 00 04 00 00 00 05 00 00 00 04 ... ............ 0090 00 00 00 06 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 0e 8b f9 50 1f 35 28 35 78 00 00 00 03 ......P.5(5x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 cc 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 ff ................ 0080 ff ff ff 20 00 00 00 04 00 00 00 05 00 00 00 04 ... ............ 0090 00 00 00 06 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 88 05 07 8b 2a 3c f5 16 78 00 00 00 03 .......*<..x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 cc 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 ff ................ 0080 ff ff ff 20 00 00 00 04 00 00 00 05 00 00 00 04 ... ............ 0090 00 00 00 06 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 3b cf 96 d8 27 3f cd 9f 78 00 00 00 03 ...;...'?..x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 a3 8c 93 16 6c 49 59 23 78 00 00 00 03 .......lIY#x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 a3 8c 93 16 6c 49 59 23 78 00 00 00 03 .......lIY#x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 a3 8c 93 16 6c 49 59 23 78 00 00 00 03 .......lIY#x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... TS_SCardStatus: 0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........ 0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@ 0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............ 0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................ 0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............ 0090 00 00 00 09 00 00 00 00 00 00 00 ........... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-establish-context.txt000644 001751 000000 00000002171 14652432047 025143 0ustar00metawheel000000 000000 TS_SCardEstablishContext: 0000 03 00 00 72 02 f0 80 68 00 01 03 ed f0 64 08 00 ...r...h.....d.. 0010 00 00 a7 8d 52 74 fd 96 bc b4 50 00 00 00 03 00 ....Rt....P..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 18 00 ................ 0040 00 00 14 00 09 00 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 08 00 00 00 00 00 00 00 02 00 00 00 00 00 ................ 0070 00 00 .. TS_SCardEstablishContext: 0000 03 00 00 72 02 f0 80 68 00 01 03 ed f0 64 08 00 ...r...h.....d.. 0010 00 00 51 f7 43 00 73 65 44 53 50 00 00 00 03 00 ..Q.C.seDSP..... 0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 00 ..rDRI.......... 0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 18 00 ................ 0040 00 00 14 00 09 00 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................ 0060 cc cc 08 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0070 00 00 .. xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-get-status-change.txt000644 001751 000000 00000003137 14652432047 025031 0ustar00metawheel000000 000000 TS_SCardGetStatusChange: 0000 03 00 01 6b 02 f0 80 68 00 01 03 ed f0 81 5c 08 ...k...h......\. 0010 00 00 00 bf 53 5b 23 43 71 9b 2b 48 01 00 00 03 ....S[#Cq.+H.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 10 ................ 0040 01 00 00 a4 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 00 01 00 00 00 00 00 00 04 00 00 00 00 ................ 0070 00 02 00 ff ff ff ff 02 00 00 00 04 00 02 00 04 ................ 0080 00 00 00 01 00 00 00 02 00 00 00 08 00 02 00 00 ................ 0090 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c ................ 00c0 00 02 00 10 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00f0 00 00 00 15 00 00 00 00 00 00 00 15 00 00 00 5c ...............\ 0100 00 5c 00 3f 00 50 00 6e 00 50 00 3f 00 5c 00 4e .\.?.P.n.P.?.\.N 0110 00 6f 00 74 00 69 00 66 00 69 00 63 00 61 00 74 .o.t.i.f.i.c.a.t 0120 00 69 00 6f 00 6e 00 00 00 00 00 19 00 00 00 00 .i.o.n.......... 0130 00 00 00 19 00 00 00 47 00 65 00 6d 00 70 00 6c .......G.e.m.p.l 0140 00 75 00 73 00 20 00 47 00 65 00 6d 00 50 00 43 .u.s. .G.e.m.P.C 0150 00 20 00 54 00 77 00 69 00 6e 00 20 00 30 00 30 . .T.w.i.n. .0.0 0160 00 20 00 30 00 30 00 00 00 00 00 . .0.0..... xrdp-0.10.1/sesman/chansrv/pcsc/dumps/scard-disconnect.txt000644 001751 000000 00000002610 14652432047 023632 0ustar00metawheel000000 000000 TS_SCardDisconnect: 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 0010 00 00 00 87 b4 3a 7f a4 2a 6d ad 70 00 00 00 03 .....:..*m.p.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 0040 00 00 00 b8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 0080 00 00 00 03 00 00 00 04 00 00 00 04 00 00 00 00 ................ 0090 00 00 00 ... TS_SCardDisconnect: 0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........ 0010 00 00 00 72 7f fb 24 4e b1 36 c8 70 00 00 00 03 ...r..$N.6.p.... 0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI......... 0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8 0040 00 00 00 b8 00 09 00 00 00 00 00 00 00 00 00 00 ................ 0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................ 0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............ 0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................ 0080 00 00 00 04 00 00 00 04 00 00 00 05 00 00 00 00 ................ 0090 00 00 00 ... xrdp-0.10.1/sesman/tools/authtest.c000644 001751 000000 00000021354 14652432047 017275 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file authtest.c * @brief An utility to test the compiled-in authentication module * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "log.h" #include "sesman_auth.h" #include "os_calls.h" #include "string_calls.h" // cppcheck doesn't always set this macro to something in double-quotes #if defined(__cppcheck__) #undef PACKAGE_VERSION #endif #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" #endif #ifndef MAX_PASSWORD_LEN # define MAX_PASSWORD_LEN 512 #endif /** * Parameters needed to call the auth module */ struct authmod_params { const char *username; char password[MAX_PASSWORD_LEN + 1]; const char *command; int start_session; }; /**************************************************************************//** * Prints a brief summary of options and defaults */ static void usage(void) { g_printf("xrdp auth module tester v" PACKAGE_VERSION "\n"); g_printf("\n" "Calls functions in the compiled-in auth module, so that the\n" "module can be checked simply for functionality, memory leaks,\n" "etc.\n\n" "This is a DEVELOPER-ONLY tool\n"); g_printf("\nusage:\n"); g_printf("authtest [options] [username]\n\n"); g_printf("options:\n"); g_printf(" -p \n" " -F Read password from this file descriptor\n" " -c Start a session and run the\n" " specified non-interactive command\n" " in it\n"); g_printf("\nIf username is omitted, the current user is used, and.\n" "a UDS login is attempted\n" "If username is provided, password is needed.\n" " Password is prompted for if -p or -F are not specified\n"); } /**************************************************************************//** * Read a password from a file descriptor * * @param fd_str string representing file descriptor * @param sp Authmod parameter structure for resulting password * @return !=0 for success */ static int read_password_from_fd(const char *fd_str, struct authmod_params *amp) { int result = 0; int s = g_file_read(atoi(fd_str), amp->password, sizeof (amp->password) - 1); if (s < 0) { LOG(LOG_LEVEL_ERROR, "Can't read password from fd %s - %s", fd_str, g_get_strerror()); amp->password[0] = '\0'; } else { amp->password[s] = '\0'; if (s > 0 && amp->password[s - 1] == '\n') { amp->password[s - 1] = '\0'; } result = 1; } return result; } /**************************************************************************//** * Parses the program args * * @param argc Passed to main * @param @argv Passed to main * @param amp Authmod parameter structure for resulting values * @return !=0 for success */ static int parse_program_args(int argc, char *argv[], struct authmod_params *amp) { int params_ok = 1; int opt; bool_t password_set = 0; amp->username = NULL; amp->password[0] = '\0'; amp->start_session = 0; amp->command = NULL; while ((opt = getopt(argc, argv, "c:p:F:")) != -1) { switch (opt) { case 'c': if (amp->command) { LOG(LOG_LEVEL_WARNING, "Ignoring multiple '%c' options", (char)opt); } else { amp->command = optarg; } break; case 'p': if (password_set) { LOG(LOG_LEVEL_WARNING, "Ignoring option '%c' - password already set ", (char)opt); } else { g_strncpy(amp->password, optarg, sizeof(amp->password) - 1); password_set = 1; } break; case 'F': if (password_set) { LOG(LOG_LEVEL_WARNING, "Ignoring option '%c' - password already set ", (char)opt); } else { if (read_password_from_fd(optarg, amp)) { password_set = 1; } else { params_ok = 0; } } break; default: LOG(LOG_LEVEL_ERROR, "Unrecognised switch '%c'", (char)opt); params_ok = 0; } } if (argc == optind) { // No username was specified if (password_set) { LOG(LOG_LEVEL_WARNING, "No username - ignoring specified password"); amp->password[0] = '\0'; } amp->username = NULL; } else if ((argc - optind) > 1) { LOG(LOG_LEVEL_ERROR, "Unexpected arguments after username"); params_ok = 0; } else { amp->username = argv[optind]; if (!password_set) { const char *p = getpass("Password: "); if (p == NULL) { params_ok = 0; } else { g_snprintf(amp->password, sizeof(amp->password), "%s", p); } } } return params_ok; } /******************************************************************************/ /** * Gets the current username for a UDS login * * Result must be freed after use. */ static char * get_username() { int uid = g_getuid(); char *this_user; int status; status = g_getuser_info_by_uid(uid, &this_user, NULL, NULL, NULL, NULL); if (status != 0) { LOG(LOG_LEVEL_ERROR, "Can't map UID %d to a username", uid); this_user = NULL; } else { LOG(LOG_LEVEL_INFO, "Mapped current UID %d to \"%s\"", uid, this_user); } return this_user; } /******************************************************************************/ int main(int argc, char **argv) { struct log_config *logging; int rv = 0; char *this_user = NULL; struct authmod_params amp; logging = log_config_init_for_console(LOG_LEVEL_DEBUG, g_getenv("AUTHTEST_LOG_LEVEL")); log_start_from_param(logging); log_config_free(logging); if (!parse_program_args(argc, argv, &)) { usage(); rv = 1; } else if (amp.username == NULL && (this_user = get_username()) == NULL) { rv = 1; } else { struct auth_info *auth_info; enum scp_login_status errorcode; char errstr[64]; if (amp.username == NULL) { auth_info = auth_uds(this_user, &errorcode); } else { auth_info = auth_userpass(amp.username, amp.password, NULL, &errorcode); } scp_login_status_to_str(errorcode, errstr, sizeof(errstr)); LOG(LOG_LEVEL_INFO, "auth_userpass() returned %s, errorcode=%d [%s]", (auth_info == NULL) ? "NULL" : "non-NULL", (int)errorcode, errstr); rv = (int)errorcode; if (auth_info && rv == 0 && amp.command != NULL) { int display = 10; rv = auth_start_session(auth_info, display); LOG(LOG_LEVEL_INFO, "auth_start_session(,%d) returned %d", display, rv); if (rv == 0) { rv = g_system(amp.command); LOG(LOG_LEVEL_INFO, "command \"%s\" returned %d", amp.command, rv); } } if (auth_info != NULL) { int rv2 = auth_end(auth_info); LOG(LOG_LEVEL_INFO, "auth_end() returned %d", rv2); rv = (rv == 0) ? rv2 : rv; } } g_free(this_user); log_end(); return rv; } xrdp-0.10.1/sesman/tools/Makefile.in000644 001751 000000 00000062056 14652432075 017342 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xrdp-sesrun$(EXEEXT) xrdp-sesadmin$(EXEEXT) \ xrdp-dis$(EXEEXT) noinst_PROGRAMS = xrdp-authtest$(EXEEXT) xrdp-xcon$(EXEEXT) subdir = sesman/tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_xrdp_authtest_OBJECTS = authtest.$(OBJEXT) xrdp_authtest_OBJECTS = $(am_xrdp_authtest_OBJECTS) am__DEPENDENCIES_1 = xrdp_authtest_DEPENDENCIES = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_xrdp_dis_OBJECTS = dis.$(OBJEXT) xrdp_dis_OBJECTS = $(am_xrdp_dis_OBJECTS) xrdp_dis_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_xrdp_sesadmin_OBJECTS = sesadmin.$(OBJEXT) tools_common.$(OBJEXT) xrdp_sesadmin_OBJECTS = $(am_xrdp_sesadmin_OBJECTS) xrdp_sesadmin_DEPENDENCIES = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la am_xrdp_sesrun_OBJECTS = sesrun.$(OBJEXT) tools_common.$(OBJEXT) xrdp_sesrun_OBJECTS = $(am_xrdp_sesrun_OBJECTS) xrdp_sesrun_DEPENDENCIES = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la am_xrdp_xcon_OBJECTS = xcon.$(OBJEXT) xrdp_xcon_OBJECTS = $(am_xrdp_xcon_OBJECTS) xrdp_xcon_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) xrdp_xcon_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xrdp_xcon_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/authtest.Po ./$(DEPDIR)/dis.Po \ ./$(DEPDIR)/sesadmin.Po ./$(DEPDIR)/sesrun.Po \ ./$(DEPDIR)/tools_common.Po ./$(DEPDIR)/xcon.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_authtest_SOURCES) $(xrdp_dis_SOURCES) \ $(xrdp_sesadmin_SOURCES) $(xrdp_sesrun_SOURCES) \ $(xrdp_xcon_SOURCES) DIST_SOURCES = $(xrdp_authtest_SOURCES) $(xrdp_dis_SOURCES) \ $(xrdp_sesadmin_SOURCES) $(xrdp_sesrun_SOURCES) \ $(xrdp_xcon_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libipm AM_CFLAGS = $(X_CFLAGS) xrdp_sesrun_SOURCES = \ sesrun.c \ tools_common.h \ tools_common.c xrdp_sesadmin_SOURCES = \ sesadmin.c \ tools_common.h \ tools_common.c xrdp_dis_SOURCES = \ dis.c xrdp_dis_LDADD = \ $(top_builddir)/common/libcommon.la xrdp_xcon_SOURCES = \ xcon.c xrdp_authtest_SOURCES = \ authtest.c xrdp_sesrun_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la xrdp_sesadmin_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la xrdp_xcon_LDFLAGS = \ $(X_LIBS) xrdp_xcon_LDADD = \ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) xrdp_authtest_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(AUTHMOD_LIB) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sesman/tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign sesman/tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) xrdp-authtest$(EXEEXT): $(xrdp_authtest_OBJECTS) $(xrdp_authtest_DEPENDENCIES) $(EXTRA_xrdp_authtest_DEPENDENCIES) @rm -f xrdp-authtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_authtest_OBJECTS) $(xrdp_authtest_LDADD) $(LIBS) xrdp-dis$(EXEEXT): $(xrdp_dis_OBJECTS) $(xrdp_dis_DEPENDENCIES) $(EXTRA_xrdp_dis_DEPENDENCIES) @rm -f xrdp-dis$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_dis_OBJECTS) $(xrdp_dis_LDADD) $(LIBS) xrdp-sesadmin$(EXEEXT): $(xrdp_sesadmin_OBJECTS) $(xrdp_sesadmin_DEPENDENCIES) $(EXTRA_xrdp_sesadmin_DEPENDENCIES) @rm -f xrdp-sesadmin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_sesadmin_OBJECTS) $(xrdp_sesadmin_LDADD) $(LIBS) xrdp-sesrun$(EXEEXT): $(xrdp_sesrun_OBJECTS) $(xrdp_sesrun_DEPENDENCIES) $(EXTRA_xrdp_sesrun_DEPENDENCIES) @rm -f xrdp-sesrun$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_sesrun_OBJECTS) $(xrdp_sesrun_LDADD) $(LIBS) xrdp-xcon$(EXEEXT): $(xrdp_xcon_OBJECTS) $(xrdp_xcon_DEPENDENCIES) $(EXTRA_xrdp_xcon_DEPENDENCIES) @rm -f xrdp-xcon$(EXEEXT) $(AM_V_CCLD)$(xrdp_xcon_LINK) $(xrdp_xcon_OBJECTS) $(xrdp_xcon_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authtest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesadmin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesrun.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools_common.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcon.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/authtest.Po -rm -f ./$(DEPDIR)/dis.Po -rm -f ./$(DEPDIR)/sesadmin.Po -rm -f ./$(DEPDIR)/sesrun.Po -rm -f ./$(DEPDIR)/tools_common.Po -rm -f ./$(DEPDIR)/xcon.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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 ./$(DEPDIR)/authtest.Po -rm -f ./$(DEPDIR)/dis.Po -rm -f ./$(DEPDIR)/sesadmin.Po -rm -f ./$(DEPDIR)/sesrun.Po -rm -f ./$(DEPDIR)/tools_common.Po -rm -f ./$(DEPDIR)/xcon.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/sesman/tools/dis.c000644 001751 000000 00000004061 14652432047 016207 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include "xrdp_sockets.h" #include "os_calls.h" #include "string_calls.h" int main(int argc, char **argv) { int sck; int dis; struct sockaddr_un sa; size_t len; char *display; if (argc != 1) { printf("xrdp disconnect utility\n"); printf("run with no parameters to disconnect you xrdp session\n"); return 0; } display = getenv("DISPLAY"); if (display == 0) { printf("display not set\n"); return 1; } dis = g_get_display_num_from_display(display); if (dis < 0) { printf("Can't parse DISPLAY='%s'\n", display); return 1; } memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_UNIX; sprintf(sa.sun_path, XRDP_DISCONNECT_STR, g_getuid(), dis); if (access(sa.sun_path, F_OK) != 0) { printf("not in an xrdp session\n"); return 1; } if ((sck = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) { printf("socket open error\n"); return 1; } len = sizeof(sa); if (sendto(sck, "sig", 4, 0, (struct sockaddr *)&sa, len) > 0) { printf("message sent ok\n"); } else { printf("message send failed: %s\n", strerror(errno)); } return 0; } xrdp-0.10.1/sesman/tools/Makefile.am000644 001751 000000 00000002265 14652432047 017324 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libipm AM_CFLAGS = $(X_CFLAGS) bin_PROGRAMS = \ xrdp-sesrun \ xrdp-sesadmin \ xrdp-dis noinst_PROGRAMS = \ xrdp-authtest \ xrdp-xcon xrdp_sesrun_SOURCES = \ sesrun.c \ tools_common.h \ tools_common.c xrdp_sesadmin_SOURCES = \ sesadmin.c \ tools_common.h \ tools_common.c xrdp_dis_SOURCES = \ dis.c xrdp_dis_LDADD = \ $(top_builddir)/common/libcommon.la xrdp_xcon_SOURCES = \ xcon.c xrdp_authtest_SOURCES = \ authtest.c xrdp_sesrun_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la xrdp_sesadmin_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la xrdp_xcon_LDFLAGS = \ $(X_LIBS) xrdp_xcon_LDADD = \ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) xrdp_authtest_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/common/libcommon.la \ $(top_builddir)/libipm/libipm.la \ $(AUTHMOD_LIB) xrdp-0.10.1/sesman/tools/xcon.c000644 001751 000000 00000003001 14652432047 016370 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include Display *g_display = 0; int g_x_socket = 0; int main(int argc, char **argv) { int i1; XEvent xevent; g_display = XOpenDisplay(0); if (g_display == 0) { printf("XOpenDisplay failed\n"); return 0; } g_x_socket = XConnectionNumber(g_display); while (1) { struct pollfd pollfd; pollfd.fd = g_x_socket; pollfd.events = POLLIN; pollfd.revents = 0; do { i1 = poll(&pollfd, 1, -1); } while (i1 < 0 && errno == EINTR); if (i1 < 0) { break; } XNextEvent(g_display, &xevent); } return 0; } xrdp-0.10.1/sesman/tools/sesrun.c000644 001751 000000 00000040163 14652432047 016752 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesrun.c * @brief An utility to start a session * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include "parse.h" #include "trans.h" #include "os_calls.h" #include "sesman_config.h" #include "log.h" #include "string_calls.h" #include "guid.h" #include "tools_common.h" // cppcheck doesn't always set this macro to something in double-quotes #if defined(__cppcheck__) #undef PACKAGE_VERSION #endif #if !defined(PACKAGE_VERSION) #define PACKAGE_VERSION "???" #endif #ifndef MAX_PASSWORD_LEN # define MAX_PASSWORD_LEN 512 #endif #ifndef DEFAULT_WIDTH # define DEFAULT_WIDTH 1280 #endif #ifndef DEFAULT_HEIGHT # define DEFAULT_HEIGHT 1024 #endif /* Default setting used by Windows 10 mstsc.exe */ #ifndef DEFAULT_BPP # define DEFAULT_BPP 32 #endif #ifndef DEFAULT_SESSION_TYPE # define DEFAULT_SESSION_TYPE "Xorg" #endif /** * Maps session type strings session type codes */ static struct { const char *name; enum scp_session_type type; } type_map[] = { { "Xvnc", SCP_SESSION_TYPE_XVNC}, { "Xorg", SCP_SESSION_TYPE_XORG}, { NULL, (enum scp_session_type) - 1} }; /** * Parameters needed for a session */ struct session_params { int width; int height; int bpp; enum scp_session_type session_type; const char *directory; const char *shell; const char *ip_addr; const char *username; char password[MAX_PASSWORD_LEN + 1]; }; /**************************************************************************//** * Maps a string to a session type value * * @param string session type string * @param[out] value session type value * @return 0 for success or != 0 if not found */ static int string_to_session_type(const char *t, enum scp_session_type *value) { unsigned int i; for (i = 0 ; type_map[i].name != NULL; ++i) { if (g_strcasecmp(type_map[i].name, t) == 0) { *value = type_map[i].type; return 0; } } return 1; } /**************************************************************************//** * Returns a list of supported session types * * Caller supplies a buffer. Buffer handling and buffer overflow detection are * the same as snprint() * * @param buff area for result * @param bufflen Size of result * @return number of characters for the output string */ static unsigned int get_session_type_list(char *buff, unsigned int bufflen) { unsigned int i; unsigned int ret = 0; const char *sep = ""; for (i = 0 ; type_map[i].name != NULL; ++i) { if (ret < bufflen) { ret += g_snprintf(buff + ret, bufflen - ret, "%s%s", sep, type_map[i].name); sep = ", "; } } return ret; } /**************************************************************************//** * Prints a brief summary of options and defaults */ static void usage(void) { char sesstype_list[64]; (void)get_session_type_list(sesstype_list, sizeof(sesstype_list)); g_printf("xrdp session starter v" PACKAGE_VERSION "\n"); g_printf("\nusage:\n"); g_printf("sesrun --help\n" "\nor\n" "sesrun [options] [username]\n\n"); g_printf("options:\n"); g_printf(" -g Default:%dx%d\n", DEFAULT_WIDTH, DEFAULT_HEIGHT); g_printf(" -b Default:%d\n", DEFAULT_BPP); g_printf(" -t Default:%s\n", DEFAULT_SESSION_TYPE); g_printf(" -D Default: $HOME\n" " -S Default: Defined window manager\n" " -p TESTING ONLY - DO NOT USE IN PRODUCTION\n" " -F Read password from this file descriptor\n" " -c Alternative sesman.ini file\n"); g_printf("\nSupported types are %s\n", sesstype_list); g_printf("\nIf username is omitted, the current user is used.\n" "If username is provided, password is needed.\n" " Password is prompted for if -p or -F are not specified\n"); } /**************************************************************************//** * Parses a string x * * @param geom_str Input string * @param sp Session parameter structure for resulting width and height * @return !=0 for success */ static int parse_geometry_string(const char *geom_str, struct session_params *sp) { int result = 0; unsigned int sep_count = 0; /* Count of 'x' separators */ unsigned int other_count = 0; /* Count of non-digits and non separators */ const char *sepp = NULL; /* Pointer to the 'x' */ const char *p = geom_str; while (*p != '\0') { if (!isdigit(*p)) { if (*p == 'x' || *p == 'X') { ++sep_count; sepp = p; } else { ++other_count; } } ++p; } if (sep_count != 1 || other_count > 0 || sepp == geom_str || /* Separator at start of string */ sepp == (p - 1) ) /* Separator at end of string */ { LOG(LOG_LEVEL_ERROR, "Invalid geometry string '%s'", geom_str); } else { sp->width = atoi(geom_str); sp->height = atoi(sepp + 1); result = 1; } return result; } /**************************************************************************//** * Read a password from a file descriptor * * @param fd_str string representing file descriptor * @param sp Session parameter structure for resulting password * @return !=0 for success */ static int read_password_from_fd(const char *fd_str, struct session_params *sp) { int result = 0; int s = g_file_read(atoi(fd_str), sp->password, sizeof (sp->password) - 1); if (s < 0) { LOG(LOG_LEVEL_ERROR, "Can't read password from fd %s - %s", fd_str, g_get_strerror()); sp->password[0] = '\0'; } else { sp->password[s] = '\0'; if (s > 0 && sp->password[s - 1] == '\n') { sp->password[s - 1] = '\0'; } result = 1; } return result; } /**************************************************************************//** * Parses the program args * * @param argc Passed to main * @param @argv Passed to main * @param sp Session parameter structure for resulting values * @param sesman_ini Pointer to an alternative config file if one is specified * @return !=0 for success */ static int parse_program_args(int argc, char *argv[], struct session_params *sp, const char **sesman_ini) { int params_ok = 1; int opt; bool_t password_set = 0; sp->width = DEFAULT_WIDTH; sp->height = DEFAULT_HEIGHT; sp->bpp = DEFAULT_BPP; (void)string_to_session_type(DEFAULT_SESSION_TYPE, &sp->session_type); sp->directory = ""; sp->shell = ""; sp->ip_addr = ""; sp->username = NULL; sp->password[0] = '\0'; while ((opt = getopt(argc, argv, "g:b:s:t:D:S:p:F:c:")) != -1) { switch (opt) { case 'g': if (!parse_geometry_string(optarg, sp)) { params_ok = 0; } break; case 'b': sp->bpp = atoi(optarg); break; case 't': if (string_to_session_type(optarg, &sp->session_type) != 0) { LOG(LOG_LEVEL_ERROR, "Unrecognised session type '%s'", optarg); params_ok = 0; } break; case 'D': sp->directory = optarg; break; case 'S': sp->shell = optarg; break; case 'p': if (password_set) { LOG(LOG_LEVEL_WARNING, "Ignoring option '%c' - password already set ", (char)opt); } else { g_strncpy(sp->password, optarg, sizeof(sp->password) - 1); password_set = 1; } break; case 'F': if (password_set) { LOG(LOG_LEVEL_WARNING, "Ignoring option '%c' - password already set ", (char)opt); } else { if (read_password_from_fd(optarg, sp)) { password_set = 1; } else { params_ok = 0; } } break; case 'c': *sesman_ini = optarg; break; default: LOG(LOG_LEVEL_ERROR, "Unrecognised switch '%c'", (char)opt); params_ok = 0; } } if (argc == optind) { // No username was specified if (password_set) { LOG(LOG_LEVEL_WARNING, "No username - ignoring specified password"); sp->password[0] = '\0'; } sp->username = NULL; } else if ((argc - optind) > 1) { LOG(LOG_LEVEL_ERROR, "Unexpected arguments after username"); params_ok = 0; } else if (params_ok) { // A username is specified sp->username = argv[optind]; if (!password_set) { const char *p = getpass("Password: "); if (p == NULL) { params_ok = 0; } else { g_snprintf(sp->password, sizeof(sp->password), "%s", p); } } } return params_ok; } /**************************************************************************//** * Sends an SCP login request * * A sys login request (i.e. username / password) is used if a username * is specified. Otherwise we use a uds login request for the current user. * * @param t SCP connection * @param sp Data for request */ static int send_login_request(struct trans *t, const struct session_params *sp) { int rv; LOG(LOG_LEVEL_DEBUG, "ip_addr:\"%s\"", sp->ip_addr); if (sp->username != NULL) { /* Only log the password in development builds */ LOG_DEVEL(LOG_LEVEL_DEBUG, "password:\"%s\"", sp->password); rv = scp_send_sys_login_request(t, sp->username, sp->password, sp->ip_addr); } else { rv = scp_send_uds_login_request(t); } return rv; } /**************************************************************************//** * Receives an SCP login response * * @param t SCP transport to receive reply on * @param[out] server_closed != 0 if server has gone away * @return 0 for successful authentication */ static int handle_login_response(struct trans *t, int *server_closed) { enum scp_login_status login_result; int rv = wait_for_sesman_reply(t, E_SCP_LOGIN_RESPONSE); if (rv != 0) { *server_closed = 1; } else { rv = scp_get_login_response(t, &login_result, server_closed, NULL); if (rv == 0) { if (login_result != E_SCP_LOGIN_OK) { char msg[256]; scp_login_status_to_str(login_result, msg, sizeof(msg)); g_printf("Login failed; %s\n", msg); rv = 1; } } scp_msg_in_reset(t); // Done with this message } return rv; } /**************************************************************************//** * Sends an SCP create session request * * @param t SCP connection * @param sp Data for request */ static int send_create_session_request(struct trans *t, const struct session_params *sp) { LOG(LOG_LEVEL_DEBUG, "width:%d height:%d bpp:%d code:%d\n" "directory:\"%s\" shell:\"%s\"", sp->width, sp->height, sp->bpp, sp->session_type, sp->directory, sp->shell); return scp_send_create_session_request( t, sp->session_type, sp->width, sp->height, sp->bpp, sp->shell, sp->directory); } /**************************************************************************//** * Receives an SCP create session response * * @param t SCP transport to receive reply on * @return 0 for success */ static int handle_create_session_response(struct trans *t) { enum scp_screate_status status; int display; struct guid guid; int rv = wait_for_sesman_reply(t, E_SCP_CREATE_SESSION_RESPONSE); if (rv == 0) { rv = scp_get_create_session_response(t, &status, &display, &guid); if (rv == 0) { if (status != E_SCP_SCREATE_OK) { char msg[256]; scp_screate_status_to_str(status, msg, sizeof(msg)); g_printf("Connection failed; %s\n", msg); rv = 1; } else { char guid_str[GUID_STR_SIZE]; g_printf("ok display=:%d GUID=%s\n", display, guid_to_str(&guid, guid_str)); } } scp_msg_in_reset(t); // Done with this message } return rv; } /******************************************************************************/ int main(int argc, char **argv) { const char *sesman_ini = XRDP_CFG_PATH "/sesman.ini"; struct config_sesman *cfg = NULL; struct trans *t = NULL; struct session_params sp; struct log_config *logging; int rv = 1; logging = log_config_init_for_console(LOG_LEVEL_WARNING, g_getenv("SESRUN_LOG_LEVEL")); log_start_from_param(logging); log_config_free(logging); if (argc == 2 && g_strcmp(argv[1], "--help") == 0) { usage(); rv = 0; } else if (!parse_program_args(argc, argv, &sp, &sesman_ini)) { usage(); } else if ((cfg = config_read(sesman_ini)) == NULL) { LOG(LOG_LEVEL_ERROR, "error reading config file %s : %s", sesman_ini, g_get_strerror()); } else if (!(t = scp_connect(cfg->listen_port, "xrdp-sesrun", NULL))) { LOG(LOG_LEVEL_ERROR, "connect error - %s", g_get_strerror()); } else { int server_closed = 0; while (!server_closed) { rv = send_login_request(t, &sp); if (rv != 0) { LOG(LOG_LEVEL_ERROR, "Error sending login request to sesman"); break; } rv = handle_login_response(t, &server_closed); if (rv == 0) { break; /* Successful authentication */ } if (!server_closed) { const char *p = getpass("Password: "); if (p == NULL) { break; } g_snprintf(sp.password, sizeof(sp.password), "%s", p); } } if (rv == 0) { if ((rv = send_create_session_request(t, &sp)) == 0) { rv = handle_create_session_response(t); } } trans_delete(t); } g_memset(sp.password, '\0', sizeof(sp.password)); config_free(cfg); log_end(); return rv; } xrdp-0.10.1/sesman/tools/tools_common.c000644 001751 000000 00000003332 14652432047 020140 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file tools_common.c * @brief Common definitions for the tools utilities * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "trans.h" #include "os_calls.h" #include "scp.h" /*****************************************************************************/ int wait_for_sesman_reply(struct trans *t, enum scp_msg_code wait_msgno) { int rv = 0; int available = 0; while (rv == 0 && !available) { if ((rv = scp_msg_in_wait_available(t)) != 0) { LOG(LOG_LEVEL_ERROR, "Error waiting on sesman transport"); } else { enum scp_msg_code reply_msgno = scp_msg_in_get_msgno(t); available = 1; if (reply_msgno != wait_msgno) { char buff[64]; scp_msgno_to_str(reply_msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_WARNING, "Ignoring unexpected message %s", buff); scp_msg_in_reset(t); available = 0; } } } return rv; } xrdp-0.10.1/sesman/tools/sesadmin.c000644 001751 000000 00000013516 14652432047 017240 0ustar00metawheel000000 000000 /* * sesadmin.c - an sesman administration tool * (c) 2008 Simone Fedele * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "trans.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" #include "tools_common.h" #include #include char cmnd[257]; char port[257]; static int cmndList(struct trans *t); static int cmndKill(struct trans *t); static void cmndHelp(void); int main(int argc, char **argv) { struct trans *t; //int end; int idx; //int sel; struct log_config *logging; int rv = 1; cmnd[0] = '\0'; port[0] = '\0'; logging = log_config_init_for_console(LOG_LEVEL_INFO, NULL); log_start_from_param(logging); log_config_free(logging); for (idx = 0; idx < argc; idx++) { if (0 == g_strncmp(argv[idx], "-u=", 3)) { g_printf("** Ignoring unused argument '-u'"); } else if (0 == g_strncmp(argv[idx], "-p=", 3)) { g_printf("** Ignoring unused argument '-p'"); } else if (0 == g_strncmp(argv[idx], "-i=", 3)) { g_strncpy(port, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-c=", 3)) { g_strncpy(cmnd, (argv[idx]) + 3, 256); } } if (0 == g_strncmp(cmnd, "", 1)) { cmndHelp(); return 0; } t = scp_connect(port, "xrdp-sesadmin", NULL); if (t == NULL) { LOG(LOG_LEVEL_ERROR, "scp_connect() error"); } else { enum scp_login_status login_result; /* Log in as the current user */ if ((rv = scp_send_uds_login_request(t)) == 0 && (rv = wait_for_sesman_reply(t, E_SCP_LOGIN_RESPONSE)) == 0) { rv = scp_get_login_response(t, &login_result, NULL, NULL); if (rv == 0) { if (login_result != E_SCP_LOGIN_OK) { char msg[256]; scp_login_status_to_str(login_result, msg, sizeof(msg)); g_printf("Login failed; %s\n", msg); rv = 1; } } scp_msg_in_reset(t); // Done with this message } } if (rv == 0) { if (0 == g_strncmp(cmnd, "list", 5)) { rv = cmndList(t); } else if (0 == g_strncmp(cmnd, "kill:", 5)) { rv = cmndKill(t); } } if (rv == 0) { rv = scp_send_close_connection_request(t); } trans_delete(t); log_end(); return rv; } static void cmndHelp(void) { fprintf(stderr, "sesadmin - a console sesman administration tool\n"); fprintf(stderr, "syntax: sesadmin [] COMMAND [OPTIONS]\n\n"); fprintf(stderr, "-i= : sesman port (can be defaulted)\n"); fprintf(stderr, "-c= : command to execute on the server [MANDATORY]\n"); fprintf(stderr, " it can be one of those:\n"); fprintf(stderr, " list\n"); fprintf(stderr, " kill:\n"); } static void print_session(const struct scp_session_info *s) { char *username; const char *uptr; g_getuser_info_by_uid(s->uid, &username, NULL, NULL, NULL, NULL); uptr = (username == NULL) ? "" : username; printf("Session ID: %d\n", s->sid); printf("\tDisplay: :%u\n", s->display); printf("\tUser: %s\n", uptr); printf("\tSession type: %s\n", SCP_SESSION_TYPE_TO_STR(s->type)); printf("\tScreen size: %dx%d, color depth %d\n", s->width, s->height, s->bpp); printf("\tStarted: %s", ctime(&s->start_time)); if (s->start_ip_addr[0] != '\0') { printf("\tStart IP address: %s\n", s->start_ip_addr); } g_free(username); } static int cmndList(struct trans *t) { struct list *sessions = list_create(); int end_of_list = 0; enum scp_list_sessions_status status; struct scp_session_info *p; int rv = scp_send_list_sessions_request(t); sessions->auto_free = 1; while (rv == 0 && !end_of_list) { rv = wait_for_sesman_reply(t, E_SCP_LIST_SESSIONS_RESPONSE); if (rv != 0) { break; } rv = scp_get_list_sessions_response(t, &status, &p); if (rv != 0) { break; } switch (status) { case E_SCP_LS_SESSION_INFO: list_add_item(sessions, (tintptr)p); break; case E_SCP_LS_END_OF_LIST: end_of_list = 1; break; default: printf("Unexpected return code %d\n", status); rv = 1; } scp_msg_in_reset(t); } if (rv == 0) { if (sessions->count == 0) { printf("No sessions.\n"); } else { int i; for (i = 0 ; i < sessions->count; ++i) { print_session((struct scp_session_info *)sessions->items[i]); } } } list_delete(sessions); return rv; } static int cmndKill(struct trans *t) { fprintf(stderr, "not yet implemented\n"); return 1; } xrdp-0.10.1/sesman/tools/tools_common.h000644 001751 000000 00000002436 14652432047 020151 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2022 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file tools_common.c * @brief Common definitions for the tools utilities * @author Matt Burt * */ #if !defined(TOOLS_COMMON_H) #define TOOLS_COMMON_H #include "scp.h" struct trans; /**************************************************************************//** * Waits for an expected reply from sesman * * Any other incoming messages are ignored. * * Following this call, the message can be parsed in the usual way. * * @param t SCP transport * @param wait_msgno Code of the message we're waiting for. * @result 0 for success */ int wait_for_sesman_reply(struct trans *t, enum scp_msg_code wait_msgno); #endif /* TOOLS_COMMON_H */ xrdp-0.10.1/sesman/libsesman/verify_user_pam.c000644 001751 000000 00000035043 14652432047 021450 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file verify_user_pam.c * @brief Authenticate user using pam * @author Jay Sorg * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include "log.h" #include "string_calls.h" #include "sesman_auth.h" #include #include /* Allows the conversation function to find required items */ struct conv_func_data { const char *pass; }; struct auth_info { int session_opened; int did_setcred; pam_handle_t *ph; }; /***************************************************************************//** * Returns a string representing a pam_conv message style * * @param msg_style PAM msg_style (pam_conv(3)) * @param buff Buffer for conversion of unrecognised values * @param bufflen Total length of above * * The buffer described by buff is only written to if required. */ static const char * msg_style_to_str(int msg_style, char *buff, unsigned int bufflen) { const char *result; switch (msg_style) { case PAM_PROMPT_ECHO_OFF: result = "PAM_PROMPT_ECHO_OFF"; break; case PAM_PROMPT_ECHO_ON: result = "PAM_PROMPT_ECHO_ON"; break; case PAM_ERROR_MSG: result = "PAM_ERROR_MSG"; break; case PAM_TEXT_INFO: result = "PAM_TEXT_INFO"; break; default: g_snprintf(buff, bufflen, "UNKNOWN_0x%x", msg_style); result = buff; } return result; } /***************************************************************************//** * Provides the PAM conversation callback function * * At present, the main purpose of this function is to supply the * user's password to the PAM stack, although some module logging is * implemented here. * * @param[in] num_msg Count of messages in the msg array * @param[in] msg Messages from the PAM stack to the application * @param[out] resp Message replies from the application to the PAM stack * @param[in] appdata_ptr Used to pass in a struct conv_func_data pointer * * @result PAM_SUCCESS if the messages were all processed successfully. * * @post If PAM_SUCCESS is returned, resp and its contents are allocated here * and must be freed by the caller * @post If PAM_SUCCESS is not returned, resp is not allocated and must not * be not freed by the caller * * @note See pam_conv(3) for more information * @note A basic example conversation function can be found in OSF RFC 86.0 (1995) */ static int verify_pam_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) { int i; struct pam_response *reply = NULL; struct conv_func_data *conv_func_data; char sb[64]; int rv = PAM_SUCCESS; if (num_msg <= 0 || num_msg > PAM_MAX_NUM_MSG) { rv = PAM_CONV_ERR; } else if ((reply = g_new0(struct pam_response, num_msg)) == NULL) { rv = PAM_BUF_ERR; } else { for (i = 0; i < num_msg && rv == PAM_SUCCESS; i++) { LOG_DEVEL(LOG_LEVEL_INFO, "Handling struct pam_message" " { style = %s, msg = \"%s\" }", msg_style_to_str(msg[i]->msg_style, sb, sizeof (sb)), msg[i]->msg == NULL ? "" : msg[i]->msg); switch (msg[i]->msg_style) { case PAM_PROMPT_ECHO_OFF: /* password */ conv_func_data = (struct conv_func_data *) appdata_ptr; /* Check this function isn't being called * later than we expected */ if (conv_func_data == NULL || conv_func_data->pass == NULL) { LOG(LOG_LEVEL_ERROR, "verify_pam_conv: Password unavailable"); reply[i].resp = g_strdup("????"); } else { reply[i].resp = g_strdup(conv_func_data->pass); } break; case PAM_ERROR_MSG: LOG(LOG_LEVEL_ERROR, "PAM: %s", msg[i]->msg); break; case PAM_TEXT_INFO: LOG(LOG_LEVEL_INFO, "PAM: %s", msg[i]->msg); break; default: { LOG(LOG_LEVEL_ERROR, "Unhandled message in verify_pam_conv" " { style = %s, msg = \"%s\" }", msg_style_to_str(msg[i]->msg_style, sb, sizeof (sb)), msg[i]->msg == NULL ? "" : msg[i]->msg); rv = PAM_CONV_ERR; } } } } if (rv == PAM_SUCCESS) { *resp = reply; } else if (reply != NULL) { for (i = 0; i < num_msg; i++) { if (reply[i].resp != NULL) { g_free(reply[i].resp); } } g_free(reply); } return rv; } /******************************************************************************/ static void get_service_name(char *service_name) { service_name[0] = 0; if (g_file_exist("/etc/pam.d/xrdp-sesman") || #ifdef __LINUX_PAM__ /* /usr/lib/pam.d is hardcoded into Linux-PAM */ g_file_exist("/usr/lib/pam.d/xrdp-sesman") || #endif #ifdef OPENPAM_VERSION /* /usr/local/etc/pam.d is hardcoded into OpenPAM */ g_file_exist("/usr/local/etc/pam.d/xrdp-sesman") || #endif g_file_exist(XRDP_PAMCONF_PATH "/xrdp-sesman")) { g_strncpy(service_name, "xrdp-sesman", 255); } else { g_strncpy(service_name, "gdm", 255); } } /******************************************************************************/ /** Performs PAM operations common to login methods * * @param auth_info Module auth_info structure * @param user User name * @param pass Password, if needed for authentication. * @param client_ip Client IP if known, or NULL * @param authentication_required True if user must be authenticated * * For a UDS connection, the user can be assumed to be authenticated, * so in this instance authentication_required can be false. * * @return Code describing the success of the operation */ static enum scp_login_status common_pam_login(struct auth_info *auth_info, const char *user, const char *pass, const char *client_ip, int authentication_required) { int perror; char service_name[256]; struct conv_func_data conv_func_data; struct pam_conv pamc; /* * Set up the data required by the conversation function, and the * structure which allows us to pass this to pam_start() */ conv_func_data.pass = (authentication_required) ? pass : NULL; pamc.conv = verify_pam_conv; pamc.appdata_ptr = (void *) &conv_func_data; get_service_name(service_name); perror = pam_start(service_name, user, &pamc, &(auth_info->ph)); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_start failed: %s", pam_strerror(auth_info->ph, perror)); pam_end(auth_info->ph, perror); return E_SCP_LOGIN_GENERAL_ERROR; } if (client_ip != NULL && client_ip[0] != '\0') { perror = pam_set_item(auth_info->ph, PAM_RHOST, client_ip); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item(PAM_RHOST) failed: %s", pam_strerror(auth_info->ph, perror)); } } perror = pam_set_item(auth_info->ph, PAM_TTY, service_name); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item(PAM_TTY) failed: %s", pam_strerror(auth_info->ph, perror)); } if (authentication_required) { perror = pam_authenticate(auth_info->ph, 0); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_authenticate failed: %s", pam_strerror(auth_info->ph, perror)); pam_end(auth_info->ph, perror); return E_SCP_LOGIN_NOT_AUTHENTICATED; } } /* From man page: The pam_acct_mgmt function is used to determine if the users account is valid. It checks for authentication token and account expiration and verifies access restrictions. It is typically called after the user has been authenticated. */ perror = pam_acct_mgmt(auth_info->ph, 0); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_acct_mgmt failed: %s", pam_strerror(auth_info->ph, perror)); pam_end(auth_info->ph, perror); return E_SCP_LOGIN_NOT_AUTHORIZED; } /* Set the appdata_ptr passed to the conversation function to * NULL, as the existing value is going out of scope */ pamc.appdata_ptr = NULL; perror = pam_set_item(auth_info->ph, PAM_CONV, &pamc); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item(PAM_CONV) failed: %s", pam_strerror(auth_info->ph, perror)); } return E_SCP_LOGIN_OK; } /******************************************************************************/ /* returns non-NULL for success * Detailed error code is in the errorcode variable */ struct auth_info * auth_userpass(const char *user, const char *pass, const char *client_ip, enum scp_login_status *errorcode) { struct auth_info *auth_info; enum scp_login_status status; auth_info = g_new0(struct auth_info, 1); if (auth_info == NULL) { status = E_SCP_LOGIN_NO_MEMORY; } else { status = common_pam_login(auth_info, user, pass, client_ip, 1); if (status != E_SCP_LOGIN_OK) { g_free(auth_info); auth_info = NULL; } } if (errorcode != NULL) { *errorcode = status; } return auth_info; } /******************************************************************************/ struct auth_info * auth_uds(const char *user, enum scp_login_status *errorcode) { struct auth_info *auth_info; enum scp_login_status status; auth_info = g_new0(struct auth_info, 1); if (auth_info == NULL) { status = E_SCP_LOGIN_NO_MEMORY; } else { status = common_pam_login(auth_info, user, NULL, NULL, 0); if (status != E_SCP_LOGIN_OK) { g_free(auth_info); auth_info = NULL; } } if (errorcode != NULL) { *errorcode = status; } return auth_info; } /******************************************************************************/ /* returns error */ static int auth_start_session_private(struct auth_info *auth_info, int display_num) { int error; char display[256]; g_sprintf(display, ":%d", display_num); error = pam_set_item(auth_info->ph, PAM_TTY, display); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item failed: %s", pam_strerror(auth_info->ph, error)); return 1; } error = pam_setcred(auth_info->ph, PAM_ESTABLISH_CRED); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_setcred failed: %s", pam_strerror(auth_info->ph, error)); return 1; } auth_info->did_setcred = 1; error = pam_open_session(auth_info->ph, 0); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_open_session failed: %s", pam_strerror(auth_info->ph, error)); return 1; } auth_info->session_opened = 1; return 0; } /******************************************************************************/ /** * Main routine to start a session * * Calls the private routine and logs an additional error if the private * routine fails */ int auth_start_session(struct auth_info *auth_info, int display_num) { int result = auth_start_session_private(auth_info, display_num); if (result != 0) { LOG(LOG_LEVEL_ERROR, "Can't start PAM session. See PAM logging for more info"); } return result; } /******************************************************************************/ /* returns error */ static int auth_stop_session(struct auth_info *auth_info) { int rv = 0; int error; if (auth_info->session_opened) { error = pam_close_session(auth_info->ph, 0); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_close_session failed: %s", pam_strerror(auth_info->ph, error)); rv = 1; } else { auth_info->session_opened = 0; } } if (auth_info->did_setcred) { pam_setcred(auth_info->ph, PAM_DELETE_CRED); auth_info->did_setcred = 0; } return rv; } /******************************************************************************/ /* returns error */ /* cleanup */ int auth_end(struct auth_info *auth_info) { if (auth_info != NULL) { if (auth_info->ph != 0) { auth_stop_session(auth_info); pam_end(auth_info->ph, PAM_SUCCESS); auth_info->ph = 0; } } g_free(auth_info); return 0; } /******************************************************************************/ /* returns error */ /* set any pam env vars */ int auth_set_env(struct auth_info *auth_info) { char **pam_envlist; char **pam_env; if (auth_info != NULL) { /* export PAM environment */ pam_envlist = pam_getenvlist(auth_info->ph); if (pam_envlist != NULL) { for (pam_env = pam_envlist; *pam_env != NULL; ++pam_env) { char *str = *pam_env; int eq_pos = g_pos(str, "="); if (eq_pos > 0) { str[eq_pos] = '\0'; g_setenv(str, str + eq_pos + 1, 1); } g_free(str); } g_free(pam_envlist); } } return 0; } xrdp-0.10.1/sesman/libsesman/verify_user_bsd.c000644 001751 000000 00000007430 14652432047 021442 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2005-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file verify_user_bsd.c * @brief Authenticate user using BSD password system * @author Renaud Allard * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "sesman_auth.h" #define _XOPEN_SOURCE #include #include #include #include #include #include #include #if defined(OpenBSD) #include #include #else /* * If OpenBSD isn't defined, add static definitions of OpenBSD-specific * functions. This won't work, but will let the compiler on other * systems check that all is correctly defined */ static int auth_userokay(char *name, char *style, char *type, char *password) { fprintf(stderr, "auth_userokay() not implmented on this platform!\n"); abort(); return 0; } #endif /* * Need a complete type for struct auth_info, even though we're * not really using it if this module (BSD authentication) is selected */ struct auth_info { char dummy; }; /******************************************************************************/ /* returns non-NULL for success */ struct auth_info * auth_userpass(const char *const_user, const char *const_pass, const char *client_ip, enum scp_login_status *errorcode) { /* Need a non-NULL pointer to return to indicate success */ static struct auth_info success = {0}; enum scp_login_status status; // auth_userokay is not const-correct. See usr.sbin/smtpd/smtpd.c in // the OpenBSD source tree for this workaround char user[LOGIN_NAME_MAX]; char pass[LINE_MAX]; char type[] = "auth-xrdp"; snprintf(user, sizeof(user), "%s", const_user); snprintf(pass, sizeof(pass), "%s", const_pass); if (auth_userokay(user, NULL, type, pass)) { status = E_SCP_LOGIN_OK; } else { status = E_SCP_LOGIN_NOT_AUTHENTICATED; } if (errorcode != NULL) { *errorcode = status; } return (status == E_SCP_LOGIN_OK) ? &success : NULL; } /******************************************************************************/ /* returns non-NULL for success */ struct auth_info * auth_uds(const char *user, enum scp_login_status *errorcode) { /* Need a non-NULL pointer to return to indicate success */ static struct auth_info success = {0}; if (errorcode != NULL) { *errorcode = E_SCP_LOGIN_OK; } return &success; } /******************************************************************************/ /* returns error */ int auth_start_session(struct auth_info *auth_info, int display_num) { return 0; } /******************************************************************************/ int auth_end(struct auth_info *auth_info) { return 0; } /******************************************************************************/ int auth_set_env(struct auth_info *auth_info) { return 0; } /******************************************************************************/ int auth_check_pwd_chg(const char *user) { return 0; } int auth_change_pwd(const char *user, const char *newpwd) { return 0; } int auth_stop_session(struct auth_info *auth_info) { return 0; } xrdp-0.10.1/sesman/libsesman/verify_user.c000644 001751 000000 00000021770 14652432047 020615 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file verify_user.c * @brief Authenticate user using standard unix passwd/shadow system * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "sesman_auth.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" #include #include #include #include #include #include #ifndef SECS_PER_DAY #define SECS_PER_DAY (24L*3600L) #endif static int auth_crypt_pwd(const char *pwd, const char *pln, char *crp); static int auth_account_disabled(struct spwd *stp); /* * Need a complete type for struct auth_info, even though we're * not really using it if this module (UNIX authentication) is selected */ struct auth_info { char dummy; }; /******************************************************************************/ /* returns non-NULL for success */ struct auth_info * auth_userpass(const char *user, const char *pass, const char *client_ip, enum scp_login_status *errorcode) { const char *encr = NULL; struct passwd *spw; /* Need a non-NULL pointer to return to indicate success */ static struct auth_info success = {0}; /* Most likely codepath return from here is 'not authenticated' */ enum scp_login_status status = E_SCP_LOGIN_NOT_AUTHENTICATED; /* Find the encrypted password */ if ((spw = getpwnam(user)) != NULL) { if (g_strncmp(spw->pw_passwd, "x", 3) == 0) { struct spwd *stp; /* the system is using shadow */ if ((stp = getspnam(user)) == NULL) { LOG(LOG_LEVEL_ERROR, "Can't get shadow entry for account %s", user); status = E_SCP_LOGIN_GENERAL_ERROR; } else { if (1 == auth_account_disabled(stp)) { LOG(LOG_LEVEL_INFO, "account %s is disabled", user); status = E_SCP_LOGIN_NOT_AUTHORIZED; } else { encr = stp->sp_pwdp; } } } else { /* old system with only passwd */ encr = spw->pw_passwd; } } if (encr != NULL) { const char *epass; if ((epass = crypt(pass, encr)) != NULL && g_strcmp(encr, epass) == 0) { status = E_SCP_LOGIN_OK; } } if (errorcode != NULL) { *errorcode = status; } return (status == E_SCP_LOGIN_OK) ? &success : NULL; } /******************************************************************************/ struct auth_info * auth_uds(const char *user, enum scp_login_status *errorcode) { struct passwd *spw; /* Need a non-NULL pointer to return to indicate success */ static struct auth_info success = {0}; enum scp_login_status status = E_SCP_LOGIN_OK; /* Try to check for a disabled account */ if ((spw = getpwnam(user)) != NULL) { if (g_strncmp(spw->pw_passwd, "x", 3) == 0) { struct spwd *stp; /* the system is using shadow */ if ((stp = getspnam(user)) == NULL) { LOG(LOG_LEVEL_ERROR, "Can't get shadow entry for account %s", user); status = E_SCP_LOGIN_GENERAL_ERROR; } else { if (1 == auth_account_disabled(stp)) { LOG(LOG_LEVEL_INFO, "account %s is disabled", user); status = E_SCP_LOGIN_NOT_AUTHORIZED; } } } } if (errorcode != NULL) { *errorcode = status; } return (status == E_SCP_LOGIN_OK) ? &success : NULL; } /******************************************************************************/ /* returns error */ int auth_start_session(struct auth_info *auth_info, int display_num) { return 0; } /******************************************************************************/ int auth_end(struct auth_info *auth_info) { return 0; } /******************************************************************************/ int auth_set_env(struct auth_info *auth_info) { return 0; } /******************************************************************************/ int auth_check_pwd_chg(const char *user) { struct passwd *spw; struct spwd *stp; int now; long today; spw = getpwnam(user); if (spw == 0) { return AUTH_PWD_CHG_ERROR; } if (g_strncmp(spw->pw_passwd, "x", 3) != 0) { /* old system with only passwd */ return AUTH_PWD_CHG_OK; } /* the system is using shadow */ stp = getspnam(user); if (stp == 0) { return AUTH_PWD_CHG_ERROR; } /* check if we need a pwd change */ now = g_time1(); today = now / SECS_PER_DAY; if (stp->sp_expire == -1) { return AUTH_PWD_CHG_OK; } if (today >= (stp->sp_lstchg + stp->sp_max - stp->sp_warn)) { return AUTH_PWD_CHG_CHANGE; } if (today >= (stp->sp_lstchg + stp->sp_max)) { return AUTH_PWD_CHG_CHANGE_MANDATORY; } if (today < ((stp->sp_lstchg) + (stp->sp_min))) { /* cannot change pwd for now */ return AUTH_PWD_CHG_NOT_NOW; } return AUTH_PWD_CHG_OK; } int auth_change_pwd(const char *user, const char *newpwd) { struct passwd *spw; struct spwd *stp; char hash[35] = ""; long today; FILE *fd; if (0 != lckpwdf()) { return 1; } /* open passwd */ spw = getpwnam(user); if (spw == 0) { return 1; } if (g_strncmp(spw->pw_passwd, "x", 3) != 0) { /* old system with only passwd */ if (auth_crypt_pwd(spw->pw_passwd, newpwd, hash) != 0) { ulckpwdf(); return 1; } spw->pw_passwd = g_strdup(hash); fd = fopen("/etc/passwd", "rw"); putpwent(spw, fd); } else { /* the system is using shadow */ stp = getspnam(user); if (stp == 0) { return 1; } /* old system with only passwd */ if (auth_crypt_pwd(stp->sp_pwdp, newpwd, hash) != 0) { ulckpwdf(); return 1; } stp->sp_pwdp = g_strdup(hash); today = g_time1() / SECS_PER_DAY; stp->sp_lstchg = today; stp->sp_expire = today + stp->sp_max + stp->sp_inact; fd = fopen("/etc/shadow", "rw"); putspent(stp, fd); } ulckpwdf(); return 0; } /** * * @brief Password encryption * @param pwd Old password * @param pln Plaintext new password * @param crp Crypted new password * */ static int auth_crypt_pwd(const char *pwd, const char *pln, char *crp) { char salt[13] = "$1$"; int saltcnt = 0; char *encr; if (g_strncmp(pwd, "$1$", 3) == 0) { /* gnu style crypt(); */ saltcnt = 3; while ((pwd[saltcnt] != '$') && (saltcnt < 11)) { salt[saltcnt] = pwd[saltcnt]; saltcnt++; } salt[saltcnt] = '$'; salt[saltcnt + 1] = '\0'; } else { /* classic two char salt */ salt[0] = pwd[0]; salt[1] = pwd[1]; salt[2] = '\0'; } encr = crypt(pln, salt); g_strncpy(crp, encr, 34); return 0; } /** * * @return 1 if the account is disabled, 0 otherwise * */ static int auth_account_disabled(struct spwd *stp) { int today; if (0 == stp) { /* if an invalid struct was passed we assume a disabled account */ return 1; } today = g_time1() / SECS_PER_DAY; LOG_DEVEL(LOG_LEVEL_DEBUG, "last %ld", stp->sp_lstchg); LOG_DEVEL(LOG_LEVEL_DEBUG, "min %ld", stp->sp_min); LOG_DEVEL(LOG_LEVEL_DEBUG, "max %ld", stp->sp_max); LOG_DEVEL(LOG_LEVEL_DEBUG, "inact %ld", stp->sp_inact); LOG_DEVEL(LOG_LEVEL_DEBUG, "warn %ld", stp->sp_warn); LOG_DEVEL(LOG_LEVEL_DEBUG, "expire %ld", stp->sp_expire); LOG_DEVEL(LOG_LEVEL_DEBUG, "today %d", today); if ((stp->sp_expire != -1) && (today >= stp->sp_expire)) { return 1; } if ((stp->sp_max >= 0) && (stp->sp_inact >= 0) && (stp->sp_lstchg > 0) && (today >= (stp->sp_lstchg + stp->sp_max + stp->sp_inact))) { return 1; } return 0; } xrdp-0.10.1/sesman/libsesman/sesman_access.c000644 001751 000000 00000011571 14652432047 021060 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman_access.c * @brief User access control code * @author Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "arch.h" #include "sesman_access.h" #include "sesman_config.h" #include "log.h" #include "os_calls.h" /******************************************************************************/ /** * Root user login check * * @param cfg_sec Sesman security config * @param user user name * @return 0 if user is root and root accesses are not allowed */ static int root_login_check(const struct config_security *cfg_sec, const char *user) { int rv = 0; if (cfg_sec->allow_root) { rv = 1; } else { // Check the UID of the user isn't 0 int uid; if (g_getuser_info_by_name(user, &uid, NULL, NULL, NULL, NULL) != 0) { LOG(LOG_LEVEL_ERROR, "Can't get UID for user %s", user); } else if (0 == uid) { LOG(LOG_LEVEL_ERROR, "ROOT login attempted, but root login is disabled"); } else { rv = 1; } } return rv; } /******************************************************************************/ /** * Common access control for group checks * @param group Group name * @param param Where group comes from (e.g. "TerminalServerUsers") * @param always_check_group 0 if a missing group allows a login * @param user Username * @return != 0 if the access is allowed */ static int access_login_allowed_common(const char *group, const char *param, int always_check_group, const char *user) { int rv = 0; int gid; int ok; if (group == NULL || group[0] == '\0') { /* Group is not defined. Default access depends on whether * we must have the group or not */ if (always_check_group) { LOG(LOG_LEVEL_ERROR, "%s group is not defined. Access denied for %s", param, user); } else { LOG(LOG_LEVEL_INFO, "%s group is not defined. Access granted for %s", param, user); rv = 1; } } else if (g_getgroup_info(group, &gid) != 0) { /* Group is defined but doesn't exist. Default access depends * on whether we must have the group or not */ if (always_check_group) { LOG(LOG_LEVEL_ERROR, "%s group %s doesn't exist. Access denied for %s", param, group, user); } else { LOG(LOG_LEVEL_INFO, "%s group %s doesn't exist. Access granted for %s", param, group, user); rv = 1; } } else if (0 != g_check_user_in_group(user, gid, &ok)) { LOG(LOG_LEVEL_ERROR, "Error checking %s group %s. " "Access denied for %s", param, group, user); } else if (!ok) { LOG(LOG_LEVEL_ERROR, "User %s is not in %s group %s. Access denied", user, param, group); } else { LOG(LOG_LEVEL_INFO, "User %s is in %s group %s. Access granted", user, param, group); rv = 1; } return rv; } /******************************************************************************/ int access_login_allowed(const struct config_security *cfg_sec, const char *user) { int rv = 0; if (root_login_check(cfg_sec, user)) { rv = access_login_allowed_common(cfg_sec->ts_users, "TerminalServerUsers", cfg_sec->ts_always_group_check, user); } return rv; } /******************************************************************************/ int access_login_mng_allowed(const struct config_security *cfg_sec, const char *user) { int rv = 0; if (root_login_check(cfg_sec, user)) { rv = access_login_allowed_common(cfg_sec->ts_admins, "TerminalServerAdmins", 1, user); } return rv; } xrdp-0.10.1/sesman/libsesman/verify_user_kerberos.c000644 001751 000000 00000014223 14652432047 022504 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file verify_user_kerberos.c * @brief Authenticate user using kerberos * @author Jay Sorg * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "sesman_auth.h" #include "os_calls.h" #include "string_calls.h" #include "log.h" #include struct auth_info { krb5_context ctx; krb5_ccache cc; krb5_principal me; }; /******************************************************************************/ /* Logs a kerberos error code */ static void log_kerberos_failure(krb5_context ctx, krb5_error_code code, const char *where) { const char *errstr = krb5_get_error_message(ctx, code); LOG(LOG_LEVEL_ERROR, "Kerberos call to %s failed [%s]", where, errstr); krb5_free_error_message(ctx, errstr); } /******************************************************************************/ int auth_end(struct auth_info *auth_info) { if (auth_info != NULL) { if (auth_info->me) { krb5_free_principal(auth_info->ctx, auth_info->me); } if (auth_info->cc) { krb5_cc_close(auth_info->ctx, auth_info->cc); } if (auth_info->ctx) { krb5_free_context(auth_info->ctx); } g_memset(auth_info, 0, sizeof(*auth_info)); g_free(auth_info); } return 0; } /******************************************************************************/ /* Checks Kerberos can be used * * If all is well, an auth_info struct is returned */ static struct auth_info * k5_begin(const char *username) { int ok = 0; struct auth_info *auth_info = g_new0(struct auth_info, 1); krb5_error_code code; if (auth_info == NULL) { LOG(LOG_LEVEL_ERROR, "Out of memory in k5_begin()"); } else if ((code = krb5_init_context(&auth_info->ctx)) != 0) { LOG(LOG_LEVEL_ERROR, "Can't init Kerberos context"); } /* Determine the credentials cache to use */ else if ((code = krb5_cc_default(auth_info->ctx, &auth_info->cc)) != 0) { log_kerberos_failure(auth_info->ctx, code, "krb5_cc_default"); } /* Parse the username into a full principal */ else if ((code = krb5_parse_name(auth_info->ctx, username, &auth_info->me)) != 0) { log_kerberos_failure(auth_info->ctx, code, "krb5_parse_name"); } else { ok = 1; } if (!ok) { auth_end(auth_info); auth_info = NULL; } return auth_info; } /******************************************************************************/ /* returns boolean */ static enum scp_login_status k5_kinit(struct auth_info *auth_info, const char *password) { enum scp_login_status status = E_SCP_LOGIN_GENERAL_ERROR; krb5_creds my_creds; krb5_error_code code = 0; code = krb5_get_init_creds_password(auth_info->ctx, &my_creds, auth_info->me, password, NULL, NULL, 0, NULL, NULL); if (code != 0) { log_kerberos_failure(auth_info->ctx, code, "krb5_get_init_creds_password"); status = E_SCP_LOGIN_NOT_AUTHENTICATED; } else { /* * Try to store the creds in the credentials cache */ if ((code = krb5_cc_initialize(auth_info->ctx, auth_info->cc, auth_info->me)) != 0) { log_kerberos_failure(auth_info->ctx, code, "krb5_cc_initialize"); } else if ((code = krb5_cc_store_cred(auth_info->ctx, auth_info->cc, &my_creds)) != 0) { log_kerberos_failure(auth_info->ctx, code, "krb5_cc_store_cred"); } else { status = E_SCP_LOGIN_OK; } /* Prevent double-free of the client principal */ if (my_creds.client == auth_info->me) { my_creds.client = NULL; } krb5_free_cred_contents(auth_info->ctx, &my_creds); } return status; } /******************************************************************************/ /* returns non-NULL for success */ struct auth_info * auth_userpass(const char *user, const char *pass, const char *client_ip, enum scp_login_status *errorcode) { enum scp_login_status status = E_SCP_LOGIN_GENERAL_ERROR; struct auth_info *auth_info = k5_begin(user); if (auth_info) { status = k5_kinit(auth_info, pass); if (status != E_SCP_LOGIN_OK) { auth_end(auth_info); auth_info = NULL; } } if (errorcode != NULL) { *errorcode = status; } return auth_info; } /******************************************************************************/ /* returns non-NULL for success */ struct auth_info * auth_uds(const char *user, enum scp_login_status *errorcode) { struct auth_info *auth_info = k5_begin(user); if (errorcode != NULL) { *errorcode = (auth_info != NULL) ? E_SCP_LOGIN_OK : E_SCP_LOGIN_GENERAL_ERROR; } return auth_info; } /******************************************************************************/ /* returns error */ int auth_start_session(struct auth_info *auth_info, int display_num) { return 0; } /******************************************************************************/ int auth_set_env(struct auth_info *auth_info) { return 0; } xrdp-0.10.1/sesman/libsesman/sesman_clip_restrict.c000644 001751 000000 00000004252 14652432047 022463 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman_clip_restrict.c * @brief Routine for parsing clip restrict strings * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "arch.h" #include "sesman_clip_restrict.h" #include "string_calls.h" /* Map clipboard strings into bitmask values. */ static const struct bitmask_string clip_restrict_map[] = { { CLIP_RESTRICT_TEXT, "text"}, { CLIP_RESTRICT_FILE, "file"}, { CLIP_RESTRICT_IMAGE, "image"}, { CLIP_RESTRICT_ALL, "all"}, { CLIP_RESTRICT_NONE, "none"}, /* Compatibility values */ { CLIP_RESTRICT_ALL, "true"}, { CLIP_RESTRICT_ALL, "yes"}, { CLIP_RESTRICT_NONE, "false"}, BITMASK_STRING_END_OF_LIST }; /******************************************************************************/ int sesman_clip_restrict_string_to_bitmask( const char *inputstr, char *unrecognised, unsigned int unrecognised_len) { return g_str_to_bitmask(inputstr, clip_restrict_map, ",", unrecognised, unrecognised_len); } /******************************************************************************/ int sesman_clip_restrict_mask_to_string( int mask, char output[], unsigned int output_len) { int rv; if (mask == CLIP_RESTRICT_NONE) { rv = snprintf(output, output_len, "none"); } else if (mask == CLIP_RESTRICT_ALL) { rv = snprintf(output, output_len, "all"); } else { rv = g_bitmask_to_str(mask, clip_restrict_map, ',', output, output_len); } return rv; } xrdp-0.10.1/sesman/libsesman/sesman_config.c000644 001751 000000 00000056715 14652432047 021075 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file config.c * @brief User authentication code * @author Simone Fedele @< simo [at] esseemme [dot] org @> * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "sesman_config.h" #include "sesman_clip_restrict.h" #include "list.h" #include "file.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" //#include "chansrv/chansrv_common.h" #include "scp.h" #define SESMAN_CFG_GLOBALS "Globals" #define SESMAN_CFG_DEFWM "DefaultWindowManager" #define SESMAN_CFG_ADDRESS "ListenAddress" #define SESMAN_CFG_PORT "ListenPort" #define SESMAN_CFG_ENABLE_USERWM "EnableUserWindowManager" #define SESMAN_CFG_USERWM "UserWindowManager" #define SESMAN_CFG_AUTH_FILE_PATH "AuthFilePath" #define SESMAN_CFG_RECONNECT_SH "ReconnectScript" #define SESMAN_CFG_XORG_PARAMS "Xorg" #define SESMAN_CFG_VNC_PARAMS "Xvnc" #define SESMAN_CFG_SESSION_VARIABLES "SessionVariables" /* #define SESMAN_CFG_LOGGING "Logging" #define SESMAN_CFG_LOG_FILE "LogFile" #define SESMAN_CFG_LOG_LEVEL "LogLevel" #define SESMAN_CFG_LOG_ENABLE_SYSLOG "EnableSyslog" #define SESMAN_CFG_LOG_SYSLOG_LEVEL "SyslogLevel" */ #define SESMAN_CFG_SECURITY "Security" #define SESMAN_CFG_SEC_LOGIN_RETRY "MaxLoginRetry" #define SESMAN_CFG_SEC_ALLOW_ROOT "AllowRootLogin" #define SESMAN_CFG_SEC_USR_GROUP "TerminalServerUsers" #define SESMAN_CFG_SEC_ADM_GROUP "TerminalServerAdmins" #define SESMAN_CFG_SEC_ALWAYSGROUPCHECK "AlwaysGroupCheck" #define SESMAN_CFG_SEC_RESTRICT_OUTBOUND_CLIPBOARD "RestrictOutboundClipboard" #define SESMAN_CFG_SEC_RESTRICT_INBOUND_CLIPBOARD "RestrictInboundClipboard" #define SESMAN_CFG_SEC_ALLOW_ALTERNATE_SHELL "AllowAlternateShell" #define SESMAN_CFG_SEC_XORG_NO_NEW_PRIVILEGES "XorgNoNewPrivileges" #define SESMAN_CFG_SEC_SESSION_SOCKDIR_GROUP "SessionSockdirGroup" #define SESMAN_CFG_SESSIONS "Sessions" #define SESMAN_CFG_SESS_MAX "MaxSessions" #define SESMAN_CFG_SESS_KILL_DISC "KillDisconnected" #define SESMAN_CFG_SESS_IDLE_LIMIT "IdleTimeLimit" #define SESMAN_CFG_SESS_DISC_LIMIT "DisconnectedTimeLimit" #define SESMAN_CFG_SESS_X11DISPLAYOFFSET "X11DisplayOffset" #define SESMAN_CFG_SESS_MAX_DISPLAY "MaxDisplayNumber" #define SESMAN_CFG_SESS_POLICY_S "Policy" #define SESMAN_CFG_SESS_POLICY_DFLT_S "Default" #define SESMAN_CFG_SESS_POLICY_SEP_S "Separate" static const struct bitmask_char policy_bits[] = { { SESMAN_CFG_SESS_POLICY_U, 'U' }, { SESMAN_CFG_SESS_POLICY_B, 'B' }, { SESMAN_CFG_SESS_POLICY_D, 'D' }, { SESMAN_CFG_SESS_POLICY_I, 'I' }, BITMASK_CHAR_END_OF_LIST }; /***************************************************************************//** * Parse a session allocation policy string */ static unsigned int parse_policy_string(const char *value) { unsigned int rv; char unrecognised[16]; if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_DFLT_S)) { rv = SESMAN_CFG_SESS_POLICY_DEFAULT; } else if (0 == g_strcasecmp(value, SESMAN_CFG_SESS_POLICY_SEP_S)) { rv = SESMAN_CFG_SESS_POLICY_SEPARATE; } else { unrecognised[0] = '\0'; rv = g_charstr_to_bitmask(value, policy_bits, unrecognised, sizeof(unrecognised)); if (unrecognised[0] != '\0') { LOG(LOG_LEVEL_WARNING, "Character(s) '%s' in the session" " allocation policy are not recognised", unrecognised); if (g_strchr(unrecognised, 'C') != NULL || g_strchr(unrecognised, 'c') != NULL) { /* Change from xrdp v0.9.x */ LOG(LOG_LEVEL_WARNING, "Character 'C' is no longer used" " in session allocation policies - use '%s'", SESMAN_CFG_SESS_POLICY_SEP_S); } } } return rv; } /******************************************************************************/ int config_output_policy_string(unsigned int value, char *buff, unsigned int bufflen) { int rv = 0; if (bufflen > 0) { if (value & SESMAN_CFG_SESS_POLICY_DEFAULT) { rv = g_snprintf(buff, bufflen, "Default"); } else if (value & SESMAN_CFG_SESS_POLICY_SEPARATE) { rv = g_snprintf(buff, bufflen, "Separate"); } else { rv = g_bitmask_to_charstr(value, policy_bits, buff, bufflen, NULL); } } return rv; } /***************************************************************************//** * * @brief Reads sesman [global] configuration section * @param file configuration file descriptor * @param cf pointer to a config struct * @param param_n parameter name list * @param param_v parameter value list * @return 0 on success, 1 on failure * */ static int config_read_globals(int file, struct config_sesman *cf, struct list *param_n, struct list *param_v) { int i; list_clear(param_v); list_clear(param_n); /* resetting the struct */ cf->listen_port[0] = '\0'; cf->enable_user_wm = 0; cf->user_wm = g_strdup(""); cf->default_wm = 0; cf->auth_file_path = 0; cf->reconnect_sh = 0; file_read_section(file, SESMAN_CFG_GLOBALS, param_n, param_v); for (i = 0; i < param_n->count; i++) { const char *param = (const char *)list_get_item(param_n, i); const char *val = (const char *)list_get_item(param_v, i); if (0 == g_strcasecmp(param, SESMAN_CFG_DEFWM)) { cf->default_wm = g_strdup(val); } else if (0 == g_strcasecmp(param, SESMAN_CFG_USERWM)) { g_free(cf->user_wm); cf->user_wm = g_strdup(val); } else if (0 == g_strcasecmp(param, SESMAN_CFG_ENABLE_USERWM)) { cf->enable_user_wm = g_text2bool(val); } else if (0 == g_strcasecmp(param, SESMAN_CFG_PORT)) { scp_port_to_unix_domain_path(val, cf->listen_port, sizeof(cf->listen_port)); } else if (0 == g_strcasecmp(param, SESMAN_CFG_AUTH_FILE_PATH)) { cf->auth_file_path = g_strdup(val); } else if (g_strcasecmp(param, SESMAN_CFG_RECONNECT_SH) == 0) { cf->reconnect_sh = g_strdup(val); } else if (0 == g_strcasecmp(param, SESMAN_CFG_ADDRESS)) { /* Config must be updated for Unix Domain Sockets */ LOG(LOG_LEVEL_WARNING, "Obsolete setting' " SESMAN_CFG_ADDRESS "' in [" SESMAN_CFG_GLOBALS "] should be removed."); LOG(LOG_LEVEL_WARNING, "Review setting' " SESMAN_CFG_PORT "' in [" SESMAN_CFG_GLOBALS "]"); } } /* checking for missing required parameters */ if ('\0' == cf->listen_port[0]) { /* Load the default value */ scp_port_to_unix_domain_path(NULL, cf->listen_port, sizeof(cf->listen_port)); } if ('\0' == cf->user_wm[0]) { cf->enable_user_wm = 0; } if (cf->default_wm == 0 || cf->default_wm[0] == '\0') { g_free(cf->default_wm); cf->default_wm = g_strdup("startwm.sh"); } /* if default_wm doesn't begin with '/', it's a relative path to * XRDP_CFG_PATH */ if (cf->default_wm[0] != '/') { /* sizeof operator returns string length including null terminator */ int length = (sizeof(XRDP_CFG_PATH) + g_strlen(cf->default_wm) + 1); /* '/' */ char *buf = (char *)g_malloc(length, 0); g_sprintf(buf, "%s/%s", XRDP_CFG_PATH, cf->default_wm); g_free(cf->default_wm); cf->default_wm = buf; } if (cf->reconnect_sh == 0 || cf->reconnect_sh[0] == '\0') { g_free(cf->reconnect_sh); cf->reconnect_sh = g_strdup("reconnectwm.sh"); } /* if reconnect_sh doesn't begin with '/', it's a relative path to * XRDP_CFG_PATH */ if (cf->reconnect_sh[0] != '/') { /* sizeof operator returns string length including null terminator */ int length = (sizeof(XRDP_CFG_PATH) + g_strlen(cf->reconnect_sh) + 1); /* '/' */ char *buf = (char *)g_malloc(length, 0); g_sprintf(buf, "%s/%s", XRDP_CFG_PATH, cf->reconnect_sh); g_free(cf->reconnect_sh); cf->reconnect_sh = buf; } return 0; } /***************************************************************************//** * * @brief Reads sesman [Security] configuration section * @param file configuration file descriptor * @param sc pointer to a config_security struct * @param param_n parameter name list * @param param_v parameter value list * @return 0 on success, 1 on failure * */ static int config_read_security(int file, struct config_security *sc, struct list *param_n, struct list *param_v) { int i; const char *buf; const char *value; list_clear(param_v); list_clear(param_n); /* setting defaults */ sc->allow_root = 0; sc->login_retry = 3; sc->restrict_outbound_clipboard = 0; sc->restrict_inbound_clipboard = 0; sc->allow_alternate_shell = 1; sc->xorg_no_new_privileges = 1; sc->ts_users = g_strdup(""); sc->ts_admins = g_strdup(""); sc->session_sockdir_group = g_strdup(""); file_read_section(file, SESMAN_CFG_SECURITY, param_n, param_v); for (i = 0; i < param_n->count; i++) { buf = (const char *)list_get_item(param_n, i); value = (const char *)list_get_item(param_v, i); if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALLOW_ROOT)) { sc->allow_root = g_text2bool(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_LOGIN_RETRY)) { sc->login_retry = g_atoi(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_USR_GROUP)) { g_free(sc->ts_users); sc->ts_users = g_strdup(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ADM_GROUP)) { g_free(sc->ts_admins); sc->ts_admins = g_strdup(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALWAYSGROUPCHECK)) { sc->ts_always_group_check = g_text2bool(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_RESTRICT_OUTBOUND_CLIPBOARD)) { char unrecognised[256]; sc->restrict_outbound_clipboard = sesman_clip_restrict_string_to_bitmask( (const char *)list_get_item(param_v, i), unrecognised, sizeof(unrecognised)); if (unrecognised[0] != '\0') { LOG(LOG_LEVEL_WARNING, "Unrecognised tokens parsing 'RestrictOutboundClipboard' %s", unrecognised); } } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_RESTRICT_INBOUND_CLIPBOARD)) { char unrecognised[256]; sc->restrict_inbound_clipboard = sesman_clip_restrict_string_to_bitmask( (const char *)list_get_item(param_v, i), unrecognised, sizeof(unrecognised)); if (unrecognised[0] != '\0') { LOG(LOG_LEVEL_WARNING, "Unrecognised tokens parsing 'RestrictInboundClipboard' %s", unrecognised); } } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_ALLOW_ALTERNATE_SHELL)) { sc->allow_alternate_shell = g_text2bool(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_XORG_NO_NEW_PRIVILEGES)) { sc->xorg_no_new_privileges = g_text2bool(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SEC_SESSION_SOCKDIR_GROUP)) { g_free(sc->session_sockdir_group); sc->session_sockdir_group = g_strdup(value); } } return 0; } /***************************************************************************//** * * @brief Reads sesman [Sessions] configuration section * @param file configuration file descriptor * @param ss pointer to a config_sessions struct * @param param_n parameter name list * @param param_v parameter value list * @return 0 on success, 1 on failure * */ static int config_read_sessions(int file, struct config_sessions *se, struct list *param_n, struct list *param_v) { int i; const char *buf; const char *value; list_clear(param_v); list_clear(param_n); /* setting defaults */ se->x11_display_offset = 10; // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml` se->max_display_number = 63; se->max_sessions = 0; se->max_idle_time = 0; se->max_disc_time = 0; se->kill_disconnected = 0; se->policy = SESMAN_CFG_SESS_POLICY_DEFAULT; file_read_section(file, SESMAN_CFG_SESSIONS, param_n, param_v); for (i = 0; i < param_n->count; i++) { buf = (const char *)list_get_item(param_n, i); value = (const char *)list_get_item(param_v, i); if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_X11DISPLAYOFFSET)) { int x11off = g_atoi(value); if (x11off >= 0) { se->x11_display_offset = x11off; } } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_MAX_DISPLAY)) { int mdn = g_atoi(value); if (mdn > 0) { se->max_display_number = mdn; } } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_MAX)) { int sm = g_atoi(value); if (sm >= 0) { se->max_sessions = sm; } } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_KILL_DISC)) { se->kill_disconnected = g_text2bool(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_IDLE_LIMIT)) { se->max_idle_time = g_atoi(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_DISC_LIMIT)) { se->max_disc_time = g_atoi(value); } else if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_POLICY_S)) { se->policy = parse_policy_string(value); } } return 0; } /***************************************************************************//** * * @brief Reads sesman [Xorg] configuration section * @param file configuration file descriptor * @param cs pointer to a config_sesman struct * @param param_n parameter name list * @param param_v parameter value list * @return 0 on success, 1 on failure * */ static int config_read_xorg_params(int file, struct config_sesman *cs, struct list *param_n, struct list *param_v) { int i; list_clear(param_v); list_clear(param_n); cs->xorg_params = list_create(); cs->xorg_params->auto_free = 1; file_read_section(file, SESMAN_CFG_XORG_PARAMS, param_n, param_v); for (i = 0; i < param_n->count; i++) { list_add_strdup(cs->xorg_params, (const char *) list_get_item(param_v, i)); } return 0; } /***************************************************************************//** * * @brief Reads sesman [Xvnc] configuration section * @param file configuration file descriptor * @param cs pointer to a config_sesman struct * @param param_n parameter name list * @param param_v parameter value list * @return 0 on success, 1 on failure * */ static int config_read_vnc_params(int file, struct config_sesman *cs, struct list *param_n, struct list *param_v) { int i; list_clear(param_v); list_clear(param_n); cs->vnc_params = list_create(); cs->vnc_params->auto_free = 1; file_read_section(file, SESMAN_CFG_VNC_PARAMS, param_n, param_v); for (i = 0; i < param_n->count; i++) { list_add_strdup(cs->vnc_params, (const char *)list_get_item(param_v, i)); } return 0; } /******************************************************************************/ static int config_read_session_variables(int file, struct config_sesman *cs, struct list *param_n, struct list *param_v) { int i; list_clear(param_v); list_clear(param_n); cs->env_names = list_create(); cs->env_names->auto_free = 1; cs->env_values = list_create(); cs->env_values->auto_free = 1; file_read_section(file, SESMAN_CFG_SESSION_VARIABLES, param_n, param_v); for (i = 0; i < param_n->count; i++) { list_add_strdup(cs->env_names, (const char *) list_get_item(param_n, i)); list_add_strdup(cs->env_values, (const char *) list_get_item(param_v, i)); } return 0; } /******************************************************************************/ struct config_sesman * config_read(const char *sesman_ini) { struct config_sesman *cfg; int all_ok = 0; if ((cfg = g_new0(struct config_sesman, 1)) != NULL) { if ((cfg->sesman_ini = g_strdup(sesman_ini)) != NULL) { int fd; if ((fd = g_file_open_ro(cfg->sesman_ini)) != -1) { struct list *sec; struct list *param_n; struct list *param_v; sec = list_create(); sec->auto_free = 1; file_read_sections(fd, sec); param_n = list_create(); param_n->auto_free = 1; param_v = list_create(); param_v->auto_free = 1; all_ok = 1; /* read global config */ config_read_globals(fd, cfg, param_n, param_v); /* read Xvnc/Xorg parameter list */ config_read_vnc_params(fd, cfg, param_n, param_v); config_read_xorg_params(fd, cfg, param_n, param_v); /* read security config */ config_read_security(fd, &(cfg->sec), param_n, param_v); /* read session config */ config_read_sessions(fd, &(cfg->sess), param_n, param_v); config_read_session_variables(fd, cfg, param_n, param_v); /* cleanup */ list_delete(sec); list_delete(param_v); list_delete(param_n); g_file_close(fd); } } } if (!all_ok) { config_free(cfg); cfg = NULL; } return cfg; } /******************************************************************************/ void config_dump(struct config_sesman *config) { int i; struct config_sessions *se; struct config_security *sc; se = &(config->sess); sc = &(config->sec); char policy_s[64]; char restrict_s[64]; /* Global sesman configuration */ g_writeln("Filename: %s", config->sesman_ini); g_writeln("Global configuration:"); g_writeln(" ListenPort: %s", config->listen_port); g_writeln(" EnableUserWindowManager: %d", config->enable_user_wm); g_writeln(" UserWindowManager: %s", config->user_wm); g_writeln(" DefaultWindowManager: %s", config->default_wm); g_writeln(" ReconnectScript: %s", config->reconnect_sh); g_writeln(" AuthFilePath: %s", (config->auth_file_path ? config->auth_file_path : "disabled")); /* Session configuration */ config_output_policy_string(se->policy, policy_s, sizeof(policy_s)); g_writeln("Session configuration:"); g_writeln(" MaxSessions: %d", se->max_sessions); g_writeln(" X11DisplayOffset: %d", se->x11_display_offset); g_writeln(" KillDisconnected: %d", se->kill_disconnected); g_writeln(" IdleTimeLimit: %d", se->max_idle_time); g_writeln(" DisconnectedTimeLimit: %d", se->max_disc_time); g_writeln(" Policy: %s", policy_s); /* Security configuration */ g_writeln("Security configuration:"); g_writeln(" AllowRootLogin: %d", sc->allow_root); g_writeln(" MaxLoginRetry: %d", sc->login_retry); g_writeln(" AlwaysGroupCheck: %d", sc->ts_always_group_check); g_writeln(" AllowAlternateShell: %d", sc->allow_alternate_shell); #ifdef HAVE_SYS_PRCTL_H g_writeln(" XorgNoNewPrivileges: %d", sc->xorg_no_new_privileges); #endif sesman_clip_restrict_mask_to_string(sc->restrict_outbound_clipboard, restrict_s, sizeof(restrict_s)); g_writeln(" RestrictOutboundClipboard: %s", restrict_s); sesman_clip_restrict_mask_to_string(sc->restrict_inbound_clipboard, restrict_s, sizeof(restrict_s)); g_writeln(" RestrictInboundClipboard: %s", restrict_s); g_writeln(" TSUsersGroup: %s", sc->ts_users); g_writeln(" TSAdminsGroup: %s", sc->ts_admins); g_writeln(" SessionSockdirGroup: %s", sc->session_sockdir_group); /* Xorg */ if (config->xorg_params->count) { g_writeln("Xorg parameters:"); } for (i = 0; i < config->xorg_params->count; i++) { g_writeln(" Parameter %02d %s", i, (char *) list_get_item(config->xorg_params, i)); } /* Xvnc */ if (config->vnc_params->count) { g_writeln("Xvnc parameters:"); } for (i = 0; i < config->vnc_params->count; i++) { g_writeln(" Parameter %02d %s", i, (char *)list_get_item(config->vnc_params, i)); } /* SessionVariables */ if (config->env_names->count) { g_writeln("%s parameters:", SESMAN_CFG_SESSION_VARIABLES); } for (i = 0; i < config->env_names->count; i++) { g_writeln(" Parameter %02d %s=%s", i, (char *) list_get_item(config->env_names, i), (char *) list_get_item(config->env_values, i)); } } /******************************************************************************/ void config_free(struct config_sesman *cs) { if (cs != NULL) { g_free(cs->sesman_ini); g_free(cs->default_wm); g_free(cs->user_wm); g_free(cs->reconnect_sh); g_free(cs->auth_file_path); list_delete(cs->vnc_params); list_delete(cs->xorg_params); list_delete(cs->env_names); list_delete(cs->env_values); g_free(cs->sec.ts_users); g_free(cs->sec.ts_admins); g_free(cs->sec.session_sockdir_group); g_free(cs); } } xrdp-0.10.1/sesman/libsesman/sesman_auth.h000644 001751 000000 00000006442 14652432047 020566 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman_auth.h * @brief User authentication definitions * @author Jay Sorg * */ #ifndef SESMAN_AUTH_H #define SESMAN_AUTH_H /** * Opaque type used to represent an authentication handle */ struct auth_info; #include "scp_application_types.h" /** * * @brief Validates user's password * @param user user's login name * @param pass user's password * @param client_ip IP address of connecting client (or ""/NULL if not known) * @param[out] Error code for the operation. E_SCP_LOGIN_OK on success. * @return auth handle on success, NULL on failure * */ struct auth_info * auth_userpass(const char *user, const char *pass, const char *client_ip, enum scp_login_status *errorcode); /** * * @brief Gets an auth handle for a UDS login * * @param uid User ID * @param[out] Error code for the operation. E_SCP_LOGIN_OK on success. * Can be NULL if this information isn't required. * @return auth handle on success, NULL on failure * */ struct auth_info * auth_uds(const char *user, enum scp_login_status *errorcode); /** * * @brief Starts a session * @param auth_info. Auth handle created by auth_userpass * @param display_num Display number * @return 0 on success, 1 on failure * * The resources allocated when the session is started are de-allocated * by auth_end() - there is no separate way to do this. */ int auth_start_session(struct auth_info *auth_info, int display_num); /** * * @brief Deallocates an auth handle and releases all resources * @param auth_info. Auth handle created by auth_userpass * @return 0 on success, 1 on failure * */ int auth_end(struct auth_info *auth_info); /** * * @brief Sets up the environment for a session started * with auth_start_session() * * This call is only effective for PAM-based environments. It must be made * after the context has been switched to the logged-in user. * * @param auth_info. Auth handle created by auth_userpass * @return 0 on success, 1 on failure * */ int auth_set_env(struct auth_info *auth_info); #define AUTH_PWD_CHG_OK 0 #define AUTH_PWD_CHG_CHANGE 1 #define AUTH_PWD_CHG_CHANGE_MANDATORY 2 #define AUTH_PWD_CHG_NOT_NOW 3 #define AUTH_PWD_CHG_ERROR 4 /** * * @brief WIP - Checks to see if the password for a user needs changing * * @param user - Username to check * @return 0 on success, 1 on failure * */ int auth_check_pwd_chg(const char *user); /** * * @brief WIP - Changes the password for a user * * @param user Username to check * @param newpwd New password for user * @return 0 on success, 1 on failure * */ int auth_change_pwd(const char *user, const char *newpwd); #endif xrdp-0.10.1/sesman/libsesman/Makefile.am000644 001751 000000 00000002731 14652432047 020137 0ustar00metawheel000000 000000 #EXTRA_DIST = \ #xrdp_surface.c AM_CPPFLAGS = \ -DXRDP_PAMCONF_PATH=\"${pamconfdir}\" \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/common # -DXRDP_SBIN_PATH=\"${sbindir}\" \ # -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ # -DXRDP_PID_PATH=\"${localstatedir}/run\" #AM_CFLAGS = $(OPENSSL_CFLAGS) #AM_LDFLAGS = #LIBXRDP_EXTRA_LIBS = #if XRDP_NEUTRINORDP #AM_CPPFLAGS += -DXRDP_NEUTRINORDP #LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS) #endif #if XRDP_RFXCODEC #AM_CPPFLAGS += -DXRDP_RFXCODEC #endif #if XRDP_TJPEG #AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ #AM_LDFLAGS += @TurboJpegLibDir@ #LIBXRDP_EXTRA_LIBS += -lturbojpeg #else #if XRDP_JPEG #AM_CPPFLAGS += -DXRDP_JPEG #LIBXRDP_EXTRA_LIBS += -ljpeg #endif #endif module_LTLIBRARIES = \ libsesman.la # Possible authentication modules # See https://www.gnu.org/software/automake/manual/html_node/Conditional-Sources.html EXTRA_libsesman_la_SOURCES = \ verify_user.c \ verify_user_bsd.c \ verify_user_kerberos.c \ verify_user_pam.c \ verify_user_pam_userpass.c # Make sure the right authentication module is pulled in libsesman_la_DEPENDENCIES = $(AUTHMOD_OBJ) libsesman_la_SOURCES = \ sesman_access.h \ sesman_access.c \ sesman_auth.h \ sesman_config.h \ sesman_config.c \ sesman_clip_restrict.h \ sesman_clip_restrict.c libsesman_la_LIBADD = \ $(AUTHMOD_OBJ) \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la \ $(AUTHMOD_LIB) xrdp-0.10.1/sesman/libsesman/sesman_clip_restrict.h000644 001751 000000 00000003265 14652432047 022473 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file contains the chansrv configuration parameters from sesman.ini */ #ifndef SESMAN_CLIP_RESTRICT_H #define SESMAN_CLIP_RESTRICT_H #define CLIP_RESTRICT_NONE 0 #define CLIP_RESTRICT_TEXT (1<<0) #define CLIP_RESTRICT_FILE (1<<1) #define CLIP_RESTRICT_IMAGE (1<<2) #define CLIP_RESTRICT_ALL 0x7fffffff /** * Converts a sesman clip restrict string to a bitmask * * @param inputstr Input string * @param unrecognised buffer for unrecognised tokens * @param unrecognised_len Length of the above * @return Bitmask * * The input is a comma-separated list of tokens as documented in * the sesman.ini manpage */ int sesman_clip_restrict_string_to_bitmask( const char *inputstr, char *unrecognised, unsigned int unrecognised_len); /** * Converts a sesman clip restrict bitmask to a string * * @param mask Input mask * @param output buffer for output string * @param output_len Length of the above * @return Length as for snprintf() */ int sesman_clip_restrict_mask_to_string( int mask, char output[], unsigned int output_len); #endif /* SESMAN_CLIP_RESTRICT_H */ xrdp-0.10.1/sesman/libsesman/sesman_config.h000644 001751 000000 00000015520 14652432047 021067 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman_config.h * @brief User authentication definitions * @author Simone Fedele @< simo [at] esseemme [dot] org @> * */ #ifndef SESMAN_CONFIG_H #define SESMAN_CONFIG_H #include "arch.h" #include "list.h" #include "log.h" enum SESMAN_CFG_SESS_POLICY_BITS { /* If these two are set, they override everything else */ SESMAN_CFG_SESS_POLICY_DEFAULT = (1 << 0), SESMAN_CFG_SESS_POLICY_SEPARATE = (1 << 1), /* Configuration bits */ SESMAN_CFG_SESS_POLICY_U = (1 << 2), SESMAN_CFG_SESS_POLICY_B = (1 << 3), SESMAN_CFG_SESS_POLICY_D = (1 << 4), SESMAN_CFG_SESS_POLICY_I = (1 << 5) }; /** * Name of default sesman.ini file */ #define DEFAULT_SESMAN_INI XRDP_CFG_PATH "/sesman.ini" /** * * @struct config_security * @brief struct that contains sesman access control configuration * */ struct config_security { /** * @var allow_root * @brief allow root login on TS */ int allow_root; /** * @var login_retry * @brief maximum login attempts */ int login_retry; /** * @var ts_users * @brief Terminal Server Users group */ char *ts_users; /** * @var ts_admins * @brief Terminal Server Administrators group */ char *ts_admins; /** * @var ts_always_group_check * @brief if the Groups are not found deny access */ int ts_always_group_check; /** * @var restrict_outbound_clipboard * @brief if the clipboard should be enforced restricted. If true only allow client -> server, not vice versa. */ int restrict_outbound_clipboard; /** * @var restrict_inbound_clipboard * @brief if the clipboard should be enforced restricted. If true only allow server -> client, not vice versa. */ int restrict_inbound_clipboard; /** * @var allow_alternate_shell * @brief allow an user-supplied alternate shell. * @details 'YES' for all programs allowed, 'NO' for disabling of alternate * shells. * If not specified, 'YES' is assumed. */ int allow_alternate_shell; /* * @var xorg_no_new_privileges * @brief if the Xorg X11 server should be started with no_new_privs (Linux only) */ int xorg_no_new_privileges; /* * @var session_sockdir_group * @brief Group to have read access to the session sockdirs */ char *session_sockdir_group; }; /** * * @struct config_sessions * @brief struct that contains sesman session handling configuration * */ struct config_sessions { /** * @var x11_display_offset * @brief X11 TCP port offset. default value: 10 */ unsigned int x11_display_offset; /** * @var max_display_number * @brief Highest X11 display number considered for allocation */ unsigned int max_display_number; /** * @var max_sessions * @brief maximum number of allowed sessions. 0 for unlimited */ unsigned int max_sessions; /** * @var max_idle_time * @brief maximum idle time for each session */ int max_idle_time; /** * @var max_disc_time * @brief maximum disconnected time for each session */ int max_disc_time; /** * @var kill_disconnected * @brief enables automatic killing of disconnected session */ int kill_disconnected; /** * @var policy * @brief session allocation policy */ unsigned int policy; }; /** * * @struct config_sesman * @brief struct that contains sesman configuration * * This struct contains all of sesman configuration parameters\n * Every parameter in [globals] is a member of this struct, other * sections options are embedded in this struct as member structures * */ struct config_sesman { /** * @var sesman_ini * @brief File that these parameters are read from */ char *sesman_ini; /** * @var listen_port * @brief Listening port */ char listen_port[256]; /** * @var enable_user_wm * @brief Flag that enables user specific wm */ int enable_user_wm; /** * @var default_wm * @brief Default window manager */ char *default_wm; /** * @var user_wm * @brief Default window manager. */ char *user_wm; /** * @var reconnect_sh * @brief Script executed when reconnected */ char *reconnect_sh; /** * @var auth_file_path * @brief Auth file path */ char *auth_file_path; /** * @var vnc_params * @brief Xvnc additional parameter list */ struct list *vnc_params; /** * @var xorg_params * @brief Xorg additional parameter list */ struct list *xorg_params; /** * @var log * @brief Log configuration struct */ //struct log_config log; /** * @var sec * @brief Security configuration options struct */ struct config_security sec; /** * @var sess * @brief Session configuration options struct */ struct config_sessions sess; /** * @var env_names * @brief environment variable name list */ struct list *env_names; /** * @var env_values * @brief environment variable value list */ struct list *env_values; }; /** * * @brief Reads sesman configuration * @param sesman_ini Name of configuration file to read * @return configuration on success, NULL on failure * * @post pass return value to config_free() to prevent memory leaks * */ struct config_sesman * config_read(const char *sesman_ini); /** * * @brief Dumps configuration * @param pointer to a config_sesman struct * */ void config_dump(struct config_sesman *config); /** * * @brief Frees configuration allocated by config_read() * @param pointer to a config_sesman struct (may be NULL) * */ void config_free(struct config_sesman *cs); /** * Converts a session allocation Policy value to a strin * @param value - Session allocation policy value * @param buff - Buffer for result * @param bufflen - Length of buffer * @return Length of string that would be required without a terminator * to write the whole output (like snprintf()) */ int config_output_policy_string(unsigned int value, char *buff, unsigned int bufflen); #endif xrdp-0.10.1/sesman/libsesman/Makefile.in000644 001751 000000 00000061003 14652432075 020146 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = sesman/libsesman ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) am__DEPENDENCIES_1 = am_libsesman_la_OBJECTS = sesman_access.lo sesman_config.lo \ sesman_clip_restrict.lo libsesman_la_OBJECTS = $(am_libsesman_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/sesman_access.Plo \ ./$(DEPDIR)/sesman_clip_restrict.Plo \ ./$(DEPDIR)/sesman_config.Plo ./$(DEPDIR)/verify_user.Plo \ ./$(DEPDIR)/verify_user_bsd.Plo \ ./$(DEPDIR)/verify_user_kerberos.Plo \ ./$(DEPDIR)/verify_user_pam.Plo \ ./$(DEPDIR)/verify_user_pam_userpass.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libsesman_la_SOURCES) $(EXTRA_libsesman_la_SOURCES) DIST_SOURCES = $(libsesman_la_SOURCES) $(EXTRA_libsesman_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #EXTRA_DIST = \ # #xrdp_surface.c AM_CPPFLAGS = \ -DXRDP_PAMCONF_PATH=\"${pamconfdir}\" \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/common # -DXRDP_SBIN_PATH=\"${sbindir}\" \ # -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ # -DXRDP_PID_PATH=\"${localstatedir}/run\" #AM_CFLAGS = $(OPENSSL_CFLAGS) #AM_LDFLAGS = #LIBXRDP_EXTRA_LIBS = #if XRDP_NEUTRINORDP #AM_CPPFLAGS += -DXRDP_NEUTRINORDP #LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS) #endif #if XRDP_RFXCODEC #AM_CPPFLAGS += -DXRDP_RFXCODEC #endif #if XRDP_TJPEG #AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ #AM_LDFLAGS += @TurboJpegLibDir@ #LIBXRDP_EXTRA_LIBS += -lturbojpeg #else #if XRDP_JPEG #AM_CPPFLAGS += -DXRDP_JPEG #LIBXRDP_EXTRA_LIBS += -ljpeg #endif #endif module_LTLIBRARIES = \ libsesman.la # Possible authentication modules # See https://www.gnu.org/software/automake/manual/html_node/Conditional-Sources.html EXTRA_libsesman_la_SOURCES = \ verify_user.c \ verify_user_bsd.c \ verify_user_kerberos.c \ verify_user_pam.c \ verify_user_pam_userpass.c # Make sure the right authentication module is pulled in libsesman_la_DEPENDENCIES = $(AUTHMOD_OBJ) libsesman_la_SOURCES = \ sesman_access.h \ sesman_access.c \ sesman_auth.h \ sesman_config.h \ sesman_config.c \ sesman_clip_restrict.h \ sesman_clip_restrict.c libsesman_la_LIBADD = \ $(AUTHMOD_OBJ) \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la \ $(AUTHMOD_LIB) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sesman/libsesman/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign sesman/libsesman/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libsesman.la: $(libsesman_la_OBJECTS) $(libsesman_la_DEPENDENCIES) $(EXTRA_libsesman_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libsesman_la_OBJECTS) $(libsesman_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesman_access.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesman_clip_restrict.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesman_config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_bsd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_kerberos.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_pam.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify_user_pam_userpass.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/sesman_access.Plo -rm -f ./$(DEPDIR)/sesman_clip_restrict.Plo -rm -f ./$(DEPDIR)/sesman_config.Plo -rm -f ./$(DEPDIR)/verify_user.Plo -rm -f ./$(DEPDIR)/verify_user_bsd.Plo -rm -f ./$(DEPDIR)/verify_user_kerberos.Plo -rm -f ./$(DEPDIR)/verify_user_pam.Plo -rm -f ./$(DEPDIR)/verify_user_pam_userpass.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/sesman_access.Plo -rm -f ./$(DEPDIR)/sesman_clip_restrict.Plo -rm -f ./$(DEPDIR)/sesman_config.Plo -rm -f ./$(DEPDIR)/verify_user.Plo -rm -f ./$(DEPDIR)/verify_user_bsd.Plo -rm -f ./$(DEPDIR)/verify_user_kerberos.Plo -rm -f ./$(DEPDIR)/verify_user_pam.Plo -rm -f ./$(DEPDIR)/verify_user_pam_userpass.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/sesman/libsesman/sesman_access.h000644 001751 000000 00000002572 14652432047 021066 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesman_access.h * @brief User access control definitions * @author Simone Fedele * */ #ifndef SESMAN_ACCESS_H #define SESMAN_ACCESS_H struct config_security; /** * * @brief Checks if the user is allowed to access the terminal server * @param user the user to check * @return 0 if access is denied, !=0 if allowed * */ int access_login_allowed(const struct config_security *cfg_sec, const char *user); /** * * @brief Checks if the user is allowed to access the terminal server for management * @param user the user to check * @return 0 if access is denied, !=0 if allowed * */ int access_login_mng_allowed(const struct config_security *cfg_sec, const char *user); #endif xrdp-0.10.1/sesman/libsesman/verify_user_pam_userpass.c000644 001751 000000 00000021323 14652432047 023371 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file verify_user_pam.c * @brief Authenticate user using pam * @author Jay Sorg * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include "log.h" #include "string_calls.h" #include "sesman_auth.h" #include #include #include #define SERVICE "xrdp" struct auth_info { pam_userpass_t userpass; int session_opened; int did_setcred; struct pam_conv pamc; pam_handle_t *ph; }; /******************************************************************************/ /** Performs PAM operations common to login methods * * @param auth_info Module auth_info structure * @param client_ip Client IP if known, or NULL * @param need_pam_authenticate True if user must be authenticated as * well as authorized * @return Code describing the success of the operation * * The username is assumed to be supplied by the caller in * auth_info->userpass.user */ static enum scp_login_status common_pam_login(struct auth_info *auth_info, const char *client_ip, int need_pam_authenticate) { int perror; char service_name[256]; perror = pam_start(SERVICE, auth_info->userpass.user, &(auth_info->pamc), &(auth_info->ph)); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_start failed: %s", pam_strerror(auth_info->ph, perror)); pam_end(auth_info->ph, perror); return E_SCP_LOGIN_GENERAL_ERROR; } if (client_ip != NULL && client_ip[0] != '\0') { perror = pam_set_item(auth_info->ph, PAM_RHOST, client_ip); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item(PAM_RHOST) failed: %s", pam_strerror(auth_info->ph, perror)); } } perror = pam_set_item(auth_info->ph, PAM_TTY, service_name); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item(PAM_TTY) failed: %s", pam_strerror(auth_info->ph, perror)); } if (need_pam_authenticate) { perror = pam_authenticate(auth_info->ph, 0); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_authenticate failed: %s", pam_strerror(auth_info->ph, perror)); pam_end(auth_info->ph, perror); return E_SCP_LOGIN_NOT_AUTHENTICATED; } } /* From man page: The pam_acct_mgmt function is used to determine if the users account is valid. It checks for authentication token and account expiration and verifies access restrictions. It is typically called after the user has been authenticated. */ perror = pam_acct_mgmt(auth_info->ph, 0); if (perror != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_acct_mgmt failed: %s", pam_strerror(auth_info->ph, perror)); pam_end(auth_info->ph, perror); return E_SCP_LOGIN_NOT_AUTHORIZED; } return E_SCP_LOGIN_OK; } /******************************************************************************/ /* returns non-NULL for success * Detailed error code is in the errorcode variable */ struct auth_info * auth_userpass(const char *user, const char *pass, const char *client_ip, enum scp_login_status *errorcode) { struct auth_info *auth_info; enum scp_login_status status; auth_info = g_new0(struct auth_info, 1); if (auth_info == NULL) { status = E_SCP_LOGIN_NO_MEMORY; } else { auth_info->userpass.user = user; auth_info->userpass.pass = pass; auth_info->pamc.conv = &pam_userpass_conv; auth_info->pamc.appdata_ptr = &(auth_info->userpass); status = common_pam_login(auth_info, client_ip, 1); if (status != E_SCP_LOGIN_OK) { g_free(auth_info); auth_info = NULL; } } if (errorcode != NULL) { *errorcode = status; } return auth_info; } /******************************************************************************/ struct auth_info * auth_uds(const char *user, enum scp_login_status *errorcode) { struct auth_info *auth_info; enum scp_login_status status; auth_info = g_new0(struct auth_info, 1); if (auth_info == NULL) { status = E_SCP_LOGIN_NO_MEMORY; } else { auth_info->userpass.user = user; status = common_pam_login(auth_info, NULL, 0); if (status != E_SCP_LOGIN_OK) { g_free(auth_info); auth_info = NULL; } } if (errorcode != NULL) { *errorcode = status; } return auth_info; } /******************************************************************************/ /* returns error */ static int auth_start_session_private(struct auth_info *auth_info, int display_num) { int error; char display[256]; g_sprintf(display, ":%d", display_num); error = pam_set_item(auth_info->ph, PAM_TTY, display); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_set_item failed: %s", pam_strerror(auth_info->ph, error)); return 1; } error = pam_setcred(auth_info->ph, PAM_ESTABLISH_CRED); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_setcred failed: %s", pam_strerror(auth_info->ph, error)); return 1; } auth_info->did_setcred = 1; error = pam_open_session(auth_info->ph, 0); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_open_session failed: %s", pam_strerror(auth_info->ph, error)); return 1; } auth_info->session_opened = 1; return 0; } /******************************************************************************/ /** * Main routine to start a session * * Calls the private routine and logs an additional error if the private * routine fails */ int auth_start_session(struct auth_info *auth_info, int display_num) { int result = auth_start_session_private(auth_info, display_num); if (result != 0) { LOG(LOG_LEVEL_ERROR, "Can't start PAM session. See PAM logging for more info"); } return result; } /******************************************************************************/ /* returns error */ static int auth_stop_session(struct auth_info *auth_info) { int rv = 0; int error; if (auth_info->session_opened) { error = pam_close_session(auth_info->ph, 0); if (error != PAM_SUCCESS) { LOG(LOG_LEVEL_ERROR, "pam_close_session failed: %s", pam_strerror(auth_info->ph, error)); rv = 1; } else { auth_info->session_opened = 0; } } if (auth_info->did_setcred) { pam_setcred(auth_info->ph, PAM_DELETE_CRED); auth_info->did_setcred = 0; } return rv; } /******************************************************************************/ /* returns error */ /* cleanup */ int auth_end(struct auth_info *auth_info) { if (auth_info != NULL) { if (auth_info->ph != 0) { auth_stop_session(auth_info); pam_end(auth_info->ph, PAM_SUCCESS); auth_info->ph = 0; } } g_free(auth_info); return 0; } /******************************************************************************/ /* returns error */ /* set any pam env vars */ int auth_set_env(struct auth_info *auth_info) { char **pam_envlist; char **pam_env; if (auth_info != NULL) { /* export PAM environment */ pam_envlist = pam_getenvlist(auth_info->ph); if (pam_envlist != NULL) { for (pam_env = pam_envlist; *pam_env != NULL; ++pam_env) { char *str = *pam_env; int eq_pos = g_pos(str, "="); if (eq_pos > 0) { str[eq_pos] = '\0'; g_setenv(str, str + eq_pos + 1, 1); } g_free(str); } g_free(pam_envlist); } } return 0; } xrdp-0.10.1/sesman/sesexec/login_info.h000644 001751 000000 00000005176 14652432047 020067 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file login_info.h * @brief Declare functionality associated with user logins for sesexec * @author Matt Burt * */ #ifndef LOGIN_INFO_H #define LOGIN_INFO_H #include struct trans; /** * Information associated with the logged-in user */ struct login_info { uid_t uid; char *username; char *ip_addr; struct auth_info *auth_info; }; /** * @brief Attempt a system login using username/password * @param scp_trans SCP transport for talking to the client * @param username Username from xrdp * @param password Password from xrdp * @param ip_addr IP address for xrdp client * * @result Allocated login_info struct for a successful login * * This is a wrapper around the dialogue between sesexec and the SCP process * which is required to start a session. * * While this call is in operation, only the scp_trans transport will * be checked for messages. Incoming messages on other transports will be * ignored. The dialog can also be terminated by a SIGTERM if the SCP * transport is configured to allow this. * * The username in the returned structure may differ from the passed-in * username if multiple names map to the same UID. This can happen with * federated naming services (e.g. AD, LDAP) */ struct login_info * login_info_sys_login_user(struct trans *scp_trans, const char *username, const char *password, const char *ip_addr); /** * @brief Create a login_info structure using UDS credentials * * This should be a formality, as by the time sesexec tries this, sesman * should already have done it. * * Errors are logged. * * @param scp_trans SCP transport for talking to the client * @param ip_addr IP address for xrdp client * * @result Allocated login_info struct for a successful login */ struct login_info * login_info_uds_login_user(struct trans *scp_trans); /** * Free a struct login_info */ void login_info_free(struct login_info *self); #endif // LOGIN_INFO_H xrdp-0.10.1/sesman/sesexec/ercp_server.h000644 001751 000000 00000001744 14652432047 020260 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file ercp_server.h * @brief ercp (executive run-time control protocol) server function * @author Matt Burt * */ #ifndef ERCP_SERVER_H #define ERCP_SERVER_H /** * * @brief Processes an ERCP message * @param self The ERCP transport the message is coming in on * */ int ercp_server(struct trans *self); #endif // ERCP_SERVER_H xrdp-0.10.1/sesman/sesexec/sesexec.h000644 001751 000000 00000002706 14652432047 017377 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesexec.h * @brief Main include file * @author Jay Sorg * */ #ifndef SESEXEC_H #define SESEXEC_H #include struct config_sesman; struct trans; struct login_info; struct session_data; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #define USE_BSD_SETLOGIN #endif /* Globals */ extern struct config_sesman *g_cfg; extern unsigned char g_fixedkey[8]; extern struct login_info *g_login_info; extern struct session_data *g_session_data; extern tintptr g_term_event; extern tintptr g_sigchld_event; extern pid_t g_pid; /** * Callback to process incoming ERCP data */ int sesexec_ercp_data_in(struct trans *self); /* * Check for termination */ int sesexec_is_term(void); /* * Terminate the sesexec main loop */ void sesexec_terminate_main_loop(int status); #endif // SESEXEC_H xrdp-0.10.1/sesman/sesexec/session.h000644 001751 000000 00000006223 14652432047 017421 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file session.h * @brief Session management definitions * @author Jay Sorg, Simone Fedele * */ #ifndef SESSION_H #define SESSION_H #include #include "guid.h" #include "scp_application_types.h" #include "xrdp_constants.h" struct login_info; struct exit_status; /** * Information used to start a session */ struct session_parameters { unsigned int display; enum scp_session_type type; unsigned short width; unsigned short height; unsigned char bpp; struct guid guid; const char *shell; // Must not be NULL const char *directory; // Must not be NULL }; /** * Data involved in running a session (opaque type) * * Allocate with session_start() and free with * session_data_free() once session_active() returns zero. */ struct session_data; /** * * @brief starts a session * * @param login_info info for logged in user * @param s Session parameters * @param[out] session_data Pointer to session data for the session * * session_data is only set if E_SCP_CREATE_OK is returned * @return status */ enum scp_screate_status session_start(struct login_info *login_info, const struct session_parameters *s, struct session_data **session_data); /** * Processes an exited child process * * The PID of the child process is removed from the session_data. * * @param sd session_data for this session * @param pid PID of exited process * @param e Exit status of the exited process */ void session_process_child_exit(struct session_data *sd, int pid, const struct exit_status *e); /** * Returns a count of active processes in the session * * @param sd session_data for this session */ unsigned int session_active(const struct session_data *sd); /** * Returns the start time for an active session * * @param sd session_data for this session */ time_t session_get_start_time(const struct session_data *sd); /*** * Ask a session to terminate by signalling the window manager * * @param sd session_data for this session */ void session_send_term(struct session_data *sd); /** * Frees a session_data object * * @param sd session_data for this session * * Do not call this until session_active() returns zero, or you * lose the ability to track the session PIDs */ void session_data_free(struct session_data *session_data); /** * Runs the reconnect script for the session */ void session_reconnect(struct login_info *login_info, struct session_data *sd); #endif // SESSION_H xrdp-0.10.1/sesman/sesexec/xauth.h000644 001751 000000 00000002203 14652432047 017061 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Emmanuel Blindauer 2016 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file xauth.c * @brief XAUTHORITY handling code * */ #ifndef XAUTH_H #define XAUTH_H /** * * @brief create the XAUTHORITY file for the user according to the display and the cookie * xauth uses XAUTHORITY if defined, ~/.Xauthority otherwise * @param display The session display * @param file If not NULL, write the authorization in the file instead of default location * @return 0 if adding the cookie is ok */ int add_xauth_cookie(int display, const char *file); #endif xrdp-0.10.1/sesman/sesexec/env.c000644 001751 000000 00000021106 14652432047 016516 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file env.c * @brief User environment handling code * @author Jay Sorg * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "env.h" #include "sesman_config.h" #include "list.h" #include "log.h" #include "os_calls.h" #include "sesexec.h" #include "ssl_calls.h" #include "string_calls.h" #include "xrdp_sockets.h" /******************************************************************************/ int env_check_password_file(const char *filename, const char *passwd) { char encryptedPasswd[16]; char key[24]; char passwd_hash[20]; char passwd_hash_text[40]; int fd; int passwd_bytes; void *des; void *sha1; /* create password hash from password */ passwd_bytes = g_strlen(passwd); sha1 = ssl_sha1_info_create(); ssl_sha1_clear(sha1); ssl_sha1_transform(sha1, "xrdp_vnc", 8); ssl_sha1_transform(sha1, passwd, passwd_bytes); ssl_sha1_transform(sha1, passwd, passwd_bytes); ssl_sha1_complete(sha1, passwd_hash); ssl_sha1_info_delete(sha1); g_snprintf(passwd_hash_text, sizeof(passwd_hash_text), "%2.2x%2.2x%2.2x%2.2x", (tui8)passwd_hash[0], (tui8)passwd_hash[1], (tui8)passwd_hash[2], (tui8)passwd_hash[3]); passwd = passwd_hash_text; /* create file from password */ g_memset(encryptedPasswd, 0, sizeof(encryptedPasswd)); g_strncpy(encryptedPasswd, passwd, 8); g_memset(key, 0, sizeof(key)); g_mirror_memcpy(key, g_fixedkey, 8); des = ssl_des3_encrypt_info_create(key, 0); ssl_des3_encrypt(des, 8, encryptedPasswd, encryptedPasswd); ssl_des3_info_delete(des); fd = g_file_open_ex(filename, 0, 1, 1, 1); if (fd == -1) { LOG(LOG_LEVEL_WARNING, "Cannot write VNC password hash to file %s: %s", filename, g_get_strerror()); return 1; } g_file_write(fd, encryptedPasswd, 8); g_file_close(fd); return 0; } /******************************************************************************/ /* its the responsibility of the caller to free passwd_file */ int env_set_user(int uid, char **passwd_file, int display, const struct list *env_names, const struct list *env_values) { int error; int pw_gid; int index; int len; char *name; char *value; char *pw_username; char *pw_shell; char *pw_dir; char text[256]; char hostname[256]; pw_username = 0; pw_shell = 0; pw_dir = 0; error = g_getuser_info_by_uid(uid, &pw_username, &pw_gid, &pw_shell, &pw_dir, 0); if (error == 0) { g_rm_temp_dir(); g_clearenv(); #ifdef HAVE_SETUSERCONTEXT error = g_set_allusercontext(uid); #else /* Set some of the things setusercontext() handles on other * systems */ /* Primary group. Note that secondary groups should already * have been set, if we're not using setusercontext() */ error = g_setgid(pw_gid); if (error == 0) { error = g_setuid(uid); } if (error == 0) { g_setenv("PATH", "/sbin:/bin:/usr/bin:/usr/local/bin", 1); } #endif if (error == 0) { g_setenv("SHELL", pw_shell, 1); g_setenv("USER", pw_username, 1); g_setenv("LOGNAME", pw_username, 1); g_snprintf(text, sizeof(text), "%d", uid); g_setenv("UID", text, 1); g_setenv("HOME", pw_dir, 1); g_set_current_dir(pw_dir); g_snprintf(text, sizeof(text), ":%d.0", display); g_setenv("DISPLAY", text, 1); // Use our PID as the XRDP_SESSION value g_snprintf(text, sizeof(text), "%d", g_pid); g_setenv("XRDP_SESSION", text, 1); /* XRDP_SOCKET_PATH should be set here. It's used by * xorgxrdp and the pulseaudio plugin */ g_snprintf(text, sizeof(text), XRDP_SOCKET_PATH, uid); g_setenv("XRDP_SOCKET_PATH", text, 1); /* pulse sink socket */ g_snprintf(text, sizeof(text), CHANSRV_PORT_OUT_BASE_STR, display); g_setenv("XRDP_PULSE_SINK_SOCKET", text, 1); /* pulse source socket */ g_snprintf(text, sizeof(text), CHANSRV_PORT_IN_BASE_STR, display); g_setenv("XRDP_PULSE_SOURCE_SOCKET", text, 1); if ((env_names != 0) && (env_values != 0) && (env_names->count == env_values->count)) { for (index = 0; index < env_names->count; index++) { name = (char *) list_get_item(env_names, index), value = (char *) list_get_item(env_values, index), g_setenv(name, value, 1); } } g_gethostname(hostname, 255); hostname[255] = 0; if (passwd_file != 0) { if (0 == g_cfg->auth_file_path) { /* if no auth_file_path is set, then we go for $HOME/.vnc/sesman_passwd-USERNAME@HOSTNAME:DISPLAY */ if (!g_directory_exist(".vnc")) { if (g_mkdir(".vnc") < 0) { LOG(LOG_LEVEL_ERROR, "Error creating .vnc directory: %s", g_get_strerror()); } } len = g_snprintf(NULL, 0, "%s/.vnc/sesman_passwd-%s@%s:%d", pw_dir, pw_username, hostname, display); ++len; // Allow for terminator *passwd_file = (char *) g_malloc(len, 1); if (*passwd_file != NULL) { /* Try legacy names first, remove if found */ g_snprintf(*passwd_file, len, "%s/.vnc/sesman_%s_passwd:%d", pw_dir, pw_username, display); if (g_file_exist(*passwd_file)) { LOG(LOG_LEVEL_WARNING, "Removing old " "password file %s", *passwd_file); g_file_delete(*passwd_file); } g_snprintf(*passwd_file, len, "%s/.vnc/sesman_%s_passwd", pw_dir, pw_username); if (g_file_exist(*passwd_file)) { LOG(LOG_LEVEL_WARNING, "Removing insecure " "password file %s", *passwd_file); g_file_delete(*passwd_file); } g_snprintf(*passwd_file, len, "%s/.vnc/sesman_passwd-%s@%s:%d", pw_dir, pw_username, hostname, display); } } else { /* we use auth_file_path as requested */ len = g_snprintf(NULL, 0, g_cfg->auth_file_path, pw_username); ++len; // Allow for terminator *passwd_file = (char *) g_malloc(len, 1); if (*passwd_file != NULL) { g_snprintf(*passwd_file, len, g_cfg->auth_file_path, pw_username); } } if (*passwd_file != NULL) { LOG_DEVEL(LOG_LEVEL_DEBUG, "pass file: %s", *passwd_file); } } g_free(pw_username); g_free(pw_dir); g_free(pw_shell); } } else { LOG(LOG_LEVEL_ERROR, "error getting user info for uid %d", uid); } return error; } xrdp-0.10.1/sesman/sesexec/eicp_server.c000644 001751 000000 00000013553 14652432047 020243 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file eicp_server.c * @brief eicp (executive initialisation control protocol) server function * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include "trans.h" #include "eicp.h" #include "eicp_server.h" #include "login_info.h" #include "os_calls.h" #include "ercp.h" #include "scp.h" #include "sesexec.h" #include "session.h" /******************************************************************************/ static int handle_sys_login_request(struct trans *self) { const char *username; const char *password; const char *ip_addr; int scp_fd; int rv = eicp_get_sys_login_request(self, &username, &password, &ip_addr, &scp_fd); if (rv == 0) { struct trans *scp_trans; scp_trans = scp_init_trans_from_fd(scp_fd, TRANS_TYPE_SERVER, sesexec_is_term); if (scp_trans == NULL) { LOG(LOG_LEVEL_ERROR, "Can't create SCP trans"); g_file_close(scp_fd); rv = 1; } else { g_login_info = login_info_sys_login_user(scp_trans, username, password, ip_addr); if (g_login_info != NULL) { rv = eicp_send_sys_login_response(self, 1, g_login_info->uid, scp_fd); } else { rv = eicp_send_sys_login_response(self, 0, (uid_t) -1, 0); } trans_delete(scp_trans); // Closes scp_fd as well } } return rv; } /******************************************************************************/ static int handle_logout_request(struct trans *self) { LOG(LOG_LEVEL_INFO, "xrdp-sesexec pid %d is now logging out", g_pid); sesexec_terminate_main_loop(0); return 0; } /******************************************************************************/ static int handle_create_session_request(struct trans *self) { int scp_fd; struct session_parameters sp = {0}; int rv; rv = eicp_get_create_session_request(self, &scp_fd, &sp.display, &sp.type, &sp.width, &sp.height, &sp.bpp, &sp.shell, &sp.directory); if (rv == 0) { // Need to talk to the SCP client struct trans *scp_trans; scp_trans = scp_init_trans_from_fd(scp_fd, TRANS_TYPE_SERVER, sesexec_is_term); if (scp_trans == NULL) { LOG(LOG_LEVEL_ERROR, "Can't create SCP trans"); g_file_close(scp_fd); rv = 1; } else { enum scp_screate_status scp_status = E_SCP_SCREATE_OK; // Use the UID from the SCP connection if the user hasn't // explicitly logged in if (g_login_info == NULL && (g_login_info = login_info_uds_login_user(scp_trans)) == NULL) { scp_status = E_SCP_SCREATE_GENERAL_ERROR; } if (scp_status == E_SCP_SCREATE_OK) { // Try to create the session sp.guid = guid_new(); scp_status = session_start(g_login_info, &sp, &g_session_data); } // Return the status to the SCP client rv = scp_send_create_session_response(scp_trans, scp_status, sp.display, &sp.guid); trans_delete(scp_trans); // Further comms from sesexec is sent over the ERCP protocol ercp_trans_from_eicp_trans(self, sesexec_ercp_data_in, (void *)self); if (scp_status == E_SCP_SCREATE_OK) { rv = ercp_send_session_announce_event( self, sp.display, g_login_info->uid, sp.type, sp.width, sp.height, sp.bpp, &sp.guid, g_login_info->ip_addr, session_get_start_time(g_session_data)); } else { rv = ercp_send_session_finished_event(self); sesexec_terminate_main_loop(1); } } } return rv; } /******************************************************************************/ int eicp_server(struct trans *self) { int rv = 0; enum eicp_msg_code msgno; switch ((msgno = eicp_msg_in_get_msgno(self))) { case E_EICP_SYS_LOGIN_REQUEST: rv = handle_sys_login_request(self); break; case E_EICP_LOGOUT_REQUEST: rv = handle_logout_request(self); break; case E_EICP_CREATE_SESSION_REQUEST: rv = handle_create_session_request(self); break; default: { char buff[64]; eicp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "Ignored EICP message %s", buff); } } return rv; } xrdp-0.10.1/sesman/sesexec/xwait.h000644 001751 000000 00000001121 14652432047 017062 0ustar00metawheel000000 000000 #ifndef XWAIT_H #define XWAIT_H #include enum xwait_status { XW_STATUS_OK = 0, XW_STATUS_MISC_ERROR, XW_STATUS_TIMED_OUT, XW_STATUS_FAILED_TO_START }; /** * * @brief waits for X to start * @param uid User to run program under * @param env_names Environment to set for user (names) * @param env_values Environment to set for user (values) * @param display number * @return status * */ enum xwait_status wait_for_xserver(uid_t uid, struct list *env_names, struct list *env_values, int display); #endif xrdp-0.10.1/sesman/sesexec/xauth.c000644 001751 000000 00000003060 14652432047 017056 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Emmanuel Blindauer 2016 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file xauth.c * @brief XAUTHORITY handling code * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "log.h" #include "os_calls.h" #include "string_calls.h" /******************************************************************************/ int add_xauth_cookie(int display, const char *file) { FILE *dp; char cookie_str[33]; char cookie_bin[16]; char xauth_str[256]; int ret; g_random(cookie_bin, 16); g_bytes_to_hexstr(cookie_bin, 16, cookie_str, 33); g_sprintf(xauth_str, "xauth -q -f %s add :%d . %s", file, display, cookie_str); dp = popen(xauth_str, "r"); if (dp == NULL) { LOG(LOG_LEVEL_ERROR, "Unable to launch xauth"); return 1; } ret = pclose(dp); if (ret < 0) { LOG(LOG_LEVEL_ERROR, "An error occurred while running xauth"); return 1; } return 0; } xrdp-0.10.1/sesman/sesexec/ercp_server.c000644 001751 000000 00000003302 14652432047 020243 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file ercp_server.c * @brief ercp (executive run-time control protocol) server function * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "sesexec.h" #include "session.h" #include "trans.h" #include "ercp.h" #include "ercp_server.h" /******************************************************************************/ static int handle_session_reconnect_event(struct trans *self) { session_reconnect(g_login_info, g_session_data); return 0; } /******************************************************************************/ int ercp_server(struct trans *self) { int rv = 0; enum ercp_msg_code msgno; switch ((msgno = ercp_msg_in_get_msgno(self))) { case E_ERCP_SESSION_RECONNECT_EVENT: rv = handle_session_reconnect_event(self); break; default: { char buff[64]; ercp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "Ignored ERCP message %s", buff); } } return rv; } xrdp-0.10.1/sesman/sesexec/sesexec.c000644 001751 000000 00000032222 14652432047 017366 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Matt Burt 2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file sesexec.c * @brief Main program file for session executive process * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include "arch.h" #include "eicp.h" #include "eicp_server.h" #include "ercp.h" #include "ercp_server.h" #include "login_info.h" #include "sesexec.h" #include "sesman_config.h" #include "log.h" #include "os_calls.h" #include "session.h" #include "string_calls.h" #include "trans.h" #include "xrdp_sockets.h" struct startup_params { const char *sesman_ini; }; /* * Program-scope globals */ struct config_sesman *g_cfg; unsigned char g_fixedkey[8] = { 23, 82, 107, 6, 35, 78, 88, 7 }; struct login_info *g_login_info; struct session_data *g_session_data; tintptr g_term_event = 0; tintptr g_sigchld_event = 0; pid_t g_pid; /* * Module-scope globals */ static struct trans *g_ecp_trans; static int g_terminate_loop = 0; static int g_terminate_status = 0; /*****************************************************************************/ /** * Command line argument parser * @param[in] argc number of command line arguments * @param[in] argv pointer array of commandline arguments * @param[out] startup_params Returned startup parameters * @return 0 on success */ static int process_params(int argc, char **argv, struct startup_params *startup_params) { int index; const char *option; const char *value; startup_params->sesman_ini = DEFAULT_SESMAN_INI; index = 1; while (index < argc) { option = argv[index]; if (index + 1 < argc) { value = argv[index + 1]; } else { value = ""; } if (g_strcmp(option, "-c") == 0) { index++; startup_params->sesman_ini = value; } else /* unknown option */ { return index; } index++; } return 0; } /******************************************************************************/ #if 0 static int sesexec_scp_data_in(struct trans *self) { int rv; int available; rv = scp_msg_in_check_available(self, &available); if (rv == 0 && available) { struct sesman_con *sc = (struct sesman_con *)self->callback_data; //if ((rv = scp_process(sc)) != 0) { LOG(LOG_LEVEL_ERROR, "%s: scp_process failed", __func__); } scp_msg_in_reset(self); } return rv; } #endif /******************************************************************************/ static int sesexec_eicp_data_in(struct trans *self) { int rv; int available; rv = eicp_msg_in_check_available(self, &available); if (rv == 0 && available) { if ((rv = eicp_server(self)) != 0) { LOG(LOG_LEVEL_ERROR, "%s: eicp_server failed", __func__); } eicp_msg_in_reset(self); } return rv; } /******************************************************************************/ int sesexec_ercp_data_in(struct trans *self) { int rv; int available; rv = ercp_msg_in_check_available(self, &available); if (rv == 0 && available) { if ((rv = ercp_server(self)) != 0) { LOG(LOG_LEVEL_ERROR, "%s: ercp_server failed", __func__); } ercp_msg_in_reset(self); } return rv; } /******************************************************************************/ /** * Informs the main loop a termination signal has been received */ static void set_term_event(int sig) { /* Don't try to use a wait obj in a child process */ if (g_getpid() == g_pid) { g_set_wait_obj(g_term_event); } } /*****************************************************************************/ /* No-op signal handler. */ static void sig_no_op(int sig) { /* no-op */ } /******************************************************************************/ /** * Informs the main loop a child exiting signal has been received */ static void set_sigchld_event(int sig) { /* Don't try to use a wait obj in a child process */ if (g_getpid() == g_pid) { g_set_wait_obj(g_sigchld_event); } } /******************************************************************************/ int sesexec_is_term(void) { return g_terminate_loop || g_is_wait_obj_set(g_term_event); } /******************************************************************************/ void sesexec_terminate_main_loop(int status) { g_terminate_loop = 1; g_terminate_status = status; } /******************************************************************************/ static void process_sigchld_event(void) { struct exit_status e; int pid; // Check for any finished children while ((pid = g_waitchild(&e)) > 0) { session_process_child_exit(g_session_data, pid, &e); } } /******************************************************************************/ /** * * @brief Starts sesexec main loop * */ static int sesexec_main_loop(void) { int error = 0; int robjs_count; intptr_t robjs[32]; g_terminate_loop = 0; g_terminate_status = 0; g_login_info = NULL; while (!g_terminate_loop) { robjs_count = 0; robjs[robjs_count++] = g_term_event; robjs[robjs_count++] = g_sigchld_event; error = trans_get_wait_objs(g_ecp_trans, robjs, &robjs_count); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesexec_main_loop: " "trans_get_wait_objs(ECP) failed"); sesexec_terminate_main_loop(error); continue; } if (g_obj_wait(robjs, robjs_count, NULL, 0, -1) != 0) { /* should not get here */ LOG(LOG_LEVEL_WARNING, "sesexec_main_loop: " "Unexpected error from g_obj_wait()"); g_sleep(100); continue; } if (g_is_wait_obj_set(g_term_event)) /* term */ { g_reset_wait_obj(g_term_event); if (session_active(g_session_data)) { // Ask the active session to terminate LOG(LOG_LEVEL_INFO, "sesexec_main_loop: " "sesexec asked to terminate. " "Terminating active session"); session_send_term(g_session_data); } else { // Terminate immediately LOG(LOG_LEVEL_INFO, "sesexec_main_loop: " "sesexec asked to terminate. " "No session is active"); sesexec_terminate_main_loop(0); continue; } } if (g_is_wait_obj_set(g_sigchld_event)) /* SIGCHLD */ { g_reset_wait_obj(g_sigchld_event); // See whether the session goes from active to inactive // after processing SIGCHLD int session_was_active = session_active(g_session_data); process_sigchld_event(); if (session_was_active && !session_active(g_session_data)) { // We've finished the session. Tell sesman and // finish up. (void)ercp_send_session_finished_event(g_ecp_trans); session_data_free(g_session_data); g_session_data = NULL; sesexec_terminate_main_loop(0); continue; } } error = trans_check_wait_objs(g_ecp_trans); if (error != 0) { LOG(LOG_LEVEL_ERROR, "sesexec_main_loop: " "trans_check_wait_objs failed for ECP transport"); sesexec_terminate_main_loop(error); continue; } } login_info_free(g_login_info); return g_terminate_status; } /******************************************************************************/ static int start_logging(const char *sesman_ini) { char text[256]; int rv = 1; if (!g_file_exist(sesman_ini)) { g_printf("Config file %s does not exist\n", sesman_ini); } else { enum logReturns log_error; log_error = log_start(sesman_ini, "xrdp-sesexec", 0); if (log_error != LOG_STARTUP_OK) { switch (log_error) { case LOG_ERROR_MALLOC: g_writeln("error on malloc. cannot start logging. quitting."); break; case LOG_ERROR_FILE_OPEN: g_writeln("error opening log file [%s]. quitting.", getLogFile(text, sizeof(text) - 1)); break; default: // Assume sufficient messages have already been generated break; } } else { rv = 0; } } return rv; } /******************************************************************************/ static int get_eicp_fd(char errstr[], unsigned int errstr_size) { const char *s = g_getenv("EICP_FD"); const char *p; int fd; errstr[0] = '\0'; if (s == NULL || s[0] == '\0') { g_snprintf(errstr, errstr_size, "Can't read EICP_FD environment variable"); return -1; } for (p = s ; isdigit(*p) ; ++p) { ; } if (*p != '\0') { g_snprintf(errstr, errstr_size, "EICP_FD has non-digit char '%c'", *p); return -1; } if ((p - s) > 4) { g_snprintf(errstr, errstr_size, "EICP_FD has too many digits"); return -1; } fd = g_atoi(s); if (!g_file_is_open(fd)) { g_snprintf(errstr, errstr_size, "EICP_FD %d is not open", fd); return -1; } return fd; } /******************************************************************************/ int main(int argc, char **argv) { int error = 1; struct startup_params startup_params = {0}; int errored_argc; int eicp_fd; char eicp_errstr[128]; /* * Check the EICP transport file descriptor is provided and open * before opening any log files, config files, etc. We then open * log files, and log errors at that point */ eicp_fd = get_eicp_fd(eicp_errstr, sizeof(eicp_errstr)); g_init("xrdp-sesexec"); //g_sleep(15 * 1000); errored_argc = process_params(argc, argv, &startup_params); if (errored_argc > 0) { g_writeln("Unknown option: %s", argv[errored_argc]); } /* starting logging subsystem * * For historic reasons, we share a log file with sesman */ else if (start_logging(startup_params.sesman_ini) == 0) { /* reading config * * For historic reasons, we share a config with sesman */ if ((g_cfg = config_read(startup_params.sesman_ini)) == NULL) { LOG(LOG_LEVEL_ALWAYS, "error reading config %s: %s", startup_params.sesman_ini, g_get_strerror()); } else if (eicp_fd < 0) { LOG(LOG_LEVEL_ERROR, "%s", eicp_errstr); } else { char text[128]; g_pid = g_getpid(); /* signal handling */ g_snprintf(text, sizeof(text), "xrdp_sesexec_%8.8x_main_term", g_pid); g_term_event = g_create_wait_obj(text); g_snprintf(text, sizeof(text), "xrdp_sesexec_%8.8x_sigchld", g_pid); g_sigchld_event = g_create_wait_obj(text); // No need to terminate on SIGINT for sesexec. This can // also make it hard to debug sessions. //g_signal_user_interrupt(set_term_event); g_signal_terminate(set_term_event); /* SIGTERM */ g_signal_pipe(sig_no_op); /* SIGPIPE */ g_signal_child_stop(set_sigchld_event); /* Set up an EICP process handler * Errors are logged by this call if necessary */ g_ecp_trans = eicp_init_trans_from_fd(eicp_fd, TRANS_TYPE_SERVER, sesexec_is_term); if (g_ecp_trans != NULL) { g_ecp_trans->trans_data_in = sesexec_eicp_data_in; g_ecp_trans->callback_data = NULL; /* start program main loop */ LOG(LOG_LEVEL_INFO, "starting xrdp-sesexec with pid %d", g_pid); error = sesexec_main_loop(); trans_delete(g_ecp_trans); } g_delete_wait_obj(g_term_event); } config_free(g_cfg); log_end(); } g_deinit(); return error; } xrdp-0.10.1/sesman/sesexec/session.c000644 001751 000000 00000071751 14652432047 017424 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2015 * * BSD process grouping by: * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland. * Copyright (c) 2000-2001 Markus Friedl. * Copyright (c) 2011-2015 Koichiro Iwao, Kyushu Institute of Technology. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file session.c * @brief Session management code * @author Jay Sorg, Simone Fedele * */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include "arch.h" #include "session.h" #include "sesman_auth.h" #include "sesman_config.h" #include "env.h" #include "guid.h" #include "list.h" #include "log.h" #include "login_info.h" #include "os_calls.h" #include "sesexec.h" #include "string_calls.h" #include "xauth.h" #include "xwait.h" #include "xrdp_sockets.h" struct session_data { pid_t x_server; ///< PID of X server pid_t win_mgr; ///< PID of window manager pid_t chansrv; //< PID of chansrv time_t start_time; struct session_parameters params; // Flexible array member used to store strings in params and ip_addr; #ifdef __cplusplus char strings[1]; #else char strings[]; #endif }; /******************************************************************************/ /** * Create a new session_data structure from a session_parameters object * * @param sp Session parameters passed to session_start() * @return semi-initialised session_data struct */ static struct session_data * session_data_new(const struct session_parameters *sp) { unsigned int string_length = 0; // What string length do we need? string_length += g_strlen(sp->shell) + 1; string_length += g_strlen(sp->directory) + 1; struct session_data *sd = (struct session_data *)g_malloc(sizeof(*sd) + string_length, 0); if (sd == NULL) { LOG(LOG_LEVEL_ERROR, "Out of memory allocating session data struct"); } else { sd->win_mgr = -1; sd->x_server = -1; sd->chansrv = -1; sd->start_time = 0; /* Copy all the non-string session parameters... */ sd->params = *sp; /* ...and then the strings */ char *memptr = sd->strings; #define COPY_STRING(dest,src) \ (dest) = memptr; \ strcpy(memptr, src); \ memptr += strlen(memptr) + 1 COPY_STRING(sd->params.shell, sp->shell); COPY_STRING(sd->params.directory, sp->directory); #undef COPY_STRING } return sd; } /******************************************************************************/ void session_data_free(struct session_data *session_data) { if (session_data != NULL) { #ifdef USE_DEVEL_LOGGING if (session_data->win_mgr > 0) { LOG_DEVEL(LOG_LEVEL_WARNING, "Freeing session data with valid window manager PID %d", session_data->win_mgr); } if (session_data->x_server > 0) { LOG_DEVEL(LOG_LEVEL_WARNING, "Freeing session data with valid X server PID %d", session_data->x_server); } if (session_data->chansrv > 0) { LOG_DEVEL(LOG_LEVEL_WARNING, "Freeing session data with valid chansrv PID %d", session_data->chansrv); } #endif free(session_data); } } /******************************************************************************/ /** * Creates a string consisting of all parameters that is hosted in the param list * @param self * @param outstr, allocate this buffer before you use this function * @param len the allocated len for outstr * @return */ char * dumpItemsToString(struct list *self, char *outstr, int len) { int index; int totalLen = 0; g_memset(outstr, 0, len); if (self->count == 0) { LOG_DEVEL(LOG_LEVEL_TRACE, "List is empty"); } for (index = 0; index < self->count; index++) { /* +1 = one space*/ totalLen = totalLen + g_strlen((char *)list_get_item(self, index)) + 1; if (len > totalLen) { g_strcat(outstr, (char *)list_get_item(self, index)); g_strcat(outstr, " "); } } return outstr ; } /******************************************************************************/ static void start_chansrv(struct login_info *login_info, const struct session_parameters *s) { struct list *chansrv_params = list_create(); const char *exe_path = XRDP_SBIN_PATH "/xrdp-chansrv"; if (chansrv_params != NULL) { chansrv_params->auto_free = 1; if (!list_add_strdup(chansrv_params, exe_path)) { list_delete(chansrv_params); chansrv_params = NULL; } } if (chansrv_params == NULL) { LOG(LOG_LEVEL_ERROR, "Out of memory starting chansrv"); } else { env_set_user(login_info->uid, 0, s->display, g_cfg->env_names, g_cfg->env_values); LOG_DEVEL_LEAKING_FDS("chansrv", 3, -1); /* executing chansrv */ g_execvp_list(exe_path, chansrv_params); /* should not get here */ list_delete(chansrv_params); } } /******************************************************************************/ static void start_window_manager(struct login_info *login_info, const struct session_parameters *s) { char text[256]; env_set_user(login_info->uid, 0, s->display, g_cfg->env_names, g_cfg->env_values); auth_set_env(login_info->auth_info); LOG_DEVEL_LEAKING_FDS("window manager", 3, -1); if (s->directory[0] != '\0') { if (g_cfg->sec.allow_alternate_shell) { g_set_current_dir(s->directory); } else { LOG(LOG_LEVEL_WARNING, "Directory change to %s requested, but not " "allowed by AllowAlternateShell config value.", s->directory); } } if (s->shell[0] != '\0') { if (g_cfg->sec.allow_alternate_shell) { if (g_strchr(s->shell, ' ') != 0 || g_strchr(s->shell, '\t') != 0) { LOG(LOG_LEVEL_INFO, "Using user requested window manager on " "display %u with embedded arguments using a shell: %s", s->display, s->shell); const char *argv[] = {"sh", "-c", s->shell, NULL}; g_execvp("/bin/sh", (char **)argv); } else { LOG(LOG_LEVEL_INFO, "Using user requested window manager on " "display %d: %s", s->display, s->shell); g_execlp3(s->shell, s->shell, 0); } } else { LOG(LOG_LEVEL_WARNING, "Shell %s requested by user, but not allowed by " "AllowAlternateShell config value.", s->shell); } } else { LOG(LOG_LEVEL_DEBUG, "The user session on display %u did " "not request a specific window manager", s->display); } /* try to execute user window manager if enabled */ if (g_cfg->enable_user_wm) { g_snprintf(text, sizeof(text), "%s/%s", g_getenv("HOME"), g_cfg->user_wm); if (g_file_exist(text)) { LOG(LOG_LEVEL_INFO, "Using window manager on display %u" " from user home directory: %s", s->display, text); g_execlp3(text, g_cfg->user_wm, 0); } else { LOG(LOG_LEVEL_DEBUG, "The user home directory window manager configuration " "is enabled but window manager program does not exist: %s", text); } } LOG(LOG_LEVEL_INFO, "Using the default window manager on display %u: %s", s->display, g_cfg->default_wm); g_execlp3(g_cfg->default_wm, g_cfg->default_wm, 0); /* still a problem starting window manager just start xterm */ LOG(LOG_LEVEL_WARNING, "No window manager on display %u started, " "so falling back to starting xterm for user debugging", s->display); g_execlp3("xterm", "xterm", 0); /* should not get here */ LOG(LOG_LEVEL_ERROR, "A fatal error has occurred attempting to start " "the window manager on display %u, aborting connection", s->display); } /******************************************************************************/ static struct list * prepare_xorg_xserver_params(const struct session_parameters *s, const char *authfile) { char screen[32]; /* display number */ char text[128]; const char *xserver; struct list *params = list_create(); if (params != NULL) { params->auto_free = 1; /* * Make sure Xorg doesn't run setuid root. Root access is not * needed. Xorg can fail when run as root and the user has no * console permissions. */ if (g_cfg->sec.xorg_no_new_privileges && g_no_new_privs() != 0) { LOG(LOG_LEVEL_WARNING, "[session start] (display %u): Failed to disable " "setuid on X server: %s", s->display, g_get_strerror()); } g_snprintf(screen, sizeof(screen), ":%u", s->display); /* some args are passed via env vars */ g_snprintf(text, sizeof(text), "%d", s->width); g_setenv("XRDP_START_WIDTH", text, 1); g_snprintf(text, sizeof(text), "%d", s->height); g_setenv("XRDP_START_HEIGHT", text, 1); g_snprintf(text, sizeof(text), "%d", g_cfg->sess.max_idle_time); g_setenv("XRDP_SESMAN_MAX_IDLE_TIME", text, 1); g_snprintf(text, sizeof(text), "%d", g_cfg->sess.max_disc_time); g_setenv("XRDP_SESMAN_MAX_DISC_TIME", text, 1); g_snprintf(text, sizeof(text), "%d", g_cfg->sess.kill_disconnected); g_setenv("XRDP_SESMAN_KILL_DISCONNECTED", text, 1); /* get path of Xorg from config */ xserver = (const char *)list_get_item(g_cfg->xorg_params, 0); /* these are the must have parameters */ list_add_strdup_multi(params, xserver, screen, "-auth", authfile, NULL); /* additional parameters from sesman.ini file */ list_append_list_strdup(g_cfg->xorg_params, params, 1); } return params; } /******************************************************************************/ static struct list * prepare_xvnc_xserver_params(const struct session_parameters *s, const char *authfile, const char *passwd_file) { char screen[32] = {0}; /* display number */ char geometry[32] = {0}; char depth[32] = {0}; char guid_str[GUID_STR_SIZE]; const char *xserver; struct list *params = list_create(); if (params != NULL) { params->auto_free = 1; g_snprintf(screen, sizeof(screen), ":%u", s->display); g_snprintf(geometry, sizeof(geometry), "%dx%d", s->width, s->height); g_snprintf(depth, sizeof(depth), "%d", s->bpp); guid_to_str(&s->guid, guid_str); env_check_password_file(passwd_file, guid_str); /* get path of Xvnc from config */ xserver = (const char *)list_get_item(g_cfg->vnc_params, 0); /* these are the must have parameters */ list_add_strdup_multi(params, xserver, screen, "-auth", authfile, "-geometry", geometry, "-depth", depth, "-rfbauth", passwd_file, NULL); /* additional parameters from sesman.ini file */ //config_read_xserver_params(SCP_SESSION_TYPE_XVNC, // xserver_params); list_append_list_strdup(g_cfg->vnc_params, params, 1); } return params; } /******************************************************************************/ /* Either execs the X server, or returns */ static void start_x_server(struct login_info *login_info, const struct session_parameters *s) { char authfile[256]; /* The filename for storing xauth information */ char execvpparams[2048]; char *passwd_file = NULL; struct list *xserver_params = NULL; int unknown_session_type = 0; if (s->type == SCP_SESSION_TYPE_XVNC) { env_set_user(login_info->uid, &passwd_file, s->display, g_cfg->env_names, g_cfg->env_values); } else { env_set_user(login_info->uid, 0, s->display, g_cfg->env_names, g_cfg->env_values); } /* prepare the Xauthority stuff */ if (g_getenv("XAUTHORITY") != NULL) { g_snprintf(authfile, sizeof(authfile), "%s", g_getenv("XAUTHORITY")); } else { g_snprintf(authfile, sizeof(authfile), "%s", ".Xauthority"); } /* Add the entry in XAUTHORITY file or exit if error */ if (add_xauth_cookie(s->display, authfile) != 0) { LOG(LOG_LEVEL_ERROR, "Error setting the xauth cookie for display %u in file %s", s->display, authfile); } else { switch (s->type) { case SCP_SESSION_TYPE_XORG: xserver_params = prepare_xorg_xserver_params(s, authfile); break; case SCP_SESSION_TYPE_XVNC: xserver_params = prepare_xvnc_xserver_params(s, authfile, passwd_file); break; default: unknown_session_type = 1; } g_free(passwd_file); passwd_file = NULL; if (xserver_params == NULL) { LOG(LOG_LEVEL_ERROR, "Out of memory allocating X server params"); } else if (unknown_session_type) { LOG(LOG_LEVEL_ERROR, "Unknown session type: %d", s->type); } else { /* fire up X server */ LOG(LOG_LEVEL_INFO, "Starting X server on display %u: %s", s->display, dumpItemsToString(xserver_params, execvpparams, 2048)); LOG_DEVEL_LEAKING_FDS("X server", 3, -1); g_execvp_list((const char *)xserver_params->items[0], xserver_params); } } /* should not get here */ list_delete(xserver_params); LOG(LOG_LEVEL_ERROR, "A fatal error has occurred attempting " "to start the X server on display %u, aborting connection", s->display); } /******************************************************************************/ /* * Simple helper process to fork a child and log errors */ static int fork_child( void (*runproc)(struct login_info *, const struct session_parameters *), struct login_info *login_info, const struct session_parameters *s, pid_t group_pid) { int pid = g_fork(); if (pid == 0) { /* Child process */ if (group_pid >= 0) { (void)g_setpgid(0, group_pid); } runproc(login_info, s); g_exit(0); } if (pid < 0) { LOG(LOG_LEVEL_ERROR, "Fork failed [%s]", g_get_strerror()); } return pid; } /******************************************************************************/ enum scp_screate_status session_start_wrapped(struct login_info *login_info, const struct session_parameters *s, struct session_data *sd) { int chansrv_pid; int display_pid; int window_manager_pid; enum scp_screate_status status = E_SCP_SCREATE_GENERAL_ERROR; if (auth_start_session(login_info->auth_info, s->display) != 0) { // Errors are logged by the auth module, as they are // specific to that module return E_SCP_SCREATE_GENERAL_ERROR; } #ifdef USE_BSD_SETLOGIN /** * Create a new session and process group since the 4.4BSD * setlogin() affects the entire process group */ if (g_setsid() < 0) { LOG(LOG_LEVEL_WARNING, "[session start] (display %d): setsid failed - pid %d", s->display, g_getpid()); } if (g_setlogin(login_info->username) < 0) { LOG(LOG_LEVEL_WARNING, "[session start] (display %d): setlogin failed for user %s - pid %d", s->display, login_info->username, g_getpid()); } #endif /* Set the secondary groups before starting the session to prevent * problems on PAM-based systems (see Linux pam_setcred(3)). * If we have *BSD setusercontext() this is not done here */ #ifndef HAVE_SETUSERCONTEXT if (g_initgroups(login_info->username) != 0) { LOG(LOG_LEVEL_ERROR, "Failed to initialise secondary groups for %s: %s", login_info->username, g_get_strerror()); return E_SCP_SCREATE_GENERAL_ERROR; } #endif /* start the X server in a new process group. * * We group the X server, window manager and chansrv in a single * process group, as it allows signals to be sent to the user session * without affecting sesexec (and vice-versa). This is particularly * important when debugging sesexec as we don't want a SIGINT in * the debugger to be passed to the children */ display_pid = fork_child(start_x_server, login_info, s, 0); if (display_pid > 0) { enum xwait_status xws; xws = wait_for_xserver(login_info->uid, g_cfg->env_names, g_cfg->env_values, s->display); if (xws != XW_STATUS_OK) { switch (xws) { case XW_STATUS_TIMED_OUT: LOG(LOG_LEVEL_ERROR, "Timed out waiting for X server"); break; case XW_STATUS_FAILED_TO_START: LOG(LOG_LEVEL_ERROR, "X server failed to start"); break; default: LOG(LOG_LEVEL_ERROR, "An error occurred waiting for the X server"); } status = E_SCP_SCREATE_X_SERVER_FAIL; /* Kill it anyway in case it did start and we just failed to * pick up on it */ g_sigterm(display_pid); g_waitpid(display_pid); } else { LOG(LOG_LEVEL_INFO, "X server :%d is working", s->display); LOG(LOG_LEVEL_INFO, "Starting window manager for display :%d", s->display); window_manager_pid = fork_child(start_window_manager, login_info, s, display_pid); if (window_manager_pid < 0) { g_sigterm(display_pid); g_waitpid(display_pid); } else { LOG(LOG_LEVEL_INFO, "Starting the xrdp channel server for display :%d", s->display); chansrv_pid = fork_child(start_chansrv, login_info, s, display_pid); // Tell the caller we've started LOG(LOG_LEVEL_INFO, "Session in progress on display :%d. Waiting until the " "window manager (pid %d) exits to end the session", s->display, window_manager_pid); sd->win_mgr = window_manager_pid; sd->x_server = display_pid; sd->chansrv = chansrv_pid; sd->start_time = g_time1(); status = E_SCP_SCREATE_OK; } } } return status; } /******************************************************************************/ enum scp_screate_status session_start(struct login_info *login_info, const struct session_parameters *sp, struct session_data **session_data) { enum scp_screate_status status = E_SCP_SCREATE_GENERAL_ERROR; /* Create the session_data struct first */ struct session_data *sd = session_data_new(sp); if (sd == NULL) { status = E_SCP_SCREATE_NO_MEMORY; } else { status = session_start_wrapped(login_info, sp, sd); if (status == E_SCP_SCREATE_OK) { *session_data = sd; } else { *session_data = NULL; session_data_free(sd); } } return status; } /******************************************************************************/ static int cleanup_sockets(int uid, int display) { LOG_DEVEL(LOG_LEVEL_INFO, "cleanup_sockets:"); char file[XRDP_SOCKETS_MAXPATH]; int error = 0; g_snprintf(file, sizeof(file), CHANSRV_PORT_OUT_STR, uid, display); if (g_file_exist(file)) { LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { LOG(LOG_LEVEL_WARNING, "cleanup_sockets: failed to delete %s (%s)", file, g_get_strerror()); error++; } } g_snprintf(file, sizeof(file), CHANSRV_PORT_IN_STR, uid, display); if (g_file_exist(file)) { LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { LOG(LOG_LEVEL_WARNING, "cleanup_sockets: failed to delete %s (%s)", file, g_get_strerror()); error++; } } g_snprintf(file, sizeof(file), XRDP_CHANSRV_STR, uid, display); if (g_file_exist(file)) { LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { LOG(LOG_LEVEL_WARNING, "cleanup_sockets: failed to delete %s (%s)", file, g_get_strerror()); error++; } } g_snprintf(file, sizeof(file), CHANSRV_API_STR, uid, display); if (g_file_exist(file)) { LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { LOG(LOG_LEVEL_WARNING, "cleanup_sockets: failed to delete %s (%s)", file, g_get_strerror()); error++; } } /* the following files should be deleted by xorgxrdp * but just in case the deletion failed */ g_snprintf(file, sizeof(file), XRDP_X11RDP_STR, uid, display); if (g_file_exist(file)) { LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { LOG(LOG_LEVEL_WARNING, "cleanup_sockets: failed to delete %s (%s)", file, g_get_strerror()); error++; } } g_snprintf(file, sizeof(file), XRDP_DISCONNECT_STR, uid, display); if (g_file_exist(file)) { LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { LOG(LOG_LEVEL_WARNING, "cleanup_sockets: failed to delete %s (%s)", file, g_get_strerror()); error++; } } return error; } /******************************************************************************/ static void exit_status_to_str(const struct exit_status *e, char buff[], int bufflen) { switch (e->reason) { case E_XR_STATUS_CODE: if (e->val == 0) { g_snprintf(buff, bufflen, "exit code zero"); } else { g_snprintf(buff, bufflen, "non-zero exit code %d", e->val); } break; case E_XR_SIGNAL: { char sigstr[MAXSTRSIGLEN]; g_snprintf(buff, bufflen, "signal %s", g_sig2text(e->val, sigstr)); } break; default: g_snprintf(buff, bufflen, "an unexpected error"); break; } } /******************************************************************************/ void session_process_child_exit(struct session_data *sd, int pid, const struct exit_status *e) { if (pid == sd->x_server) { LOG(LOG_LEVEL_INFO, "X server pid %d on display :%d finished", sd->x_server, sd->params.display); sd->x_server = -1; // No other action - window manager should be going soon } else if (pid == sd->chansrv) { LOG(LOG_LEVEL_INFO, "xrdp channel server pid %d on display :%d finished", sd->chansrv, sd->params.display); sd->chansrv = -1; } else if (pid == sd->win_mgr) { int wm_wait_time = g_time1() - sd->start_time; if (e->reason == E_XR_STATUS_CODE && e->val == 0) { LOG(LOG_LEVEL_INFO, "Window manager (pid %d, display %d) " "finished normally in %d secs", sd->win_mgr, sd->params.display, wm_wait_time); } else { char reason[128]; exit_status_to_str(e, reason, sizeof(reason)); LOG(LOG_LEVEL_WARNING, "Window manager (pid %d, display %d) " "exited with %s. This " "could indicate a window manager config problem", sd->win_mgr, sd->params.display, reason); } if (wm_wait_time < 10) { /* This could be a config issue. Log a significant error */ LOG(LOG_LEVEL_WARNING, "Window manager (pid %d, display %d) " "exited quickly (%d secs). This could indicate a window " "manager config problem", sd->win_mgr, sd->params.display, wm_wait_time); } sd->win_mgr = -1; if (sd->x_server > 0) { LOG(LOG_LEVEL_INFO, "Terminating X server (pid %d) on display :%d", sd->x_server, sd->params.display); g_sigterm(sd->x_server); } if (sd->chansrv > 0) { LOG(LOG_LEVEL_INFO, "Terminating the xrdp channel server (pid %d) " "on display :%d", sd->chansrv, sd->params.display); g_sigterm(sd->chansrv); } } if (!session_active(sd)) { cleanup_sockets(g_login_info->uid, sd->params.display); } } /******************************************************************************/ unsigned int session_active(const struct session_data *sd) { return (sd == NULL) ? 0 : (sd->win_mgr > 0) + (sd->x_server > 0) + (sd->chansrv > 0); } /******************************************************************************/ time_t session_get_start_time(const struct session_data *sd) { return (sd == NULL) ? 0 : sd->start_time; } /******************************************************************************/ void session_send_term(struct session_data *sd) { if (sd != NULL && sd->win_mgr > 0) { g_sigterm(sd->win_mgr); } } /******************************************************************************/ static void start_reconnect_script(struct login_info *login_info, const struct session_parameters *s) { env_set_user(login_info->uid, 0, s->display, g_cfg->env_names, g_cfg->env_values); auth_set_env(login_info->auth_info); if (g_file_exist(g_cfg->reconnect_sh)) { LOG_DEVEL_LEAKING_FDS("reconnect script", 3, -1); LOG(LOG_LEVEL_INFO, "Starting session reconnection script on display %d: %s", s->display, g_cfg->reconnect_sh); g_execlp3(g_cfg->reconnect_sh, g_cfg->reconnect_sh, 0); /* should not get here */ LOG(LOG_LEVEL_ERROR, "Error starting session reconnection script on display %d: %s", s->display, g_cfg->reconnect_sh); } else { LOG(LOG_LEVEL_WARNING, "Session reconnection script file does not exist: %s", g_cfg->reconnect_sh); } } /******************************************************************************/ void session_reconnect(struct login_info *login_info, struct session_data *sd) { if (fork_child(start_reconnect_script, login_info, &sd->params, sd->x_server) < 0) { LOG(LOG_LEVEL_ERROR, "Failed to fork for session reconnection script"); } } xrdp-0.10.1/sesman/sesexec/Makefile.am000644 001751 000000 00000001427 14652432047 017622 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/common SESEXEC_EXTRA_LIBS = pkglibexec_PROGRAMS = \ xrdp-sesexec xrdp_sesexec_SOURCES = \ sesexec.c \ sesexec.h \ session.c \ session.h \ eicp_server.c \ eicp_server.h \ ercp_server.c \ ercp_server.h \ env.c \ env.h \ login_info.c \ login_info.h \ xauth.c \ xauth.h \ xwait.c \ xwait.h xrdp_sesexec_LDFLAGS = xrdp_sesexec_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la \ $(SESEXEC_EXTRA_LIBS) xrdp-0.10.1/sesman/sesexec/login_info.c000644 001751 000000 00000025021 14652432047 020051 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file login_info.c * @brief Define functionality associated with user logins for sesexec * @author Matt Burt * */ #if defined(HAVE_CONFIG_H) #include #endif #include "login_info.h" #include "trans.h" #include "sesman_auth.h" #include "sesman_access.h" #include "sesman_config.h" #include "login_info.h" #include "os_calls.h" #include "scp.h" #include "sesexec.h" #include "string_calls.h" /******************************************************************************/ /** * Logs an authentication failure message * * @param username Username * @param ip_addr IP address, if known * * The message is intended for use by fail2ban. Make changes with care. */ static void log_authfail_message(const char *username, const char *ip_addr) { if (ip_addr == NULL || ip_addr[0] == '\0') { ip_addr = "unknown"; } LOG(LOG_LEVEL_INFO, "AUTHFAIL: user=%s ip=%s time=%d", username, ip_addr, g_time1()); } /******************************************************************************/ /** * Authenticate and authorize the connection * * @param username Name for user * @param password Password * @param ip_addr Remote IP address * @param login_info Structure to fill in for a successful login * @return Status for the operation * * @post If E_SCP_LOGIN_OK is returned, g_login_info is filled in * */ static enum scp_login_status authenticate_and_authorize_connection(const char *supplied_username, const char *password, const char *ip_addr, struct login_info *login_info) { int uid; char *username; // From reverse-looking up the UID enum scp_login_status status; struct auth_info *auth_info; if (g_getuser_info_by_name(supplied_username, &uid, NULL, NULL, NULL, NULL) != 0) { /* we can't get a UID for the user */ LOG(LOG_LEVEL_ERROR, "Can't get UID for user %s", supplied_username); log_authfail_message(supplied_username, ip_addr); status = E_SCP_LOGIN_NOT_AUTHENTICATED; } else if (g_getuser_info_by_uid(uid, &username, NULL, NULL, NULL, NULL) != 0) { LOG(LOG_LEVEL_ERROR, "Can't reverse lookup UID %d", uid); status = E_SCP_LOGIN_NOT_AUTHENTICATED; } else { if (g_strcmp(username, supplied_username) != 0) { /* * If using a federated naming service (e.g. AD), the username * supplied may not match that name mapped to by the UID. We * will generate a warning in this instance so the user can see * what is being used */ LOG(LOG_LEVEL_WARNING, "Using username %s for the session (from UID %d)", username, uid); } auth_info = auth_userpass(username, password, ip_addr, &status); /* Sanity check on result of call */ if ((auth_info != NULL && status != E_SCP_LOGIN_OK) || (auth_info == NULL && status == E_SCP_LOGIN_OK)) { LOG(LOG_LEVEL_ERROR, "Bugcheck; inconsistent auth result. " "info = %p, status = %d", (void *)auth_info, (int)status); status = E_SCP_LOGIN_GENERAL_ERROR; auth_end(auth_info); auth_info = NULL; } /* Group access allowed? */ if (status == E_SCP_LOGIN_OK && !access_login_allowed(&g_cfg->sec, username)) { LOG(LOG_LEVEL_INFO, "Username okay but group problem for " "user: %s", username); status = E_SCP_LOGIN_NOT_AUTHORIZED; auth_end(auth_info); auth_info = NULL; } switch (status) { case E_SCP_LOGIN_OK: { char *dup_username = g_strdup(username); char *dup_ip_addr = g_strdup(ip_addr); if (dup_username == NULL || dup_ip_addr == NULL) { LOG(LOG_LEVEL_ERROR, "%s : Memory allocation failed", __func__); g_free(dup_username); g_free(dup_ip_addr); status = E_SCP_LOGIN_NO_MEMORY; auth_end(auth_info); auth_info = NULL; } else { LOG(LOG_LEVEL_INFO, "Access permitted for user: %s", username); login_info->uid = uid; login_info->username = dup_username; login_info->ip_addr = dup_ip_addr; login_info->auth_info = auth_info; } } break; case E_SCP_LOGIN_NOT_AUTHENTICATED: log_authfail_message(username, ip_addr); break; default: break; } g_free(username); } return status; } /******************************************************************************/ static int get_scp_client_retry(struct trans *scp_trans, const char **username, const char **password, const char **ip_addr) { int got_message = 0; // Wait for an SCP message enum scp_msg_code msgno; scp_msg_in_reset(scp_trans); if (scp_msg_in_wait_available(scp_trans) == 0) { msgno = scp_msg_in_get_msgno(scp_trans); switch (msgno) { case E_SCP_SYS_LOGIN_REQUEST: if (scp_get_sys_login_request(scp_trans, username, password, ip_addr) == 0) { got_message = 1; } break; case E_SCP_CLOSE_CONNECTION_REQUEST: break; default: { char buff[64]; scp_msgno_to_str(msgno, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "unexpected message %s from SCP client", buff); } break; } } return got_message; } /******************************************************************************/ struct login_info * login_info_sys_login_user(struct trans *scp_trans, const char *username, const char *password, const char *ip_addr) { struct login_info *result; enum scp_login_status status = E_SCP_LOGIN_GENERAL_ERROR; int server_closed = 0; if ((result = g_new0(struct login_info, 1)) == NULL) { LOG(LOG_LEVEL_ERROR, "Allocation failure logging in user"); } else { int first_time = 1; unsigned int retry_count = g_cfg->sec.login_retry; result->uid = (uid_t) -1; while (status != E_SCP_LOGIN_OK && !server_closed) { // First time round, we have credentials supplied by the // caller. On subsequent trips, we have to wait for the // SCP client to send us more. if (first_time) { first_time = 0; } else if (!get_scp_client_retry(scp_trans, &username, &password, &ip_addr)) { status = E_SCP_LOGIN_GENERAL_ERROR; break; } status = authenticate_and_authorize_connection(username, password, ip_addr, result); if (status != E_SCP_LOGIN_OK) { if (retry_count > 0) { --retry_count; } else { server_closed = 1; } } if (scp_send_login_response(scp_trans, status, server_closed, result->uid) != 0) { status = E_SCP_LOGIN_GENERAL_ERROR; break; } } } if (status != E_SCP_LOGIN_OK) { login_info_free(result); result = NULL; } return result; } /******************************************************************************/ struct login_info * login_info_uds_login_user(struct trans *scp_trans) { struct login_info *result; int uid; // Needed as g_sck_get_peer_cred() doesn't use uid_t // Allocate a struct for the result, with the IP address set to "" if ((result = g_new0(struct login_info, 1)) == NULL || (result->ip_addr = g_new0(char, 1)) == NULL) { LOG(LOG_LEVEL_ERROR, "Allocation failure logging in user"); } else if (g_sck_get_peer_cred(scp_trans->sck, NULL, &uid, NULL) != 0) { LOG(LOG_LEVEL_ERROR, "Unable to get peer credentials for SCP socket"); } else if (g_getuser_info_by_uid(uid, &result->username, NULL, NULL, NULL, NULL) != 0) { LOG(LOG_LEVEL_ERROR, "Can't reverse lookup UID %d", result->uid); } else if ((result->auth_info = auth_uds(result->username, NULL)) == NULL) { LOG(LOG_LEVEL_ERROR, "Can't authorize user %s over UDS", result->username); } else if (!access_login_allowed(&g_cfg->sec, result->username)) { LOG(LOG_LEVEL_ERROR, "Access denied for user %s by your system admin", result->username); } else { result->uid = (uid_t)uid; return result; } login_info_free(result); return NULL; } /******************************************************************************/ void login_info_free(struct login_info *self) { if (self != NULL) { g_free(self->username); g_free(self->ip_addr); if (self->auth_info != NULL) { auth_end(self->auth_info); } g_free(self); } } xrdp-0.10.1/sesman/sesexec/xwait.c000644 001751 000000 00000011400 14652432047 017056 0ustar00metawheel000000 000000 #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include "env.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" #include "xwait.h" #include #include /******************************************************************************/ static void log_waitforx_messages(FILE *dp) { char buffer[256]; while (fgets(buffer, sizeof(buffer), dp)) { const char *msg = buffer; enum logLevels level = LOG_LEVEL_ERROR; g_strtrim(buffer, 2); // Has the message got a class at the start? if (strlen(buffer) > 3 && buffer[0] == '<' && buffer[2] == '>') { switch (buffer[1]) { case 'D': level = LOG_LEVEL_DEBUG; break; case 'I': level = LOG_LEVEL_INFO; break; case 'W': level = LOG_LEVEL_WARNING; break; default: level = LOG_LEVEL_ERROR; break; } msg = buffer + 3; } if (strlen(msg) > 0) { LOG(level, "waitforx: %s", msg); } } } /******************************************************************************/ /** * Contruct the command to run to check the X server */ static struct list * make_xwait_command(int display) { const char exe[] = XRDP_LIBEXEC_PATH "/waitforx"; char displaystr[64]; struct list *cmd = list_create(); if (cmd != NULL) { cmd->auto_free = 1; g_snprintf(displaystr, sizeof(displaystr), ":%d", display); if (!list_add_strdup_multi(cmd, exe, "-d", displaystr, NULL)) { list_delete(cmd); cmd = NULL; } } return cmd; } /******************************************************************************/ enum xwait_status wait_for_xserver(uid_t uid, struct list *env_names, struct list *env_values, int display) { enum xwait_status rv = XW_STATUS_MISC_ERROR; int fd[2] = {-1, -1}; struct list *cmd = make_xwait_command(display); // Construct the command to execute to check the display if (cmd == NULL) { LOG(LOG_LEVEL_ERROR, "Can't create xwait command list - no mem"); } else if (g_pipe(fd) != 0) { LOG(LOG_LEVEL_ERROR, "Can't create pipe : %s", g_get_strerror()); } else { pid_t pid = g_fork(); if (pid < 0) { // Error already logged } else if (pid == 0) { /* Child process */ /* Send stdout and stderr up the pipe */ g_file_close(fd[0]); g_file_duplicate_on(fd[1], 1); g_file_duplicate_on(fd[1], 2); /* Move to the user context... */ env_set_user(uid, 0, display, env_names, env_values); /* ...and run the program */ g_execvp_list((const char *)cmd->items[0], cmd); LOG(LOG_LEVEL_ERROR, "Can't run %s - %s", (const char *)cmd->items[0], g_get_strerror()); g_exit(rv); } else { LOG(LOG_LEVEL_DEBUG, "Waiting for X server to start on display :%d", display); g_file_close(fd[1]); fd[1] = -1; FILE *dp = fdopen(fd[0], "r"); if (dp == NULL) { LOG(LOG_LEVEL_ERROR, "Unable to launch waitforx"); } else { struct exit_status e; fd[0] = -1; // File descriptor closed by fclose() log_waitforx_messages(dp); fclose(dp); e = g_waitpid_status(pid); switch (e.reason) { case E_XR_STATUS_CODE: rv = (enum xwait_status)e.val; break; case E_XR_SIGNAL: { char sigstr[MAXSTRSIGLEN]; LOG(LOG_LEVEL_ERROR, "waitforx failed with unexpected signal %s", g_sig2text(e.val, sigstr)); } break; default: LOG(LOG_LEVEL_ERROR, "waitforx failed with unknown reason"); } } } if (fd[0] >= 0) { g_file_close(fd[0]); } if (fd[1] >= 0) { g_file_close(fd[1]); } } list_delete(cmd); return rv; } xrdp-0.10.1/sesman/sesexec/eicp_server.h000644 001751 000000 00000001752 14652432047 020246 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file eicp_server.h * @brief eicp (executive initialisation control protocol) server function * @author Matt Burt * */ #ifndef EICP_SERVER_H #define EICP_SERVER_H /** * * @brief Processes an EICP message * @param self The EICP transport the message is coming in on * */ int eicp_server(struct trans *self); #endif // EICP_SERVER_H xrdp-0.10.1/sesman/sesexec/Makefile.in000644 001751 000000 00000056477 14652432075 017653 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = xrdp-sesexec$(EXEEXT) subdir = sesman/sesexec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" PROGRAMS = $(pkglibexec_PROGRAMS) am_xrdp_sesexec_OBJECTS = sesexec.$(OBJEXT) session.$(OBJEXT) \ eicp_server.$(OBJEXT) ercp_server.$(OBJEXT) env.$(OBJEXT) \ login_info.$(OBJEXT) xauth.$(OBJEXT) xwait.$(OBJEXT) xrdp_sesexec_OBJECTS = $(am_xrdp_sesexec_OBJECTS) am__DEPENDENCIES_1 = xrdp_sesexec_DEPENDENCIES = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = xrdp_sesexec_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(xrdp_sesexec_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/eicp_server.Po ./$(DEPDIR)/env.Po \ ./$(DEPDIR)/ercp_server.Po ./$(DEPDIR)/login_info.Po \ ./$(DEPDIR)/sesexec.Po ./$(DEPDIR)/session.Po \ ./$(DEPDIR)/xauth.Po ./$(DEPDIR)/xwait.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xrdp_sesexec_SOURCES) DIST_SOURCES = $(xrdp_sesexec_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_LIBEXEC_PATH=\"${libexecdir}/xrdp\" \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/sesman/libsesman \ -I$(top_srcdir)/libipm \ -I$(top_srcdir)/common SESEXEC_EXTRA_LIBS = xrdp_sesexec_SOURCES = \ sesexec.c \ sesexec.h \ session.c \ session.h \ eicp_server.c \ eicp_server.h \ ercp_server.c \ ercp_server.h \ env.c \ env.h \ login_info.c \ login_info.h \ xauth.c \ xauth.h \ xwait.c \ xwait.h xrdp_sesexec_LDFLAGS = xrdp_sesexec_LDADD = \ $(top_builddir)/sesman/libsesman/libsesman.la \ $(top_builddir)/libipm/libipm.la \ $(top_builddir)/common/libcommon.la \ $(SESEXEC_EXTRA_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sesman/sesexec/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign sesman/sesexec/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || 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)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && $(am__rm_f) $$files clean-pkglibexecPROGRAMS: $(am__rm_f) $(pkglibexec_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(pkglibexec_PROGRAMS:$(EXEEXT)=) xrdp-sesexec$(EXEEXT): $(xrdp_sesexec_OBJECTS) $(xrdp_sesexec_DEPENDENCIES) $(EXTRA_xrdp_sesexec_DEPENDENCIES) @rm -f xrdp-sesexec$(EXEEXT) $(AM_V_CCLD)$(xrdp_sesexec_LINK) $(xrdp_sesexec_OBJECTS) $(xrdp_sesexec_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eicp_server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ercp_server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/login_info.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sesexec.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xauth.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xwait.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/eicp_server.Po -rm -f ./$(DEPDIR)/env.Po -rm -f ./$(DEPDIR)/ercp_server.Po -rm -f ./$(DEPDIR)/login_info.Po -rm -f ./$(DEPDIR)/sesexec.Po -rm -f ./$(DEPDIR)/session.Po -rm -f ./$(DEPDIR)/xauth.Po -rm -f ./$(DEPDIR)/xwait.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-pkglibexecPROGRAMS 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 ./$(DEPDIR)/eicp_server.Po -rm -f ./$(DEPDIR)/env.Po -rm -f ./$(DEPDIR)/ercp_server.Po -rm -f ./$(DEPDIR)/login_info.Po -rm -f ./$(DEPDIR)/sesexec.Po -rm -f ./$(DEPDIR)/session.Po -rm -f ./$(DEPDIR)/xauth.Po -rm -f ./$(DEPDIR)/xwait.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibexecPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibexecPROGRAMS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/sesman/sesexec/env.h000644 001751 000000 00000002633 14652432047 016527 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * * @file env.h * @brief User environment handling code declarations * @author Jay Sorg * */ #ifndef ENV_H #define ENV_H #include "list.h" /** * * @brief Creates vnc password file * @param filename VNC password file name * @param password The password to be encrypted * @return 0 on success, 1 on error * */ int env_check_password_file(const char *filename, const char *password); /** * * @brief Sets user environment ($PATH, $HOME, $UID, and others) * @param uid user ID * @param passwd_file VNC password file * @param display The session display * @return 0 on success, g_getuser_info() error codes on error * */ int env_set_user(int uid, char **passwd_file, int display, const struct list *env_names, const struct list *env_values); #endif xrdp-0.10.1/libxrdp/xrdp_sec.c000644 001751 000000 00000275266 14652432047 016276 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * secure layer */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "log.h" #include "string_calls.h" /* some compilers need unsigned char to avoid warnings */ static tui8 g_pad_54[40] = { 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54 }; /* some compilers need unsigned char to avoid warnings */ static tui8 g_pad_92[48] = { 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92 }; static const tui8 g_fips_reverse_table[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; static const tui8 g_fips_oddparity_table[256] = { 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x07, 0x07, 0x08, 0x08, 0x0b, 0x0b, 0x0d, 0x0d, 0x0e, 0x0e, 0x10, 0x10, 0x13, 0x13, 0x15, 0x15, 0x16, 0x16, 0x19, 0x19, 0x1a, 0x1a, 0x1c, 0x1c, 0x1f, 0x1f, 0x20, 0x20, 0x23, 0x23, 0x25, 0x25, 0x26, 0x26, 0x29, 0x29, 0x2a, 0x2a, 0x2c, 0x2c, 0x2f, 0x2f, 0x31, 0x31, 0x32, 0x32, 0x34, 0x34, 0x37, 0x37, 0x38, 0x38, 0x3b, 0x3b, 0x3d, 0x3d, 0x3e, 0x3e, 0x40, 0x40, 0x43, 0x43, 0x45, 0x45, 0x46, 0x46, 0x49, 0x49, 0x4a, 0x4a, 0x4c, 0x4c, 0x4f, 0x4f, 0x51, 0x51, 0x52, 0x52, 0x54, 0x54, 0x57, 0x57, 0x58, 0x58, 0x5b, 0x5b, 0x5d, 0x5d, 0x5e, 0x5e, 0x61, 0x61, 0x62, 0x62, 0x64, 0x64, 0x67, 0x67, 0x68, 0x68, 0x6b, 0x6b, 0x6d, 0x6d, 0x6e, 0x6e, 0x70, 0x70, 0x73, 0x73, 0x75, 0x75, 0x76, 0x76, 0x79, 0x79, 0x7a, 0x7a, 0x7c, 0x7c, 0x7f, 0x7f, 0x80, 0x80, 0x83, 0x83, 0x85, 0x85, 0x86, 0x86, 0x89, 0x89, 0x8a, 0x8a, 0x8c, 0x8c, 0x8f, 0x8f, 0x91, 0x91, 0x92, 0x92, 0x94, 0x94, 0x97, 0x97, 0x98, 0x98, 0x9b, 0x9b, 0x9d, 0x9d, 0x9e, 0x9e, 0xa1, 0xa1, 0xa2, 0xa2, 0xa4, 0xa4, 0xa7, 0xa7, 0xa8, 0xa8, 0xab, 0xab, 0xad, 0xad, 0xae, 0xae, 0xb0, 0xb0, 0xb3, 0xb3, 0xb5, 0xb5, 0xb6, 0xb6, 0xb9, 0xb9, 0xba, 0xba, 0xbc, 0xbc, 0xbf, 0xbf, 0xc1, 0xc1, 0xc2, 0xc2, 0xc4, 0xc4, 0xc7, 0xc7, 0xc8, 0xc8, 0xcb, 0xcb, 0xcd, 0xcd, 0xce, 0xce, 0xd0, 0xd0, 0xd3, 0xd3, 0xd5, 0xd5, 0xd6, 0xd6, 0xd9, 0xd9, 0xda, 0xda, 0xdc, 0xdc, 0xdf, 0xdf, 0xe0, 0xe0, 0xe3, 0xe3, 0xe5, 0xe5, 0xe6, 0xe6, 0xe9, 0xe9, 0xea, 0xea, 0xec, 0xec, 0xef, 0xef, 0xf1, 0xf1, 0xf2, 0xf2, 0xf4, 0xf4, 0xf7, 0xf7, 0xf8, 0xf8, 0xfb, 0xfb, 0xfd, 0xfd, 0xfe, 0xfe }; static const tui8 g_fips_ivec[8] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; /*****************************************************************************/ static void hex_str_to_bin(char *in, char *out, int out_len) { int in_index; int in_len; int out_index; int val; char hex[16]; in_len = g_strlen(in); out_index = 0; in_index = 0; while (in_index <= (in_len - 4)) { if ((in[in_index] == '0') && (in[in_index + 1] == 'x')) { hex[0] = in[in_index + 2]; hex[1] = in[in_index + 3]; hex[2] = 0; if (out_index < out_len) { val = g_htoi(hex); out[out_index] = val; } out_index++; } in_index++; } } /*****************************************************************************/ static void xrdp_load_keyboard_layout(struct xrdp_client_info *client_info) { int fd; int index = 0; int bytes; struct list *names = (struct list *)NULL; struct list *items = (struct list *)NULL; struct list *values = (struct list *)NULL; char *item = (char *)NULL; char *value = (char *)NULL; char *q = (char *)NULL; char keyboard_cfg_file[256] = { 0 }; char rdp_layout[256] = { 0 }; const struct xrdp_keyboard_overrides *ko = &client_info->xrdp_keyboard_overrides; LOG(LOG_LEVEL_INFO, "xrdp_load_keyboard_layout: Keyboard information sent" " by the RDP client, keyboard_type:[0x%02X], keyboard_subtype:[0x%02X]," " keylayout:[0x%08X]", client_info->keyboard_type, client_info->keyboard_subtype, client_info->keylayout); if (ko->type != -1) { LOG(LOG_LEVEL_INFO, "overrode keyboard_type 0x%02X" " with 0x%02X", client_info->keyboard_type, ko->type); client_info->keyboard_type = ko->type; } if (ko->subtype != -1) { LOG(LOG_LEVEL_INFO, "overrode keyboard_subtype 0x%02X" " with 0x%02X", client_info->keyboard_subtype, ko->subtype); client_info->keyboard_subtype = ko->subtype; } if (ko->layout != -1) { LOG(LOG_LEVEL_INFO, "overrode keylayout 0x%08X" " with 0x%08X", client_info->keylayout, ko->layout); client_info->keylayout = ko->layout; } /* infer model/variant */ /* TODO specify different X11 keyboard models/variants */ g_memset(client_info->model, 0, sizeof(client_info->model)); g_memset(client_info->variant, 0, sizeof(client_info->variant)); g_strncpy(client_info->layout, "us", sizeof(client_info->layout) - 1); if (client_info->keyboard_subtype == 3) { /* macintosh keyboard */ bytes = sizeof(client_info->variant); g_strncpy(client_info->variant, "mac", bytes - 1); } else if (client_info->keyboard_subtype == 0) { /* default - standard subtype */ client_info->keyboard_subtype = 1; } g_snprintf(keyboard_cfg_file, 255, "%s/xrdp_keyboard.ini", XRDP_CFG_PATH); LOG(LOG_LEVEL_DEBUG, "keyboard_cfg_file %s", keyboard_cfg_file); fd = g_file_open_ro(keyboard_cfg_file); if (fd >= 0) { int section_found = -1; char section_rdp_layouts[256] = { 0 }; char section_layouts_map[256] = { 0 }; names = list_create(); names->auto_free = 1; items = list_create(); items->auto_free = 1; values = list_create(); values->auto_free = 1; file_read_sections(fd, names); for (index = 0; index < names->count; index++) { q = (char *)list_get_item(names, index); if (g_strncasecmp("default", q, 8) != 0) { int i; file_read_section(fd, q, items, values); for (i = 0; i < items->count; i++) { item = (char *)list_get_item(items, i); value = (char *)list_get_item(values, i); LOG(LOG_LEVEL_DEBUG, "xrdp_load_keyboard_layout: item %s value %s", item, value); if (g_strcasecmp(item, "keyboard_type") == 0) { int v = g_atoi(value); if (v == client_info->keyboard_type) { section_found = index; } } else if (g_strcasecmp(item, "keyboard_subtype") == 0) { int v = g_atoi(value); if (v != client_info->keyboard_subtype && section_found == index) { section_found = -1; break; } } else if (g_strcasecmp(item, "rdp_layouts") == 0) { if (section_found != -1 && section_found == index) { g_strncpy(section_rdp_layouts, value, 255); } } else if (g_strcasecmp(item, "layouts_map") == 0) { if (section_found != -1 && section_found == index) { g_strncpy(section_layouts_map, value, 255); } } else if (g_strcasecmp(item, "model") == 0) { if (section_found != -1 && section_found == index) { bytes = sizeof(client_info->model); g_memset(client_info->model, 0, bytes); g_strncpy(client_info->model, value, bytes - 1); } } else if (g_strcasecmp(item, "variant") == 0) { if (section_found != -1 && section_found == index) { bytes = sizeof(client_info->variant); g_memset(client_info->variant, 0, bytes); g_strncpy(client_info->variant, value, bytes - 1); } } else if (g_strcasecmp(item, "options") == 0) { if (section_found != -1 && section_found == index) { bytes = sizeof(client_info->options); g_memset(client_info->options, 0, bytes); g_strncpy(client_info->options, value, bytes - 1); } } else { /* * mixing items from different sections will result in * skipping over current section. */ LOG(LOG_LEVEL_DEBUG, "xrdp_load_keyboard_layout: skipping " "configuration item - %s, continuing to next " "section", item); break; } } list_clear(items); list_clear(values); } } if (section_found == -1) { g_memset(section_rdp_layouts, 0, sizeof(char) * 256); g_memset(section_layouts_map, 0, sizeof(char) * 256); // read default section file_read_section(fd, "default", items, values); for (index = 0; index < items->count; index++) { item = (char *)list_get_item(items, index); value = (char *)list_get_item(values, index); if (g_strcasecmp(item, "rdp_layouts") == 0) { g_strncpy(section_rdp_layouts, value, 255); } else if (g_strcasecmp(item, "layouts_map") == 0) { g_strncpy(section_layouts_map, value, 255); } } list_clear(items); list_clear(values); } /* load the map */ file_read_section(fd, section_rdp_layouts, items, values); for (index = 0; index < items->count; index++) { int rdp_layout_id; item = (char *)list_get_item(items, index); value = (char *)list_get_item(values, index); rdp_layout_id = g_htoi(value); if (rdp_layout_id == client_info->keylayout) { g_strncpy(rdp_layout, item, 255); break; } } list_clear(items); list_clear(values); file_read_section(fd, section_layouts_map, items, values); for (index = 0; index < items->count; index++) { item = (char *)list_get_item(items, index); value = (char *)list_get_item(values, index); if (g_strcasecmp(item, rdp_layout) == 0) { bytes = sizeof(client_info->layout); g_strncpy(client_info->layout, value, bytes - 1); break; } } list_delete(names); list_delete(items); list_delete(values); LOG(LOG_LEVEL_INFO, "xrdp_load_keyboard_layout: model [%s] variant [%s] " "layout [%s] options [%s]", client_info->model, client_info->variant, client_info->layout, client_info->options); g_file_close(fd); } else { LOG(LOG_LEVEL_ERROR, "xrdp_load_keyboard_layout: error opening %s", keyboard_cfg_file); } } /*****************************************************************************/ struct xrdp_sec * xrdp_sec_create(struct xrdp_rdp *owner, struct trans *trans) { struct xrdp_sec *self; self = (struct xrdp_sec *) g_malloc(sizeof(struct xrdp_sec), 1); self->rdp_layer = owner; self->crypt_method = CRYPT_METHOD_NONE; /* set later */ self->crypt_level = CRYPT_LEVEL_NONE; self->mcs_layer = xrdp_mcs_create(self, trans, &(self->client_mcs_data), &(self->server_mcs_data)); self->fastpath_layer = xrdp_fastpath_create(self, trans); self->chan_layer = xrdp_channel_create(self, self->mcs_layer); self->is_security_header_present = 1; return self; } /*****************************************************************************/ void xrdp_sec_delete(struct xrdp_sec *self) { if (self == 0) { return; } xrdp_channel_delete(self->chan_layer); xrdp_mcs_delete(self->mcs_layer); xrdp_fastpath_delete(self->fastpath_layer); ssl_rc4_info_delete(self->decrypt_rc4_info); /* TODO clear all data */ ssl_rc4_info_delete(self->encrypt_rc4_info); /* TODO clear all data */ ssl_des3_info_delete(self->decrypt_fips_info); ssl_des3_info_delete(self->encrypt_fips_info); ssl_hmac_info_delete(self->sign_fips_info); g_free(self->client_mcs_data.data); g_free(self->server_mcs_data.data); /* Crypto information must always be cleared */ g_memset(self, 0, sizeof(struct xrdp_sec)); g_free(self); } /*****************************************************************************/ /* returns error */ int xrdp_sec_init(struct xrdp_sec *self, struct stream *s) { if (xrdp_mcs_init(self->mcs_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_init: xrdp_mcs_init failed"); return 1; } if (self->crypt_level > CRYPT_LEVEL_NONE) /* RDP encryption */ { if (self->crypt_level == CRYPT_LEVEL_FIPS) { s_push_layer(s, sec_hdr, 4 + 4 + 8); } else if (self->crypt_level > CRYPT_LEVEL_LOW) { s_push_layer(s, sec_hdr, 4 + 8); } else if (self->crypt_level) { s_push_layer(s, sec_hdr, 4); } } else { s_push_layer(s, sec_hdr, 0); } return 0; } /*****************************************************************************/ /* Reduce key entropy from 64 to 40 bits */ static void xrdp_sec_make_40bit(char *key) { key[0] = 0xd1; key[1] = 0x26; key[2] = 0x9e; } /*****************************************************************************/ /* returns error */ /* update an encryption key */ static int xrdp_sec_update(char *key, char *update_key, int key_len) { char shasig[20]; void *sha1_info; void *md5_info; void *rc4_info; sha1_info = ssl_sha1_info_create(); md5_info = ssl_md5_info_create(); rc4_info = ssl_rc4_info_create(); ssl_sha1_clear(sha1_info); ssl_sha1_transform(sha1_info, update_key, key_len); ssl_sha1_transform(sha1_info, (char *)g_pad_54, 40); ssl_sha1_transform(sha1_info, key, key_len); ssl_sha1_complete(sha1_info, shasig); ssl_md5_clear(md5_info); ssl_md5_transform(md5_info, update_key, key_len); ssl_md5_transform(md5_info, (char *)g_pad_92, 48); ssl_md5_transform(md5_info, shasig, 20); ssl_md5_complete(md5_info, key); ssl_rc4_set_key(rc4_info, key, key_len); ssl_rc4_crypt(rc4_info, key, key_len); if (key_len == 8) { xrdp_sec_make_40bit(key); } ssl_sha1_info_delete(sha1_info); ssl_md5_info_delete(md5_info); ssl_rc4_info_delete(rc4_info); return 0; } /*****************************************************************************/ static void xrdp_sec_fips_decrypt(struct xrdp_sec *self, char *data, int len) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_fips_decrypt:"); ssl_des3_decrypt(self->decrypt_fips_info, len, data, data); self->decrypt_use_count++; } /*****************************************************************************/ static void xrdp_sec_decrypt(struct xrdp_sec *self, char *data, int len) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_decrypt:"); if (self->decrypt_use_count == 4096) { xrdp_sec_update(self->decrypt_key, self->decrypt_update_key, self->rc4_key_len); ssl_rc4_set_key(self->decrypt_rc4_info, self->decrypt_key, self->rc4_key_len); self->decrypt_use_count = 0; } ssl_rc4_crypt(self->decrypt_rc4_info, data, len); self->decrypt_use_count++; } /*****************************************************************************/ static void xrdp_sec_fips_encrypt(struct xrdp_sec *self, char *data, int len) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_fips_encrypt:"); ssl_des3_encrypt(self->encrypt_fips_info, len, data, data); self->encrypt_use_count++; } /*****************************************************************************/ static void xrdp_sec_encrypt(struct xrdp_sec *self, char *data, int len) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_encrypt:"); if (self->encrypt_use_count == 4096) { xrdp_sec_update(self->encrypt_key, self->encrypt_update_key, self->rc4_key_len); ssl_rc4_set_key(self->encrypt_rc4_info, self->encrypt_key, self->rc4_key_len); self->encrypt_use_count = 0; } ssl_rc4_crypt(self->encrypt_rc4_info, data, len); self->encrypt_use_count++; } /*****************************************************************************/ /** * Reads a null-terminated unicode string from a stream where the length * of the string is known. * * Strings are part of one of the following from [MS-RDPBCGR] :- * - TS_INFO_PACKET (2.2.1.11.1.1) * - TS_EXTENDED_INFO_PACKET (2.2.1.11.1.1.1) * * @param s Stream * @param src_bytes Size in bytes of the string, EXCLUDING the two-byte * terminator * @param dst Destination buffer * @param dst_len Length of buffer, including terminator space * * @return 0 for success, != 0 for a buffer overflow or a missing terminator */ static int ts_info_utf16_in(struct stream *s, int src_bytes, char *dst, int dst_len) { int rv = 0; LOG_DEVEL(LOG_LEVEL_TRACE, "ts_info_utf16_in: uni_len %d, dst_len %d", src_bytes, dst_len); if (!s_check_rem_and_log(s, src_bytes + 2, "ts_info_utf16_in")) { rv = 1; } else { int term; int num_chars = in_utf16_le_fixed_as_utf8(s, src_bytes / 2, dst, dst_len); if (num_chars > dst_len) { LOG(LOG_LEVEL_ERROR, "ts_info_utf16_in: output buffer overflow"); rv = 1; } // String should be null-terminated. We haven't read the terminator yet in_uint16_le(s, term); if (term != 0) { LOG(LOG_LEVEL_ERROR, "ts_info_utf16_in: bad terminator. Expected 0, got %d", term); rv = 1; } } return rv; } /*****************************************************************************/ /* Process TS_INFO_PACKET */ /* returns error */ static int xrdp_sec_process_logon_info(struct xrdp_sec *self, struct stream *s) { int flags = 0; unsigned int len_domain = 0; unsigned int len_user = 0; unsigned int len_password = 0; unsigned int len_program = 0; unsigned int len_directory = 0; unsigned int len_clnt_addr = 0; unsigned int len_clnt_dir = 0; const char *sep; if (!s_check_rem_and_log(s, 8, "Parsing [MS-RDPBCGR] TS_INFO_PACKET")) { return 1; } in_uint8s(s, 4); in_uint32_le(s, flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Parsing [MS-RDPBCGR] TS_INFO_PACKET"); /* this is the first test that the decrypt is working */ if ((flags & RDP_LOGON_NORMAL) != RDP_LOGON_NORMAL) /* 0x33 */ { /* must be or error */ LOG(LOG_LEVEL_ERROR, "received wrong flags, likely decrypt not working"); return 1; } if (flags & RDP_LOGON_LEAVE_AUDIO) { self->rdp_layer->client_info.sound_code = 1; LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_REMOTECONSOLEAUDIO found"); LOG(LOG_LEVEL_DEBUG, "Client requested that audio on the server be played on the server."); } if (flags & RDP_LOGON_RAIL) { self->rdp_layer->client_info.rail_enable = 1; LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_RAIL found"); LOG(LOG_LEVEL_DEBUG, "Client requested Remote Application Integrated Locally (RAIL)."); } if (flags & RDP_LOGON_AUTO) { LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_AUTOLOGON found"); /* todo, for now not allowing autologon and mce both */ if (!self->rdp_layer->client_info.is_mce) { self->rdp_layer->client_info.rdp_autologin = 1; LOG(LOG_LEVEL_DEBUG, "Client requested auto logon."); } else { LOG(LOG_LEVEL_WARNING, "Auto logon is not supported with MCE"); } } if (flags & RDP_COMPRESSION) { LOG_DEVEL(LOG_LEVEL_DEBUG, "[MS-RDPBCGR] TS_INFO_PACKET flag INFO_COMPRESSION found, " "CompressionType 0x%1.1x", (flags & 0x00001E00) >> 9); /* TODO: check the client's supported compression type vs the server compression used */ if (self->rdp_layer->client_info.use_bulk_comp) { self->rdp_layer->client_info.rdp_compression = 1; LOG(LOG_LEVEL_DEBUG, "Client requested compression enabled."); } else { LOG(LOG_LEVEL_DEBUG, "Client requested compression, but server " "compression is disabled."); } } if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_INFO_PACKET cbDomain")) { return 1; } in_uint16_le(s, len_domain); if (len_domain >= INFO_CLIENT_MAX_CB_LEN) { LOG(LOG_LEVEL_ERROR, "Client supplied domain is too long. Max length %d, domain length %d", INFO_CLIENT_MAX_CB_LEN, len_domain); return 1; } if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_INFO_PACKET cbUserName")) { return 1; } in_uint16_le(s, len_user); /* * Microsoft's itap client running on Mac OS/Android * always sends autologon credentials, even when user has not * configured any */ if (len_user == 0 && self->rdp_layer->client_info.rdp_autologin) { LOG(LOG_LEVEL_DEBUG, "Client supplied user name is empty, disabling autologin"); self->rdp_layer->client_info.rdp_autologin = 0; } if (len_user >= INFO_CLIENT_MAX_CB_LEN) { LOG(LOG_LEVEL_ERROR, "Client supplied user name is too long. Max length %d, user name length %d", INFO_CLIENT_MAX_CB_LEN, len_user); return 1; } if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_INFO_PACKET cbPassword")) { return 1; } in_uint16_le(s, len_password); /* * Ignore autologin requests if the password is empty. System managers * who really want to allow empty passwords can do this with a * special session type */ if (len_password == 0 && self->rdp_layer->client_info.rdp_autologin) { LOG(LOG_LEVEL_DEBUG, "Client supplied password is empty, disabling autologin"); self->rdp_layer->client_info.rdp_autologin = 0; } if (len_password >= INFO_CLIENT_MAX_CB_LEN) { LOG(LOG_LEVEL_ERROR, "Client supplied password is too long. Max length %d, password length %d", INFO_CLIENT_MAX_CB_LEN, len_password); return 1; } if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_INFO_PACKET cbAlternateShell")) { return 1; } in_uint16_le(s, len_program); if (len_program >= INFO_CLIENT_MAX_CB_LEN) { LOG(LOG_LEVEL_ERROR, "Client supplied program name is too long. Max length %d, program name length %d", INFO_CLIENT_MAX_CB_LEN, len_program); return 1; } if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_INFO_PACKET cbWorkingDir")) { return 1; } in_uint16_le(s, len_directory); if (len_directory >= INFO_CLIENT_MAX_CB_LEN) { LOG(LOG_LEVEL_ERROR, "Client supplied directory name is too long. Max length %d, directory name length %d", INFO_CLIENT_MAX_CB_LEN, len_directory); return 1; } if (ts_info_utf16_in(s, len_domain, self->rdp_layer->client_info.domain, sizeof(self->rdp_layer->client_info.domain)) != 0) { LOG(LOG_LEVEL_ERROR, "ERROR reading domain"); return 1; } if (ts_info_utf16_in(s, len_user, self->rdp_layer->client_info.username, sizeof(self->rdp_layer->client_info.username)) != 0) { LOG(LOG_LEVEL_ERROR, "ERROR reading user name"); return 1; } // If we require credentials, don't continue if they're not provided if (self->rdp_layer->client_info.require_credentials) { if ((flags & RDP_LOGON_AUTO) == 0) { LOG(LOG_LEVEL_ERROR, "Server is configured to require that the " "client enable auto logon with credentials, but the client did " "not request auto logon."); return 1; } if (len_user == 0 || len_password == 0) { LOG(LOG_LEVEL_ERROR, "Server is configured to require that the " "client enable auto logon with credentials, but the client did " "not supply both a username and password."); return 1; } } if (flags & RDP_LOGON_AUTO) { if (ts_info_utf16_in(s, len_password, self->rdp_layer->client_info.password, sizeof(self->rdp_layer->client_info.password)) != 0) { LOG(LOG_LEVEL_ERROR, "ERROR reading password"); return 1; } } else if (self->rdp_layer->client_info.enable_token_login && len_user > 0 && len_password == 0 && (sep = g_strchr(self->rdp_layer->client_info.username, '\x1f')) != NULL) { LOG(LOG_LEVEL_DEBUG, "Client supplied a Logon token. Overwriting password with logon token."); g_strncpy(self->rdp_layer->client_info.password, sep + 1, sizeof(self->rdp_layer->client_info.password) - 1); self->rdp_layer->client_info.username[sep - self->rdp_layer->client_info.username] = '\0'; self->rdp_layer->client_info.rdp_autologin = 1; } else { // Skip the password if (!s_check_rem_and_log(s, len_password + 2, "Parsing [MS-RDPBCGR] TS_INFO_PACKET Password")) { return 1; } in_uint8s(s, len_password + 2); } if (self->rdp_layer->client_info.domain_user_separator[0] != '\0' && self->rdp_layer->client_info.domain[0] != '\0') { LOG(LOG_LEVEL_DEBUG, "Client supplied domain with user name. Overwriting user name with user name parsed from domain."); int size = sizeof(self->rdp_layer->client_info.username); g_strncat(self->rdp_layer->client_info.username, self->rdp_layer->client_info.domain_user_separator, size - 1 - g_strlen(self->rdp_layer->client_info.domain_user_separator)); g_strncat(self->rdp_layer->client_info.username, self->rdp_layer->client_info.domain, size - 1 - g_strlen(self->rdp_layer->client_info.domain)); } if (ts_info_utf16_in(s, len_program, self->rdp_layer->client_info.program, sizeof(self->rdp_layer->client_info.program)) != 0) { LOG(LOG_LEVEL_ERROR, "ERROR reading program"); return 1; } if (ts_info_utf16_in(s, len_directory, self->rdp_layer->client_info.directory, sizeof(self->rdp_layer->client_info.directory)) != 0) { LOG(LOG_LEVEL_ERROR, "ERROR reading directory"); return 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_INFO_PACKET " "CodePage (ignored), flags 0x%8.8x, cbDomain %d, cbUserName %d, " "cbPassword %d, cbAlternateShell %d, cbWorkingDir %d, Domain %s, " "UserName %s, Password (omitted from log), AlternateShell %s, " "WorkingDir %s", flags, len_domain, len_user, len_password, len_program, len_directory, self->rdp_layer->client_info.domain, self->rdp_layer->client_info.username, self->rdp_layer->client_info.program, self->rdp_layer->client_info.directory); LOG(LOG_LEVEL_DEBUG, "Client supplied domain: %s", self->rdp_layer->client_info.domain); LOG(LOG_LEVEL_DEBUG, "Client supplied username: %s", self->rdp_layer->client_info.username); LOG(LOG_LEVEL_DEBUG, "Client supplied password: "); LOG(LOG_LEVEL_DEBUG, "Client supplied program: %s", self->rdp_layer->client_info.program); LOG(LOG_LEVEL_DEBUG, "Client supplied directory: %s", self->rdp_layer->client_info.directory); /* TODO: explain why the windows key flag is used to determine if the TS_EXTENDED_INFO_PACKET should be parsed */ if (flags & RDP_LOGON_BLOB) /* INFO_ENABLEWINDOWSKEY */ { if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_EXTENDED_INFO_PACKET " "clientAddressFamily and cbClientAddress")) { return 1; } /* TS_EXTENDED_INFO_PACKET required fields */ in_uint8s(s, 2); /* clientAddressFamily */ in_uint16_le(s, len_clnt_addr); if (len_clnt_addr > EXTENDED_INFO_MAX_CLIENT_ADDR_LENGTH || !s_check_rem(s, len_clnt_addr)) { LOG(LOG_LEVEL_ERROR, "clientAddress is too long (%u bytes)", len_clnt_addr); return 1; } // The clientAddress is currently unused. [MS-RDPBCGR] requires // a mandatory null terminator, but some clients set // len_clnt_addr == 0 if this field is missing. Allow for this // in any future implementation. in_uint8s(s, len_clnt_addr); // Skip Unicode clientAddress if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_EXTENDED_INFO_PACKET clientDir")) { return 1; } in_uint16_le(s, len_clnt_dir); if (len_clnt_dir > INFO_CLIENT_MAX_CB_LEN || !s_check_rem(s, len_clnt_dir)) { LOG(LOG_LEVEL_ERROR, "clientDir is too long (%u bytes)", len_clnt_dir); return 1; } in_uint8s(s, len_clnt_dir); // Skip Unicode clientDir LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_EXTENDED_INFO_PACKET " " clientAddressFamily (ignored), " "cbClientAddress (ignored), clientAddress (ignored), " "cbClientDir (ignored), clientDir (ignored)"); /* TODO: MS-BCGR 2.2.1.11.1.1.1 says that all fields after the client directory are optional. */ if (!s_check_rem_and_log(s, 4 + 64 + 20 + 64 + 20 + 4 + 4, "Parsing [MS-RDPBCGR] TS_EXTENDED_INFO_PACKET " "clientTimeZone, clientSessionId, and performanceFlags")) { return 1; } /* TS_TIME_ZONE_INFORMATION */ in_uint8s(s, 4); /* Bias (4) */ in_uint8s(s, 64); /* StandardName (64) */ in_uint8s(s, 20); /* StandardDate (16), StandardBias (4) */ in_uint8s(s, 64); /* DaylightName (64) */ in_uint8s(s, 20); /* DaylightDate (16), DaylightBias (4) */ in_uint8s(s, 4); /* TS_EXTENDED_INFO_PACKET clientSessionId (4) */ /* TS_EXTENDED_INFO_PACKET optional fields */ in_uint32_le(s, self->rdp_layer->client_info.rdp5_performanceflags); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_EXTENDED_INFO_PACKET " " clientTimeZone (ignored), " "clientSessionId (ignored), performanceFlags 0x%8.8x, " "cbAutoReconnectCookie (ignored), autoReconnectCookie (ignored), " "reserved1 (ignored), reserved2 (ignored), " "cbDynamicDSTTimeZoneKeyName (ignored), " "dynamicDSTTimeZoneKeyName (ignored), " "dynamicDaylightTimeDisabled (ignored)", self->rdp_layer->client_info.rdp5_performanceflags); } return 0; } /*****************************************************************************/ /* * Send a [MS-RDPBCGR] Server License Error PDU (2.2.1.12) with * STATUS_VALID_CLIENT */ /* returns error */ static int xrdp_sec_send_lic_response(struct xrdp_sec *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_mcs_init(self->mcs_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_send_lic_response: xrdp_mcs_init failed"); free_stream(s); return 1; } /* [MS-RDPBCGR] TS_SECURITY_HEADER */ /* A careful reading of [MS-RDPBCGR] 2.2.1.12 shows that a securityHeader * MUST be included, and provided the flag fields of the header does * not contain SEC_ENCRYPT, it is always possible to send a basic * security header */ out_uint16_le(s, SEC_LICENSE_PKT | SEC_LICENSE_ENCRYPT_CS); /* flags */ out_uint16_le(s, 0); /* flagsHi */ /* [MS-RDPBCGR] LICENSE_VALID_CLIENT_DATA */ /* preamble (LICENSE_PREAMBLE) */ out_uint8(s, ERROR_ALERT); out_uint8(s, PREAMBLE_VERSION_3_0); out_uint16_le(s, 16); /* Message size, including pre-amble */ /* validClientMessage */ /* From [MS-RDPBCGR] 2.2.12.1, dwStateTransition must be ST_NO_TRANSITION, * and the bbErrorInfo field must contain an empty blob of type * BB_ERROR_BLOB */ out_uint32_le(s, STATUS_VALID_CLIENT); /* dwErrorCode */ out_uint32_le(s, ST_NO_TRANSITION); /* dwStateTransition */ out_uint16_le(s, BB_ERROR_BLOB); /* wBlobType */ out_uint16_le(s, 0); /* wBlobLen */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] Server License Error PDU with STATUS_VALID_CLIENT"); if (xrdp_mcs_send(self->mcs_layer, s, MCS_GLOBAL_CHANNEL) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] Server License Error PDU with STATUS_VALID_CLIENT failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ static void xrdp_sec_rsa_op(struct xrdp_sec *self, char *out, char *in, int in_bytes, char *mod, char *exp) { ssl_mod_exp(out, self->rsa_key_bytes, in, in_bytes, mod, self->rsa_key_bytes, exp, self->rsa_key_bytes); } /*****************************************************************************/ static void xrdp_sec_hash_48(char *out, char *in, char *salt1, char *salt2, int salt) { int i; void *sha1_info; void *md5_info; char pad[4]; char sha1_sig[20]; char md5_sig[16]; sha1_info = ssl_sha1_info_create(); md5_info = ssl_md5_info_create(); for (i = 0; i < 3; i++) { g_memset(pad, salt + i, 4); ssl_sha1_clear(sha1_info); ssl_sha1_transform(sha1_info, pad, i + 1); ssl_sha1_transform(sha1_info, in, 48); ssl_sha1_transform(sha1_info, salt1, 32); ssl_sha1_transform(sha1_info, salt2, 32); ssl_sha1_complete(sha1_info, sha1_sig); ssl_md5_clear(md5_info); ssl_md5_transform(md5_info, in, 48); ssl_md5_transform(md5_info, sha1_sig, 20); ssl_md5_complete(md5_info, md5_sig); g_memcpy(out + i * 16, md5_sig, 16); } ssl_sha1_info_delete(sha1_info); ssl_md5_info_delete(md5_info); } /*****************************************************************************/ static void xrdp_sec_hash_16(char *out, char *in, char *salt1, char *salt2) { void *md5_info; md5_info = ssl_md5_info_create(); ssl_md5_clear(md5_info); ssl_md5_transform(md5_info, in, 16); ssl_md5_transform(md5_info, salt1, 32); ssl_md5_transform(md5_info, salt2, 32); ssl_md5_complete(md5_info, out); ssl_md5_info_delete(md5_info); } /*****************************************************************************/ static void fips_expand_key_bits(const char *in, char *out) { tui8 buf[32]; tui8 c; int i; int b; int p; int r; /* reverse every byte in the key */ for (i = 0; i < 21; i++) { c = in[i]; buf[i] = g_fips_reverse_table[c]; } /* insert a zero-bit after every 7th bit */ for (i = 0, b = 0; i < 24; i++, b += 7) { p = b / 8; r = b % 8; if (r == 0) { out[i] = buf[p] & 0xfe; } else { /* c is accumulator */ c = buf[p] << r; c |= buf[p + 1] >> (8 - r); out[i] = c & 0xfe; } } /* reverse every byte */ /* alter lsb so the byte has odd parity */ for (i = 0; i < 24; i++) { c = out[i]; c = g_fips_reverse_table[c]; out[i] = g_fips_oddparity_table[c]; } } /****************************************************************************/ static void xrdp_sec_fips_establish_keys(struct xrdp_sec *self) { char server_encrypt_key[32]; char server_decrypt_key[32]; const char *fips_ivec; void *sha1; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_sec_fips_establish_keys:"); sha1 = ssl_sha1_info_create(); ssl_sha1_clear(sha1); ssl_sha1_transform(sha1, self->client_random + 16, 16); ssl_sha1_transform(sha1, self->server_random + 16, 16); ssl_sha1_complete(sha1, server_decrypt_key); server_decrypt_key[20] = server_decrypt_key[0]; fips_expand_key_bits(server_decrypt_key, self->fips_decrypt_key); ssl_sha1_info_delete(sha1); sha1 = ssl_sha1_info_create(); ssl_sha1_clear(sha1); ssl_sha1_transform(sha1, self->client_random, 16); ssl_sha1_transform(sha1, self->server_random, 16); ssl_sha1_complete(sha1, server_encrypt_key); server_encrypt_key[20] = server_encrypt_key[0]; fips_expand_key_bits(server_encrypt_key, self->fips_encrypt_key); ssl_sha1_info_delete(sha1); sha1 = ssl_sha1_info_create(); ssl_sha1_clear(sha1); ssl_sha1_transform(sha1, server_encrypt_key, 20); ssl_sha1_transform(sha1, server_decrypt_key, 20); ssl_sha1_complete(sha1, self->fips_sign_key); ssl_sha1_info_delete(sha1); fips_ivec = (const char *) g_fips_ivec; self->encrypt_fips_info = ssl_des3_encrypt_info_create(self->fips_encrypt_key, fips_ivec); self->decrypt_fips_info = ssl_des3_decrypt_info_create(self->fips_decrypt_key, fips_ivec); self->sign_fips_info = ssl_hmac_info_create(); } /****************************************************************************/ static void xrdp_sec_establish_keys(struct xrdp_sec *self) { char session_key[48]; char temp_hash[48]; char input[48]; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_sec_establish_keys:"); g_memcpy(input, self->client_random, 24); g_memcpy(input + 24, self->server_random, 24); xrdp_sec_hash_48(temp_hash, input, self->client_random, self->server_random, 65); xrdp_sec_hash_48(session_key, temp_hash, self->client_random, self->server_random, 88); g_memcpy(self->sign_key, session_key, 16); xrdp_sec_hash_16(self->encrypt_key, session_key + 16, self->client_random, self->server_random); xrdp_sec_hash_16(self->decrypt_key, session_key + 32, self->client_random, self->server_random); if (self->crypt_method == CRYPT_METHOD_40BIT) { xrdp_sec_make_40bit(self->sign_key); xrdp_sec_make_40bit(self->encrypt_key); xrdp_sec_make_40bit(self->decrypt_key); self->rc4_key_len = 8; } else { self->rc4_key_len = 16; } g_memcpy(self->decrypt_update_key, self->decrypt_key, 16); g_memcpy(self->encrypt_update_key, self->encrypt_key, 16); ssl_rc4_set_key(self->decrypt_rc4_info, self->decrypt_key, self->rc4_key_len); ssl_rc4_set_key(self->encrypt_rc4_info, self->encrypt_key, self->rc4_key_len); } /*****************************************************************************/ /* returns error */ int xrdp_sec_recv_fastpath(struct xrdp_sec *self, struct stream *s) { int ver; int len; int pad; #ifndef USE_DEVEL_LOGGING /* TODO: remove UNUSED_VAR once the `ver` variable is used for more than logging in debug mode */ UNUSED_VAR(ver); #endif if (xrdp_fastpath_recv(self->fastpath_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_recv_fastpath: xrdp_fastpath_recv failed"); return 1; } if (self->fastpath_layer->secFlags & FASTPATH_INPUT_ENCRYPTED) { if (self->crypt_level == CRYPT_LEVEL_FIPS) { if (!s_check_rem_and_log(s, 12, "Parsing [MS-RDPBCGR] TS_FP_FIPS_INFO")) { return 1; } /* TS_FP_FIPS_INFO */ in_uint16_le(s, len); in_uint8(s, ver); /* length (2 bytes) */ in_uint8(s, pad); LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_FP_FIPS_INFO " "length %d, version %d, padlen %d", len, ver, pad); if (len != 0x10) /* length MUST set to 0x10 */ { LOG(LOG_LEVEL_ERROR, "Received header [MS-RDPBCGR] TS_FP_FIPS_INFO " "invalid fastpath length. Expected 16, received %d", len); return 1; } /* remainder of TS_FP_INPUT_PDU */ in_uint8s(s, 8); /* dataSignature (8 bytes), skip for now */ LOG_DEVEL(LOG_LEVEL_TRACE, "CRYPT_LEVEL_FIPS - data len %d", (int)(s->end - s->p)); xrdp_sec_fips_decrypt(self, s->p, (int)(s->end - s->p)); s->end -= pad; } else { if (!s_check_rem_and_log(s, 8, "Parsing [MS-RDPBCGR] TS_FP_INPUT_PDU dataSignature")) { return 1; } /* remainder of TS_FP_INPUT_PDU */ in_uint8s(s, 8); /* dataSignature (8 bytes), skip for now */ xrdp_sec_decrypt(self, s->p, (int)(s->end - s->p)); } } if (self->fastpath_layer->numEvents == 0) /* set by xrdp_fastpath_recv() */ { /** * If numberEvents is not provided in fpInputHeader, it will be provided * as one additional byte here. */ if (!s_check_rem_and_log(s, 8, "Parsing [MS-RDPBCGR] TS_FP_INPUT_PDU numEvents")) { return 1; } in_uint8(s, self->fastpath_layer->numEvents); /* numEvents (1 byte) (optional) */ } LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_INPUT_PDU " "fpInputHeader.action (ignored), " "fpInputHeader.numEvents (see final numEvents), " "fpInputHeader.flags %d, length1 (ToDo), length2 (ToDo), " "fipsInformation %s, dataSignature (ignored), numEvents %d", self->fastpath_layer->secFlags, (self->fastpath_layer->secFlags & FASTPATH_INPUT_ENCRYPTED) ? "(see above)" : "(not present)", self->fastpath_layer->numEvents); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_sec_recv(struct xrdp_sec *self, struct stream *s, int *chan) { int flags; int len; int ver; int pad; if (xrdp_mcs_recv(self->mcs_layer, s, chan) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_recv: xrdp_mcs_recv failed"); return 1; } /* TODO: check if moving this check until after the is_security_header_present causes any issues. the security header is optional (eg. TLS connections), so this check should really be after the check if the security header is present, this currently seems to be working by coincidence at the moment. */ if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_SECURITY_HEADER")) { return 1; } if (!(self->is_security_header_present)) { /* noisy log statement with no real info since this is an expected state for TLS connections */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_sec_recv: security header NOT present"); return 0; } /* TS_SECURITY_HEADER */ in_uint32_le(s, flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_SECURITY_HEADER " "flags 0x%8.8x, flagsHi (merged with flags)", flags); if (flags & SEC_ENCRYPT) /* 0x08 */ { if (self->crypt_level == CRYPT_LEVEL_FIPS) { if (!s_check_rem_and_log(s, 12, "Parsing [MS-RDPBCGR] TS_SECURITY_HEADER2")) { return 1; } /* TS_SECURITY_HEADER2 */ in_uint16_le(s, len); /* length */ in_uint8(s, ver); /* version */ in_uint8(s, pad); /* padlen */ in_uint8s(s, 8); /* signature(8) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_SECURITY_HEADER2 " "length %d, version %d, padlen %d, dataSignature (ignored)", len, ver, pad); if (len != 16) { LOG(LOG_LEVEL_ERROR, "Received header [MS-RDPBCGR] TS_SECURITY_HEADER2 " "has unexpected length. Expected 16, actual %d", len); return 1; } if (ver != 1) { LOG(LOG_LEVEL_ERROR, "Received header [MS-RDPBCGR] TS_SECURITY_HEADER2 " "has unexpected version. Expected 1, actual %d", ver); return 1; } xrdp_sec_fips_decrypt(self, s->p, (int)(s->end - s->p)); s->end -= pad; } else if (self->crypt_level > CRYPT_LEVEL_NONE) { if (!s_check_rem_and_log(s, 8, "Parsing [MS-RDPBCGR] TS_SECURITY_HEADER1")) { return 1; } /* TS_SECURITY_HEADER1 */ in_uint8s(s, 8); /* signature(8) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_SECURITY_HEADER1 " "dataSignature (ignored)"); xrdp_sec_decrypt(self, s->p, (int)(s->end - s->p)); } } if (flags & SEC_EXCHANGE_PKT) /* 0x01 TS_SECURITY_PACKET */ { if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_SECURITY_PACKET")) { return 1; } in_uint32_le(s, len); /* 512, 2048 bit */ if ((len != 64 + 8) && (len != 256 + 8)) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_recv : error - unexpected length %d", len); return 1; } if (!s_check_rem_and_log(s, len - 8, "Parsing [MS-RDPBCGR] TS_SECURITY_PACKET encryptedClientRandom")) { return 1; } in_uint8a(s, self->client_crypt_random, len - 8); xrdp_sec_rsa_op(self, self->client_random, self->client_crypt_random, len - 8, self->pub_mod, self->pri_exp); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_SECURITY_PACKET " "length %d, encryptedClientRandom (see below)", len); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "encryptedClientRandom", self->client_crypt_random, len - 8); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "decrypted encryptedClientRandom", self->client_random, 256); if (self->crypt_level == CRYPT_LEVEL_FIPS) { xrdp_sec_fips_establish_keys(self); } else if (self->crypt_method != CRYPT_METHOD_NONE) { xrdp_sec_establish_keys(self); } *chan = 1; /* just set a non existing channel and exit */ LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_recv: out channel 1 (non-existing channel)"); return 0; } if (flags & SEC_INFO_PKT) { if (xrdp_sec_process_logon_info(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_recv: xrdp_sec_process_logon_info failed"); return 1; } if (xrdp_sec_send_lic_response(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_recv: xrdp_sec_send_lic_response failed"); return 1; } if (self->crypt_level == CRYPT_LEVEL_NONE && self->crypt_method == CRYPT_METHOD_NONE) { /* in tls mode, no more security header from now on */ self->is_security_header_present = 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_recv: out 'send demand active'"); return -1; /* special error that means send demand active */ } return 0; } /*****************************************************************************/ /* Output a uint32 into a buffer (little-endian) */ static void buf_out_uint32(char *buffer, int value) { buffer[0] = (value) & 0xff; buffer[1] = (value >> 8) & 0xff; buffer[2] = (value >> 16) & 0xff; buffer[3] = (value >> 24) & 0xff; } /*****************************************************************************/ /* Generate a MAC hash (5.2.3.1), using a combination of SHA1 and MD5 */ static void xrdp_sec_fips_sign(struct xrdp_sec *self, char *out, int out_len, char *data, int data_len) { char buf[20]; char lenhdr[4]; buf_out_uint32(lenhdr, self->encrypt_use_count); ssl_hmac_sha1_init(self->sign_fips_info, self->fips_sign_key, 20); ssl_hmac_transform(self->sign_fips_info, data, data_len); ssl_hmac_transform(self->sign_fips_info, lenhdr, 4); ssl_hmac_complete(self->sign_fips_info, buf, 20); g_memcpy(out, buf, out_len); } /*****************************************************************************/ /* Generate a MAC hash (5.2.3.1), using a combination of SHA1 and MD5 */ static void xrdp_sec_sign(struct xrdp_sec *self, char *out, int out_len, char *data, int data_len) { char shasig[20]; char md5sig[16]; char lenhdr[4]; void *sha1_info; void *md5_info; buf_out_uint32(lenhdr, data_len); sha1_info = ssl_sha1_info_create(); md5_info = ssl_md5_info_create(); ssl_sha1_clear(sha1_info); ssl_sha1_transform(sha1_info, self->sign_key, self->rc4_key_len); ssl_sha1_transform(sha1_info, (char *)g_pad_54, 40); ssl_sha1_transform(sha1_info, lenhdr, 4); ssl_sha1_transform(sha1_info, data, data_len); ssl_sha1_complete(sha1_info, shasig); ssl_md5_clear(md5_info); ssl_md5_transform(md5_info, self->sign_key, self->rc4_key_len); ssl_md5_transform(md5_info, (char *)g_pad_92, 48); ssl_md5_transform(md5_info, shasig, 20); ssl_md5_complete(md5_info, md5sig); g_memcpy(out, md5sig, out_len); ssl_sha1_info_delete(sha1_info); ssl_md5_info_delete(md5_info); } /*****************************************************************************/ /* returns error */ int xrdp_sec_send(struct xrdp_sec *self, struct stream *s, int chan) { int datalen; int pad; s_pop_layer(s, sec_hdr); if (self->crypt_level > CRYPT_LEVEL_NONE) { if (self->crypt_level == CRYPT_LEVEL_FIPS) { out_uint32_le(s, SEC_ENCRYPT); datalen = (int)((s->end - s->p) - 12); out_uint16_le(s, 16); /* crypto header size */ out_uint8(s, 1); /* fips version */ pad = (8 - (datalen % 8)) & 7; g_memset(s->end, 0, pad); s->end += pad; out_uint8(s, pad); /* fips pad */ xrdp_sec_fips_sign(self, s->p, 8, s->p + 8, datalen); xrdp_sec_fips_encrypt(self, s->p + 8, datalen + pad); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_SECURITY_HEADER2 " "flags 0x%4.4x, flagsHi 0x%4.4x, length 16, version 1, " "padlen %d, dataSignature 0x%8.8x 0x%8.8x", SEC_ENCRYPT & 0xffff, (SEC_ENCRYPT & 0xffff0000) >> 16, pad, *((uint32_t *) s->p), *((uint32_t *) (s->p + 4))); } else if (self->crypt_level > CRYPT_LEVEL_LOW) { out_uint32_le(s, SEC_ENCRYPT); datalen = (int)((s->end - s->p) - 8); xrdp_sec_sign(self, s->p, 8, s->p + 8, datalen); xrdp_sec_encrypt(self, s->p + 8, datalen); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_SECURITY_HEADER1 " "flags 0x%4.4x, flagsHi 0x%4.4x, dataSignature 0x%8.8x 0x%8.8x", SEC_ENCRYPT & 0xffff, (SEC_ENCRYPT & 0xffff0000) >> 16, *((uint32_t *) s->p), *((uint32_t *) (s->p + 4))); } else { out_uint32_le(s, 0); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_SECURITY_HEADER " "flags 0x0000, flagsHi 0x0000"); } } if (xrdp_mcs_send(self->mcs_layer, s, chan) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_send: xrdp_mcs_send failed"); return 1; } return 0; } /*****************************************************************************/ /* returns the fastpath sec byte count */ int xrdp_sec_get_fastpath_bytes(struct xrdp_sec *self) { if (self->crypt_level == CRYPT_LEVEL_FIPS) { return 3 + 4 + 8; } else if (self->crypt_level > CRYPT_LEVEL_LOW) { return 3 + 8; } return 3; } /*****************************************************************************/ /* returns error */ int xrdp_sec_init_fastpath(struct xrdp_sec *self, struct stream *s) { if (xrdp_fastpath_init(self->fastpath_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_init_fastpath: xrdp_fastpath_init failed"); return 1; } if (self->crypt_level == CRYPT_LEVEL_FIPS) { s_push_layer(s, sec_hdr, 3 + 4 + 8); } else if (self->crypt_level > CRYPT_LEVEL_LOW) { s_push_layer(s, sec_hdr, 3 + 8); } else { s_push_layer(s, sec_hdr, 3); } return 0; } /*****************************************************************************/ /* returns error */ /* 2.2.9.1.2 Server Fast-Path Update PDU (TS_FP_UPDATE_PDU) * http://msdn.microsoft.com/en-us/library/cc240621.aspx */ int xrdp_sec_send_fastpath(struct xrdp_sec *self, struct stream *s) { int secFlags; int fpOutputHeader; int datalen; int pdulen; int pad; int error; char save[8]; error = 0; s_pop_layer(s, sec_hdr); if (self->crypt_level == CRYPT_LEVEL_FIPS) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_send_fastpath: fips"); pdulen = (int)(s->end - s->p); datalen = pdulen - 15; pad = (8 - (datalen % 8)) & 7; secFlags = 0x2; fpOutputHeader = secFlags << 6; out_uint8(s, fpOutputHeader); pdulen += pad; pdulen |= 0x8000; out_uint16_be(s, pdulen); out_uint16_le(s, 16); /* crypto header size */ out_uint8(s, 1); /* fips version */ s->end += pad; out_uint8(s, pad); /* fips pad */ xrdp_sec_fips_sign(self, s->p, 8, s->p + 8, datalen); g_memcpy(save, s->p + 8 + datalen, pad); g_memset(s->p + 8 + datalen, 0, pad); xrdp_sec_fips_encrypt(self, s->p + 8, datalen + pad); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_UPDATE_PDU " "fpOutputHeader.action 0, fpOutputHeader.reserved 0, " "fpOutputHeader.flags 0x2, length1 0x%2.2x, length2 0x%2.2x, " "fipsInformation.length 16, fipsInformation.version 1, " "fipsInformation.padlen %d, dataSignature 0x%8.8x 0x%8.8x, ", pdulen >> 4, pdulen & 0xff, pad, *((uint32_t *) s->p), *((uint32_t *) (s->p + 4))); error = xrdp_fastpath_send(self->fastpath_layer, s); g_memcpy(s->p + 8 + datalen, save, pad); } else if (self->crypt_level > CRYPT_LEVEL_LOW) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_send_fastpath: crypt"); pdulen = (int)(s->end - s->p); datalen = pdulen - 11; secFlags = 0x2; fpOutputHeader = secFlags << 6; out_uint8(s, fpOutputHeader); pdulen |= 0x8000; out_uint16_be(s, pdulen); xrdp_sec_sign(self, s->p, 8, s->p + 8, datalen); xrdp_sec_encrypt(self, s->p + 8, datalen); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_UPDATE_PDU " "fpOutputHeader.action 0, fpOutputHeader.reserved 0, " "fpOutputHeader.flags 0x2, length1 0x%2.2x, length2 0x%2.2x, " "dataSignature 0x%8.8x 0x%8.8x, ", pdulen >> 4, pdulen & 0xff, *((uint32_t *) s->p), *((uint32_t *) (s->p + 4))); error = xrdp_fastpath_send(self->fastpath_layer, s); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_sec_send_fastpath: no crypt"); pdulen = (int)(s->end - s->p); secFlags = 0x0; fpOutputHeader = secFlags << 6; out_uint8(s, fpOutputHeader); pdulen |= 0x8000; out_uint16_be(s, pdulen); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_UPDATE_PDU " "fpOutputHeader.action 0, fpOutputHeader.reserved 0, " "fpOutputHeader.flags 0, length1 0x%2.2x, length2 0x%2.2x", pdulen >> 4, pdulen & 0xff); error = xrdp_fastpath_send(self->fastpath_layer, s); } if (error != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_send_fastpath: xrdp_fastpath_send failed"); return 1; } return 0; } /*****************************************************************************/ /* http://msdn.microsoft.com/en-us/library/cc240510.aspx 2.2.1.3.2 Client Core Data (TS_UD_CS_CORE) */ static int xrdp_sec_process_mcs_data_CS_CORE(struct xrdp_sec *self, struct stream *s) { #define CS_CORE_MIN_LENGTH \ (\ 4 + /* Version */ \ 2 + 2 + /* desktopWidth + desktopHeight */ \ 2 + 2 + /* colorDepth + SASSequence */ \ 4 + /* keyboardLayout */ \ 4 + INFO_CLIENT_NAME_BYTES + /* clientBuild + clientName */ \ 4 + 4 + 4 + /* keyboardType + keyboardSubType + keyboardFunctionKey */ \ 64 + /* imeFileName */ \ 0) int version; int colorDepth; int postBeta2ColorDepth; int highColorDepth; int supportedColorDepths; int earlyCapabilityFlags; char clientName[INFO_CLIENT_NAME_BYTES / 2] = { '\0' }; UNUSED_VAR(version); struct xrdp_client_info *client_info = &self->rdp_layer->client_info; /* Clear physical sizes. These are optional and may not be read later */ client_info->session_physical_width = 0; client_info->session_physical_height = 0; /* TS_UD_CS_CORE required fields */ if (!s_check_rem_and_log(s, CS_CORE_MIN_LENGTH, "Parsing [MS-RDPBCGR] TS_UD_CS_CORE")) { return 1; } in_uint32_le(s, version); in_uint16_le(s, client_info->display_sizes.session_width); in_uint16_le(s, client_info->display_sizes.session_height); in_uint16_le(s, colorDepth); switch (colorDepth) { case RNS_UD_COLOR_4BPP: client_info->bpp = 4; break; case RNS_UD_COLOR_8BPP: client_info->bpp = 8; break; } in_uint8s(s, 2); /* SASSequence */ in_uint8s(s, 4); /* keyboardLayout */ in_uint8s(s, 4); /* clientBuild */ /* clientName * * This should be null-terminated. Allow for the possibility it * isn't by ignoring the last two bytes and treating them as a * terminator anyway */ in_utf16_le_fixed_as_utf8(s, (INFO_CLIENT_NAME_BYTES - 2) / 2, clientName, sizeof(clientName)); in_uint8s(s, 2); /* See above */ LOG(LOG_LEVEL_INFO, "Connected client computer name: %s", clientName); in_uint8s(s, 4); /* keyboardType */ in_uint8s(s, 4); /* keyboardSubType */ in_uint8s(s, 4); /* keyboardFunctionKey */ in_uint8s(s, 64); /* imeFileName */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " version %08x, desktopWidth %d, " "desktopHeight %d, colorDepth %s, SASSequence (ignored), " "keyboardLayout (ignored), clientBuild (ignored), " "clientName %s, keyboardType (ignored), " "keyboardSubType (ignored), keyboardFunctionKey (ignored), " "imeFileName (ignored)", version, client_info->display_sizes.session_width, client_info->display_sizes.session_height, (colorDepth == 0xca00 ? "RNS_UD_COLOR_4BPP" : colorDepth == 0xca01 ? "RNS_UD_COLOR_8BPP" : "unknown"), clientName); /* TS_UD_CS_CORE optional fields */ if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, postBeta2ColorDepth); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " postBeta2ColorDepth %s", postBeta2ColorDepth == 0xca00 ? "RNS_UD_COLOR_4BPP" : postBeta2ColorDepth == 0xca01 ? "RNS_UD_COLOR_8BPP" : postBeta2ColorDepth == 0xca02 ? "RNS_UD_COLOR_16BPP_555" : postBeta2ColorDepth == 0xca03 ? "RNS_UD_COLOR_16BPP_565" : postBeta2ColorDepth == 0xca04 ? "RNS_UD_COLOR_24BPP" : "unknown"); switch (postBeta2ColorDepth) { case RNS_UD_COLOR_4BPP: client_info->bpp = 4; break; case RNS_UD_COLOR_8BPP : client_info->bpp = 8; break; case RNS_UD_COLOR_16BPP_555: client_info->bpp = 15; break; case RNS_UD_COLOR_16BPP_565: client_info->bpp = 16; break; case RNS_UD_COLOR_24BPP: client_info->bpp = 24; break; } if (!s_check_rem(s, 2)) { return 0; } in_uint8s(s, 2); /* clientProductId */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " clientProductId (ignored)"); if (!s_check_rem(s, 4)) { return 0; } in_uint8s(s, 4); /* serialNumber */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " serialNumber (ignored)"); if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, highColorDepth); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " highColorDepth %s", highColorDepth == 0x0004 ? "HIGH_COLOR_4BPP" : highColorDepth == 0x0008 ? "HIGH_COLOR_8BPP" : highColorDepth == 0x000F ? "HIGH_COLOR_15BPP" : highColorDepth == 0x0010 ? "HIGH_COLOR_16BPP" : highColorDepth == 0x0018 ? "HIGH_COLOR_24BPP" : "unknown"); client_info->bpp = highColorDepth; if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, supportedColorDepths); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " supportedColorDepths %s", supportedColorDepths == RNS_UD_24BPP_SUPPORT ? "RNS_UD_24BPP_SUPPORT" : supportedColorDepths == RNS_UD_16BPP_SUPPORT ? "RNS_UD_16BPP_SUPPORT" : supportedColorDepths == RNS_UD_15BPP_SUPPORT ? "RNS_UD_15BPP_SUPPORT" : supportedColorDepths == RNS_UD_32BPP_SUPPORT ? "RNS_UD_32BPP_SUPPORT" : "unknown"); if (!s_check_rem(s, 2)) { return 0; } in_uint16_le(s, earlyCapabilityFlags); client_info->mcs_early_capability_flags = earlyCapabilityFlags; LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " earlyCapabilityFlags 0x%4.4x", earlyCapabilityFlags); if ((earlyCapabilityFlags & RNS_UD_CS_WANT_32BPP_SESSION) && (supportedColorDepths & RNS_UD_32BPP_SUPPORT)) { client_info->bpp = 32; } #ifdef XRDP_RFXCODEC if (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL) { if (client_info->bpp < 32) { LOG(LOG_LEVEL_WARNING, "client requested gfx protocol with insufficient color depth"); } else if (client_info->max_bpp > 0 && client_info->max_bpp < 32) { LOG(LOG_LEVEL_WARNING, "Client requested gfx protocol " "but the server configuration is limited to %d bpp.", client_info->max_bpp); } else { LOG(LOG_LEVEL_INFO, "client supports gfx protocol"); self->rdp_layer->client_info.gfx = 1; } } else { LOG_DEVEL(LOG_LEVEL_INFO, "client DOES NOT support gfx"); } #endif if (!s_check_rem(s, 64)) { return 0; } in_uint8s(s, 64); /* clientDigProductId */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " clientDigProductId (ignored)"); if (!s_check_rem(s, 1)) { return 0; } in_uint8(s, client_info->mcs_connection_type); /* connectionType */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " connectionType 0x%2.2x", client_info->mcs_connection_type); if (!s_check_rem(s, 1)) { return 0; } in_uint8s(s, 1); /* pad1octet */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " pad1octet (ignored)"); if (!s_check_rem(s, 4)) { return 0; } in_uint8s(s, 4); /* serverSelectedProtocol */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " serverSelectedProtocol (ignored)"); /* * Non-zero values for the desktop physical width and height values * are only sent if the client has a single monitor. For multiple * monitors, the physical size of each monitor is sent in the * TS_UD_CS_MONITOR_EX PDU */ if (!s_check_rem(s, 4)) { return 0; } in_uint32_le(s, client_info->session_physical_width); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " desktopPhysicalWidth %u", client_info->session_physical_width); if (!s_check_rem(s, 4)) { client_info->session_physical_width = 0; return 0; } in_uint32_le(s, client_info->session_physical_height); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " desktopPhysicalHeight %u", client_info->session_physical_height); /* MS-RDPBCGR 2.2.1.3.2 */ if (client_info->session_physical_width < 10 || client_info->session_physical_width > 10000 || client_info->session_physical_height < 10 || client_info->session_physical_height > 10000) { LOG(LOG_LEVEL_WARNING, "Physical desktop dimensions (%ux%u) are invalid", client_info->session_physical_width, client_info->session_physical_height); client_info->session_physical_width = 0; client_info->session_physical_height = 0; } if (!s_check_rem(s, 2)) { return 0; } in_uint8s(s, 2); /* reserved */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " desktopOrientation (ignored)"); return 0; #undef CS_CORE_MIN_LENGTH } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_UD_CS_SEC message */ static int xrdp_sec_process_mcs_data_CS_SECURITY(struct xrdp_sec *self, struct stream *s) { int crypt_method; int found; in_uint32_le(s, crypt_method); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_SEC " "encryptionMethods 0x%8.8x, extEncryptionMethods (ignored)", crypt_method); if (crypt_method & CRYPT_METHOD_40BIT) { LOG(LOG_LEVEL_DEBUG, "Client supports 40 bit encryption"); } if (crypt_method & CRYPT_METHOD_128BIT) { LOG(LOG_LEVEL_DEBUG, "Client supports 128 bit encryption"); } if (crypt_method & CRYPT_METHOD_56BIT) { LOG(LOG_LEVEL_DEBUG, "Client supports 56 bit encryption"); } if (crypt_method & CRYPT_METHOD_FIPS) { LOG(LOG_LEVEL_DEBUG, "Client supports fips encryption"); } found = 0; if ((found == 0) && (self->mcs_layer->iso_layer->selectedProtocol == PROTOCOL_SSL)) { LOG(LOG_LEVEL_DEBUG, "The connection is using TLS, skipping RDP crypto negotiation"); found = 1; } if ((found == 0) && (self->crypt_method & CRYPT_METHOD_FIPS) && (self->crypt_level == CRYPT_LEVEL_FIPS)) { if (crypt_method & CRYPT_METHOD_FIPS) { LOG(LOG_LEVEL_DEBUG, "Client and server both support fips encryption, " "using RDP fips encryption."); self->crypt_method = CRYPT_METHOD_FIPS; self->crypt_level = CRYPT_LEVEL_FIPS; found = 1; } } if ((found == 0) && (self->crypt_method & CRYPT_METHOD_128BIT) && (self->crypt_level == CRYPT_LEVEL_HIGH)) { if (crypt_method & CRYPT_METHOD_128BIT) { LOG(LOG_LEVEL_DEBUG, "Client and server both support high encryption, " "using RDP 128-bit encryption."); self->crypt_method = CRYPT_METHOD_128BIT; self->crypt_level = CRYPT_LEVEL_HIGH; found = 1; } } /* TODO: figure out why both "COMPATIBLE" and "LOW" crypto level both use 40-bit encryption, and why there is no cypto method for 56-bit encryption even though there is code for checking for 56-bit encryption */ if ((found == 0) && (self->crypt_method & CRYPT_METHOD_40BIT) && (self->crypt_level == CRYPT_LEVEL_CLIENT_COMPATIBLE)) { if (crypt_method & CRYPT_METHOD_40BIT) { LOG(LOG_LEVEL_DEBUG, "Client and server both support medium encryption, " "using RDP 40-bit encryption."); self->crypt_method = CRYPT_METHOD_40BIT; self->crypt_level = CRYPT_LEVEL_CLIENT_COMPATIBLE; found = 1; } } if ((found == 0) && (self->crypt_method & CRYPT_METHOD_40BIT) && (self->crypt_level == CRYPT_LEVEL_LOW)) { if (crypt_method & CRYPT_METHOD_40BIT) { LOG(LOG_LEVEL_DEBUG, "Client and server both support low encryption, " "using RDP 40-bit encryption."); self->crypt_method = CRYPT_METHOD_40BIT; self->crypt_level = CRYPT_LEVEL_LOW; found = 1; } } if ((found == 0) && (self->crypt_level == CRYPT_LEVEL_NONE)) { if (crypt_method == CRYPT_METHOD_NONE) { LOG(LOG_LEVEL_DEBUG, "Client and server both support no encryption, " "RDP encryption is disabled."); self->crypt_method = CRYPT_METHOD_NONE; self->crypt_level = CRYPT_LEVEL_NONE; found = 1; } } if (found == 0) { /* TODO: figure out why failing to find a shared encryption level does not return an error? */ /* TODO: does the connection fail now or is the default server encryption used? */ LOG(LOG_LEVEL_WARNING, "Client and server do not both support the same encryption."); // return 1; } return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_UD_CS_NET message. This adds the mcs channels in the list of channels to be used when creating the server mcs data */ static int xrdp_sec_process_mcs_data_channels(struct xrdp_sec *self, struct stream *s) { int num_channels; int index; struct xrdp_client_info *client_info; struct mcs_channel_item *channel_item; int next_mcs_channel_id; client_info = &(self->rdp_layer->client_info); /* this is an option set in xrdp.ini */ if (client_info->channels_allowed == 0) /* are channels on? */ { LOG(LOG_LEVEL_DEBUG, "All channels are disabled by configuration"); return 0; } if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_UD_CS_NET")) { return 1; } in_uint32_le(s, num_channels); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_NET " "channelCount %d", num_channels); if (num_channels > MAX_STATIC_CHANNELS) { LOG(LOG_LEVEL_ERROR, "[MS-RDPBCGR] Protocol error: too many channels requested. " "max %d, received %d", MAX_STATIC_CHANNELS, num_channels); return 1; } /* GOTCHA: When adding a channel the MCS channel ID is set to * MCS_GLOBAL_CHANNEL + (index + 1). This is assumed by * xrdp_channel_process(), when mapping an incoming PDU into an * entry in this array */ next_mcs_channel_id = MCS_GLOBAL_CHANNEL + 1; for (index = 0; index < num_channels; index++) { channel_item = g_new0(struct mcs_channel_item, 1); if (!s_check_rem_and_log(s, 12, "Parsing [MS-RDPBCGR] TS_UD_CS_NET.CHANNEL_DEF")) { g_free(channel_item); return 1; } in_uint8a(s, channel_item->name, 8); in_uint32_le(s, channel_item->flags); if (g_strlen(channel_item->name) > 0 && g_strlen(channel_item->name) < 8) { LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] " "TS_UD_CS_NET.CHANNEL_DEF %d, name %s, options 0x%8.8x", index, channel_item->name, channel_item->flags); channel_item->chanid = next_mcs_channel_id++; list_add_item(self->mcs_layer->channel_list, (intptr_t) channel_item); LOG(LOG_LEVEL_DEBUG, "Adding channel: name %s, channel id %d, flags 0x%8.8x", channel_item->name, channel_item->chanid, channel_item->flags); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "Received [MS-RDPBCGR] " "TS_UD_CS_NET.CHANNEL_DEF %d, skipped because of " "malformed channel name.", index); LOG_DEVEL_HEXDUMP(LOG_LEVEL_WARNING, "[MS-RDPBCGR] TS_UD_CS_NET.CHANNEL_DEF name", channel_item->name, 8); g_free(channel_item); } } /* Set the user channel as well */ self->mcs_layer->chanid = next_mcs_channel_id++; self->mcs_layer->userid = self->mcs_layer->chanid - MCS_USERCHANNEL_BASE; LOG_DEVEL(LOG_LEVEL_DEBUG, "MCS user is %d, channel id is %d", self->mcs_layer->userid, self->mcs_layer->chanid); return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_UD_CS_MONITOR message. reads the client monitors data */ int xrdp_sec_process_mcs_data_monitors(struct xrdp_sec *self, struct stream *s) { int flags; int error = 0; struct xrdp_client_info *client_info = &(self->rdp_layer->client_info); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_sec_process_mcs_data_monitors:"); /* this is an option set in xrdp.ini */ if (client_info->multimon != 1) /* are multi-monitors allowed ? */ { LOG(LOG_LEVEL_INFO, "xrdp_sec_process_mcs_data_monitors:" " Multi-monitor is disabled by server config"); return 0; } if (!s_check_rem_and_log(s, 4, "xrdp_sec_process_mcs_data_monitors:" " Parsing [MS-RDPBCGR] TS_UD_CS_MONITOR")) { return SEC_PROCESS_MONITORS_ERR; } in_uint32_le(s, flags); /* flags */ //verify flags - must be 0x0 if (flags != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_process_mcs_data_monitors: [MS-RDPBCGR]" " Protocol error: TS_UD_CS_MONITOR flags MUST be zero," " received: 0x%8.8x", flags); return SEC_PROCESS_MONITORS_ERR; } struct display_size_description *description = (struct display_size_description *) g_malloc(sizeof(struct display_size_description), 1); error = libxrdp_process_monitor_stream(s, description, 0); if (error == 0) { client_info->display_sizes.monitorCount = description->monitorCount; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_sec_process_mcs_data_monitors:" " Received [MS-RDPBCGR] TS_UD_CS_MONITOR" " flags 0x%8.8x, monitorCount %d", flags, description->monitorCount); client_info->display_sizes.session_width = description->session_width; client_info->display_sizes.session_height = description->session_height; g_memcpy(client_info->display_sizes.minfo, description->minfo, sizeof(struct monitor_info) * CLIENT_MONITOR_DATA_MAXIMUM_MONITORS); g_memcpy(client_info->display_sizes.minfo_wm, description->minfo_wm, sizeof(struct monitor_info) * CLIENT_MONITOR_DATA_MAXIMUM_MONITORS); } g_free(description); return error; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_UD_CS_MONITOR_EX message. reads the client monitor's extended data */ int xrdp_sec_process_mcs_data_monitors_ex(struct xrdp_sec *self, struct stream *s) { int flags; struct xrdp_client_info *client_info = &(self->rdp_layer->client_info); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_sec_process_mcs_data_monitors_ex:"); /* this is an option set in xrdp.ini */ if (client_info->multimon != 1) /* are multi-monitors allowed ? */ { /* This should already be logged in xrdp_sec_process_mcs_data_monitors() */ return 0; } if (!s_check_rem_and_log(s, 4, "xrdp_sec_process_mcs_data_monitors_ex:" " Parsing [MS-RDPBCGR] TS_UD_CS_MONITOR_EX")) { return SEC_PROCESS_MONITORS_ERR; } in_uint32_le(s, flags); /* flags */ //verify flags - must be 0x0 if (flags != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_process_mcs_data_monitors_ex: [MS-RDPBCGR]" " Protocol error: TS_UD_CS_MONITOR_EX flags MUST be zero," " received: 0x%8.8x", flags); return SEC_PROCESS_MONITORS_ERR; } return libxrdp_process_monitor_ex_stream(s, &client_info->display_sizes); } /*****************************************************************************/ /* Process a Client MCS Connect Initial PDU with GCC Conference Create Request. process client mcs data, we need some things in here to create the server mcs data */ int xrdp_sec_process_mcs_data(struct xrdp_sec *self) { struct stream *s = (struct stream *)NULL; char *hold_p = (char *)NULL; int tag = 0; int size = 0; struct xrdp_client_info *client_info = &self->rdp_layer->client_info; s = &(self->client_mcs_data); /* set p to beginning */ s->p = s->data; /* skip header */ if (!s_check_rem_and_log(s, 23, "Parsing [ITU T.124] ConferenceCreateRequest")) { return 1; } in_uint8s(s, 23); /* skip [ITU T.124] ConferenceCreateRequest fields until userData */ while (s_check_rem(s, 4)) { hold_p = s->p; in_uint16_le(s, tag); in_uint16_le(s, size); LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_UD_HEADER " "type 0x%4.4x, length %d", tag, size); if (size < 4) { LOG(LOG_LEVEL_WARNING, "[MS-RDPBCGR] Protocol error: Invalid TS_UD_HEADER length value. " "expected >= 4, actual %d", size); break; } if (!s_check_rem_and_log(s, size - 4, "Parsing [MS-RDPBCGR] GCC Conference Create Request client data field")) { break; } switch (tag) { case SEC_TAG_CLI_INFO: /* CS_CORE 0xC001 */ if (xrdp_sec_process_mcs_data_CS_CORE(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [MS-RDPBCGR] TS_UD_CS_CORE failed"); return 1; } break; case SEC_TAG_CLI_CRYPT: /* CS_SECURITY 0xC002 */ if (xrdp_sec_process_mcs_data_CS_SECURITY(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [MS-RDPBCGR] TS_UD_CS_SEC failed"); return 1; } break; case SEC_TAG_CLI_CHANNELS: /* CS_NET 0xC003 */ if (xrdp_sec_process_mcs_data_channels(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [MS-RDPBCGR] TS_UD_CS_NET failed"); return 1; } break; case SEC_TAG_CLI_4: /* CS_CLUSTER 0xC004 */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Received [MS-RDPBCGR] TS_UD_CS_CLUSTER - no-op"); break; case SEC_TAG_CLI_MONITOR: /* CS_MONITOR 0xC005 */ if (xrdp_sec_process_mcs_data_monitors(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [MS-RDPBCGR] TS_UD_CS_MONITOR failed"); return 1; } break; case SEC_TAG_CLI_MONITOR_EX: /* CS_MONITOR_EX 0xC008 */ if (xrdp_sec_process_mcs_data_monitors_ex(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [MS-RDPBCGR] TS_UD_CS_MONITOR_EX failed"); return 1; } break; /* CS_MCS_MSGCHANNEL 0xC006 CS_MULTITRANSPORT 0xC00A SC_CORE 0x0C01 SC_SECURITY 0x0C02 SC_NET 0x0C03 SC_MCS_MSGCHANNEL 0x0C04 SC_MULTITRANSPORT 0x0C08 */ default: LOG(LOG_LEVEL_WARNING, "Received [MS-RDPBCGR] TS_UD_HEADER type 0x%4.4x " "is unknown (ignored)", tag); break; } s->p = hold_p + size; } if (client_info->max_bpp > 0) { if (client_info->bpp > client_info->max_bpp) { LOG(LOG_LEVEL_WARNING, "Client requested %d bpp color depth, " "but the server configuration is limited to %d bpp. " "Downgrading the color depth to %d bits-per-pixel.", client_info->bpp, client_info->max_bpp, client_info->max_bpp); client_info->bpp = client_info->max_bpp; } } /* set p to beginning */ s->p = s->data; return 0; } /*****************************************************************************/ /* Process the mcs client data [ITU T.124] ConferenceCreateRequest userData field as a [MS-RDPBCGR] TS_UD_CS_CORE struct */ /* TODO: why does this method parse the strust from back to front (resetting after each field) instead of from front to back like the rest of the parsing code? */ /* TODO: why does this method exist when the same struct is parsed in xrdp_sec_process_mcs_data_CS_CORE and there does not seem to be any dependencies preventing a call to that function. */ /* TODO: this is a brittle function that assumes field offsets in the stream instead of parsing the variable length fields of [ITU T.124] ConferenceCreateRequest */ static int xrdp_sec_in_mcs_data(struct xrdp_sec *self) { struct stream *s = (struct stream *)NULL; struct xrdp_client_info *client_info = (struct xrdp_client_info *)NULL; client_info = &(self->rdp_layer->client_info); s = &(self->client_mcs_data); /* get hostname, it's unicode */ s->p = s->data; if (!s_check_rem_and_log(s, 47, "Parsing [ITU T.124] ConferenceCreateRequest")) { return 1; } in_uint8s(s, 47); /* skip [ITU T.124] ConferenceCreateRequest up to the userData field, and skip [MS-RDPBCGR] TS_UD_CS_CORE up to the clientName field */ if (!s_check_rem_and_log(s, INFO_CLIENT_NAME_BYTES, "Parsing [MS-RDPBCGR] TS_UD_CS_CORE clientName")) { return 1; } in_utf16_le_fixed_as_utf8(s, (INFO_CLIENT_NAME_BYTES - 2) / 2, client_info->hostname, sizeof(client_info->hostname)); in_uint8s(s, 2); /* Ignored - terminator for full-size clientName */ /* get build */ s->p = s->data; if (!s_check_rem_and_log(s, 43 + 4, "Parsing [MS-RDPBCGR] TS_UD_CS_CORE clientBuild")) { return 1; } in_uint8s(s, 43); in_uint32_le(s, client_info->build); /* [MS-RDPBCGR] TS_UD_CS_CORE clientBuild */ /* get keylayout */ s->p = s->data; if (!s_check_rem_and_log(s, 39 + 4, "Parsing [MS-RDPBCGR] TS_UD_CS_CORE keyboardLayout")) { return 1; } in_uint8s(s, 39); in_uint32_le(s, client_info->keylayout); /* [MS-RDPBCGR] TS_UD_CS_CORE keyboardLayout */ /* get keyboard type / subtype */ s->p = s->data; if (!s_check_rem_and_log(s, 79 + 8, "Parsing [MS-RDPBCGR] TS_UD_CS_CORE keyboardType")) { return 1; } in_uint8s(s, 79); in_uint32_le(s, client_info->keyboard_type); /* [MS-RDPBCGR] TS_UD_CS_CORE keyboardType */ in_uint32_le(s, client_info->keyboard_subtype); /* [MS-RDPBCGR] TS_UD_CS_CORE keyboardSubType */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_CORE " " version (ignored), desktopWidth (ignored), " "desktopHeight (ignored), colorDepth (ignored), SASSequence (ignored), " "keyboardLayout 0x%8.8x, clientBuild %d, " "clientName %s, keyboardType 0x%8.8x, " "keyboardSubType 0x%8.8x, keyboardFunctionKey (ignored), " "imeFileName (ignored)", client_info->keylayout, client_info->build, client_info->hostname, client_info->keyboard_type, client_info->keyboard_subtype); xrdp_load_keyboard_layout(client_info); s->p = s->data; return 0; } /*****************************************************************************/ /* returns error */ int xrdp_sec_init_rdp_security(struct xrdp_sec *self) { switch (self->rdp_layer->client_info.crypt_level) { case 0: /* none */ self->crypt_method = CRYPT_METHOD_NONE; self->crypt_level = CRYPT_LEVEL_NONE; break; case 1: /* low */ self->crypt_method = CRYPT_METHOD_40BIT; self->crypt_level = CRYPT_LEVEL_LOW; break; case 2: /* medium */ self->crypt_method = CRYPT_METHOD_40BIT; self->crypt_level = CRYPT_LEVEL_CLIENT_COMPATIBLE; break; case 3: /* high */ self->crypt_method = CRYPT_METHOD_128BIT; self->crypt_level = CRYPT_LEVEL_HIGH; break; case 4: /* fips */ self->crypt_method = CRYPT_METHOD_FIPS; self->crypt_level = CRYPT_LEVEL_FIPS; break; default: LOG_DEVEL(LOG_LEVEL_WARNING, "Fatal : Illegal crypt_level %d", self->rdp_layer->client_info.crypt_level); break ; } if (self->decrypt_rc4_info != NULL) { LOG_DEVEL(LOG_LEVEL_WARNING, "xrdp_sec_init_rdp_security: decrypt_rc4_info already created !!!"); } else { self->decrypt_rc4_info = ssl_rc4_info_create(); } if (self->encrypt_rc4_info != NULL) { LOG_DEVEL(LOG_LEVEL_WARNING, "xrdp_sec_init_rdp_security: encrypt_rc4_info already created !!!"); } else { self->encrypt_rc4_info = ssl_rc4_info_create(); } return 0; } /*****************************************************************************/ int xrdp_sec_incoming(struct xrdp_sec *self) { struct list *items = NULL; struct list *values = NULL; struct xrdp_iso *iso; int index = 0; char *item = NULL; char *value = NULL; char key_file[256]; iso = self->mcs_layer->iso_layer; /* negotiate security layer */ if (xrdp_iso_incoming(iso) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_incoming: xrdp_iso_incoming failed"); return 1; } /* initialize selected security layer */ if (iso->selectedProtocol > PROTOCOL_RDP) { /* init tls security */ if (trans_set_tls_mode(self->mcs_layer->iso_layer->trans, self->rdp_layer->client_info.key_file, self->rdp_layer->client_info.certificate, self->rdp_layer->client_info.ssl_protocols, self->rdp_layer->client_info.tls_ciphers) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_incoming: trans_set_tls_mode failed"); return 1; } LOG(LOG_LEVEL_DEBUG, "Using TLS security, and " "setting RDP security crypto to LEVEL_NONE and METHOD_NONE"); self->crypt_level = CRYPT_LEVEL_NONE; self->crypt_method = CRYPT_METHOD_NONE; self->rsa_key_bytes = 0; } else { /* init rdp security */ if (xrdp_sec_init_rdp_security(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_incoming: xrdp_sec_init_rdp_security failed"); return 1; } if (self->crypt_method != CRYPT_METHOD_NONE) { LOG(LOG_LEVEL_DEBUG, "Using RDP security, and " "reading the server configuration"); g_memset(key_file, 0, sizeof(char) * 256); g_random(self->server_random, 32); items = list_create(); items->auto_free = 1; values = list_create(); values->auto_free = 1; g_snprintf(key_file, 255, "%s/rsakeys.ini", XRDP_CFG_PATH); if (file_by_name_read_section(key_file, "keys", items, values) != 0) { /* this is a show stopper */ LOG(LOG_LEVEL_ERROR, "XRDP cannot read file: %s " "(check permissions)", key_file); list_delete(items); list_delete(values); return 1; } for (index = 0; index < items->count; index++) { item = (char *)list_get_item(items, index); value = (char *)list_get_item(values, index); if (g_strcasecmp(item, "pub_exp") == 0) { hex_str_to_bin(value, self->pub_exp, 4); } else if (g_strcasecmp(item, "pub_mod") == 0) { self->rsa_key_bytes = (g_strlen(value) + 1) / 5; LOG_DEVEL(LOG_LEVEL_DEBUG, "Server config: pub_mod bytes %d", self->rsa_key_bytes); hex_str_to_bin(value, self->pub_mod, self->rsa_key_bytes); } else if (g_strcasecmp(item, "pub_sig") == 0) { hex_str_to_bin(value, self->pub_sig, 64); } else if (g_strcasecmp(item, "pri_exp") == 0) { self->rsa_key_bytes = (g_strlen(value) + 1) / 5; LOG_DEVEL(LOG_LEVEL_DEBUG, "Server config: pri_exp %d", self->rsa_key_bytes); hex_str_to_bin(value, self->pri_exp, self->rsa_key_bytes); } } if (self->rsa_key_bytes <= 64) { LOG(LOG_LEVEL_WARNING, "warning, RSA key len 512 " "bits or less, consider creating a 2048 bit key"); } list_delete(items); list_delete(values); } } /* negotiate mcs layer */ if (xrdp_mcs_incoming(self->mcs_layer) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_incoming: xrdp_mcs_incoming failed"); return 1; } LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "client mcs data received", self->client_mcs_data.data, (int)(self->client_mcs_data.end - self->client_mcs_data.data)); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "server mcs data sent", self->server_mcs_data.data, (int)(self->server_mcs_data.end - self->server_mcs_data.data)); if (xrdp_sec_in_mcs_data(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_sec_incoming: xrdp_sec_in_mcs_data failed"); return 1; } return 0; } /*****************************************************************************/ int xrdp_sec_disconnect(struct xrdp_sec *self) { int rv; rv = xrdp_mcs_disconnect(self->mcs_layer); return rv; } xrdp-0.10.1/libxrdp/libxrdp.c000644 001751 000000 00000237750 14652432047 016127 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * this is the interface to libxrdp */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "string_calls.h" #include "xrdp_orders_rail.h" #include "ms-rdpedisp.h" #include "ms-rdpbcgr.h" #define MAX_BITMAP_BUF_SIZE (16 * 1024) /* 16K */ #define TS_MONITOR_ATTRIBUTES_SIZE 20 /* [MS-RDPBCGR] 2.2.1.3.9 */ /******************************************************************************/ struct xrdp_session *EXPORT_CC libxrdp_init(tbus id, struct trans *trans, const char *xrdp_ini) { struct xrdp_session *session; session = (struct xrdp_session *)g_malloc(sizeof(struct xrdp_session), 1); session->id = id; session->trans = trans; if (xrdp_ini != NULL) { session->xrdp_ini = g_strdup(xrdp_ini); } else { session->xrdp_ini = g_strdup(XRDP_CFG_PATH "/xrdp.ini"); } session->rdp = xrdp_rdp_create(session, trans); session->orders = xrdp_orders_create(session, (struct xrdp_rdp *)session->rdp); session->client_info = &(((struct xrdp_rdp *)session->rdp)->client_info); session->check_for_app_input = 1; return session; } /******************************************************************************/ int EXPORT_CC libxrdp_exit(struct xrdp_session *session) { if (session == 0) { return 0; } xrdp_orders_delete((struct xrdp_orders *)session->orders); xrdp_rdp_delete((struct xrdp_rdp *)session->rdp); g_free(session->xrdp_ini); g_free(session); return 0; } /******************************************************************************/ int EXPORT_CC libxrdp_disconnect(struct xrdp_session *session) { return xrdp_rdp_disconnect((struct xrdp_rdp *)session->rdp); } /******************************************************************************/ int EXPORT_CC libxrdp_process_incoming(struct xrdp_session *session) { int rv; rv = xrdp_rdp_incoming((struct xrdp_rdp *)(session->rdp)); return rv; } /*****************************************************************************/ int EXPORT_CC libxrdp_get_pdu_bytes(const char *aheader) { int rv; const tui8 *header; rv = -1; header = (const tui8 *) aheader; if (header[0] == 0x03) { /* TPKT */ rv = (header[2] << 8) | header[3]; } else { /* Fast-Path */ if (header[1] & 0x80) { rv = ((header[1] & 0x7F) << 8) | header[2]; } else { rv = header[1]; } } return rv; } /******************************************************************************/ /* only used during connection */ struct stream * libxrdp_force_read(struct trans *trans) { int bytes; struct stream *s; s = trans->in_s; init_stream(s, 32 * 1024); if (trans_force_read(trans, 4) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_force_read: header read error"); return NULL; } bytes = libxrdp_get_pdu_bytes(s->data); if (bytes < 4 || bytes > s->size) { LOG(LOG_LEVEL_ERROR, "libxrdp_force_read: bad header length %d", bytes); return NULL; } if (trans_force_read(trans, bytes - 4) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_force_read: Can't read PDU"); return NULL; } return s; } /******************************************************************************/ int EXPORT_CC libxrdp_process_data(struct xrdp_session *session, struct stream *s) { int cont; int rv; int code; int term; int dead_lock_counter; int do_read; struct xrdp_rdp *rdp; do_read = s == 0; if (do_read && session->up_and_running) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_data: error logic"); return 1; } if (session->in_process_data != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_data: error reentry"); return 1; } session->in_process_data++; term = 0; cont = 1; rv = 0; dead_lock_counter = 0; rdp = (struct xrdp_rdp *) (session->rdp); while ((cont || !session->up_and_running) && !term) { if (session->is_term != 0) { if (session->is_term()) { term = 1; break; } } code = 0; if (do_read) { if (s == 0) { s = libxrdp_force_read(session->trans); } else { if ((s->next_packet == 0) || (s->next_packet >= s->end)) { s = libxrdp_force_read(session->trans); } } if (s == 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_data: libxrdp_force_read failed"); rv = 1; break; } } if (xrdp_rdp_recv(rdp, s, &code) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_data: xrdp_rdp_recv failed"); rv = 1; break; } LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_process_data code %d", code); switch (code) { case -1: xrdp_caps_send_demand_active(rdp); session->up_and_running = 0; break; case 0: dead_lock_counter++; break; case PDUTYPE_CONFIRMACTIVEPDU: LOG_DEVEL(LOG_LEVEL_TRACE, "Processing received " "[MS-RDPBCGR] PDUTYPE_CONFIRMACTIVEPDU"); xrdp_caps_process_confirm_active(rdp, s); break; case PDUTYPE_DATAPDU: LOG_DEVEL(LOG_LEVEL_TRACE, "Processing received " "[MS-RDPBCGR] PDUTYPE_DATAPDU"); if (xrdp_rdp_process_data(rdp, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_data: xrdp_rdp_process_data failed"); cont = 0; term = 1; } break; case 2: /* FASTPATH_INPUT_EVENT */ if (xrdp_fastpath_process_input_event(rdp->sec_layer->fastpath_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_data: xrdp_fastpath_process_input_event failed"); cont = 0; term = 1; } break; default: LOG(LOG_LEVEL_WARNING, "unknown code = %d (ignored)", code); dead_lock_counter++; break; } if (dead_lock_counter > 100000) { /*This situation can happen and this is a workaround*/ cont = 0; LOG(LOG_LEVEL_WARNING, "Serious programming error: we were locked in a deadly loop. " "Remaining bytes: %d", (int) (s->end - s->next_packet)); s->next_packet = 0; } if (cont) { cont = (s->next_packet != 0) && (s->next_packet < s->end); } } session->in_process_data--; return rv; } /******************************************************************************/ int EXPORT_CC libxrdp_send_palette(struct xrdp_session *session, int *palette) { int rv; int i = 0; int color = 0; struct stream *s = (struct stream *)NULL; if (session->client_info->bpp > 8) { return 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, "sending palette (%s)", ((session->client_info->use_fast_path & 1) ? "fastpath" : "slowpath")); /* clear orders */ libxrdp_orders_force_send(session); make_stream(s); init_stream(s, 8192); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_palette: xrdp_rdp_init_fastpath failed"); free_stream(s); return 1; } } else { xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); } /* TS_UPDATE_PALETTE_DATA */ out_uint16_le(s, RDP_UPDATE_PALETTE); /* updateType */ out_uint16_le(s, 0); /* pad2Octets */ out_uint16_le(s, 256); /* # of colors (low-bytes) */ out_uint16_le(s, 0); /* # of colors (high-bytes) */ /* paletteEntries */ for (i = 0; i < 256; i++) { color = palette[i]; out_uint8(s, color >> 16); out_uint8(s, color >> 8); out_uint8(s, color); } s_mark_end(s); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_UPDATE_PALETTE " "paletteUpdateData = { updateType %d (UPDATETYPE_PALETTE), " "pad2Octets , numberColors 256, " "paletteEntries }", RDP_UPDATE_PALETTE); if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_PALETTE) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_palette: xrdp_rdp_send_fastpath failed"); free_stream(s); return 1; } } else { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_UPDATE_PALETTE_DATA " "updateType %d (UPDATETYPE_PALETTE), pad2Octets , " "numberColors 256, paletteEntries ", RDP_UPDATE_PALETTE); xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_UPDATE); } free_stream(s); /* send the orders palette too */ rv = libxrdp_orders_init(session); if (rv == 0) { rv = libxrdp_orders_send_palette(session, palette, 0); } if (rv == 0) { rv = libxrdp_orders_send(session); } return rv; } /******************************************************************************/ int EXPORT_CC libxrdp_send_bell(struct xrdp_session *session) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_bell: xrdp_rdp_init_data failed"); free_stream(s); return 1; } out_uint32_le(s, 100); /* duration (ms) */ out_uint32_le(s, 440); /* frequency */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_PLAY_SOUND_PDU_DATA " "duration 100 ms, frequency 440 Hz"); if (xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_PLAY_SOUND) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_bell: xrdp_rdp_send_data failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_send_bitmap(struct xrdp_session *session, int width, int height, int bpp, char *data, int x, int y, int cx, int cy) { int line_bytes = 0; int i = 0; int j = 0; int k; int total_lines = 0; int lines_sending = 0; int Bpp = 0; int e = 0; int bufsize = 0; int total_bufsize = 0; int num_updates = 0; int line_pad_bytes; int server_line_bytes; char *p_num_updates = (char *)NULL; char *p = (char *)NULL; char *q = (char *)NULL; struct stream *s = (struct stream *)NULL; struct stream *temp_s = (struct stream *)NULL; tui32 pixel; LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: sending bitmap"); Bpp = (bpp + 7) / 8; e = (4 - width) & 3; switch (bpp) { case 15: case 16: server_line_bytes = width * 2; break; case 24: case 32: server_line_bytes = width * 4; break; default: /* 8 bpp */ server_line_bytes = width; break; } line_bytes = width * Bpp; line_pad_bytes = line_bytes + e * Bpp; LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: bpp %d Bpp %d line_bytes %d " "server_line_bytes %d", bpp, Bpp, line_bytes, server_line_bytes); make_stream(s); init_stream(s, MAX_BITMAP_BUF_SIZE); if (session->client_info->use_bitmap_comp) { LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: compression"); make_stream(temp_s); init_stream(temp_s, 65536); i = 0; if (cy <= height) { i = cy; } while (i > 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: i %d", i); total_bufsize = 0; num_updates = 0; xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); out_uint16_le(s, RDP_UPDATE_BITMAP); /* updateType */ p_num_updates = s->p; out_uint8s(s, 2); /* num_updates set later */ do { if (session->client_info->op1) { s_push_layer(s, channel_hdr, 18); } else { s_push_layer(s, channel_hdr, 26); } p = s->p; if (bpp > 24) { LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: 32 bpp"); lines_sending = xrdp_bitmap32_compress(data, width, height, s, 32, (MAX_BITMAP_BUF_SIZE - 100) - total_bufsize, i - 1, temp_s, e, 0x10); LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: i %d lines_sending %d", i, lines_sending); } else { lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, (MAX_BITMAP_BUF_SIZE - 100) - total_bufsize, i - 1, temp_s, e); LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: i %d lines_sending %d", i, lines_sending); } if (lines_sending == 0) { break; } num_updates++; bufsize = s->p - p; total_bufsize += bufsize; i = i - lines_sending; s_mark_end(s); s_pop_layer(s, channel_hdr); out_uint16_le(s, x); /* left */ out_uint16_le(s, y + i); /* top */ out_uint16_le(s, (x + cx) - 1); /* right */ out_uint16_le(s, (y + i + lines_sending) - 1); /* bottom */ out_uint16_le(s, width + e); /* width */ out_uint16_le(s, lines_sending); /* height */ out_uint16_le(s, bpp); /* bpp */ if (session->client_info->op1) { out_uint16_le(s, 0x401); /* compress */ out_uint16_le(s, bufsize); /* compressed size */ j = (width + e) * Bpp; j = j * lines_sending; total_bufsize += 18; /* bytes since pop layer */ } else { out_uint16_le(s, 0x1); /* compress */ out_uint16_le(s, bufsize + 8); out_uint8s(s, 2); /* pad */ out_uint16_le(s, bufsize); /* compressed size */ j = (width + e) * Bpp; out_uint16_le(s, j); /* line size */ j = j * lines_sending; out_uint16_le(s, j); /* final size */ total_bufsize += 26; /* bytes since pop layer */ } LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: decompressed pixels %d " "decompressed bytes %d compressed bytes %d", lines_sending * (width + e), line_pad_bytes * lines_sending, bufsize); if (j > MAX_BITMAP_BUF_SIZE) { LOG(LOG_LEVEL_WARNING, "libxrdp_send_bitmap: error, decompressed " "size too big: %d bytes", j); } if (bufsize > MAX_BITMAP_BUF_SIZE) { LOG(LOG_LEVEL_WARNING, "libxrdp_send_bitmap: error, compressed size " "too big: %d bytes", bufsize); } s->p = s->end; } while (total_bufsize < MAX_BITMAP_BUF_SIZE && i > 0); LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: num_updates %d total_bufsize %d", num_updates, total_bufsize); p_num_updates[0] = num_updates; p_num_updates[1] = num_updates >> 8; LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_UPDATE_BITMAP_DATA " "updateType %d (UPDATETYPE_BITMAP), numberRectangles %d, " "rectangles ", RDP_UPDATE_BITMAP, num_updates); xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_UPDATE); if (total_bufsize > MAX_BITMAP_BUF_SIZE) { LOG(LOG_LEVEL_WARNING, "libxrdp_send_bitmap: error, total compressed " "size too big: %d bytes", total_bufsize); } } free_stream(temp_s); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_bitmap: no compression"); total_lines = height; i = 0; p = data; if (line_bytes > 0 && total_lines > 0) { while (i < total_lines) { lines_sending = (MAX_BITMAP_BUF_SIZE - 100) / line_pad_bytes; if (i + lines_sending > total_lines) { lines_sending = total_lines - i; } if (lines_sending == 0) { LOG(LOG_LEVEL_WARNING, "libxrdp_send_bitmap: error, lines_sending == zero"); break; } p += server_line_bytes * lines_sending; xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); out_uint16_le(s, RDP_UPDATE_BITMAP); out_uint16_le(s, 1); /* num updates */ out_uint16_le(s, x); out_uint16_le(s, y + i); out_uint16_le(s, (x + cx) - 1); out_uint16_le(s, (y + i + lines_sending) - 1); out_uint16_le(s, width + e); out_uint16_le(s, lines_sending); out_uint16_le(s, bpp); /* bpp */ out_uint16_le(s, 0); /* compress */ out_uint16_le(s, line_pad_bytes * lines_sending); /* bufsize */ q = p; switch (bpp) { case 8: for (j = 0; j < lines_sending; j++) { q = q - line_bytes; out_uint8a(s, q, line_bytes); out_uint8s(s, e); } break; case 15: case 16: for (j = 0; j < lines_sending; j++) { q = q - server_line_bytes; for (k = 0; k < width; k++) { pixel = *((tui16 *)(q + k * 2)); out_uint16_le(s, pixel); } out_uint8s(s, e * 2); } break; case 24: for (j = 0; j < lines_sending; j++) { q = q - server_line_bytes; for (k = 0; k < width; k++) { pixel = *((tui32 *)(q + k * 4)); out_uint8(s, pixel); out_uint8(s, pixel >> 8); out_uint8(s, pixel >> 16); } out_uint8s(s, e * 3); } break; case 32: for (j = 0; j < lines_sending; j++) { q = q - server_line_bytes; for (k = 0; k < width; k++) { pixel = *((int *)(q + k * 4)); out_uint32_le(s, pixel); } out_uint8s(s, e * 4); } break; } s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_UPDATE_BITMAP_DATA " "updateType %d (UPDATETYPE_BITMAP), numberRectangles 1, " "rectangles ", RDP_UPDATE_BITMAP); xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_UPDATE); i = i + lines_sending; } } } free_stream(s); return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_send_pointer(struct xrdp_session *session, int cache_idx, char *data, char *mask, int x, int y, int bpp, int width, int height) { struct stream *s; char *p; tui16 *p16; tui32 *p32; int i; int j; int data_bytes; int mask_bytes; LOG_DEVEL(LOG_LEVEL_DEBUG, "sending cursor"); if (bpp == 0) { bpp = 24; } if (width == 0) { width = 32; } if (height == 0) { height = 32; } /* error check */ if ((session->client_info->pointer_flags & 1) == 0) { if (bpp != 24) { LOG(LOG_LEVEL_ERROR, "Send pointer: client does not support " "new cursors. The only valid bpp is 24, received %d", bpp); return 1; } } if ((bpp != 15) && (bpp != 16) && (bpp != 24) && (bpp != 32)) { LOG(LOG_LEVEL_ERROR, "Send pointer: invalid bpp value. Expected 15, 16, 24 or 32, " "received %d", bpp); return 1; } make_stream(s); data_bytes = width * height * ((bpp + 7) / 8); mask_bytes = width * height / 8; init_stream(s, data_bytes + mask_bytes + 8192); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_pointer: fastpath"); if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_pointer: xrdp_rdp_init_fastpath failed"); free_stream(s); return 1; } if ((session->client_info->pointer_flags & 1) != 0) { out_uint16_le(s, bpp); /* TS_FP_POINTERATTRIBUTE -> newPointerUpdateData.xorBpp */ } } else /* slowpath */ { LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_send_pointer: slowpath"); xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); if ((session->client_info->pointer_flags & 1) == 0) { out_uint16_le(s, RDP_POINTER_COLOR); out_uint16_le(s, 0); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_POINTER_PDU " "messageType %d (TS_PTRMSGTYPE_COLOR), pad2Octets ", RDP_POINTER_COLOR); } else { out_uint16_le(s, RDP_POINTER_POINTER); out_uint16_le(s, 0); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_POINTER_PDU " "messageType %d (TS_PTRMSGTYPE_POINTER), pad2Octets ", RDP_POINTER_POINTER); out_uint16_le(s, bpp); /* TS_POINTERATTRIBUTE -> xorBpp */ } } /* the TS_COLORPOINTERATTRIBUTE field which is shared by all of the pointer attribute PDU types */ out_uint16_le(s, cache_idx); /* cache_idx */ out_uint16_le(s, x); /* hotSpot.xPos */ out_uint16_le(s, y); /* hotSpot.yPos */ out_uint16_le(s, width); /* width */ out_uint16_le(s, height); /* height */ out_uint16_le(s, mask_bytes); /* lengthAndMask */ out_uint16_le(s, data_bytes); /* lengthXorMask */ /* xorMaskData */ switch (bpp) { case 15: /* fallthrough */ case 16: p16 = (tui16 *) data; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { out_uint16_le(s, *p16); p16++; } } break; case 24: p = data; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { out_uint8(s, *p); p++; out_uint8(s, *p); p++; out_uint8(s, *p); p++; } } break; case 32: p32 = (tui32 *) data; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { out_uint32_le(s, *p32); p32++; } } break; } out_uint8a(s, mask, mask_bytes); /* andMaskData */ out_uint8(s, 0); /* pad */ s_mark_end(s); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { if ((session->client_info->pointer_flags & 1) == 0) { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_COLORPOINTERATTRIBUTE " "cachedPointerUpdateData = { cacheIndex %d, " "hotSpot.xPos %d, hotSpot.yPos %d, width %d, " "height %d, lengthAndMask %d, lengthXorMask %d, " "xorMaskData , " "andMaskData }", cache_idx, x, y, width, height, mask_bytes, data_bytes); if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_COLOR) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_pointer: xrdp_rdp_send_fastpath failed"); free_stream(s); return 1; } } else { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_POINTERATTRIBUTE " "newPointerUpdateData.xorBpp %d, " "newPointerUpdateData.colorPtrAttr = { cacheIndex %d, " "hotSpot.xPos %d, hotSpot.yPos %d, width %d, " "height %d, lengthAndMask %d, lengthXorMask %d, " "xorMaskData , " "andMaskData }", bpp, cache_idx, x, y, width, height, mask_bytes, data_bytes); if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_POINTER) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_pointer: xrdp_rdp_send_fastpath failed"); free_stream(s); return 1; } } } else { if ((session->client_info->pointer_flags & 1) == 0) { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_COLORPOINTERATTRIBUTE " "cacheIndex %d, " "hotSpot.xPos %d, hotSpot.yPos %d, width %d, " "height %d, lengthAndMask %d, lengthXorMask %d, " "xorMaskData , " "andMaskData ", cache_idx, x, y, width, height, mask_bytes, data_bytes); } else { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_POINTERATTRIBUTE " "xorBpp %d, colorPtrAttr = { cacheIndex %d, " "hotSpot.xPos %d, hotSpot.yPos %d, width %d, " "height %d, lengthAndMask %d, lengthXorMask %d, " "xorMaskData , " "andMaskData }", bpp, cache_idx, x, y, width, height, mask_bytes, data_bytes); } xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_POINTER); } free_stream(s); return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_set_pointer(struct xrdp_session *session, int cache_idx) { struct stream *s; make_stream(s); init_stream(s, 8192); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_set_pointer: xrdp_rdp_init_fastpath failed"); free_stream(s); return 1; } } else { xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); out_uint16_le(s, RDP_POINTER_CACHED); out_uint16_le(s, 0); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_POINTER_PDU " "messageType %d (TS_PTRMSGTYPE_CACHED), pad2Octets ", RDP_POINTER_CACHED); } out_uint16_le(s, cache_idx); /* cache_idx */ s_mark_end(s); if (session->client_info->use_fast_path & 1) /* fastpath output supported */ { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_CACHEDPOINTERATTRIBUTE " "cachedPointerUpdateData.cacheIndex %d", cache_idx); if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s, FASTPATH_UPDATETYPE_CACHED) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_set_pointer: xrdp_rdp_send_fastpath failed"); free_stream(s); return 1; } } else { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_CACHEDPOINTERATTRIBUTE " "cacheIndex %d", cache_idx); xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_POINTER); } free_stream(s); return 0; } /******************************************************************************/ int EXPORT_CC libxrdp_orders_init(struct xrdp_session *session) { return xrdp_orders_init((struct xrdp_orders *)session->orders); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_send(struct xrdp_session *session) { return xrdp_orders_send((struct xrdp_orders *)session->orders); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_force_send(struct xrdp_session *session) { return xrdp_orders_force_send((struct xrdp_orders *)session->orders); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_rect(struct xrdp_session *session, int x, int y, int cx, int cy, int color, struct xrdp_rect *rect) { return xrdp_orders_rect((struct xrdp_orders *)session->orders, x, y, cx, cy, color, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_screen_blt(struct xrdp_session *session, int x, int y, int cx, int cy, int srcx, int srcy, int rop, struct xrdp_rect *rect) { return xrdp_orders_screen_blt((struct xrdp_orders *)session->orders, x, y, cx, cy, srcx, srcy, rop, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_pat_blt(struct xrdp_session *session, int x, int y, int cx, int cy, int rop, int bg_color, int fg_color, struct xrdp_brush *brush, struct xrdp_rect *rect) { return xrdp_orders_pat_blt((struct xrdp_orders *)session->orders, x, y, cx, cy, rop, bg_color, fg_color, brush, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_dest_blt(struct xrdp_session *session, int x, int y, int cx, int cy, int rop, struct xrdp_rect *rect) { return xrdp_orders_dest_blt((struct xrdp_orders *)session->orders, x, y, cx, cy, rop, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_line(struct xrdp_session *session, int mix_mode, int startx, int starty, int endx, int endy, int rop, int bg_color, struct xrdp_pen *pen, struct xrdp_rect *rect) { return xrdp_orders_line((struct xrdp_orders *)session->orders, mix_mode, startx, starty, endx, endy, rop, bg_color, pen, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_mem_blt(struct xrdp_session *session, int cache_id, int color_table, int x, int y, int cx, int cy, int rop, int srcx, int srcy, int cache_idx, struct xrdp_rect *rect) { return xrdp_orders_mem_blt((struct xrdp_orders *)session->orders, cache_id, color_table, x, y, cx, cy, rop, srcx, srcy, cache_idx, rect); } /******************************************************************************/ int libxrdp_orders_composite_blt(struct xrdp_session *session, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat, struct xrdp_rect *rect) { return xrdp_orders_composite_blt((struct xrdp_orders *)session->orders, srcidx, srcformat, srcwidth, srcrepeat, srctransform, mskflags, mskidx, mskformat, mskwidth, mskrepeat, op, srcx, srcy, mskx, msky, dstx, dsty, width, height, dstformat, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_text(struct xrdp_session *session, int font, int flags, int mixmode, int fg_color, int bg_color, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len, struct xrdp_rect *rect) { return xrdp_orders_text((struct xrdp_orders *)session->orders, font, flags, mixmode, fg_color, bg_color, clip_left, clip_top, clip_right, clip_bottom, box_left, box_top, box_right, box_bottom, x, y, data, data_len, rect); } /******************************************************************************/ int EXPORT_CC libxrdp_orders_send_palette(struct xrdp_session *session, int *palette, int cache_id) { return xrdp_orders_send_palette((struct xrdp_orders *)session->orders, palette, cache_id); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_raw_bitmap(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx) { return xrdp_orders_send_raw_bitmap((struct xrdp_orders *)session->orders, width, height, bpp, data, cache_id, cache_idx); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_bitmap(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx) { return xrdp_orders_send_bitmap((struct xrdp_orders *)session->orders, width, height, bpp, data, cache_id, cache_idx); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_font(struct xrdp_session *session, struct xrdp_font_char *font_char, int font_index, int char_index) { return xrdp_orders_send_font((struct xrdp_orders *)session->orders, font_char, font_index, char_index); } /*****************************************************************************/ int EXPORT_CC libxrdp_reset(struct xrdp_session *session) { LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_reset:"); /* this will send any lingering orders */ if (xrdp_orders_reset((struct xrdp_orders *)session->orders) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_reset: xrdp_orders_reset failed"); return 1; } /* * Stop output from the client during the deactivation-reactivation * sequence [MS-RDPBCGR] 1.3.1.3 */ xrdp_rdp_suppress_output((struct xrdp_rdp *)session->rdp, 1, XSO_REASON_DEACTIVATE_REACTIVATE, 0, 0, 0, 0); /* shut down the rdp client * * When resetting the lib, disable application input checks, as * otherwise we can send a channel message to the other end while * the channels are inactive ([MS-RDPBCGR] 3.2.5.5.1 */ session->check_for_app_input = 0; if (xrdp_rdp_send_deactivate((struct xrdp_rdp *)session->rdp) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_reset: xrdp_rdp_send_deactivate failed"); return 1; } /* this should do the resizing */ if (xrdp_caps_send_demand_active((struct xrdp_rdp *)session->rdp) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_reset: xrdp_caps_send_demand_active failed"); return 1; } /* Re-enable application input checks */ session->check_for_app_input = 1; return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_raw_bitmap2(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx) { return xrdp_orders_send_raw_bitmap2((struct xrdp_orders *)session->orders, width, height, bpp, data, cache_id, cache_idx); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_bitmap2(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints) { return xrdp_orders_send_bitmap2((struct xrdp_orders *)session->orders, width, height, bpp, data, cache_id, cache_idx, hints); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_bitmap3(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints) { return xrdp_orders_send_bitmap3((struct xrdp_orders *)session->orders, width, height, bpp, data, cache_id, cache_idx, hints); } /*****************************************************************************/ int EXPORT_CC libxrdp_get_channel_count(const struct xrdp_session *session) { int count = 0; const struct xrdp_rdp *rdp = (const struct xrdp_rdp *)session->rdp; const struct xrdp_mcs *mcs = rdp->sec_layer->mcs_layer; if (mcs->channel_list == NULL) { LOG(LOG_LEVEL_WARNING, "libxrdp_get_channel_count - No channel initialized"); } else { count = mcs->channel_list->count; } return count; } /*****************************************************************************/ /* returns error */ /* this function gets the channel name and its flags, index is zero based. either channel_name or channel_flags can be passed in nil if they are not needed */ int EXPORT_CC libxrdp_query_channel(struct xrdp_session *session, int channel_id, char *channel_name, int *channel_flags) { int count = 0; struct xrdp_rdp *rdp = (struct xrdp_rdp *)NULL; struct xrdp_mcs *mcs = (struct xrdp_mcs *)NULL; struct mcs_channel_item *channel_item = (struct mcs_channel_item *)NULL; rdp = (struct xrdp_rdp *)session->rdp; mcs = rdp->sec_layer->mcs_layer; if (mcs->channel_list == NULL) { LOG(LOG_LEVEL_ERROR, "libxrdp_query_channel - No channel initialized"); return 1 ; } count = mcs->channel_list->count; if (channel_id < 0 || channel_id >= count) { LOG(LOG_LEVEL_ERROR, "libxrdp_query_channel: Channel index out of range. " "max channel index %d, received channel index %d", count, channel_id); return 1; } channel_item = (struct mcs_channel_item *) list_get_item(mcs->channel_list, channel_id); if (channel_item == NULL) { /* this should not happen */ LOG(LOG_LEVEL_ERROR, "libxrdp_query_channel - channel item is NULL"); return 1; } if (channel_name != 0) { g_strncpy(channel_name, channel_item->name, 8); LOG(LOG_LEVEL_DEBUG, "libxrdp_query_channel - Channel %d name %s", channel_id, channel_name); } if (channel_flags != 0) { *channel_flags = channel_item->flags; } return 0; } /*****************************************************************************/ /* returns a zero based index of the channel, -1 if error or it doesn't exist */ int EXPORT_CC libxrdp_get_channel_id(struct xrdp_session *session, const char *name) { int index = 0; int count = 0; struct xrdp_rdp *rdp = NULL; struct xrdp_mcs *mcs = NULL; struct mcs_channel_item *channel_item = NULL; rdp = (struct xrdp_rdp *)session->rdp; mcs = rdp->sec_layer->mcs_layer; if (mcs->channel_list == NULL) { LOG(LOG_LEVEL_ERROR, "libxrdp_get_channel_id No channel initialized"); return -1 ; } count = mcs->channel_list->count; for (index = 0; index < count; index++) { channel_item = (struct mcs_channel_item *) list_get_item(mcs->channel_list, index); if (channel_item != 0) { if (g_strcasecmp(name, channel_item->name) == 0) { return index; } } } return -1; } /*****************************************************************************/ int EXPORT_CC libxrdp_send_to_channel(struct xrdp_session *session, int channel_id, char *data, int data_len, int total_data_len, int flags) { struct xrdp_rdp *rdp = NULL; struct xrdp_sec *sec = NULL; struct xrdp_channel *chan = NULL; struct stream *s = NULL; rdp = (struct xrdp_rdp *)session->rdp; sec = rdp->sec_layer; chan = sec->chan_layer; make_stream(s); init_stream(s, data_len + 1024); /* this should be big enough */ if (xrdp_channel_init(chan, s) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_to_channel: xrdp_channel_init failed"); free_stream(s); return 1; } else { LOG(LOG_LEVEL_TRACE, "libxrdp_send_to_channel: xrdp_channel_init successful!"); } /* here we make a copy of the data */ out_uint8a(s, data, data_len); s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] Virtual Channel PDU " "data "); if (xrdp_channel_send(chan, s, channel_id, total_data_len, flags) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_send_to_channel: xrdp_channel_send failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ int libxrdp_disable_channel(struct xrdp_session *session, int channel_id, int is_disabled) { struct xrdp_rdp *rdp; struct xrdp_mcs *mcs; struct mcs_channel_item *channel_item; rdp = (struct xrdp_rdp *) (session->rdp); mcs = rdp->sec_layer->mcs_layer; if (mcs->channel_list == NULL) { LOG(LOG_LEVEL_ERROR, "Channel list is NULL"); return 1; } channel_item = (struct mcs_channel_item *) list_get_item(mcs->channel_list, channel_id); if (channel_item == NULL) { LOG(LOG_LEVEL_ERROR, "Channel item is NULL"); return 1; } channel_item->disabled = is_disabled; LOG(LOG_LEVEL_DEBUG, "%s channel %d (%s)", (is_disabled ? "Disabling" : "Enabling"), channel_item->chanid, channel_item->name); return 1; } /*****************************************************************************/ int libxrdp_drdynvc_start(struct xrdp_session *session) { struct xrdp_rdp *rdp; struct xrdp_sec *sec; struct xrdp_channel *chan; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_drdynvc_start:"); rdp = (struct xrdp_rdp *) (session->rdp); sec = rdp->sec_layer; chan = sec->chan_layer; return xrdp_channel_drdynvc_start(chan); } /*****************************************************************************/ int libxrdp_drdynvc_open(struct xrdp_session *session, const char *name, int flags, struct xrdp_drdynvc_procs *procs, int *chan_id) { struct xrdp_rdp *rdp; struct xrdp_sec *sec; struct xrdp_channel *chan; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_drdynvc_open:"); rdp = (struct xrdp_rdp *) (session->rdp); sec = rdp->sec_layer; chan = sec->chan_layer; return xrdp_channel_drdynvc_open(chan, name, flags, procs, chan_id); } /*****************************************************************************/ int libxrdp_drdynvc_close(struct xrdp_session *session, int chan_id) { struct xrdp_rdp *rdp; struct xrdp_sec *sec; struct xrdp_channel *chan; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_drdynvc_close:"); rdp = (struct xrdp_rdp *) (session->rdp); sec = rdp->sec_layer; chan = sec->chan_layer; return xrdp_channel_drdynvc_close(chan, chan_id); } /*****************************************************************************/ int libxrdp_drdynvc_data_first(struct xrdp_session *session, int chan_id, const char *data, int data_bytes, int total_data_bytes) { struct xrdp_rdp *rdp; struct xrdp_sec *sec; struct xrdp_channel *chan; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_drdynvc_data_first:"); rdp = (struct xrdp_rdp *) (session->rdp); sec = rdp->sec_layer; chan = sec->chan_layer; return xrdp_channel_drdynvc_data_first(chan, chan_id, data, data_bytes, total_data_bytes); } /*****************************************************************************/ int libxrdp_drdynvc_data(struct xrdp_session *session, int chan_id, const char *data, int data_bytes) { struct xrdp_rdp *rdp; struct xrdp_sec *sec; struct xrdp_channel *chan; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_drdynvc_data:"); rdp = (struct xrdp_rdp *) (session->rdp); sec = rdp->sec_layer; chan = sec->chan_layer; return xrdp_channel_drdynvc_data(chan, chan_id, data, data_bytes); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_brush(struct xrdp_session *session, int width, int height, int bpp, int type, int size, char *data, int cache_id) { return xrdp_orders_send_brush((struct xrdp_orders *)session->orders, width, height, bpp, type, size, data, cache_id); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_create_os_surface(struct xrdp_session *session, int id, int width, int height, struct list *del_list) { return xrdp_orders_send_create_os_surface ((struct xrdp_orders *)(session->orders), id, width, height, del_list); } /*****************************************************************************/ int EXPORT_CC libxrdp_orders_send_switch_os_surface(struct xrdp_session *session, int id) { return xrdp_orders_send_switch_os_surface ((struct xrdp_orders *)(session->orders), id); } /*****************************************************************************/ int EXPORT_CC libxrdp_window_new_update(struct xrdp_session *session, int window_id, struct rail_window_state_order *window_state, int flags) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_window_new_update(orders, window_id, window_state, flags); } /*****************************************************************************/ int EXPORT_CC libxrdp_window_delete(struct xrdp_session *session, int window_id) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_window_delete(orders, window_id); } /*****************************************************************************/ int EXPORT_CC libxrdp_window_icon(struct xrdp_session *session, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_window_icon(orders, window_id, cache_entry, cache_id, icon_info, flags); } /*****************************************************************************/ int EXPORT_CC libxrdp_window_cached_icon(struct xrdp_session *session, int window_id, int cache_entry, int cache_id, int flags) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_window_cached_icon(orders, window_id, cache_entry, cache_id, flags); } /*****************************************************************************/ int EXPORT_CC libxrdp_notify_new_update(struct xrdp_session *session, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_notify_new_update(orders, window_id, notify_id, notify_state, flags); } /*****************************************************************************/ int libxrdp_notify_delete(struct xrdp_session *session, int window_id, int notify_id) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_notify_delete(orders, window_id, notify_id); } /*****************************************************************************/ int libxrdp_monitored_desktop(struct xrdp_session *session, struct rail_monitored_desktop_order *mdo, int flags) { struct xrdp_orders *orders; orders = (struct xrdp_orders *)(session->orders); return xrdp_orders_send_monitored_desktop(orders, mdo, flags); } /*****************************************************************************/ int EXPORT_CC libxrdp_codec_jpeg_compress(struct xrdp_session *session, int format, char *inp_data, int width, int height, int stride, int x, int y, int cx, int cy, int quality, char *out_data, int *io_len) { struct xrdp_orders *orders; void *jpeg_han; orders = (struct xrdp_orders *)(session->orders); jpeg_han = orders->jpeg_han; return xrdp_codec_jpeg_compress(jpeg_han, format, inp_data, width, height, stride, x, y, cx, cy, quality, out_data, io_len); } /*****************************************************************************/ int EXPORT_CC libxrdp_fastpath_send_surface(struct xrdp_session *session, char *data_pad, int pad_bytes, int data_bytes, int destLeft, int destTop, int destRight, int destBottom, int bpp, int codecID, int width, int height) { struct stream ls; struct stream *s; struct xrdp_rdp *rdp; int sec_bytes; int rdp_bytes; int max_bytes; int cmd_bytes; LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_fastpath_send_surface:"); if ((session->client_info->use_fast_path & 1) == 0) { LOG(LOG_LEVEL_ERROR, "Sending data via fastpath is disabled"); return 1; } max_bytes = session->client_info->max_fastpath_frag_bytes; if (max_bytes < 32 * 1024) { max_bytes = 32 * 1024; } rdp = (struct xrdp_rdp *) (session->rdp); rdp_bytes = xrdp_rdp_get_fastpath_bytes(rdp); sec_bytes = xrdp_sec_get_fastpath_bytes(rdp->sec_layer); cmd_bytes = 10 + 12; if (data_bytes + rdp_bytes + sec_bytes + cmd_bytes > max_bytes) { LOG(LOG_LEVEL_ERROR, "Too much data to send via fastpath. " "Max fastpath bytes %d, received bytes %d", max_bytes, (data_bytes + rdp_bytes + sec_bytes + cmd_bytes)); return 1; } if (sec_bytes + rdp_bytes + cmd_bytes > pad_bytes) { LOG(LOG_LEVEL_ERROR, "Too much header to send via fastpath. " "Max fastpath header bytes %d, received bytes %d", pad_bytes, (rdp_bytes + sec_bytes + cmd_bytes)); return 1; } g_memset(&ls, 0, sizeof(ls)); s = &ls; s->data = (data_pad + pad_bytes) - (rdp_bytes + sec_bytes + cmd_bytes); s->sec_hdr = s->data; s->rdp_hdr = s->sec_hdr + sec_bytes; s->end = data_pad + pad_bytes + data_bytes; s->size = s->end - s->data; s->p = s->data + (rdp_bytes + sec_bytes); /* TS_SURFCMD_STREAM_SURF_BITS */ out_uint16_le(s, CMDTYPE_STREAM_SURFACE_BITS); out_uint16_le(s, destLeft); out_uint16_le(s, destTop); out_uint16_le(s, destRight); out_uint16_le(s, destBottom); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_SURFCMD_STREAM_SURF_BITS " "cmdType 0x%4.4x (CMDTYPE_STREAM_SURFACE_BITS), destLeft %d, " "destTop %d, destRight %d, destBottom %d, " "bitmapData ", CMDTYPE_STREAM_SURFACE_BITS, destLeft, destTop, destRight, destBottom); /* TS_BITMAP_DATA_EX */ out_uint8(s, bpp); out_uint8(s, 0); out_uint8(s, 0); out_uint8(s, codecID); out_uint16_le(s, width); out_uint16_le(s, height); out_uint32_le(s, data_bytes); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding field bitmapData [MS-RDPBCGR] TS_BITMAP_DATA_EX " "bpp %d, flags 0x00, reserved 0, codecID %d, width %d, " "height %d, bitmapDataLength %d, exBitmapDataHeader , " "bitmapData ", bpp, codecID, width, height, data_bytes); if (xrdp_rdp_send_fastpath(rdp, s, FASTPATH_UPDATETYPE_SURFCMDS) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_fastpath_send_surface: xrdp_rdp_send_fastpath failed"); return 1; } return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_fastpath_send_frame_marker(struct xrdp_session *session, int frame_action, int frame_id) { struct stream *s; struct xrdp_rdp *rdp; LOG_DEVEL(LOG_LEVEL_DEBUG, "libxrdp_fastpath_send_frame_marker:"); if ((session->client_info->use_fast_path & 1) == 0) { LOG(LOG_LEVEL_ERROR, "Sending data via fastpath is disabled"); return 1; } if (session->client_info->use_frame_acks == 0) { LOG(LOG_LEVEL_ERROR, "Fastpath frame acks is disabled"); return 1; } rdp = (struct xrdp_rdp *) (session->rdp); make_stream(s); init_stream(s, 8192); xrdp_rdp_init_fastpath(rdp, s); out_uint16_le(s, CMDTYPE_FRAME_MARKER); out_uint16_le(s, frame_action); out_uint32_le(s, frame_id); s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FRAME_MARKER " "cmdType 0x%4.4x (CMDTYPE_FRAME_MARKER), frameAction 0x%4.4x, " "frameId %d", CMDTYPE_FRAME_MARKER, frame_action, frame_id); if (xrdp_rdp_send_fastpath(rdp, s, FASTPATH_UPDATETYPE_SURFCMDS) != 0) { LOG(LOG_LEVEL_ERROR, "libxrdp_fastpath_send_frame_marker: xrdp_rdp_send_fastpath failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_send_session_info(struct xrdp_session *session, const char *data, int data_bytes) { struct xrdp_rdp *rdp; rdp = (struct xrdp_rdp *) (session->rdp); return xrdp_rdp_send_session_info(rdp, data, data_bytes); } /*****************************************************************************/ /* Sanitise extended monitor attributes The extended attributes are received from either [MS-RDPEDISP] 2.2.2.2.1 (DISPLAYCONTROL_MONITOR_LAYOUT), or [MS-RDPBCGR] 2.2.1.3.9.1 (TS_MONITOR_ATTRIBUTES) @param monitor_layout struct containing extended attributes */ static void sanitise_extended_monitor_attributes(struct monitor_info *monitor_layout) { if (monitor_layout->physical_width == 0 && monitor_layout->physical_width == 0 && monitor_layout->orientation == 0 && monitor_layout->desktop_scale_factor == 0 && monitor_layout->device_scale_factor == 0) { /* Module expects us to provide defaults */ monitor_layout->orientation = ORIENTATION_LANDSCAPE; monitor_layout->desktop_scale_factor = 100; monitor_layout->device_scale_factor = 100; return; } /* if EITHER physical_width or physical_height are * out of range, BOTH must be ignored. */ if (monitor_layout->physical_width > 10000 || monitor_layout->physical_width < 10) { LOG(LOG_LEVEL_WARNING, "sanitise_extended_monitor_attributes:" " physical_width is not within valid range." " Setting physical_width to 0mm," " Setting physical_height to 0mm," " physical_width was: %d", monitor_layout->physical_width); monitor_layout->physical_width = 0; monitor_layout->physical_height = 0; } if (monitor_layout->physical_height > 10000 || monitor_layout->physical_height < 10) { LOG(LOG_LEVEL_WARNING, "sanitise_extended_monitor_attributes:" " physical_height is not within valid range." " Setting physical_width to 0mm," " Setting physical_height to 0mm," " physical_height was: %d", monitor_layout->physical_height); monitor_layout->physical_width = 0; monitor_layout->physical_height = 0; } switch (monitor_layout->orientation) { case ORIENTATION_LANDSCAPE: case ORIENTATION_PORTRAIT: case ORIENTATION_LANDSCAPE_FLIPPED: case ORIENTATION_PORTRAIT_FLIPPED: break; default: LOG(LOG_LEVEL_WARNING, "sanitise_extended_monitor_attributes:" " Orientation is not one of %d, %d, %d, or %d." " Value was %d and ignored and set to default value of LANDSCAPE.", ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE_FLIPPED, ORIENTATION_PORTRAIT_FLIPPED, monitor_layout->orientation); monitor_layout->orientation = ORIENTATION_LANDSCAPE; } int check_desktop_scale_factor = monitor_layout->desktop_scale_factor < 100 || monitor_layout->desktop_scale_factor > 500; if (check_desktop_scale_factor) { LOG(LOG_LEVEL_WARNING, "sanitise_extended_monitor_attributes:" " desktop_scale_factor is not within valid range" " of [100, 500]. Assuming 100. Value was: %d", monitor_layout->desktop_scale_factor); } int check_device_scale_factor = monitor_layout->device_scale_factor != 100 && monitor_layout->device_scale_factor != 140 && monitor_layout->device_scale_factor != 180; if (check_device_scale_factor) { LOG(LOG_LEVEL_WARNING, "sanitise_extended_monitor_attributes:" " device_scale_factor a valid value (One of 100, 140, 180)." " Assuming 100. Value was: %d", monitor_layout->device_scale_factor); } if (check_desktop_scale_factor || check_device_scale_factor) { monitor_layout->desktop_scale_factor = 100; monitor_layout->device_scale_factor = 100; } } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_UD_CS_MONITOR message. reads the client monitors data */ int libxrdp_process_monitor_stream(struct stream *s, struct display_size_description *description, int full_parameters) { uint32_t num_monitor; uint32_t monitor_index; struct monitor_info monitors[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; struct monitor_info *monitor_layout; int monitor_struct_stream_check_bytes; const char *monitor_struct_stream_check_message; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_process_monitor_stream:"); if (description == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "libxrdp_process_monitor_stream: description was" " null. Valid pointer to allocated description expected."); return SEC_PROCESS_MONITORS_ERR; } if (!s_check_rem_and_log(s, 4, "libxrdp_process_monitor_stream:" " Parsing [MS-RDPBCGR] TS_UD_CS_MONITOR")) { return SEC_PROCESS_MONITORS_ERR; } in_uint32_le(s, num_monitor); LOG(LOG_LEVEL_DEBUG, "libxrdp_process_monitor_stream:" " The number of monitors received is: %d", num_monitor); if (num_monitor >= CLIENT_MONITOR_DATA_MAXIMUM_MONITORS) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_monitor_stream: [MS-RDPBCGR] Protocol" " error: TS_UD_CS_MONITOR monitorCount" " MUST be less than %d, received: %d", CLIENT_MONITOR_DATA_MAXIMUM_MONITORS, num_monitor); return SEC_PROCESS_MONITORS_ERR_TOO_MANY_MONITORS; } /* * Unfortunately the structure length values aren't directly defined in the * Microsoft specifications. They are derived from the lengths of the * specific structures referenced below. */ if (full_parameters == 0) { monitor_struct_stream_check_bytes = 20; monitor_struct_stream_check_message = "libxrdp_process_monitor_stream: Parsing monitor definitions" " from [MS-RDPBCGR] 2.2.1.3.6.1 Monitor Definition" " (TS_MONITOR_DEF)."; } else { monitor_struct_stream_check_bytes = 40; monitor_struct_stream_check_message = "libxrdp_process_monitor_stream: Parsing monitor definitions" " from [MS-RDPEDISP] 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT."; } memset(monitors, 0, sizeof(monitors[0]) * num_monitor); for (monitor_index = 0; monitor_index < num_monitor; ++monitor_index) { if (!s_check_rem_and_log( s, monitor_struct_stream_check_bytes, monitor_struct_stream_check_message)) { return SEC_PROCESS_MONITORS_ERR; } monitor_layout = &monitors[monitor_index]; if (full_parameters != 0) { in_uint32_le(s, monitor_layout->flags); } in_uint32_le(s, monitor_layout->left); in_uint32_le(s, monitor_layout->top); if (full_parameters == 0) { in_uint32_le(s, monitor_layout->right); in_uint32_le(s, monitor_layout->bottom); in_uint32_le(s, monitor_layout->is_primary); /* * 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */ LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_process_monitor_stream:" " Received [MS-RDPBCGR] 2.2.1.3.6.1" " TS_UD_CS_MONITOR.TS_MONITOR_DEF" " Index: %d, Left %d, Top %d, Right %d, Bottom %d," " Flags 0x%8.8x", monitor_index, monitor_layout->left, monitor_layout->top, monitor_layout->right, monitor_layout->bottom, monitor_layout->is_primary); } else { /* Per spec (2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT), * this is the width. * 200 <= width <= 8192 and must not be odd. * Ex: in_uint32_le(s, monitor_layout->width); */ int width; in_uint32_le(s, width); if (width > CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_WIDTH || width < CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_WIDTH || width % 2 != 0) { return SEC_PROCESS_MONITORS_ERR_INVALID_MONITOR; } monitor_layout->right = monitor_layout->left + width - 1; /* Per spec (2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT), * this is the height. * 200 <= height <= 8192 * Ex: in_uint32_le(s, monitor_layout->height); */ int height; in_uint32_le(s, height); if (height > CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_HEIGHT || height < CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_HEIGHT) { return SEC_PROCESS_MONITORS_ERR_INVALID_MONITOR; } monitor_layout->bottom = monitor_layout->top + height - 1; in_uint32_le(s, monitor_layout->physical_width); in_uint32_le(s, monitor_layout->physical_height); in_uint32_le(s, monitor_layout->orientation); in_uint32_le(s, monitor_layout->desktop_scale_factor); in_uint32_le(s, monitor_layout->device_scale_factor); /* * 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT */ LOG_DEVEL(LOG_LEVEL_INFO, "libxrdp_process_monitor_stream:" " Received [MS-RDPEDISP] 2.2.2.2.1" " DISPLAYCONTROL_MONITOR_LAYOUT_PDU" ".DISPLAYCONTROL_MONITOR_LAYOUT" " Index: %d, Flags 0x%8.8x, Left %d, Top %d, Width %d," " Height %d, PhysicalWidth %d, PhysicalHeight %d," " Orientation %d, DesktopScaleFactor %d," " DeviceScaleFactor %d", monitor_index, monitor_layout->flags, monitor_layout->left, monitor_layout->top, width, height, monitor_layout->physical_width, monitor_layout->physical_height, monitor_layout->orientation, monitor_layout->desktop_scale_factor, monitor_layout->device_scale_factor); if (monitor_layout->flags == DISPLAYCONTROL_MONITOR_PRIMARY) { monitor_layout->is_primary = TS_MONITOR_PRIMARY; } } } return libxrdp_init_display_size_description( num_monitor, monitors, description); } /*****************************************************************************/ int libxrdp_process_monitor_ex_stream(struct stream *s, struct display_size_description *description) { uint32_t num_monitor; uint32_t monitor_index; uint32_t attribute_size; struct monitor_info *monitor_layout; LOG_DEVEL(LOG_LEVEL_TRACE, "libxrdp_process_monitor_ex_stream:"); if (description == NULL) { LOG_DEVEL(LOG_LEVEL_ERROR, "libxrdp_process_monitor_ex_stream: " "description was null. " " Valid pointer to allocated description expected."); return SEC_PROCESS_MONITORS_ERR; } if (!s_check_rem_and_log(s, 4, "libxrdp_process_monitor_ex_stream:" " Parsing [MS-RDPBCGR] TS_UD_CS_MONITOR_EX")) { return SEC_PROCESS_MONITORS_ERR; } in_uint32_le(s, attribute_size); if (attribute_size != TS_MONITOR_ATTRIBUTES_SIZE) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_monitor_ex_stream: [MS-RDPBCGR] Protocol" " error: TS_UD_CS_MONITOR_EX monitorAttributeSize" " MUST be %d, received: %d", TS_MONITOR_ATTRIBUTES_SIZE, attribute_size); return SEC_PROCESS_MONITORS_ERR; } in_uint32_le(s, num_monitor); LOG(LOG_LEVEL_DEBUG, "libxrdp_process_monitor_ex_stream:" " The number of monitors received is: %d", num_monitor); if (num_monitor != description->monitorCount) { LOG(LOG_LEVEL_ERROR, "libxrdp_process_monitor_ex_stream: [MS-RDPBCGR] Protocol" " error: TS_UD_CS_MONITOR monitorCount" " MUST be %d, received: %d", description->monitorCount, num_monitor); return SEC_PROCESS_MONITORS_ERR; } for (monitor_index = 0; monitor_index < num_monitor; ++monitor_index) { if (!s_check_rem_and_log(s, attribute_size, "libxrdp_process_monitor_ex_stream:" " Parsing TS_UD_CS_MONITOR_EX")) { return SEC_PROCESS_MONITORS_ERR; } monitor_layout = description->minfo + monitor_index; in_uint32_le(s, monitor_layout->physical_width); in_uint32_le(s, monitor_layout->physical_height); in_uint32_le(s, monitor_layout->orientation); in_uint32_le(s, monitor_layout->desktop_scale_factor); in_uint32_le(s, monitor_layout->device_scale_factor); sanitise_extended_monitor_attributes(monitor_layout); LOG_DEVEL(LOG_LEVEL_INFO, "libxrdp_process_monitor_ex_stream:" " Received [MS-RDPBCGR] 2.2.1.3.9.1 " " TS_MONITOR_ATTRIBUTES" " Index: %d, PhysicalWidth %d, PhysicalHeight %d," " Orientation %d, DesktopScaleFactor %d," " DeviceScaleFactor %d", monitor_index, monitor_layout->physical_width, monitor_layout->physical_height, monitor_layout->orientation, monitor_layout->desktop_scale_factor, monitor_layout->device_scale_factor); } /* Update non negative monitor info values */ const struct monitor_info *src = description->minfo; struct monitor_info *dst = description->minfo_wm; for (monitor_index = 0; monitor_index < num_monitor; ++monitor_index) { dst->physical_width = src->physical_width; dst->physical_height = src->physical_height; dst->orientation = src->orientation; dst->desktop_scale_factor = src->desktop_scale_factor; dst->device_scale_factor = src->device_scale_factor; ++src; ++dst; } return 0; } /*****************************************************************************/ int libxrdp_init_display_size_description( unsigned int num_monitor, const struct monitor_info *monitors, struct display_size_description *description) { unsigned int monitor_index; struct monitor_info *monitor_layout; struct xrdp_rect all_monitors_encompassing_bounds = {0}; int got_primary = 0; /* Caller should have checked this, so don't log an error */ if (num_monitor > CLIENT_MONITOR_DATA_MAXIMUM_MONITORS) { return SEC_PROCESS_MONITORS_ERR_TOO_MANY_MONITORS; } description->monitorCount = num_monitor; for (monitor_index = 0 ; monitor_index < num_monitor; ++monitor_index) { monitor_layout = &description->minfo[monitor_index]; *monitor_layout = monitors[monitor_index]; sanitise_extended_monitor_attributes(monitor_layout); if (monitor_index == 0) { all_monitors_encompassing_bounds.left = monitor_layout->left; all_monitors_encompassing_bounds.top = monitor_layout->top; all_monitors_encompassing_bounds.right = monitor_layout->right; all_monitors_encompassing_bounds.bottom = monitor_layout->bottom; } else { all_monitors_encompassing_bounds.left = MIN(monitor_layout->left, all_monitors_encompassing_bounds.left); all_monitors_encompassing_bounds.top = MIN(monitor_layout->top, all_monitors_encompassing_bounds.top); all_monitors_encompassing_bounds.right = MAX(all_monitors_encompassing_bounds.right, monitor_layout->right); all_monitors_encompassing_bounds.bottom = MAX(all_monitors_encompassing_bounds.bottom, monitor_layout->bottom); } if (monitor_layout->is_primary == TS_MONITOR_PRIMARY) { if (got_primary) { // Already got one - don't have two monitor_layout->is_primary = 0; } else { got_primary = 1; } } } if (!got_primary) { /* no primary monitor was set, * choose the leftmost monitor as primary. */ for (monitor_index = 0; monitor_index < num_monitor; ++monitor_index) { monitor_layout = description->minfo + monitor_index; if (monitor_layout->left == all_monitors_encompassing_bounds.left && monitor_layout->top == all_monitors_encompassing_bounds.top) { monitor_layout->is_primary = TS_MONITOR_PRIMARY; break; } } } /* set wm geometry if the encompassing area is well formed. Otherwise, log and return an error. */ if (all_monitors_encompassing_bounds.right > all_monitors_encompassing_bounds.left && all_monitors_encompassing_bounds.bottom > all_monitors_encompassing_bounds.top) { description->session_width = all_monitors_encompassing_bounds.right - all_monitors_encompassing_bounds.left + 1; description->session_height = all_monitors_encompassing_bounds.bottom - all_monitors_encompassing_bounds.top + 1; } else { LOG(LOG_LEVEL_ERROR, "libxrdp_init_display_size_description:" " The area encompassing the monitors is not a" " well-formed rectangle. Received" " (top: %d, left: %d, right: %d, bottom: %d)." " This will prevent initialization.", all_monitors_encompassing_bounds.top, all_monitors_encompassing_bounds.left, all_monitors_encompassing_bounds.right, all_monitors_encompassing_bounds.bottom); return SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP; } /* Make sure virtual desktop size is OK * 2.2.1.3.6 Client Monitor Data (TS_UD_CS_MONITOR) */ if (description->session_width > CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH || description->session_width < CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_WIDTH || description->session_height > CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT || description->session_height < CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_HEIGHT) { LOG(LOG_LEVEL_ERROR, "libxrdp_init_display_size_description: Calculated virtual" " desktop width or height is invalid." " Allowed width range: min %d, max %d. Width received: %d." " Allowed height range: min %d, max %d. Height received: %d", CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_WIDTH, CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH, description->session_width, CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_HEIGHT, CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT, description->session_width); return SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP; } /* keep a copy of non negative monitor info values for xrdp_wm usage */ for (monitor_index = 0; monitor_index < num_monitor; ++monitor_index) { monitor_layout = description->minfo_wm + monitor_index; *monitor_layout = description->minfo[monitor_index]; monitor_layout->left = monitor_layout->left - all_monitors_encompassing_bounds.left; monitor_layout->top = monitor_layout->top - all_monitors_encompassing_bounds.top; monitor_layout->right = monitor_layout->right - all_monitors_encompassing_bounds.left; monitor_layout->bottom = monitor_layout->bottom - all_monitors_encompassing_bounds.top; } return 0; } /*****************************************************************************/ int EXPORT_CC libxrdp_planar_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int flags) { return xrdp_bitmap32_compress(in_data, width, height, s, bpp, byte_limit, start_line, temp_s, e, flags); } xrdp-0.10.1/libxrdp/xrdp_bitmap_compress.c000644 001751 000000 00000144066 14652432047 020704 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * bitmap compressor * This is the original RDP bitmap compression algorithm. Pixel based. * This does not do 32 bpp compression, nscodec, rfx, etc */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #define BC_MAX_BYTES (16 * 1024) /*****************************************************************************/ #define IN_PIXEL8(in_ptr, in_x, in_y, in_w, in_last_pixel, in_pixel); \ do { \ if (in_ptr == 0) \ { \ in_pixel = 0; \ } \ else if (in_x < in_w) \ { \ in_pixel = GETPIXEL8(in_ptr, in_x, in_y, in_w); \ } \ else \ { \ in_pixel = in_last_pixel; \ } \ } while (0) /*****************************************************************************/ #define IN_PIXEL16(in_ptr, in_x, in_y, in_w, in_last_pixel, in_pixel); \ do { \ if (in_ptr == 0) \ { \ in_pixel = 0; \ } \ else if (in_x < in_w) \ { \ in_pixel = GETPIXEL16(in_ptr, in_x, in_y, in_w); \ } \ else \ { \ in_pixel = in_last_pixel; \ } \ } while (0) /*****************************************************************************/ #define IN_PIXEL32(in_ptr, in_x, in_y, in_w, in_last_pixel, in_pixel); \ do { \ if (in_ptr == 0) \ { \ in_pixel = 0; \ } \ else if (in_x < in_w) \ { \ in_pixel = GETPIXEL32(in_ptr, in_x, in_y, in_w); \ } \ else \ { \ in_pixel = in_last_pixel; \ } \ } while (0) /*****************************************************************************/ /* color */ #define OUT_COLOR_COUNT1(in_count, in_s, in_data) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x3 << 5) | in_count; \ out_uint8(in_s, temp); \ out_uint8(in_s, in_data); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x60); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ out_uint8(in_s, in_data); \ } \ else \ { \ out_uint8(in_s, 0xf3); \ out_uint16_le(in_s, in_count); \ out_uint8(in_s, in_data); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* color */ #define OUT_COLOR_COUNT2(in_count, in_s, in_data) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x3 << 5) | in_count; \ out_uint8(in_s, temp); \ out_uint16_le(in_s, in_data); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x60); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ out_uint16_le(in_s, in_data); \ } \ else \ { \ out_uint8(in_s, 0xf3); \ out_uint16_le(in_s, in_count); \ out_uint16_le(in_s, in_data); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* color */ #define OUT_COLOR_COUNT3(in_count, in_s, in_data) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x3 << 5) | in_count; \ out_uint8(in_s, temp); \ out_uint8(in_s, in_data & 0xff); \ out_uint8(in_s, (in_data >> 8) & 0xff); \ out_uint8(in_s, (in_data >> 16) & 0xff); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x60); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ out_uint8(in_s, in_data & 0xff); \ out_uint8(in_s, (in_data >> 8) & 0xff); \ out_uint8(in_s, (in_data >> 16) & 0xff); \ } \ else \ { \ out_uint8(in_s, 0xf3); \ out_uint16_le(in_s, in_count); \ out_uint8(in_s, in_data & 0xff); \ out_uint8(in_s, (in_data >> 8) & 0xff); \ out_uint8(in_s, (in_data >> 16) & 0xff); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* copy */ #define OUT_COPY_COUNT1(in_count, in_s, in_data) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x4 << 5) | in_count; \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_data->data, in_count); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x80); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_data->data, in_count); \ } \ else \ { \ out_uint8(in_s, 0xf4); \ out_uint16_le(in_s, in_count); \ out_uint8a(in_s, in_data->data, in_count); \ } \ } \ in_count = 0; \ init_stream(in_data, 0); \ } while (0) /*****************************************************************************/ /* copy */ #define OUT_COPY_COUNT2(in_count, in_s, in_data) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x4 << 5) | in_count; \ out_uint8(in_s, temp); \ temp = in_count * 2; \ out_uint8a(in_s, in_data->data, temp); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x80); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ temp = in_count * 2; \ out_uint8a(in_s, in_data->data, temp); \ } \ else \ { \ out_uint8(in_s, 0xf4); \ out_uint16_le(in_s, in_count); \ temp = in_count * 2; \ out_uint8a(in_s, in_data->data, temp); \ } \ } \ in_count = 0; \ init_stream(in_data, 0); \ } while (0) /*****************************************************************************/ /* copy */ #define OUT_COPY_COUNT3(in_count, in_s, in_data) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x4 << 5) | in_count; \ out_uint8(in_s, temp); \ temp = in_count * 3; \ out_uint8a(in_s, in_data->end, temp); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x80); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ temp = in_count * 3; \ out_uint8a(in_s, in_data->end, temp); \ } \ else \ { \ out_uint8(in_s, 0xf4); \ out_uint16_le(in_s, in_count); \ temp = in_count * 3; \ out_uint8a(in_s, in_data->end, temp); \ } \ } \ in_count = 0; \ init_stream(in_data, 0); \ } while (0) /*****************************************************************************/ /* bicolor */ #define OUT_BICOLOR_COUNT1(in_count, in_s, in_color1, in_color2) \ do { \ if (in_count > 0) \ { \ if (in_count / 2 < 16) \ { \ temp = (0xe << 4) | (in_count / 2); \ out_uint8(in_s, temp); \ out_uint8(in_s, in_color1); \ out_uint8(in_s, in_color2); \ } \ else if (in_count / 2 < 256 + 16) \ { \ out_uint8(in_s, 0xe0); \ temp = in_count / 2 - 16; \ out_uint8(in_s, temp); \ out_uint8(in_s, in_color1); \ out_uint8(in_s, in_color2); \ } \ else \ { \ out_uint8(in_s, 0xf8); \ temp = in_count / 2; \ out_uint16_le(in_s, temp); \ out_uint8(in_s, in_color1); \ out_uint8(in_s, in_color2); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* bicolor */ #define OUT_BICOLOR_COUNT2(in_count, in_s, in_color1, in_color2) \ do { \ if (in_count > 0) \ { \ if (in_count / 2 < 16) \ { \ temp = (0xe << 4) | (in_count / 2); \ out_uint8(in_s, temp); \ out_uint16_le(in_s, in_color1); \ out_uint16_le(in_s, in_color2); \ } \ else if (in_count / 2 < 256 + 16) \ { \ out_uint8(in_s, 0xe0); \ temp = in_count / 2 - 16; \ out_uint8(in_s, temp); \ out_uint16_le(in_s, in_color1); \ out_uint16_le(in_s, in_color2); \ } \ else \ { \ out_uint8(in_s, 0xf8); \ temp = in_count / 2; \ out_uint16_le(in_s, temp); \ out_uint16_le(in_s, in_color1); \ out_uint16_le(in_s, in_color2); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* bicolor */ #define OUT_BICOLOR_COUNT3(in_count, in_s, in_color1, in_color2) \ do { \ if (in_count > 0) \ { \ if (in_count / 2 < 16) \ { \ temp = (0xe << 4) | (in_count / 2); \ out_uint8(in_s, temp); \ out_uint8(in_s, in_color1 & 0xff); \ out_uint8(in_s, (in_color1 >> 8) & 0xff); \ out_uint8(in_s, (in_color1 >> 16) & 0xff); \ out_uint8(in_s, in_color2 & 0xff); \ out_uint8(in_s, (in_color2 >> 8) & 0xff); \ out_uint8(in_s, (in_color2 >> 16) & 0xff); \ } \ else if (in_count / 2 < 256 + 16) \ { \ out_uint8(in_s, 0xe0); \ temp = in_count / 2 - 16; \ out_uint8(in_s, temp); \ out_uint8(in_s, in_color1 & 0xff); \ out_uint8(in_s, (in_color1 >> 8) & 0xff); \ out_uint8(in_s, (in_color1 >> 16) & 0xff); \ out_uint8(in_s, in_color2 & 0xff); \ out_uint8(in_s, (in_color2 >> 8) & 0xff); \ out_uint8(in_s, (in_color2 >> 16) & 0xff); \ } \ else \ { \ out_uint8(in_s, 0xf8); \ temp = in_count / 2; \ out_uint16_le(in_s, temp); \ out_uint8(in_s, in_color1 & 0xff); \ out_uint8(in_s, (in_color1 >> 8) & 0xff); \ out_uint8(in_s, (in_color1 >> 16) & 0xff); \ out_uint8(in_s, in_color2 & 0xff); \ out_uint8(in_s, (in_color2 >> 8) & 0xff); \ out_uint8(in_s, (in_color2 >> 16) & 0xff); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* fill */ #define OUT_FILL_COUNT1(in_count, in_s) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ out_uint8(in_s, in_count); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x0); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ } \ else \ { \ out_uint8(in_s, 0xf0); \ out_uint16_le(in_s, in_count); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* fill */ #define OUT_FILL_COUNT2(in_count, in_s) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ out_uint8(in_s, in_count); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x0); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ } \ else \ { \ out_uint8(in_s, 0xf0); \ out_uint16_le(in_s, in_count); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* fill */ #define OUT_FILL_COUNT3(in_count, in_s) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ out_uint8(in_s, in_count); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x0); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ } \ else \ { \ out_uint8(in_s, 0xf0); \ out_uint16_le(in_s, in_count); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* mix */ #define OUT_MIX_COUNT1(in_count, in_s) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x1 << 5) | in_count; \ out_uint8(in_s, temp); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x20); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ } \ else \ { \ out_uint8(in_s, 0xf1); \ out_uint16_le(in_s, in_count); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* mix */ #define OUT_MIX_COUNT2(in_count, in_s) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x1 << 5) | in_count; \ out_uint8(in_s, temp); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x20); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ } \ else \ { \ out_uint8(in_s, 0xf1); \ out_uint16_le(in_s, in_count); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* mix */ #define OUT_MIX_COUNT3(in_count, in_s) \ do { \ if (in_count > 0) \ { \ if (in_count < 32) \ { \ temp = (0x1 << 5) | in_count; \ out_uint8(in_s, temp); \ } \ else if (in_count < 256 + 32) \ { \ out_uint8(in_s, 0x20); \ temp = in_count - 32; \ out_uint8(in_s, temp); \ } \ else \ { \ out_uint8(in_s, 0xf1); \ out_uint16_le(in_s, in_count); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* fom */ #define OUT_FOM_COUNT1(in_count, in_s, in_mask, in_mask_len) \ do { \ if (in_count > 0) \ { \ if ((in_count % 8) == 0 && in_count < 249) \ { \ temp = (0x2 << 5) | (in_count / 8); \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ else if (in_count < 256) \ { \ out_uint8(in_s, 0x40); \ temp = in_count - 1; \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ else \ { \ out_uint8(in_s, 0xf2); \ out_uint16_le(in_s, in_count); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* fom */ #define OUT_FOM_COUNT2(in_count, in_s, in_mask, in_mask_len) \ do { \ if (in_count > 0) \ { \ if ((in_count % 8) == 0 && in_count < 249) \ { \ temp = (0x2 << 5) | (in_count / 8); \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ else if (in_count < 256) \ { \ out_uint8(in_s, 0x40); \ temp = in_count - 1; \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ else \ { \ out_uint8(in_s, 0xf2); \ out_uint16_le(in_s, in_count); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ /* fill or mix (fom) */ #define OUT_FOM_COUNT3(in_count, in_s, in_mask, in_mask_len) \ do { \ if (in_count > 0) \ { \ if ((in_count % 8) == 0 && in_count < 249) \ { \ temp = (0x2 << 5) | (in_count / 8); \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ else if (in_count < 256) \ { \ out_uint8(in_s, 0x40); \ temp = in_count - 1; \ out_uint8(in_s, temp); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ else \ { \ out_uint8(in_s, 0xf2); \ out_uint16_le(in_s, in_count); \ out_uint8a(in_s, in_mask, in_mask_len); \ } \ } \ in_count = 0; \ } while (0) /*****************************************************************************/ #define TEST_FILL \ ((last_line == 0 && pixel == 0) || \ (last_line != 0 && pixel == ypixel)) #define TEST_MIX \ ((last_line == 0 && pixel == mix) || \ (last_line != 0 && pixel == (ypixel ^ mix))) #define TEST_FOM (TEST_FILL || TEST_MIX) #define TEST_COLOR (pixel == last_pixel) #define TEST_BICOLOR \ ( \ (pixel != last_pixel) && \ ( \ (!bicolor_spin && pixel == bicolor1 && last_pixel == bicolor2) || \ (bicolor_spin && pixel == bicolor2 && last_pixel == bicolor1) \ ) \ ) #define RESET_COUNTS \ do { \ bicolor_count = 0; \ fill_count = 0; \ color_count = 0; \ mix_count = 0; \ fom_count = 0; \ fom_mask_len = 0; \ bicolor_spin = 0; \ } while (0) /*****************************************************************************/ int xrdp_bitmap_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e) { char *line; char *last_line; char fom_mask[8192]; /* good for up to 64K bitmap */ int lines_sent; int pixel; int count; int color_count; int last_pixel; int bicolor_count; int bicolor1; int bicolor2; int bicolor_spin; int end; int i; int out_count; int ypixel; int last_ypixel; int fill_count; int mix_count; int mix; int fom_count; int fom_mask_len; int temp; /* used in macros */ init_stream(temp_s, 0); fom_mask_len = 0; last_line = 0; lines_sent = 0; end = width + e; count = 0; color_count = 0; last_pixel = 0; last_ypixel = 0; bicolor_count = 0; bicolor1 = 0; bicolor2 = 0; bicolor_spin = 0; fill_count = 0; mix_count = 0; fom_count = 0; if (bpp == 8) { mix = 0xff; out_count = end; line = in_data + width * start_line; while (start_line >= 0 && out_count <= BC_MAX_BYTES) { i = (s->p - s->data) + count; if (i - color_count >= byte_limit && i - bicolor_count >= byte_limit && i - fill_count >= byte_limit && i - mix_count >= byte_limit && i - fom_count >= byte_limit) { break; } out_count += end; for (i = 0; i < end; i++) { /* read next pixel */ IN_PIXEL8(line, i, 0, width, last_pixel, pixel); IN_PIXEL8(last_line, i, 0, width, last_ypixel, ypixel); if (!TEST_FILL) { if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_FILL_COUNT1(fill_count, s); RESET_COUNTS; } fill_count = 0; } if (!TEST_MIX) { if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && mix_count >= color_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_MIX_COUNT1(mix_count, s); RESET_COUNTS; } mix_count = 0; } if (!TEST_COLOR) { if (color_count > 3 && color_count >= fill_count && color_count >= bicolor_count && color_count >= mix_count && color_count >= fom_count) { count -= color_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_COLOR_COUNT1(color_count, s, last_pixel); RESET_COUNTS; } color_count = 0; } if (!TEST_BICOLOR) { if (bicolor_count > 3 && bicolor_count >= fill_count && bicolor_count >= color_count && bicolor_count >= mix_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) == 0) { count -= bicolor_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_BICOLOR_COUNT1(bicolor_count, s, bicolor1, bicolor2); } else { bicolor_count--; count -= bicolor_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_BICOLOR_COUNT1(bicolor_count, s, bicolor2, bicolor1); } RESET_COUNTS; } bicolor_count = 0; bicolor1 = last_pixel; bicolor2 = pixel; bicolor_spin = 0; } if (!TEST_FOM) { if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && fom_count >= mix_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_FOM_COUNT1(fom_count, s, fom_mask, fom_mask_len); RESET_COUNTS; } fom_count = 0; fom_mask_len = 0; } if (TEST_FILL) { fill_count++; } if (TEST_MIX) { mix_count++; } if (TEST_COLOR) { color_count++; } if (TEST_BICOLOR) { bicolor_spin = !bicolor_spin; bicolor_count++; } if (TEST_FOM) { if ((fom_count % 8) == 0) { fom_mask[fom_mask_len] = 0; fom_mask_len++; } if (pixel == (ypixel ^ mix)) { fom_mask[fom_mask_len - 1] |= (1 << (fom_count % 8)); } fom_count++; } out_uint8(temp_s, pixel); count++; last_pixel = pixel; last_ypixel = ypixel; } /* can't take fix, mix, or fom past first line */ if (last_line == 0) { if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_FILL_COUNT1(fill_count, s); RESET_COUNTS; } fill_count = 0; if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && mix_count >= color_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_MIX_COUNT1(mix_count, s); RESET_COUNTS; } mix_count = 0; if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && fom_count >= mix_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_FOM_COUNT1(fom_count, s, fom_mask, fom_mask_len); RESET_COUNTS; } fom_count = 0; fom_mask_len = 0; } last_line = line; line = line - width; start_line--; lines_sent++; } if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_FILL_COUNT1(fill_count, s); } else if (mix_count > 3 && mix_count >= color_count && mix_count >= bicolor_count && mix_count >= fill_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_MIX_COUNT1(mix_count, s); } else if (color_count > 3 && color_count >= mix_count && color_count >= bicolor_count && color_count >= fill_count && color_count >= fom_count) { count -= color_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_COLOR_COUNT1(color_count, s, last_pixel); } else if (bicolor_count > 3 && bicolor_count >= mix_count && bicolor_count >= color_count && bicolor_count >= fill_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) == 0) { count -= bicolor_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_BICOLOR_COUNT1(bicolor_count, s, bicolor1, bicolor2); } else { bicolor_count--; count -= bicolor_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_BICOLOR_COUNT1(bicolor_count, s, bicolor2, bicolor1); } count -= bicolor_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_BICOLOR_COUNT1(bicolor_count, s, bicolor1, bicolor2); } else if (fom_count > 3 && fom_count >= mix_count && fom_count >= color_count && fom_count >= fill_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT1(count, s, temp_s); OUT_FOM_COUNT1(fom_count, s, fom_mask, fom_mask_len); } else { OUT_COPY_COUNT1(count, s, temp_s); } } else if ((bpp == 15) || (bpp == 16)) { mix = (bpp == 15) ? 0xba1f : 0xffff; out_count = end * 2; line = in_data + width * start_line * 2; while (start_line >= 0 && out_count <= BC_MAX_BYTES) { i = (s->p - s->data) + count * 2; if (i - (color_count * 2) >= byte_limit && i - (bicolor_count * 2) >= byte_limit && i - (fill_count * 2) >= byte_limit && i - (mix_count * 2) >= byte_limit && i - (fom_count * 2) >= byte_limit) { break; } out_count += end * 2; for (i = 0; i < end; i++) { /* read next pixel */ IN_PIXEL16(line, i, 0, width, last_pixel, pixel); IN_PIXEL16(last_line, i, 0, width, last_ypixel, ypixel); if (!TEST_FILL) { if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_FILL_COUNT2(fill_count, s); RESET_COUNTS; } fill_count = 0; } if (!TEST_MIX) { if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && mix_count >= color_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_MIX_COUNT2(mix_count, s); RESET_COUNTS; } mix_count = 0; } if (!TEST_COLOR) { if (color_count > 3 && color_count >= fill_count && color_count >= bicolor_count && color_count >= mix_count && color_count >= fom_count) { count -= color_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_COLOR_COUNT2(color_count, s, last_pixel); RESET_COUNTS; } color_count = 0; } if (!TEST_BICOLOR) { if (bicolor_count > 3 && bicolor_count >= fill_count && bicolor_count >= color_count && bicolor_count >= mix_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) == 0) { count -= bicolor_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_BICOLOR_COUNT2(bicolor_count, s, bicolor1, bicolor2); } else { bicolor_count--; count -= bicolor_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_BICOLOR_COUNT2(bicolor_count, s, bicolor2, bicolor1); } RESET_COUNTS; } bicolor_count = 0; bicolor1 = last_pixel; bicolor2 = pixel; bicolor_spin = 0; } if (!TEST_FOM) { if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && fom_count >= mix_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_FOM_COUNT2(fom_count, s, fom_mask, fom_mask_len); RESET_COUNTS; } fom_count = 0; fom_mask_len = 0; } if (TEST_FILL) { fill_count++; } if (TEST_MIX) { mix_count++; } if (TEST_COLOR) { color_count++; } if (TEST_BICOLOR) { bicolor_spin = !bicolor_spin; bicolor_count++; } if (TEST_FOM) { if ((fom_count % 8) == 0) { fom_mask[fom_mask_len] = 0; fom_mask_len++; } if (pixel == (ypixel ^ mix)) { fom_mask[fom_mask_len - 1] |= (1 << (fom_count % 8)); } fom_count++; } out_uint16_le(temp_s, pixel); count++; last_pixel = pixel; last_ypixel = ypixel; } /* can't take fix, mix, or fom past first line */ if (last_line == 0) { if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_FILL_COUNT2(fill_count, s); RESET_COUNTS; } fill_count = 0; if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && mix_count >= color_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_MIX_COUNT2(mix_count, s); RESET_COUNTS; } mix_count = 0; if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && fom_count >= mix_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_FOM_COUNT2(fom_count, s, fom_mask, fom_mask_len); RESET_COUNTS; } fom_count = 0; fom_mask_len = 0; } last_line = line; line = line - width * 2; start_line--; lines_sent++; } if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_FILL_COUNT2(fill_count, s); } else if (mix_count > 3 && mix_count >= color_count && mix_count >= bicolor_count && mix_count >= fill_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_MIX_COUNT2(mix_count, s); } else if (color_count > 3 && color_count >= mix_count && color_count >= bicolor_count && color_count >= fill_count && color_count >= fom_count) { count -= color_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_COLOR_COUNT2(color_count, s, last_pixel); } else if (bicolor_count > 3 && bicolor_count >= mix_count && bicolor_count >= color_count && bicolor_count >= fill_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) == 0) { count -= bicolor_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_BICOLOR_COUNT2(bicolor_count, s, bicolor1, bicolor2); } else { bicolor_count--; count -= bicolor_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_BICOLOR_COUNT2(bicolor_count, s, bicolor2, bicolor1); } count -= bicolor_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_BICOLOR_COUNT2(bicolor_count, s, bicolor1, bicolor2); } else if (fom_count > 3 && fom_count >= mix_count && fom_count >= color_count && fom_count >= fill_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT2(count, s, temp_s); OUT_FOM_COUNT2(fom_count, s, fom_mask, fom_mask_len); } else { OUT_COPY_COUNT2(count, s, temp_s); } } else if (bpp == 24) { mix = 0xffffff; out_count = end * 3; line = in_data + width * start_line * 4; while (start_line >= 0 && out_count <= BC_MAX_BYTES) { i = (s->p - s->data) + count * 3; if (i - (color_count * 3) >= byte_limit && i - (bicolor_count * 3) >= byte_limit && i - (fill_count * 3) >= byte_limit && i - (mix_count * 3) >= byte_limit && i - (fom_count * 3) >= byte_limit) { break; } out_count += end * 3; for (i = 0; i < end; i++) { /* read next pixel */ IN_PIXEL32(line, i, 0, width, last_pixel, pixel); IN_PIXEL32(last_line, i, 0, width, last_ypixel, ypixel); if (!TEST_FILL) { if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_FILL_COUNT3(fill_count, s); RESET_COUNTS; } fill_count = 0; } if (!TEST_MIX) { if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && mix_count >= color_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_MIX_COUNT3(mix_count, s); RESET_COUNTS; } mix_count = 0; } if (!TEST_COLOR) { if (color_count > 3 && color_count >= fill_count && color_count >= bicolor_count && color_count >= mix_count && color_count >= fom_count) { count -= color_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_COLOR_COUNT3(color_count, s, last_pixel); RESET_COUNTS; } color_count = 0; } if (!TEST_BICOLOR) { if (bicolor_count > 3 && bicolor_count >= fill_count && bicolor_count >= color_count && bicolor_count >= mix_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) == 0) { count -= bicolor_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_BICOLOR_COUNT3(bicolor_count, s, bicolor1, bicolor2); } else { bicolor_count--; count -= bicolor_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_BICOLOR_COUNT3(bicolor_count, s, bicolor2, bicolor1); } RESET_COUNTS; } bicolor_count = 0; bicolor1 = last_pixel; bicolor2 = pixel; bicolor_spin = 0; } if (!TEST_FOM) { if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && fom_count >= mix_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_FOM_COUNT3(fom_count, s, fom_mask, fom_mask_len); RESET_COUNTS; } fom_count = 0; fom_mask_len = 0; } if (TEST_FILL) { fill_count++; } if (TEST_MIX) { mix_count++; } if (TEST_COLOR) { color_count++; } if (TEST_BICOLOR) { bicolor_spin = !bicolor_spin; bicolor_count++; } if (TEST_FOM) { if ((fom_count % 8) == 0) { fom_mask[fom_mask_len] = 0; fom_mask_len++; } if (pixel == (ypixel ^ mix)) { fom_mask[fom_mask_len - 1] |= (1 << (fom_count % 8)); } fom_count++; } out_uint8(temp_s, pixel & 0xff); out_uint8(temp_s, (pixel >> 8) & 0xff); out_uint8(temp_s, (pixel >> 16) & 0xff); count++; last_pixel = pixel; last_ypixel = ypixel; } /* can't take fix, mix, or fom past first line */ if (last_line == 0) { if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_FILL_COUNT3(fill_count, s); RESET_COUNTS; } fill_count = 0; if (mix_count > 3 && mix_count >= fill_count && mix_count >= bicolor_count && mix_count >= color_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_MIX_COUNT3(mix_count, s); RESET_COUNTS; } mix_count = 0; if (fom_count > 3 && fom_count >= fill_count && fom_count >= color_count && fom_count >= mix_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_FOM_COUNT3(fom_count, s, fom_mask, fom_mask_len); RESET_COUNTS; } fom_count = 0; fom_mask_len = 0; } last_line = line; line = line - width * 4; start_line--; lines_sent++; } if (fill_count > 3 && fill_count >= color_count && fill_count >= bicolor_count && fill_count >= mix_count && fill_count >= fom_count) { count -= fill_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_FILL_COUNT3(fill_count, s); } else if (mix_count > 3 && mix_count >= color_count && mix_count >= bicolor_count && mix_count >= fill_count && mix_count >= fom_count) { count -= mix_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_MIX_COUNT3(mix_count, s); } else if (color_count > 3 && color_count >= mix_count && color_count >= bicolor_count && color_count >= fill_count && color_count >= fom_count) { count -= color_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_COLOR_COUNT3(color_count, s, last_pixel); } else if (bicolor_count > 3 && bicolor_count >= mix_count && bicolor_count >= color_count && bicolor_count >= fill_count && bicolor_count >= fom_count) { if ((bicolor_count % 2) == 0) { count -= bicolor_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_BICOLOR_COUNT3(bicolor_count, s, bicolor1, bicolor2); } else { bicolor_count--; count -= bicolor_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_BICOLOR_COUNT3(bicolor_count, s, bicolor2, bicolor1); } count -= bicolor_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_BICOLOR_COUNT3(bicolor_count, s, bicolor1, bicolor2); } else if (fom_count > 3 && fom_count >= mix_count && fom_count >= color_count && fom_count >= fill_count && fom_count >= bicolor_count) { count -= fom_count; OUT_COPY_COUNT3(count, s, temp_s); OUT_FOM_COUNT3(fom_count, s, fom_mask, fom_mask_len); } else { OUT_COPY_COUNT3(count, s, temp_s); } } return lines_sent; } xrdp-0.10.1/libxrdp/xrdp_mppc_enc.c000644 001751 000000 00000075546 14652432047 017307 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol Implementation * Implements Microsoft Point to Point Compression (MPPC) protocol * * Copyright 2012-2013 Laxmikant Rashinkar * Copyright 2012-2013 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" /* local defines */ #define RDP_40_HIST_BUF_LEN (1024 * 8) /* RDP 4.0 uses 8K history buf */ #define RDP_50_HIST_BUF_LEN (1024 * 64) /* RDP 5.0 uses 64K history buf */ /* Compression Types */ #define PACKET_COMPRESSED 0x20 #define PACKET_AT_FRONT 0x40 #define PACKET_FLUSHED 0x80 #define PACKET_COMPR_TYPE_8K 0x00 #define PACKET_COMPR_TYPE_64K 0x01 #define PACKET_COMPR_TYPE_RDP6 0x02 #define PACKET_COMPR_TYPE_RDP61 0x03 #define CompressionTypeMask 0x0F #define CRC_INIT 0xFFFF #define CRC(_crcval, _newchar) _crcval = \ ((_crcval) >> 8) ^ g_crc_table[((_crcval) ^ (_newchar)) & 0x00ff] /* CRC16 defs */ static const tui16 g_crc_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 }; /***************************************************************************** insert 2 bits into outputBuffer ******************************************************************************/ #define insert_2_bits(_data) \ do \ { \ if ((bits_left >= 3) && (bits_left <= 8)) \ { \ i = bits_left - 2; \ outputBuffer[opb_index] |= _data << i; \ bits_left = i; \ } \ else \ { \ i = 2 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= _data >> i; \ outputBuffer[opb_index] |= _data << j; \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 3 bits into outputBuffer ******************************************************************************/ #define insert_3_bits(_data) \ do \ { \ if ((bits_left >= 4) && (bits_left <= 8)) \ { \ i = bits_left - 3; \ outputBuffer[opb_index] |= _data << i; \ bits_left = i; \ } \ else \ { \ i = 3 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= _data >> i; \ outputBuffer[opb_index] |= _data << j; \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 4 bits into outputBuffer ******************************************************************************/ #define insert_4_bits(_data) \ do \ { \ if ((bits_left >= 5) && (bits_left <= 8)) \ { \ i = bits_left - 4; \ outputBuffer[opb_index] |= _data << i; \ bits_left = i; \ } \ else \ { \ i = 4 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= _data >> i; \ outputBuffer[opb_index] |= _data << j; \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 5 bits into outputBuffer ******************************************************************************/ #define insert_5_bits(_data) \ do \ { \ if ((bits_left >= 6) && (bits_left <= 8)) \ { \ i = bits_left - 5; \ outputBuffer[opb_index] |= _data << i; \ bits_left = i; \ } \ else \ { \ i = 5 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= _data >> i; \ outputBuffer[opb_index] |= _data << j; \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 6 bits into outputBuffer ******************************************************************************/ #define insert_6_bits(_data) \ do \ { \ if ((bits_left >= 7) && (bits_left <= 8)) \ { \ i = bits_left - 6; \ outputBuffer[opb_index] |= (_data << i); \ bits_left = i; \ } \ else \ { \ i = 6 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= (_data >> i); \ outputBuffer[opb_index] |= (_data << j); \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 7 bits into outputBuffer ******************************************************************************/ #define insert_7_bits(_data) \ do \ { \ if (bits_left == 8) \ { \ outputBuffer[opb_index] |= _data << 1; \ bits_left = 1; \ } \ else \ { \ i = 7 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= _data >> i; \ outputBuffer[opb_index] |= _data << j; \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 8 bits into outputBuffer ******************************************************************************/ #define insert_8_bits(_data) \ do \ { \ if (bits_left == 8) \ { \ outputBuffer[opb_index++] |= _data; \ bits_left = 8; \ } \ else \ { \ i = 8 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= _data >> i; \ outputBuffer[opb_index] |= _data << j; \ bits_left = j; \ } \ } while (0) /***************************************************************************** insert 9 bits into outputBuffer ******************************************************************************/ #define insert_9_bits(_data16) \ do \ { \ i = 9 - bits_left; \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ if (bits_left == 0) \ { \ opb_index++; \ bits_left = 8; \ } \ } while (0) /***************************************************************************** insert 10 bits into outputBuffer ******************************************************************************/ #define insert_10_bits(_data16) \ do \ { \ i = 10 - bits_left; \ if ((bits_left >= 3) && (bits_left <= 8)) \ { \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ } \ else \ { \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } \ } while (0) /***************************************************************************** insert 11 bits into outputBuffer ******************************************************************************/ #define insert_11_bits(_data16) \ do \ { \ i = 11 - bits_left; \ if ((bits_left >= 4) && (bits_left <= 8)) \ { \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ } \ else \ { \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } \ } while (0) /***************************************************************************** insert 12 bits into outputBuffer ******************************************************************************/ #define insert_12_bits(_data16) \ do \ { \ i = 12 - bits_left; \ if ((bits_left >= 5) && (bits_left <= 8)) \ { \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ } \ else \ { \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } \ } while (0) /***************************************************************************** insert 13 bits into outputBuffer ******************************************************************************/ #define insert_13_bits(_data16) \ do \ { \ i = 13 - bits_left; \ if ((bits_left >= 6) && (bits_left <= 8)) \ { \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ } \ else \ { \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } \ } while (0) /***************************************************************************** insert 14 bits into outputBuffer ******************************************************************************/ #define insert_14_bits(_data16) \ do \ { \ i = 14 - bits_left; \ if ((bits_left >= 7) && (bits_left <= 8)) \ { \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ } \ else \ { \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } \ } while (0) /***************************************************************************** insert 15 bits into outputBuffer ******************************************************************************/ #define insert_15_bits(_data16) \ do \ { \ i = 15 - bits_left; \ if (bits_left == 8) \ { \ j = 8 - i; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index] |= (char) (_data16 << j); \ bits_left = j; \ } \ else \ { \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } \ } while (0) /***************************************************************************** insert 16 bits into outputBuffer ******************************************************************************/ #define insert_16_bits(_data16) \ do \ { \ i = 16 - bits_left; \ j = i - 8; \ k = 8 - j; \ outputBuffer[opb_index++] |= (char) (_data16 >> i); \ outputBuffer[opb_index++] |= (char) (_data16 >> j); \ outputBuffer[opb_index] |= (char) (_data16 << k); \ bits_left = k; \ } while (0) /** * Initialize mppc_enc structure * * @param protocol_type PROTO_RDP_40 or PROTO_RDP_50 * * @return struct xrdp_mppc_enc* or nil on failure */ struct xrdp_mppc_enc * mppc_enc_new(int protocol_type) { struct xrdp_mppc_enc *enc; enc = (struct xrdp_mppc_enc *) g_malloc(sizeof(struct xrdp_mppc_enc), 1); if (enc == 0) { return 0; } switch (protocol_type) { case PROTO_RDP_40: enc->protocol_type = PROTO_RDP_40; enc->buf_len = RDP_40_HIST_BUF_LEN; break; case PROTO_RDP_50: enc->protocol_type = PROTO_RDP_50; enc->buf_len = RDP_50_HIST_BUF_LEN; break; default: g_free(enc); return 0; } enc->flagsHold = PACKET_AT_FRONT; enc->historyBuffer = (char *) g_malloc(enc->buf_len, 1); if (enc->historyBuffer == 0) { g_free(enc); return 0; } enc->outputBufferPlus = (char *) g_malloc(enc->buf_len + 64, 1); if (enc->outputBufferPlus == 0) { g_free(enc->historyBuffer); g_free(enc); return 0; } enc->outputBuffer = enc->outputBufferPlus + 64; enc->hash_table = (tui16 *) g_malloc(enc->buf_len * 2, 1); if (enc->hash_table == 0) { g_free(enc->historyBuffer); g_free(enc->outputBufferPlus); g_free(enc); return 0; } return enc; } /** * deinit mppc_enc structure * * @param enc struct to be deinited */ void mppc_enc_free(struct xrdp_mppc_enc *enc) { if (enc == 0) { return; } g_free(enc->historyBuffer); g_free(enc->outputBufferPlus); g_free(enc->hash_table); g_free(enc); } /** * encode (compress) data using RDP 4.0 protocol * * @param enc encoder state info * @param srcData uncompressed data * @param len length of srcData * * @return TRUE on success, FALSE on failure */ static int compress_rdp_4(struct xrdp_mppc_enc *enc, tui8 *srcData, int len) { /* RDP 4.0 encoding not yet implemented */ return 0; } /** * encode (compress) data using RDP 5.0 protocol using hash table * * @param enc encoder state info * @param srcData uncompressed data * @param len length of srcData * * @return TRUE on success, FALSE on failure */ static int compress_rdp_5(struct xrdp_mppc_enc *enc, tui8 *srcData, int len) { char *outputBuffer; /* points to enc->outputBuffer */ char *hptr_end; /* points to end of history data */ char *historyPointer; /* points to first byte of srcData in * historyBuffer */ char *hbuf_start; /* points to start of history buffer */ char *cptr1; char *cptr2; int opb_index; /* index into outputBuffer */ int bits_left; /* unused bits in current byte in outputBuffer */ tui32 copy_offset; /* pattern match starts here... */ tui32 lom; /* ...and matches this many bytes */ int last_crc_index; /* don't compute CRC beyond this index */ tui16 *hash_table; /* hash table for pattern matching */ tui32 i; tui32 j; tui32 k; tui32 x; tui8 data; tui16 data16; tui32 historyOffset; tui16 crc; tui32 ctr; tui32 saved_ctr; tui32 data_end; tui8 byte_val; crc = 0; opb_index = 0; bits_left = 8; copy_offset = 0; hash_table = enc->hash_table; hbuf_start = enc->historyBuffer; outputBuffer = enc->outputBuffer; g_memset(outputBuffer, 0, len); enc->flags = PACKET_COMPR_TYPE_64K; if ((enc->historyOffset + len) >= enc->buf_len - 3) { /* historyBuffer cannot hold srcData - rewind it */ enc->historyOffset = 0; g_memset(hash_table, 0, enc->buf_len * 2); g_memset(enc->historyBuffer, 0, enc->buf_len); // added enc->flagsHold |= PACKET_AT_FRONT | PACKET_FLUSHED; } /* point to next free byte in historyBuffer */ historyOffset = enc->historyOffset; /* add / append new data to historyBuffer */ g_memcpy(&(enc->historyBuffer[historyOffset]), srcData, len); /* point to start of data to be compressed */ historyPointer = &(enc->historyBuffer[historyOffset]); ctr = copy_offset = lom = 0; /* if we are at start of history buffer, do not attempt to compress */ /* first 2 bytes, because minimum LoM is 3 */ if (historyOffset == 0) { /* encode first two bytes as literals */ for (x = 0; x < 2; x++) { data = *(historyPointer + x); LOG_DEVEL(LOG_LEVEL_TRACE, "%.2x ", (tui8) data); if (data & 0x80) { /* insert encoded literal */ insert_2_bits(0x02); data &= 0x7f; insert_7_bits(data); } else { /* insert literal */ insert_8_bits(data); } } /* store hash for first two entries in historyBuffer */ crc = CRC_INIT; byte_val = enc->historyBuffer[0]; CRC(crc, byte_val); byte_val = enc->historyBuffer[1]; CRC(crc, byte_val); byte_val = enc->historyBuffer[2]; CRC(crc, byte_val); hash_table[crc] = 0; crc = CRC_INIT; byte_val = enc->historyBuffer[1]; CRC(crc, byte_val); byte_val = enc->historyBuffer[2]; CRC(crc, byte_val); byte_val = enc->historyBuffer[3]; CRC(crc, byte_val); hash_table[crc] = 1; /* first two bytes have already been processed */ ctr = 2; } enc->historyOffset += len; /* point to last byte in new data */ hptr_end = &(enc->historyBuffer[enc->historyOffset - 1]); /* do not compute CRC beyond this */ last_crc_index = enc->historyOffset - 3; /* do not search for pattern match beyond this */ data_end = len - 2; /* start compressing data */ while (ctr < data_end) { cptr1 = historyPointer + ctr; crc = CRC_INIT; byte_val = *cptr1; CRC(crc, byte_val); byte_val = *(cptr1 + 1); CRC(crc, byte_val); byte_val = *(cptr1 + 2); CRC(crc, byte_val); /* cptr2 points to start of pattern match */ cptr2 = hbuf_start + hash_table[crc]; copy_offset = cptr1 - cptr2; /* save current entry */ hash_table[crc] = cptr1 - hbuf_start; /* double check that we have a pattern match */ if ((*cptr1 != *cptr2) || (*(cptr1 + 1) != *(cptr2 + 1)) || (*(cptr1 + 2) != *(cptr2 + 2))) { /* no match found; encode literal byte */ data = *cptr1; LOG_DEVEL(LOG_LEVEL_TRACE, "%.2x ", data); if (data < 0x80) { /* literal byte < 0x80 */ insert_8_bits(data); } else { /* literal byte >= 0x80 */ insert_2_bits(0x02); data &= 0x7f; insert_7_bits(data); } ctr++; continue; } /* we have a match - compute Length of Match */ cptr1 += 3; cptr2 += 3; lom = 3; while ((cptr1 <= hptr_end) && (*(cptr1++) == *(cptr2++))) { lom++; } saved_ctr = ctr + lom; LOG_DEVEL(LOG_LEVEL_TRACE, "<%ld: %u,%d> ", (historyPointer + ctr) - hbuf_start, copy_offset, lom); /* compute CRC for matching segment and store in hash table */ cptr1 = historyPointer + ctr; if (cptr1 + lom > hbuf_start + last_crc_index) { /* we have gone beyond last_crc_index - go back */ j = last_crc_index - (cptr1 - hbuf_start); } else { j = lom - 1; } ctr++; for (i = 0; i < j; i++) { cptr1 = historyPointer + ctr; /* compute CRC on triplet */ crc = CRC_INIT; byte_val = *(cptr1++); CRC(crc, byte_val); byte_val = *(cptr1++); CRC(crc, byte_val); byte_val = *(cptr1++); CRC(crc, byte_val); /* save current entry */ hash_table[crc] = (cptr1 - 3) - hbuf_start; /* point to next triplet */ ctr++; } ctr = saved_ctr; /* encode copy_offset and insert into output buffer */ if (copy_offset <= 63) /* (copy_offset >= 0) is always true */ { /* insert binary header */ data = 0x1f; insert_5_bits(data); /* insert 6 bits of copy_offset */ data = (char) (copy_offset & 0x3f); insert_6_bits(data); } else if ((copy_offset >= 64) && (copy_offset <= 319)) { /* insert binary header */ data = 0x1e; insert_5_bits(data); /* insert 8 bits of copy offset */ data = (char) (copy_offset - 64); insert_8_bits(data); } else if ((copy_offset >= 320) && (copy_offset <= 2367)) { /* insert binary header */ data = 0x0e; insert_4_bits(data); /* insert 11 bits of copy offset */ data16 = copy_offset - 320;; insert_11_bits(data16); } else { /* copy_offset is 2368+ */ /* insert binary header */ data = 0x06; insert_3_bits(data); /* insert 16 bits of copy offset */ data16 = copy_offset - 2368;; insert_16_bits(data16); } /* encode length of match and insert into output buffer */ if (lom == 3) { /* binary header is 'zero'; since outputBuffer is zero */ /* filled, all we have to do is update bits_left */ bits_left--; if (bits_left == 0) { opb_index++; bits_left = 8; } } else if ((lom >= 4) && (lom <= 7)) { /* insert binary header */ data = 0x02; insert_2_bits(data); /* insert lower 2 bits of LoM */ data = (char) (lom - 4); insert_2_bits(data); } else if ((lom >= 8) && (lom <= 15)) { /* insert binary header */ data = 0x06; insert_3_bits(data); /* insert lower 3 bits of LoM */ data = (char) (lom - 8); insert_3_bits(data); } else if ((lom >= 16) && (lom <= 31)) { /* insert binary header */ data = 0x0e; insert_4_bits(data); /* insert lower 4 bits of LoM */ data = (char) (lom - 16); insert_4_bits(data); } else if ((lom >= 32) && (lom <= 63)) { /* insert binary header */ data = 0x1e; insert_5_bits(data); /* insert lower 5 bits of LoM */ data = (char) (lom - 32); insert_5_bits(data); } else if ((lom >= 64) && (lom <= 127)) { /* insert binary header */ data = 0x3e; insert_6_bits(data); /* insert lower 6 bits of LoM */ data = (char) (lom - 64); insert_6_bits(data); } else if ((lom >= 128) && (lom <= 255)) { /* insert binary header */ data = 0x7e; insert_7_bits(data); /* insert lower 7 bits of LoM */ data = (char) (lom - 128); insert_7_bits(data); } else if ((lom >= 256) && (lom <= 511)) { /* insert binary header */ data = 0xfe; insert_8_bits(data); /* insert lower 8 bits of LoM */ data = (char) (lom - 256); insert_8_bits(data); } else if ((lom >= 512) && (lom <= 1023)) { /* insert binary header */ data16 = 0x1fe; insert_9_bits(data16); /* insert lower 9 bits of LoM */ data16 = lom - 512; insert_9_bits(data16); } else if ((lom >= 1024) && (lom <= 2047)) { /* insert binary header */ data16 = 0x3fe; insert_10_bits(data16); /* insert 10 lower bits of LoM */ data16 = lom - 1024; insert_10_bits(data16); } else if ((lom >= 2048) && (lom <= 4095)) { /* insert binary header */ data16 = 0x7fe; insert_11_bits(data16); /* insert 11 lower bits of LoM */ data16 = lom - 2048; insert_11_bits(data16); } else if ((lom >= 4096) && (lom <= 8191)) { /* insert binary header */ data16 = 0xffe; insert_12_bits(data16); /* insert 12 lower bits of LoM */ data16 = lom - 4096; insert_12_bits(data16); } else if ((lom >= 8192) && (lom <= 16383)) { /* insert binary header */ data16 = 0x1ffe; insert_13_bits(data16); /* insert 13 lower bits of LoM */ data16 = lom - 8192; insert_13_bits(data16); } else if ((lom >= 16384) && (lom <= 32767)) { /* insert binary header */ data16 = 0x3ffe; insert_14_bits(data16); /* insert 14 lower bits of LoM */ data16 = lom - 16384; insert_14_bits(data16); } else if ((lom >= 32768) && (lom <= 65535)) { /* insert binary header */ data16 = 0x7ffe; insert_15_bits(data16); /* insert 15 lower bits of LoM */ data16 = lom - 32768; insert_15_bits(data16); } } /* end while (ctr < data_end) */ /* add remaining data to the output */ while (len - ctr > 0) { data = srcData[ctr]; LOG_DEVEL(LOG_LEVEL_TRACE, "%.2x ", data); if (data < 0x80) { /* literal byte < 0x80 */ insert_8_bits(data); } else { /* literal byte >= 0x80 */ insert_2_bits(0x02); data &= 0x7f; insert_7_bits(data); } ctr++; } /* if bits_left != 8, increment opb_index, which is zero indexed */ if (bits_left != 8) { opb_index++; } if (opb_index > len) { /* compressed data longer than uncompressed data */ /* give up */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Compression algorithim produced a compressed " "buffer which is larger than the uncompressed buffer. " "compression ratio %f, flags 0x%x", (float) len / (float) opb_index, enc->flags); enc->historyOffset = 0; g_memset(hash_table, 0, enc->buf_len * 2); g_memset(enc->historyBuffer, 0, enc->buf_len); enc->flagsHold |= PACKET_AT_FRONT | PACKET_FLUSHED; return 0; } enc->flags |= PACKET_COMPRESSED; enc->bytes_in_opb = opb_index; enc->flags |= enc->flagsHold; enc->flagsHold = 0; LOG_DEVEL(LOG_LEVEL_TRACE, "Compression successful. compression ratio %f, " "flags 0x%x, bytes_in_opb %d, historyOffset %d, uncompressed len %d", (float) len / (float) enc->bytes_in_opb, enc->flags, enc->bytes_in_opb, enc->historyOffset, len); return 1; } /** * encode (compress) data * * @param enc encoder state info * @param srcData uncompressed data * @param len length of srcData * * @return TRUE on success, FALSE on failure */ int compress_rdp(struct xrdp_mppc_enc *enc, tui8 *srcData, int len) { if ((enc == 0) || (srcData == 0) || (len <= 0) || (len > enc->buf_len)) { return 0; } switch (enc->protocol_type) { case PROTO_RDP_40: return compress_rdp_4(enc, srcData, len); break; case PROTO_RDP_50: return compress_rdp_5(enc, srcData, len); break; } return 0; } xrdp-0.10.1/libxrdp/xrdp_jpeg_compress.c000644 001751 000000 00000031645 14652432047 020353 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * jpeg compressor */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #if defined(XRDP_TJPEG) /* turbo jpeg */ #include #include #include #include #include "log.h" /*****************************************************************************/ int xrdp_jpeg_compress(void *handle, char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int quality) { int error; int i; int j; unsigned int pixel; unsigned int *src32; unsigned int *dst32; unsigned long cdata_bytes; unsigned char *src_buf; unsigned char *dst_buf; char *temp_buf; tjhandle tj_han; if (bpp != 24) { LOG(LOG_LEVEL_WARNING, "xrdp_jpeg_compress: bpp wrong %d", bpp); return height; } if (handle == 0) { LOG(LOG_LEVEL_WARNING, "xrdp_jpeg_compress: handle is nil"); return height; } tj_han = (tjhandle) handle; cdata_bytes = byte_limit; src_buf = (unsigned char *) in_data; dst_buf = (unsigned char *) (s->p); temp_buf = 0; if (e == 0) { src_buf = (unsigned char *)in_data; } else { temp_buf = (char *) g_malloc((width + e) * height * 4, 0); dst32 = (unsigned int *) temp_buf; src32 = (unsigned int *) in_data; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { pixel = *src32; src32++; *dst32 = pixel; dst32++; } if (width > 0) { for (i = 0; i < e; i++) { *dst32 = pixel; dst32++; } } } src_buf = (unsigned char *) temp_buf; } dst_buf = (unsigned char *)(s->p); error = tjCompress(tj_han, src_buf, width + e, (width + e) * 4, height, TJPF_XBGR, dst_buf, &cdata_bytes, TJSAMP_420, quality, 0); if (error != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_jpeg_compress: tjCompress error: %s", tjGetErrorStr()); } s->p += cdata_bytes; g_free(temp_buf); return height; } /** * Compress a rectangular area (aka inner rectangle) inside our * frame buffer (inp_data) *****************************************************************************/ int xrdp_codec_jpeg_compress(void *handle, int format, /* input data format */ char *inp_data, /* input data */ int width, /* width of inp_data */ int height, /* height of inp_data */ int stride, /* inp_data stride, in bytes*/ int x, /* x loc in inp_data */ int y, /* y loc in inp_data */ int cx, /* width of area to compress */ int cy, /* height of area to compress */ int quality, /* higher numbers compress less */ char *out_data, /* dest for jpg image */ int *io_len /* length of out_data and on return */ /* len of compressed data */ ) { tjhandle tj_han; int error; int bpp; char *src_ptr; unsigned long lio_len; /* * note: for now we assume that format is always XBGR and ignore format */ if (handle == 0) { LOG(LOG_LEVEL_WARNING, "xrdp_codec_jpeg_compress: handle is nil"); return height; } tj_han = (tjhandle) handle; /* get bytes per pixel */ bpp = stride / width; /* start of inner rect in inp_data */ src_ptr = inp_data + (y * stride + x * bpp); lio_len = *io_len; /* compress inner rect */ /* notes * TJPF_RGB no works, zero bytes * TJPF_BGR no works, not zero but no open * TJPF_RGBX no works, zero bytes * TJPF_BGRX no works, off scaled image * TJPF_XBGR works * TJPF_XRGB no works, zero bytes * TJPF_RGBA no works, zero bytes * TJPF_BGRA no works, zero bytes * TJPF_ABGR no works, zero bytes * TJPF_ARGB no works, zero bytes */ error = tjCompress(tj_han, /* opaque handle */ (unsigned char *) src_ptr, /* source buf */ cx, /* width of area to compress */ stride, /* pitch */ cy, /* height of area to compress */ TJPF_XBGR, /* pixel size */ (unsigned char *) out_data, /* dest buf */ &lio_len, /* inner_buf length & compressed_size */ TJSAMP_420, /* jpeg sub sample */ quality, /* jpeg quality */ 0 /* flags */ ); if (error != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_codec_jpeg_compress: tjCompress error: %s", tjGetErrorStr()); } *io_len = lio_len; return height; } /*****************************************************************************/ void * xrdp_jpeg_init(void) { tjhandle tj_han; tj_han = tjInitCompress(); return tj_han; } /*****************************************************************************/ int xrdp_jpeg_deinit(void *handle) { tjhandle tj_han; if (handle == 0) { return 0; } tj_han = (tjhandle) handle; tjDestroy(tj_han); return 0; } #elif defined(XRDP_JPEG) /* libjpeg */ #include #include #include #include #define JP_QUALITY 75 struct mydata_comp { JOCTET *cb; int cb_bytes; int total_done; int overwrite; }; /*****************************************************************************/ /* called at beginning */ static void my_init_destination(j_compress_ptr cinfo) { struct mydata_comp *md; md = (struct mydata_comp *)(cinfo->client_data); md->total_done = 0; md->overwrite = 0; cinfo->dest->next_output_byte = md->cb; cinfo->dest->free_in_buffer = md->cb_bytes; } /*****************************************************************************/ /* called when buffer is full and we need more space */ static int my_empty_output_buffer(j_compress_ptr cinfo) { struct mydata_comp *md; int chunk_bytes; md = (struct mydata_comp *)(cinfo->client_data); chunk_bytes = md->cb_bytes; md->total_done += chunk_bytes; cinfo->dest->next_output_byte = md->cb; cinfo->dest->free_in_buffer = md->cb_bytes; md->overwrite = 1; return 1; } /*****************************************************************************/ /* called at end */ static void my_term_destination(j_compress_ptr cinfo) { struct mydata_comp *md; int chunk_bytes; md = (struct mydata_comp *)(cinfo->client_data); chunk_bytes = md->cb_bytes - cinfo->dest->free_in_buffer; md->total_done += chunk_bytes; } /*****************************************************************************/ static int jp_do_compress(JOCTET *data, int width, int height, int bpp, int quality, JOCTET *comp_data, int *comp_data_bytes) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; struct jpeg_destination_mgr dst_mgr; struct mydata_comp md; JSAMPROW row_pointer[4]; int Bpp; Bpp = (bpp + 7) / 8; memset(&cinfo, 0, sizeof(cinfo)); cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); memset(&md, 0, sizeof(md)); md.cb = comp_data, md.cb_bytes = *comp_data_bytes; cinfo.client_data = &md; memset(&dst_mgr, 0, sizeof(dst_mgr)); dst_mgr.init_destination = my_init_destination; dst_mgr.empty_output_buffer = my_empty_output_buffer; dst_mgr.term_destination = my_term_destination; cinfo.dest = &dst_mgr; cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = Bpp; cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); cinfo.num_components = 3; cinfo.dct_method = JDCT_FLOAT; jpeg_set_quality(&cinfo, quality, 1); jpeg_start_compress(&cinfo, 1); while (cinfo.next_scanline + 3 < cinfo.image_height) { row_pointer[0] = data; data += width * Bpp; row_pointer[1] = data; data += width * Bpp; row_pointer[2] = data; data += width * Bpp; row_pointer[3] = data; data += width * Bpp; jpeg_write_scanlines(&cinfo, row_pointer, 4); } while (cinfo.next_scanline < cinfo.image_height) { row_pointer[0] = data; data += width * Bpp; jpeg_write_scanlines(&cinfo, row_pointer, 1); } jpeg_finish_compress(&cinfo); *comp_data_bytes = md.total_done; jpeg_destroy_compress(&cinfo); if (md.overwrite) { return 1; } return 0; } /*****************************************************************************/ static int jpeg_compress(char *in_data, int width, int height, struct stream *s, struct stream *temp_s, int bpp, int byte_limit, int e, int quality) { JOCTET *data; tui32 *src32; tui8 *dst8; tui32 pixel; int red; int blue; int green; int j; int i; int cdata_bytes; data = (JOCTET *) temp_s->data; dst8 = data; if (bpp == 24) { src32 = (tui32 *)in_data; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { pixel = src32[i + j * width]; SPLITCOLOR32(red, green, blue, pixel); *(dst8++) = blue; *(dst8++) = green; *(dst8++) = red; } if (width > 0) { for (i = 0; i < e; i++) { *(dst8++) = blue; *(dst8++) = green; *(dst8++) = red; } } } } else { LOG(LOG_LEVEL_WARNING, "bpp wrong %d", bpp); } cdata_bytes = byte_limit; jp_do_compress(data, width + e, height, 24, quality, (JOCTET *) s->p, &cdata_bytes); s->p += cdata_bytes; return cdata_bytes; } /*****************************************************************************/ int xrdp_jpeg_compress(void *handle, char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int quality) { jpeg_compress(in_data, width, height, s, temp_s, bpp, byte_limit, e, quality); return height; } /*****************************************************************************/ int xrdp_codec_jpeg_compress(void *handle, int format, char *inp_data, int width, int height, int stride, int x, int y, int cx, int cy, int quality, char *out_data, int *io_len) { return 0; } /*****************************************************************************/ void * xrdp_jpeg_init(void) { return 0; } /*****************************************************************************/ int xrdp_jpeg_deinit(void *handle) { return 0; } #else /*****************************************************************************/ int xrdp_jpeg_compress(void *handle, char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int quality) { return height; } /*****************************************************************************/ int xrdp_codec_jpeg_compress(void *handle, int format, char *inp_data, int width, int height, int stride, int x, int y, int cx, int cy, int quality, char *out_data, int *io_len) { return 0; } /*****************************************************************************/ void * xrdp_jpeg_init(void) { return 0; } /*****************************************************************************/ int xrdp_jpeg_deinit(void *handle) { return 0; } #endif xrdp-0.10.1/libxrdp/xrdp_mcs.c000644 001751 000000 00000143516 14652432047 016276 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * mcs layer which implements the Multipoint Communication Service protocol as * specified in [ITU-T T.125] */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "log.h" /* Forward references */ static int handle_non_tls_client_channel_join_requests(struct xrdp_mcs *self, struct stream *s, int *appid); /*****************************************************************************/ struct xrdp_mcs * xrdp_mcs_create(struct xrdp_sec *owner, struct trans *trans, struct stream *client_mcs_data, struct stream *server_mcs_data) { struct xrdp_mcs *self; self = (struct xrdp_mcs *)g_malloc(sizeof(struct xrdp_mcs), 1); self->sec_layer = owner; self->userid = 1; self->chanid = 1001; self->client_mcs_data = client_mcs_data; self->server_mcs_data = server_mcs_data; self->iso_layer = xrdp_iso_create(self, trans); self->channel_list = list_create(); return self; } /*****************************************************************************/ void xrdp_mcs_delete(struct xrdp_mcs *self) { struct mcs_channel_item *channel_item; int index; int count; if (self == 0) { return; } /* here we have to free the channel items and anything in them */ count = self->channel_list->count; for (index = count - 1; index >= 0; index--) { channel_item = (struct mcs_channel_item *) list_get_item(self->channel_list, index); g_free(channel_item); } list_delete(self->channel_list); xrdp_iso_delete(self->iso_layer); /* make sure we get null pointer exception if struct is used again. */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_mcs_delete processed"); g_memset(self, 0, sizeof(struct xrdp_mcs)) ; g_free(self); } /*****************************************************************************/ /* Send an [ITU-T T.125] DomainMCSPDU message with type ChannelJoinConfirm */ /* returns error = 1 ok = 0 */ static int xrdp_mcs_send_cjcf(struct xrdp_mcs *self, int userid, int chanid) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_iso_init(self->iso_layer, s) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "xrdp_mcs_send_cjcf: xrdp_iso_init failed"); return 1; } /* The DomainMCSPDU choice index is a 6-bit int with the next bit as the bit field of the two optional fields in the struct (channelId, nonStandard) */ out_uint8(s, (MCS_CJCF << 2) | 0x02); /* DomainMCSPDU choice index, channelId field is present, nonStandard field is not present */ out_uint8(s, 0); /* result choice index 0 = rt-successful */ out_uint16_be(s, userid); /* initiator */ out_uint16_be(s, chanid); /* requested */ out_uint16_be(s, chanid); /* channelId (OPTIONAL) */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [ITU-T T.125] ChannelJoinConfirm " "result SUCCESS, initiator %d, requested %d, " "channelId %d", userid, chanid, chanid); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "Sening [ITU-T T.125] ChannelJoinConfirm failed"); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* Reads the header of a DomainMCSPDU and gets the appid * * @return 0 for success */ static int get_domain_mcs_pdu_header(struct xrdp_mcs *self, struct stream *s, int *appid) { int opcode; if (xrdp_iso_recv(self->iso_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_mcs_recv: xrdp_iso_recv failed"); return 1; } if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T T.125] DomainMCSPDU")) { return 1; } /* The DomainMCSPDU choice index is a 6-bit int with the 2 least significant bits of the byte as padding */ in_uint8(s, opcode); *appid = opcode >> 2; /* 2-bit padding */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] DomainMCSPDU choice index %d", *appid); return 0; } /*****************************************************************************/ /* * Processes an [ITU-T T.125] DomainMCSPDU message. * * Note: DomainMCSPDU messages use the ALIGNED BASIC-PER (Packed Encoding Rules) * from [ITU-T X.691]. * * returns error */ int xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan) { int appid; int len; if (get_domain_mcs_pdu_header(self, s, &appid) != 0) { return 1; } if (self->expecting_channel_join_requests) { if (handle_non_tls_client_channel_join_requests(self, s, &appid) != 0) { return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] completed"); self->expecting_channel_join_requests = 0; } if (appid == MCS_DPUM) /* Disconnect Provider Ultimatum */ { LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] DisconnectProviderUltimatum"); LOG(LOG_LEVEL_DEBUG, "Received disconnection request"); return 1; } if (appid != MCS_SDRQ) { LOG(LOG_LEVEL_ERROR, "Received [ITU-T T.125] DomainMCSPDU " "choice index %d is unknown. Expected the DomainMCSPDU to " "contain the type SendDataRequest with index %d", appid, MCS_SDRQ); return 1; } if (!s_check_rem_and_log(s, 6, "Parsing [ITU-T T.125] SendDataRequest")) { return 1; } in_uint8s(s, 2); /* initiator */ in_uint16_be(s, *chan); /* channelId */ in_uint8s(s, 1); /* dataPriority (4-bits), segmentation (2-bits), padding (2-bits) */ in_uint8(s, len); /* userData Length (byte 1) */ if ((len & 0xC0) == 0x80) { /* From [ITU-T X.691] 11.9.3.7 encoding a length determinant if "n" is greater than 127 and less than 16K, then n is encoded using 2 bytes. The first byte will have the two highest order bits set to 1 and 0 (ie. len & 0xC0 == 0x80) and the length is encoded as remaining 14 bits of the two bytes (ie. len & 0x3fff). */ if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T T.125] SendDataRequest userData Length")) { return 1; } in_uint8s(s, 1); /* userData Length (byte 2) */ } else if ((len & 0xC0) == 0xC0) { /* From [ITU-T X.691] 11.9.3.8 encoding a length determinant if "n" is greater than 16K, then the list of items is fragmented with the length of the first fragment encoded using 1 byte. The two highest order bits are set to 1 and 1 (ie. len & 0xC0 == 0xC0) and the remaining 6 bits contain a multiplyer for 16K (ie. n = (len & 0x3f) * 0x3f) */ LOG(LOG_LEVEL_ERROR, "[ITU-T T.125] SendDataRequest with length greater " "than 16K is not supported. len 0x%2.2x", len); return 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] SendDataRequest " "initiator (ignored), channelId %d, dataPriority (ignored), " "segmentation (ignored), userData Length (ignored)", *chan); return 0; } /*****************************************************************************/ /** * Parse the identifier and length of a [ITU-T X.690] BER (Basic Encoding Rules) * structure header. * * @param self * @param s [in] - the stream to read from * @param tag_val [in] - the expected tag value * @param len [out] - the length of the structure * @returns error */ static int xrdp_mcs_ber_parse_header(struct xrdp_mcs *self, struct stream *s, int tag_val, int *len) { int tag; int l; int i; if (tag_val > 0xff) { if (!s_check_rem_and_log(s, 2, "Parsing [ITU-T X.690] Identifier")) { return 1; } in_uint16_be(s, tag); } else { if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T X.690] Identifier")) { return 1; } in_uint8(s, tag); } if (tag != tag_val) { LOG(LOG_LEVEL_ERROR, "Parsed [ITU-T X.690] Identifier: " "expected 0x%4.4x, actual 0x%4.4x", tag_val, tag); return 1; } if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T X.690] Length")) { return 1; } in_uint8(s, l); if (l & 0x80) { l = l & ~0x80; *len = 0; while (l > 0) { if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T X.690] Length")) { return 1; } in_uint8(s, i); *len = (*len << 8) | i; l--; } } else { *len = l; } LOG_DEVEL(LOG_LEVEL_TRACE, "Parsed BER header [ITU-T X.690] " "Identifier 0x%4.4x, Length %d", tag, *len); return 0; } /*****************************************************************************/ /* Parses a [ITU-T T.125] DomainParameters structure encoded using BER */ /* returns error */ static int xrdp_mcs_parse_domain_params(struct xrdp_mcs *self, struct stream *s) { int len; if (xrdp_mcs_ber_parse_header(self, s, MCS_TAG_DOMAIN_PARAMS, &len) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] DomainParameters failed"); return 1; } if (len < 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] DomainParameters length field is " "invalid. Expected >= 0, actual %d", len); return 1; } if (!s_check_rem_and_log(s, len, "Parsing [ITU-T T.125] DomainParameters")) { return 1; } in_uint8s(s, len); /* skip all fields */ return !s_check_rem_and_log(s, 0, "Parsing [ITU-T T.125] DomainParameters"); } /*****************************************************************************/ /* Process a [ITU-T T.125] Connect-Initial message encoded using BER */ /* returns error */ static int xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self) { int len; struct stream *s; s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.125] Connect-Initial failed"); return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.125] Connect-Initial failed"); return 1; } if (xrdp_mcs_ber_parse_header(self, s, MCS_CONNECT_INITIAL, &len) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial failed"); return 1; } if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial callingDomainSelector failed"); return 1; } if (len < 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial callingDomainSelector length field is " "invalid. Expected >= 0, actual %d", len); return 1; } if (!s_check_rem_and_log(s, len, "Parsing [ITU-T T.125] Connect-Initial callingDomainSelector")) { return 1; } in_uint8s(s, len); /* [ITU-T T.125] Connect-Initial callingDomainSelector */ if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial calledDomainSelector failed"); return 1; } if (len < 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial calledDomainSelector length field is " "invalid. Expected >= 0, actual %d", len); return 1; } if (!s_check_rem_and_log(s, len, "Parsing [ITU-T T.125] Connect-Initial calledDomainSelector")) { return 1; } in_uint8s(s, len); /* [ITU-T T.125] Connect-Initial calledDomainSelector */ if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_BOOLEAN, &len) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial upwardFlag failed"); return 1; } if (len < 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial upwardFlag length field is " "invalid. Expected >= 0, actual %d", len); return 1; } if (!s_check_rem_and_log(s, len, "Parsing [ITU-T T.125] Connect-Initial upwardFlag")) { return 1; } in_uint8s(s, len); /* [ITU-T T.125] Connect-Initial upwardFlag */ /* [ITU-T T.125] Connect-Initial targetParameters */ if (xrdp_mcs_parse_domain_params(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial targetParameters failed"); return 1; } /* [ITU-T T.125] Connect-Initial minimumParameters */ if (xrdp_mcs_parse_domain_params(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial minimumParameters failed"); return 1; } /* [ITU-T T.125] Connect-Initial maximumParameters */ if (xrdp_mcs_parse_domain_params(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial maximumParameters failed"); return 1; } if (xrdp_mcs_ber_parse_header(self, s, BER_TAG_OCTET_STRING, &len) != 0) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial userData failed"); return 1; } /* mcs userData can not be zero length */ if ((len <= 0) || (len > 16 * 1024)) { LOG(LOG_LEVEL_ERROR, "Parsing [ITU-T T.125] Connect-Initial userData: invalid length. " "Expected min 1, max %d; Actual %d", 16 * 1024, len); return 1; } if (!s_check_rem_and_log(s, len, "Parsing [ITU-T T.125] Connect-Initial userData")) { return 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [ITU-T T.125] Connect-Initial " "callingDomainSelector (ignored), calledDomainSelector (ignored), " "upwardFlag (ignored), targetParameters (ignored), " "minimumParameters (ignored), maximumParameters (ignored), " "userData (copied to client_mcs_data)"); /* make a copy of client mcs data */ init_stream(self->client_mcs_data, len); out_uint8a(self->client_mcs_data, s->p, len); /* [ITU-T T.125] Connect-Initial userData */ in_uint8s(s, len); s_mark_end(self->client_mcs_data); if (!s_check_end_and_log(s, "MCS protocol error [ITU-T T.125] Connect-Initial")) { return 1; } return 0; } /*****************************************************************************/ /* Processes a [ITU-T T.25] DomainMCSPDU with type ErectDomainRequest * * Note: a parsing example can be found in [MS-RDPBCGR] 4.1.5 * * returns error */ static int xrdp_mcs_recv_edrq(struct xrdp_mcs *self) { int opcode; struct stream *s; s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.125] ErectDomainRequest failed"); return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.125] ErectDomainRequest failed"); return 1; } if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T T.125] DomainMCSPDU")) { return 1; } /* The DomainMCSPDU choice index is a 6-bit int with the next bit as the bit field of the optional field in the struct */ in_uint8(s, opcode); if ((opcode >> 2) != MCS_EDRQ) { LOG(LOG_LEVEL_ERROR, "Parsed [ITU-T T.125] DomainMCSPDU choice index " "expected %d, received %d", MCS_EDRQ, (opcode >> 2)); return 1; } if (!s_check_rem_and_log(s, 4, "Parsing [ITU-T T.125] ErectDomainRequest")) { return 1; } in_uint8s(s, 2); /* subHeight */ in_uint8s(s, 2); /* subInterval */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] DomainMCSPDU " "choice index %d (ErectDomainRequest)", (opcode >> 2)); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] ErectDomainRequest " "subHeight (ignored), subInterval (ignored), " "nonStandard (%s)", (opcode & 2) ? "present" : "not present"); /* * [MS-RDPBCGR] 2.2.1.5 says that the mcsEDrq field is 5 bytes (which have * already been read into the opcode and previous fields), so the * nonStandard field should never be present. */ if (opcode & 2) /* ErectDomainRequest v3 nonStandard optional field is present? */ { if (!s_check_rem_and_log(s, 2, "Parsing [ITU-T T.125] ErectDomainRequest nonStandard")) { return 1; } in_uint16_be(s, self->userid); /* NonStandardParameter.key NonStandardParameter.data */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] DomainMCSPDU " "choice index %d (ErectDomainRequest)", (opcode >> 2)); } if (!s_check_end_and_log(s, "MCS protocol error [ITU-T T.125] ErectDomainRequest")) { return 1; } return 0; } /*****************************************************************************/ /* Processes a [ITU-T T.25] DomainMCSPDU with type AttachUserRequest * * Note: a parsing example can be found in [MS-RDPBCGR] 4.1.6 * * returns error */ static int xrdp_mcs_recv_aurq(struct xrdp_mcs *self) { int opcode; struct stream *s; s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.125] AttachUserRequest failed"); return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.125] AttachUserRequest failed"); return 1; } if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T T.125] DomainMCSPDU")) { return 1; } /* The DomainMCSPDU choice index is a 6-bit int with the next bit as the bit field of the optional field in the struct */ in_uint8(s, opcode); if ((opcode >> 2) != MCS_AURQ) { LOG(LOG_LEVEL_ERROR, "Parsed [ITU-T T.125] DomainMCSPDU choice index " "expected %d, received %d", MCS_AURQ, (opcode >> 2)); return 1; } /* * [MS-RDPBCGR] 2.2.1.6 says that the mcsAUrq field is 1 bytes (which have * already been read into the opcode), so the nonStandard field should * never be present. */ if (opcode & 2) { if (!s_check_rem_and_log(s, 2, "Parsing [ITU-T T.125] AttachUserRequest nonStandard")) { return 1; } in_uint16_be(s, self->userid); /* NonStandardParameter.key NonStandardParameter.data */ } LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] DomainMCSPDU " "choice index %d (AttachUserRequest)", (opcode >> 2)); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] AttachUserRequest " "nonStandard (%s)", (opcode & 2) ? "present" : "not present"); if (!s_check_end_and_log(s, "MCS protocol error [ITU-T T.125] AttachUserRequest")) { return 1; } return 0; } /*****************************************************************************/ /* Send a [ITU-T T.125] DomainMCSPDU with type AttachUserConfirm. * * Note: a parsing example can be found in [MS-RDPBCGR] 4.1.7 * * returns error */ static int xrdp_mcs_send_aucf(struct xrdp_mcs *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_iso_init(self->iso_layer, s) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "xrdp_mcs_send_aucf: xrdp_iso_init failed"); return 1; } out_uint8(s, ((MCS_AUCF << 2) | 2)); /* AttachUserConfirm optional field initiator is present */ out_uint8s(s, 1); /* result = 0 rt-successful */ out_uint16_be(s, self->userid); /* initiator */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [ITU-T T.125] DomainMCSPDU " "of type AttachUserConfirm: result SUCCESS, initiator %d", self->userid); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "Sending [ITU-T T.125] AttachUserConfirm failed"); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* Processes a [ITU-T T.25] DomainMCSPDU with type ChannelJoinRequest * * Note: a parsing example can be found in [MS-RDPBCGR] 4.1.8.1.1 * * returns error */ static int xrdp_mcs_recv_cjrq(struct xrdp_mcs *self, int *channel_id) { int opcode; struct stream *s; int initiator; s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.25] ChannelJoinRequest failed"); return 1; } if (xrdp_iso_recv(self->iso_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "Processing [ITU-T T.25] ChannelJoinRequest failed"); return 1; } if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T T.125] DomainMCSPDU")) { return 1; } in_uint8(s, opcode); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] DomainMCSPDU " "choice index %d (ChannelJoinRequest)", (opcode >> 2)); if ((opcode >> 2) != MCS_CJRQ) { LOG(LOG_LEVEL_ERROR, "Parsed [ITU-T T.125] DomainMCSPDU choice index " "expected %d, received %d", MCS_CJRQ, (opcode >> 2)); return 1; } if (!s_check_rem_and_log(s, 4, "Parsing [ITU-T T.125] ChannelJoinRequest")) { return 1; } in_uint16_be(s, initiator); in_uint16_be(s, *channel_id); /* * [MS-RDPBCGR] 2.2.1.8 says that the mcsAUrq field is 5 bytes (which have * already been read into the opcode and other fields), so the nonStandard * field should never be present. */ if (opcode & 2) { if (!s_check_rem_and_log(s, 2, "Parsing [ITU-T T.125] ChannelJoinRequest nonStandard")) { return 1; } in_uint8s(s, 2); /* NonStandardParameter.key NonStandardParameter.data */ } LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] ChannelJoinRequest " "initiator %d, channelId %d, " "nonStandard (%s)", initiator, *channel_id, (opcode & 2) ? "present" : "not present"); if (!s_check_end_and_log(s, "MCS protocol error [ITU-T T.125] ChannelJoinRequest")) { return 1; } return 0; } /*****************************************************************************/ /* Write the identifier and length of a [ITU-T X.690] BER (Basic Encoding Rules) * structure header. * returns error */ static int xrdp_mcs_ber_out_header(struct xrdp_mcs *self, struct stream *s, int tag_val, int len) { if (tag_val > 0xff) { out_uint16_be(s, tag_val); } else { out_uint8(s, tag_val); } if (len >= 0x80) { out_uint8(s, 0x82); out_uint16_be(s, len); } else { out_uint8(s, len); } LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [ITU-T X.690] Identifier %d, Length %d", tag_val, len); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_ber_out_int8(struct xrdp_mcs *self, struct stream *s, int value) { xrdp_mcs_ber_out_header(self, s, BER_TAG_INTEGER, 1); out_uint8(s, value); return 0; } #if 0 /* not used */ /*****************************************************************************/ /* returns error */ static int xrdp_mcs_ber_out_int16(struct xrdp_mcs *self, struct stream *s, int value) { xrdp_mcs_ber_out_header(self, s, BER_TAG_INTEGER, 2); out_uint8(s, (value >> 8)); out_uint8(s, value); return 0; } #endif /*****************************************************************************/ /* returns error */ static int xrdp_mcs_ber_out_int24(struct xrdp_mcs *self, struct stream *s, int value) { xrdp_mcs_ber_out_header(self, s, BER_TAG_INTEGER, 3); out_uint8(s, (value >> 16)); out_uint8(s, (value >> 8)); out_uint8(s, value); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_mcs_out_domain_params(struct xrdp_mcs *self, struct stream *s, int max_channels, int max_users, int max_tokens, int max_pdu_size) { xrdp_mcs_ber_out_header(self, s, MCS_TAG_DOMAIN_PARAMS, 26); xrdp_mcs_ber_out_int8(self, s, max_channels); xrdp_mcs_ber_out_int8(self, s, max_users); xrdp_mcs_ber_out_int8(self, s, max_tokens); xrdp_mcs_ber_out_int8(self, s, 1); /* numPriorities */ xrdp_mcs_ber_out_int8(self, s, 0); /* minThroughput */ xrdp_mcs_ber_out_int8(self, s, 1); /* maxHeight */ xrdp_mcs_ber_out_int24(self, s, max_pdu_size); xrdp_mcs_ber_out_int8(self, s, 2); /* protocolVersion */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [ITU-T T.125] DomainParameters " "maxChannelIds %d, maxUserIds %d, maxTokenIds %d, numPriorities 1, " "minThroughput 0 B/s, maxHeight 1, maxMCSPDUsize %d, " "protocolVersion 2", max_channels, max_users, max_tokens, max_pdu_size); return 0; } /*****************************************************************************/ /* Write an [ITU-T T.124] ConnectData (ALIGNED variant of BASIC-PER) message * with ConnectGCCPDU, ConferenceCreateResponse, * and [MS-RDPBCGR] Server Data Blocks as user data. */ int xrdp_mcs_out_gcc_data(struct xrdp_sec *self) { struct stream *s; int num_channels_even; int num_channels; int index; int channel; int gcc_size; char *gcc_size_ptr; char *ud_ptr; int header_length = 0; int server_cert_len = 0; int public_key_blob_len = 0; int key_len = 0; int bit_len = 0; int data_len = 0; int modulus_len = 0; num_channels = self->mcs_layer->channel_list->count; num_channels_even = num_channels + (num_channels & 1); s = &(self->server_mcs_data); init_stream(s, 8192); /* [ITU-T T.124] ConnectData (ALIGNED variant of BASIC-PER) */ out_uint16_be(s, 5); /* = 0x00 0x05 */ /* t124Identifier choice index = 0 (object) */ /* object length = 5 */ out_uint16_be(s, 0x14); /* t124Identifier.object = ??? (0x00 0x14 0x7c 0x00 0x01) */ out_uint8(s, 0x7c); out_uint16_be(s, 1); /* -- */ out_uint8(s, 0x2a); /* connectPDU length = 42 */ /* connectPDU octet string of type ConnectGCCPDU (unknown where this octet string is defined to be of type ConnectGCCPDU) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [ITU-T T.124] ConnectData " "t124Identifier.object 0x00 0x14 0x7c 0x00 0x01, connectPDU length %d", 0x2a); /* [ITU-T T.124] ConnectGCCPDU (ALIGNED variant of BASIC-PER) */ out_uint8(s, 0x14); /* ConnectGCCPDU choice index 1 = ConferenceCreateResponse with userData present */ /* [ITU-T T.124] ConferenceCreateResponse (ALIGNED variant of BASIC-PER) */ out_uint8(s, 0x76); /* nodeID = 31219 - 1001 (PER offset for min value) = 30218 (big-endian 0x760a) */ out_uint8(s, 0x0a); out_uint8(s, 1); /* tag length */ out_uint8(s, 1); /* tag */ out_uint8(s, 0); /* result = 0 (success) */ out_uint16_le(s, 0xc001); /* userData set count = 1 (0x01), userData.isPresent = 0x80 (yes) | userData.key choice index = 0x40 (1 = h221NonStandard) */ out_uint8(s, 0); /* userData.key.h221NonStandard length = 4 - 4 (PER offset for min value) (H221NonStandardIdentifier is an octet string SIZE (4..255)) = 0 */ /* [ITU-T H.221] H221NonStandardIdentifier uses country codes and manufactuer codes from [ITU-T T.35]. Unknown why these values are used, maybe this is just copied from the [MS-RDPBCGR] 4.1.4 example which uses the value "McDn" */ out_uint8(s, 0x4d); /* M */ out_uint8(s, 0x63); /* c */ out_uint8(s, 0x44); /* D */ out_uint8(s, 0x6e); /* n */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [ITU-T T.124] ConferenceCreateResponse " "nodeID %d, result SUCCESS", 0x760a + 1001); /* ConferenceCreateResponse.userData.key.value (octet string) */ /* GCC Response Total Length - 2 bytes , set later */ gcc_size_ptr = s->p; /* RDPGCCUserDataResponseLength */ out_uint8s(s, 2); ud_ptr = s->p; /* User Data */ /* [MS-RDPBCGR] TS_UD_HEADER */ out_uint16_le(s, SEC_TAG_SRV_INFO); /* type */ if (self->mcs_layer->iso_layer->rdpNegData) { out_uint16_le(s, 12); /* length */ } else { out_uint16_le(s, 8); /* length */ } /* [MS-RDPBCGR] TS_UD_SC_CORE */ out_uint8(s, 4); /* version (0x00080004 = rdp5, 0x00080001 = rdp4) */ out_uint8(s, 0); out_uint8(s, 8); out_uint8(s, 0); /* version (last byte) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct header [MS-RDPBCGR] TS_UD_HEADER " "type 0x%4.4x, length %d", SEC_TAG_SRV_INFO, self->mcs_layer->iso_layer->rdpNegData ? 12 : 8); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] TS_UD_SC_CORE " " version 0x%8.8x", 0x00080004); if (self->mcs_layer->iso_layer->rdpNegData) { /* RequestedProtocol */ out_uint32_le(s, self->mcs_layer->iso_layer->requestedProtocol); /* clientRequestedProtocols */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] TS_UD_SC_CORE " " clientRequestedProtocols 0x%8.8x", self->mcs_layer->iso_layer->requestedProtocol); } /* [MS-RDPBCGR] TS_UD_HEADER */ out_uint16_le(s, SEC_TAG_SRV_CHANNELS); /* type */ out_uint16_le(s, 8 + (num_channels_even * 2)); /* length */ /* [MS-RDPBCGR] TS_UD_SC_NET */ out_uint16_le(s, MCS_GLOBAL_CHANNEL); /* 1003, 0x03eb main channel (MCSChannelId) */ out_uint16_le(s, num_channels); /* number of other channels (channelCount) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct header [MS-RDPBCGR] TS_UD_HEADER " "type 0x%4.4x, length %d", SEC_TAG_SRV_CHANNELS, 8 + (num_channels_even * 2)); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] TS_UD_SC_NET " "MCSChannelId %d, channelCount %d", MCS_GLOBAL_CHANNEL, num_channels); for (index = 0; index < num_channels_even; index++) { if (index < num_channels) { channel = MCS_GLOBAL_CHANNEL + (index + 1); out_uint16_le(s, channel); /* channelIdArray[index] (channel allocated) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] TS_UD_SC_NET channelIdArray[%d] " "channelId %d", index, channel); } else { out_uint16_le(s, 0); /* padding or channelIdArray[index] (channel not allocated) */ } } if (self->rsa_key_bytes == 64 || self->rsa_key_bytes == 256) { if (self->rsa_key_bytes == 64) { header_length = 0x00ec; /* length = 236 */ server_cert_len = 0xb8; /* serverCertLen (184 bytes) */ public_key_blob_len = 0x005c; /* wPublicKeyBlobLen (92 bytes) */ key_len = 0x0048; /* keylen (72 bytes = (bitlen / 8) modulus + 8 padding) */ bit_len = 512; /* bitlen = 512 */ data_len = 63; /* datalen (63 = (bitlen / 8) - 1) */ modulus_len = 64; } else /* if (self->rsa_key_bytes == 256) */ { header_length = 0x01ac; /* length = 428 */ server_cert_len = 0x178; /* serverCertLen (376 bytes) */ public_key_blob_len = 0x011c; /* wPublicKeyBlobLen (284 bytes) */ key_len = 0x0108; /* keylen (264 bytes = (bitlen / 8) modulus + 8 padding) */ bit_len = 2048; /* bitlen = 2048 */ data_len = 255; /* datalen (255 = (bitlen / 8) - 1) */ modulus_len = 256; } LOG(LOG_LEVEL_DEBUG, "using %d bit RSA key", bit_len); /* [MS-RDPBCGR] TS_UD_HEADER */ out_uint16_le(s, SEC_TAG_SRV_CRYPT); /* type */ out_uint16_le(s, header_length); /* length */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct header [MS-RDPBCGR] TS_UD_HEADER " "type 0x%4.4x, length %d", SEC_TAG_SRV_CRYPT, header_length); /* [MS-RDPBCGR] TS_UD_SC_SEC1 */ out_uint32_le(s, self->crypt_method); /* encryptionMethod */ out_uint32_le(s, self->crypt_level); /* encryptionLevel */ out_uint32_le(s, 32); /* serverRandomLen */ out_uint32_le(s, server_cert_len); /* serverCertLen */ out_uint8a(s, self->server_random, 32); /* serverRandom */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] TS_UD_SC_SEC1 " "encryptionMethod 0x%8.8x, encryptionLevel 0x%8.8x, " "serverRandomLen 32, serverCertLen %d, serverRandom (omitted), ", self->crypt_method, self->crypt_level, server_cert_len); /* (field serverCertificate) [MS-RDPBCGR] SERVER_CERTIFICATE */ /* HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ */ /* TermService\Parameters\Certificate */ out_uint32_le(s, 1); /* dwVersion (1 = PROPRIETARYSERVERCERTIFICATE) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] SERVER_CERTIFICATE " "dwVersion.certChainVersion 1 (CERT_CHAIN_VERSION_1), " "dwVersion.t 0 (permanent)"); /* [MS-RDPBCGR] PROPRIETARYSERVERCERTIFICATE */ out_uint32_le(s, 1); /* dwSigAlgId (1 = RSA) */ out_uint32_le(s, 1); /* dwKeyAlgId (1 = RSA) */ out_uint16_le(s, SEC_TAG_PUBKEY); /* wPublicKeyBlobType (BB_RSA_KEY_BLOB) */ out_uint16_le(s, public_key_blob_len); /* wPublicKeyBlobLen */ /* (field PublicKeyBlob) [MS-RDPBCGR] RSA_PUBLIC_KEY */ out_uint32_le(s, SEC_RSA_MAGIC); /* magic (0x31415352 'RSA1') */ out_uint32_le(s, key_len); /* keylen */ out_uint32_le(s, bit_len); /* bitlen */ out_uint32_le(s, data_len); /* datalen */ out_uint8a(s, self->pub_exp, 4); /* pubExp */ out_uint8a(s, self->pub_mod, modulus_len); /* modulus */ out_uint8s(s, 8); /* modulus zero padding */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] RSA_PUBLIC_KEY " "magic 0x%8.8x, keylen %d, bitlen %d, datalen %d, " "pubExp , modulus , ", SEC_RSA_MAGIC, key_len, bit_len, data_len); out_uint16_le(s, SEC_TAG_KEYSIG); /* wSignatureBlobType (0x0008 RSA) */ out_uint16_le(s, 72); /* wSignatureBlobLen */ out_uint8a(s, self->pub_sig, 64); /* SignatureBlob */ out_uint8s(s, 8); /* modulus zero padding */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] PROPRIETARYSERVERCERTIFICATE " "dwKeyAlgId 1, " "wPublicKeyBlobType 0x%4.4x, " "wPublicKeyBlobLen %d, PublicKeyBlob " "wSignatureBlobType 0x%4.4x, " "wSignatureBlobLen %d, " "SignatureBlob ", SEC_TAG_PUBKEY, public_key_blob_len, SEC_TAG_KEYSIG, 72); } else if (self->rsa_key_bytes == 0) /* no security */ { LOG(LOG_LEVEL_DEBUG, "using no security"); /* [MS-RDPBCGR] TS_UD_HEADER */ out_uint16_le(s, SEC_TAG_SRV_CRYPT); /* type*/ out_uint16_le(s, 12); /* length */ /* [MS-RDPBCGR] TS_UD_SC_SEC1 */ out_uint32_le(s, self->crypt_method); /* encryptionMethod */ out_uint32_le(s, self->crypt_level); /* encryptionLevel */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct header [MS-RDPBCGR] TS_UD_HEADER " "type 0x%4.4x, length %d", SEC_TAG_SRV_CRYPT, 12); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding struct [MS-RDPBCGR] TS_UD_SC_SEC1 " "encryptionMethod 0x%8.8x, encryptionMethod 0x%8.8x", self->crypt_method, self->crypt_level); } else { LOG(LOG_LEVEL_WARNING, "Unsupported xrdp_sec.rsa_key_bytes value: %d, the client " "will not be sent a [MS-RDPBCGR] TS_UD_SC_SEC1 message.", self->rsa_key_bytes); } s_mark_end(s); gcc_size = (int)(s->end - ud_ptr) | 0x8000; gcc_size_ptr[0] = gcc_size >> 8; gcc_size_ptr[1] = gcc_size; return 0; } /*****************************************************************************/ /* Send an [ITU-T T.125] Connect-Response message. * * Note: the xrdp_mcs_out_gcc_data() function must be called (to populate the * xrdp_mcs.server_mcs_data stream) before this method is called. * * returns error */ static int xrdp_mcs_send_connect_response(struct xrdp_mcs *self) { int data_len; struct stream *s; make_stream(s); init_stream(s, 8192); data_len = (int) (self->server_mcs_data->end - self->server_mcs_data->data); xrdp_iso_init(self->iso_layer, s); //TODO: we should calculate the whole length include MCS_CONNECT_RESPONSE xrdp_mcs_ber_out_header(self, s, MCS_CONNECT_RESPONSE, data_len > 0x80 ? data_len + 38 : data_len + 36); xrdp_mcs_ber_out_header(self, s, BER_TAG_RESULT, 1); out_uint8(s, 0); /* result choice index 0 = rt-successful */ xrdp_mcs_ber_out_header(self, s, BER_TAG_INTEGER, 1); out_uint8(s, 0); /* calledConnectId */ xrdp_mcs_out_domain_params(self, s, 22, 3, 0, 0xfff8); xrdp_mcs_ber_out_header(self, s, BER_TAG_OCTET_STRING, data_len); /* mcs data */ out_uint8a(s, self->server_mcs_data->data, data_len); s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [ITU-T T.125] Connect-Response " "result SUCCESS, calledConnectId 0, " "domainParameters (see xrdp_mcs_out_domain_params() trace logs), " "userData (see xrdp_mcs_out_gcc_data() trace logs and " "hex dump below)"); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "[ITU-T T.125] Connect-Response userData", self->server_mcs_data->data, data_len); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "Sending [ITU-T T.125] Connect-Response failed"); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* Handle all client channel join requests for a non-TLS connection * * @param self MCS structure * @param s Input stream * @param[in,out] appid Type of the MCS PDU whose header has just been read. * @return 0 for success * * For non-TLS connections, the channel join MCS PDUs are followed by * another MCS PDU. This not the case for TLS connections. * * Called when an MCS PDU header has been read, but the PDU has not * been processed. * * If the PDU is a channel join request, it is processed, and the next * PDU header is read. When we've exhausted all the channel join requests, * the type of the next PDU is passed back to the caller for the caller * to process. * * In order to cater for older clients which may not conform exactly to * the specification, we simply take all the join requests which come in, * and respond to them. * * See :- * - https://github.com/neutrinolabs/xrdp/issues/2166 * - [MS-RDPBCGR] 3.2.5.3.8 and 3.2.5.3.8 */ static int handle_non_tls_client_channel_join_requests(struct xrdp_mcs *self, struct stream *s, int *appid) { int rv = 0; while (*appid == MCS_CJRQ) { int userid; int chanid; if (!s_check_rem_and_log(s, 4, "Parsing [ITU-T T.125] " "ChannelJoinRequest")) { rv = 1; break; } in_uint16_be(s, userid); in_uint16_be(s, chanid); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [ITU-T T.125] ChannelJoinRequest " "initiator 0x%4.4x, channelId 0x%4.4x", userid, chanid); if (xrdp_mcs_send_cjcf(self, userid, chanid) != 0) { LOG(LOG_LEVEL_WARNING, "[ITU-T T.125] Channel join sequence: failed"); } /* Get the next PDU header */ s = libxrdp_force_read(self->iso_layer->trans); if (s == 0) { LOG(LOG_LEVEL_ERROR, "xrdp_mcs_recv: libxrdp_force_read failed"); rv = 1; break; } if (get_domain_mcs_pdu_header(self, s, appid) != 0) { rv = 1; break; } } return rv; } /*****************************************************************************/ /* Handle all client channel join requests for a TLS connection * * @param self MCS structure * @return 0 for success * * When were are about to negotiate a TLS connection, it is important that * we agree on the exact number of client join request / client join confirm * PDUs, so that we get the TLS 'client hello' message exactly when * expected. * * See [MS-RDPBCGR] 3.2.5.3.8 and 3.2.5.3.8 */ static int handle_tls_client_channel_join_requests(struct xrdp_mcs *self) { int index; int rv = 0; static const char *tag = "[MCS Connection Sequence (TLS)]"; /* * Expect a channel join request PDU for each of the static virtual * channels, plus the user channel (self->chanid) and the I/O channel * (MCS_GLOBAL_CHANNEL) */ for (index = 0; index < self->channel_list->count + 2; index++) { int channel_id; LOG(LOG_LEVEL_DEBUG, "%s receive channel join request", tag); if (xrdp_mcs_recv_cjrq(self, &channel_id) != 0) { LOG(LOG_LEVEL_ERROR, "%s receive channel join request failed", tag); rv = 1; break; } LOG(LOG_LEVEL_DEBUG, "%s send channel join confirm", tag); if (xrdp_mcs_send_cjcf(self, self->userid, channel_id) != 0) { LOG(LOG_LEVEL_ERROR, "%s send channel join confirm failed", tag); rv = 1; break; } } return rv; } /*****************************************************************************/ /* Process and send the MCS messages for the RDP Connection Sequence * [MS-RDPBCGR] 1.3.1.1 * * returns error */ int xrdp_mcs_incoming(struct xrdp_mcs *self) { LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] receive connection request"); if (xrdp_mcs_recv_connect_initial(self) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] receive connection request failed"); return 1; } /* in xrdp_sec.c */ if (xrdp_sec_process_mcs_data(self->sec_layer) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] Connect Initial PDU with GCC Conference Create Request failed"); return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] construct connection response"); if (xrdp_mcs_out_gcc_data(self->sec_layer) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] construct connection response failed"); return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] send connection response"); if (xrdp_mcs_send_connect_response(self) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] send connection response failed"); return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] receive erect domain request"); if (xrdp_mcs_recv_edrq(self) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] receive erect domain request failed"); return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] receive attach user request"); if (xrdp_mcs_recv_aurq(self) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] receive attach user request failed"); return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence] send attach user confirm"); if (xrdp_mcs_send_aucf(self) != 0) { LOG(LOG_LEVEL_ERROR, "[MCS Connection Sequence] send attach user confirm failed"); return 1; } if (self->iso_layer->selectedProtocol > PROTOCOL_RDP) { /* TLS connection. Client and server have to agree on MCS channel * join messages, and these have to be processed before the TLS * client hello */ if (handle_tls_client_channel_join_requests(self) != 0) { return 1; } LOG(LOG_LEVEL_DEBUG, "[MCS Connection Sequence (TLS)] completed"); } else { /* Non-TLS connection - channel joins handled in MCS PDU * processing loop */ self->expecting_channel_join_requests = 1; } return 0; } /*****************************************************************************/ /* returns error */ int xrdp_mcs_init(struct xrdp_mcs *self, struct stream *s) { xrdp_iso_init(self->iso_layer, s); s_push_layer(s, mcs_hdr, 8); return 0; } /*****************************************************************************/ /* returns error */ /* Inform the callback that an mcs packet has been sent. This is needed so the module can send any high priority mcs packets like audio. */ static int xrdp_mcs_call_callback(struct xrdp_mcs *self) { int rv; struct xrdp_session *session; rv = 0; /* if there is a callback, call it here */ session = self->sec_layer->rdp_layer->session; if (session != 0) { if (session->callback != 0) { if (session->check_for_app_input) { /* in xrdp_wm.c */ rv = session->callback(session->id, 0x5556, 0, 0, 0, 0); } } else { LOG_DEVEL(LOG_LEVEL_WARNING, "session->callback is NULL"); } } else { LOG_DEVEL(LOG_LEVEL_WARNING, "session is NULL"); } return rv; } /*****************************************************************************/ /* Send a [ITU-T T.125] SendDataIndication message * returns error */ int xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan) { int len; char *lp; //static int max_len = 0; s_pop_layer(s, mcs_hdr); len = (s->end - s->p) - 8; if (len > 8192 * 2) { LOG(LOG_LEVEL_WARNING, "xrdp_mcs_send: stream size too big: %d bytes", len); } /* The DomainMCSPDU choice index is a 6-bit int with the 2 least significant bits of the byte as padding */ out_uint8(s, MCS_SDIN << 2); /* DomainMCSPDU choice index */ out_uint16_be(s, self->userid); /* initiator */ out_uint16_be(s, chan); /* channelId */ out_uint8(s, 0x70); /* dataPriority (upper 2 bits), segmentation (next 2 bits), padding (4 bits) */ if (len >= 128) { len = len | 0x8000; out_uint16_be(s, len); /* userData length */ } else { out_uint8(s, len); /* userData length */ /* move everything up one byte */ lp = s->p; while (lp < s->end) { lp[0] = lp[1]; lp++; } s->end--; } LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [ITU-T T.125] SendDataIndication " "initiator %d, channelId %d, dataPriority %d, segmentation 0x0, " "userData length %d", self->userid, chan, 0x70 >> 6, (0x70 >> 4) & 0x03); if (xrdp_iso_send(self->iso_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_mcs_send: xrdp_iso_send failed"); return 1; } /* todo, do we need to call this for every mcs packet, maybe every 5 or so */ if (chan == MCS_GLOBAL_CHANNEL) { xrdp_mcs_call_callback(self); } return 0; } /** * Internal help function to close the socket * @param self */ void close_rdp_socket(struct xrdp_mcs *self) { if (self->iso_layer != 0) { if (self->iso_layer->trans != 0) { trans_shutdown_tls_mode(self->iso_layer->trans); g_tcp_close(self->iso_layer->trans->sck); self->iso_layer->trans->sck = -1; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_mcs_disconnect - socket closed"); return; } } LOG_DEVEL(LOG_LEVEL_WARNING, "Failed to close socket"); } /*****************************************************************************/ /* returns error */ int xrdp_mcs_disconnect(struct xrdp_mcs *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_iso_init(self->iso_layer, s) != 0) { free_stream(s); close_rdp_socket(self); LOG(LOG_LEVEL_ERROR, "xrdp_mcs_disconnect: xrdp_iso_init failed"); return 1; } out_uint8(s, (MCS_DPUM << 2) | 1); out_uint8(s, 0x80); /* reason (upper 3 bits) (4 = rn-channel-purged)*/ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [ITU T.125] DisconnectProviderUltimatum " "reason %d", 0x80 >> 5); if (xrdp_iso_send(self->iso_layer, s) != 0) { free_stream(s); close_rdp_socket(self); LOG(LOG_LEVEL_ERROR, "Sending [ITU T.125] DisconnectProviderUltimatum failed"); return 1; } free_stream(s); close_rdp_socket(self); return 0; } xrdp-0.10.1/libxrdp/xrdp_orders.c000644 001751 000000 00000247167 14652432047 017021 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * orders */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "ms-rdpegdi.h" #if defined(XRDP_NEUTRINORDP) #include #endif #define MAX_ORDERS_SIZE(_client_info) \ (MAX((_client_info)->max_fastpath_frag_bytes, 16 * 1024) - 256); /*****************************************************************************/ struct xrdp_orders * xrdp_orders_create(struct xrdp_session *session, struct xrdp_rdp *rdp_layer) { struct xrdp_orders *self; self = (struct xrdp_orders *)g_malloc(sizeof(struct xrdp_orders), 1); self->session = session; self->rdp_layer = rdp_layer; make_stream(self->out_s); init_stream(self->out_s, 32 * 1024); self->orders_state.clip_right = 1; /* silly rdp right clip */ self->orders_state.clip_bottom = 1; /* silly rdp bottom clip */ self->jpeg_han = xrdp_jpeg_init(); self->rfx_min_pixel = rdp_layer->client_info.rfx_min_pixel; if (self->rfx_min_pixel == 0) { self->rfx_min_pixel = 64 * 32; } make_stream(self->s); make_stream(self->temp_s); return self; } /*****************************************************************************/ void xrdp_orders_delete(struct xrdp_orders *self) { if (self == 0) { return; } xrdp_jpeg_deinit(self->jpeg_han); free_stream(self->out_s); free_stream(self->s); free_stream(self->temp_s); g_free(self->orders_state.text_data); g_free(self); } /*****************************************************************************/ /* set all values to zero */ /* returns error */ int xrdp_orders_reset(struct xrdp_orders *self) { if (xrdp_orders_force_send(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_reset: xrdp_orders_force_send failed"); return 1; } g_free(self->orders_state.text_data); g_memset(&(self->orders_state), 0, sizeof(self->orders_state)); self->order_count_ptr = 0; self->order_count = 0; self->order_level = 0; self->orders_state.clip_right = 1; /* silly rdp right clip */ self->orders_state.clip_bottom = 1; /* silly rdp bottom clip */ return 0; } /*****************************************************************************/ /* returns error */ int xrdp_orders_init(struct xrdp_orders *self) { self->order_level++; if (self->order_level == 1) { self->order_count = 0; if (self->rdp_layer->client_info.use_fast_path & 1) { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_orders_init: fastpath"); if (xrdp_rdp_init_fastpath(self->rdp_layer, self->out_s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_init: xrdp_rdp_init_fastpath failed"); return 1; } self->order_count_ptr = self->out_s->p; out_uint8s(self->out_s, 2); /* number of orders, set later */ // LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] TODO"); } else { if (xrdp_rdp_init_data(self->rdp_layer, self->out_s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_init: xrdp_rdp_init_data failed"); return 1; } out_uint16_le(self->out_s, RDP_UPDATE_ORDERS); /* updateType */ out_uint8s(self->out_s, 2); /* pad */ self->order_count_ptr = self->out_s->p; out_uint8s(self->out_s, 2); /* number of orders, set later */ out_uint8s(self->out_s, 2); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] TS_UPDATE_ORDERS_PDU_DATA " "updateType %d (UPDATETYPE_ORDERS), pad2OctetsA , " "numberOrders , pad2OctetsB ", RDP_UPDATE_ORDERS); } } return 0; } /*****************************************************************************/ /* returns error */ int xrdp_orders_send(struct xrdp_orders *self) { int rv; rv = 0; if (self->order_level > 0) { self->order_level--; if ((self->order_level == 0) && (self->order_count > 0)) { s_mark_end(self->out_s); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_orders_send sending %d orders", self->order_count); self->order_count_ptr[0] = self->order_count; self->order_count_ptr[1] = self->order_count >> 8; self->order_count = 0; if (self->rdp_layer->client_info.use_fast_path & 1) { if (xrdp_rdp_send_fastpath(self->rdp_layer, self->out_s, 0) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send: xrdp_rdp_send_fastpath failed"); rv = 1; } } else { if (xrdp_rdp_send_data(self->rdp_layer, self->out_s, RDP_DATA_PDU_UPDATE) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send: xrdp_rdp_send_data failed"); rv = 1; } } } } return rv; } /*****************************************************************************/ /* returns error */ int xrdp_orders_force_send(struct xrdp_orders *self) { if (self == 0) { return 1; } if ((self->order_level > 0) && (self->order_count > 0)) { s_mark_end(self->out_s); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_orders_force_send sending %d orders", self->order_count); self->order_count_ptr[0] = self->order_count; self->order_count_ptr[1] = self->order_count >> 8; if (self->rdp_layer->client_info.use_fast_path & 1) { if (xrdp_rdp_send_fastpath(self->rdp_layer, self->out_s, FASTPATH_UPDATETYPE_ORDERS) != 0) { return 1; } } else { if (xrdp_rdp_send_data(self->rdp_layer, self->out_s, RDP_DATA_PDU_UPDATE) != 0) { return 1; } } } self->order_count = 0; self->order_level = 0; return 0; } /*****************************************************************************/ /* check if the current order will fit in packet size of 16384, if not */ /* send what we got and init a new one */ /* returns error */ int xrdp_orders_check(struct xrdp_orders *self, int max_size) { int size; int max_order_size; struct xrdp_client_info *ci; ci = &(self->rdp_layer->client_info); max_order_size = MAX_ORDERS_SIZE(ci); if (self->order_level < 1) { if (max_size > max_order_size) { LOG(LOG_LEVEL_ERROR, "Requested orders max_size (%d) " "is greater than the client connection max_size (%d)", max_size, max_order_size); return 1; } else { xrdp_orders_init(self); return 0; } } size = (int)(self->out_s->p - self->order_count_ptr); if (size < 0) { LOG(LOG_LEVEL_ERROR, "Bug: order data length cannot be negative. " "Found length %d bytes", size); return 1; } if (size > max_order_size) { /* this suggests someone calls this function without passing the correct max_size so we end up putting more into the buffer than we indicate we can */ LOG(LOG_LEVEL_WARNING, "Ignoring Bug: order data length " "is larger than maximum length. Expected %d, actual %d", max_order_size, size); /* We where getting called with size already greater than max_order_size Which I suspect was because the sending of text did not include the text len to check the buffer size. So attempt to send the data anyway. Lets write the data anyway, somewhere else may barf. */ /* return 1; */ } if ((size + max_size + 100) > max_order_size) { xrdp_orders_force_send(self); xrdp_orders_init(self); } return 0; } /*****************************************************************************/ /* check if rect is the same as the last one sent */ /* returns boolean */ static int xrdp_orders_last_bounds(struct xrdp_orders *self, struct xrdp_rect *rect) { if (rect == 0) { return 0; } if ((rect->left == self->orders_state.clip_left) && (rect->top == self->orders_state.clip_top) && (rect->right == self->orders_state.clip_right) && (rect->bottom == self->orders_state.clip_bottom)) { return 1; } return 0; } /*****************************************************************************/ /* check if all coords are within 256 bytes */ /* returns boolean */ static int xrdp_orders_send_delta(struct xrdp_orders *self, int *vals, int count) { int i; for (i = 0; i < count; i += 2) { if (g_abs(vals[i] - vals[i + 1]) >= 128) { return 0; } } return 1; } /*****************************************************************************/ /* returns error */ static int xrdp_orders_out_bounds(struct xrdp_orders *self, struct xrdp_rect *rect) { char *bounds_flags_ptr; int bounds_flags; bounds_flags = 0; bounds_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); /* left */ if (rect->left == self->orders_state.clip_left) { } else if (g_abs(rect->left - self->orders_state.clip_left) < 128) { bounds_flags |= 0x10; } else { bounds_flags |= 0x01; } /* top */ if (rect->top == self->orders_state.clip_top) { } else if (g_abs(rect->top - self->orders_state.clip_top) < 128) { bounds_flags |= 0x20; } else { bounds_flags |= 0x02; } /* right */ if (rect->right == self->orders_state.clip_right) { } else if (g_abs(rect->right - self->orders_state.clip_right) < 128) { bounds_flags |= 0x40; } else { bounds_flags |= 0x04; } /* bottom */ if (rect->bottom == self->orders_state.clip_bottom) { } else if (g_abs(rect->bottom - self->orders_state.clip_bottom) < 128) { bounds_flags |= 0x80; } else { bounds_flags |= 0x08; } /* left */ if (bounds_flags & 0x01) { out_uint16_le(self->out_s, rect->left); } else if (bounds_flags & 0x10) { out_uint8(self->out_s, rect->left - self->orders_state.clip_left); } self->orders_state.clip_left = rect->left; /* top */ if (bounds_flags & 0x02) { out_uint16_le(self->out_s, rect->top); } else if (bounds_flags & 0x20) { out_uint8(self->out_s, rect->top - self->orders_state.clip_top); } self->orders_state.clip_top = rect->top; /* right */ if (bounds_flags & 0x04) { /* silly rdp right clip */ out_uint16_le(self->out_s, rect->right - 1); } else if (bounds_flags & 0x40) { out_uint8(self->out_s, rect->right - self->orders_state.clip_right); } self->orders_state.clip_right = rect->right; /* bottom */ if (bounds_flags & 0x08) { /* silly rdp bottom clip */ out_uint16_le(self->out_s, rect->bottom - 1); } else if (bounds_flags & 0x80) { out_uint8(self->out_s, rect->bottom - self->orders_state.clip_bottom); } self->orders_state.clip_bottom = rect->bottom; /* set flags */ *bounds_flags_ptr = bounds_flags; return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_order_pack_small_or_tiny(struct xrdp_orders *self, char *order_flags_ptr, int orders_flags, char *present_ptr, int present, int present_size) { int move_up_count = 0; int index = 0; int size = 0; int keep_looking = 1; move_up_count = 0; keep_looking = 1; for (index = present_size - 1; index >= 0; index--) { if (keep_looking) { if (((present >> (index * 8)) & 0xff) == 0) { move_up_count++; } else { keep_looking = 0; } } present_ptr[index] = present >> (index * 8); } if (move_up_count > 0) { /* move_up_count should be 0, 1, 2, or 3 shifting it 6 will make it RDP_ORDER_TINY(0x80) or RDP_ORDER_SMALL(0x40) or both */ orders_flags |= move_up_count << 6; size = (int)(self->out_s->p - present_ptr); size -= present_size; for (index = 0; index < size; index++) { present_ptr[index + (present_size - move_up_count)] = present_ptr[index + present_size]; } self->out_s->p -= move_up_count; } order_flags_ptr[0] = orders_flags; return 0; } /*****************************************************************************/ /* returns error */ /* send a solid rect to client */ /* max size 23 */ int xrdp_orders_rect(struct xrdp_orders *self, int x, int y, int cx, int cy, int color, struct xrdp_rect *rect) { int order_flags; int vals[8]; int present; char *present_ptr; char *order_flags_ptr; if (xrdp_orders_check(self, 23) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_RECT) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_RECT; if (rect != 0) { /* if clip is present, still check if it's needed */ if (x < rect->left || y < rect->top || x + cx > rect->right || y + cy > rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = x; vals[1] = self->orders_state.rect_x; vals[2] = y; vals[3] = self->orders_state.rect_y; vals[4] = cx; vals[5] = self->orders_state.rect_cx; vals[6] = cy; vals[7] = self->orders_state.rect_cy; if (xrdp_orders_send_delta(self, vals, 8)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 1 byte */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (x != self->orders_state.rect_x) { present |= 0x01; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, x - self->orders_state.rect_x); } else { out_uint16_le(self->out_s, x); } self->orders_state.rect_x = x; } if (y != self->orders_state.rect_y) { present |= 0x02; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, y - self->orders_state.rect_y); } else { out_uint16_le(self->out_s, y); } self->orders_state.rect_y = y; } if (cx != self->orders_state.rect_cx) { present |= 0x04; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cx - self->orders_state.rect_cx); } else { out_uint16_le(self->out_s, cx); } self->orders_state.rect_cx = cx; } if (cy != self->orders_state.rect_cy) { present |= 0x08; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cy - self->orders_state.rect_cy); } else { out_uint16_le(self->out_s, cy); } self->orders_state.rect_cy = cy; } if ((color & 0xff) != (self->orders_state.rect_color & 0xff)) { present |= 0x10; self->orders_state.rect_color = (self->orders_state.rect_color & 0xffff00) | (color & 0xff); out_uint8(self->out_s, color); } if ((color & 0xff00) != (self->orders_state.rect_color & 0xff00)) { present |= 0x20; self->orders_state.rect_color = (self->orders_state.rect_color & 0xff00ff) | (color & 0xff00); out_uint8(self->out_s, color >> 8); } if ((color & 0xff0000) != (self->orders_state.rect_color & 0xff0000)) { present |= 0x40; self->orders_state.rect_color = (self->orders_state.rect_color & 0x00ffff) | (color & 0xff0000); out_uint8(self->out_s, color >> 16); } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 1); return 0; } /*****************************************************************************/ /* returns error */ /* send a screen blt order */ /* max size 25 */ int xrdp_orders_screen_blt(struct xrdp_orders *self, int x, int y, int cx, int cy, int srcx, int srcy, int rop, struct xrdp_rect *rect) { int order_flags = 0; int vals[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int present = 0; char *present_ptr = (char *)NULL; char *order_flags_ptr = (char *)NULL; if (xrdp_orders_check(self, 25) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_SCREENBLT) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_SCREENBLT; if (rect != 0) { /* if clip is present, still check if it's needed */ if (x < rect->left || y < rect->top || x + cx > rect->right || y + cy > rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = x; vals[1] = self->orders_state.scr_blt_x; vals[2] = y; vals[3] = self->orders_state.scr_blt_y; vals[4] = cx; vals[5] = self->orders_state.scr_blt_cx; vals[6] = cy; vals[7] = self->orders_state.scr_blt_cy; vals[8] = srcx; vals[9] = self->orders_state.scr_blt_srcx; vals[10] = srcy; vals[11] = self->orders_state.scr_blt_srcy; if (xrdp_orders_send_delta(self, vals, 12)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 1 byte */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (x != self->orders_state.scr_blt_x) { present |= 0x01; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, x - self->orders_state.scr_blt_x); } else { out_uint16_le(self->out_s, x); } self->orders_state.scr_blt_x = x; } if (y != self->orders_state.scr_blt_y) { present |= 0x02; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, y - self->orders_state.scr_blt_y); } else { out_uint16_le(self->out_s, y); } self->orders_state.scr_blt_y = y; } if (cx != self->orders_state.scr_blt_cx) { present |= 0x04; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cx - self->orders_state.scr_blt_cx); } else { out_uint16_le(self->out_s, cx); } self->orders_state.scr_blt_cx = cx; } if (cy != self->orders_state.scr_blt_cy) { present |= 0x08; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cy - self->orders_state.scr_blt_cy); } else { out_uint16_le(self->out_s, cy); } self->orders_state.scr_blt_cy = cy; } if (rop != self->orders_state.scr_blt_rop) { present |= 0x10; out_uint8(self->out_s, rop); self->orders_state.scr_blt_rop = rop; } if (srcx != self->orders_state.scr_blt_srcx) { present |= 0x20; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcx - self->orders_state.scr_blt_srcx); } else { out_uint16_le(self->out_s, srcx); } self->orders_state.scr_blt_srcx = srcx; } if (srcy != self->orders_state.scr_blt_srcy) { present |= 0x40; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcy - self->orders_state.scr_blt_srcy); } else { out_uint16_le(self->out_s, srcy); } self->orders_state.scr_blt_srcy = srcy; } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 1); return 0; } /*****************************************************************************/ /* returns error */ /* send a pat blt order */ /* max size 39 */ int xrdp_orders_pat_blt(struct xrdp_orders *self, int x, int y, int cx, int cy, int rop, int bg_color, int fg_color, struct xrdp_brush *brush, struct xrdp_rect *rect) { int order_flags; int present; int vals[8]; char *present_ptr; char *order_flags_ptr; struct xrdp_brush blank_brush; if (xrdp_orders_check(self, 39) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_PATBLT) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_PATBLT; if (rect != 0) { /* if clip is present, still check if it's needed */ if (x < rect->left || y < rect->top || x + cx > rect->right || y + cy > rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = x; vals[1] = self->orders_state.pat_blt_x; vals[2] = y; vals[3] = self->orders_state.pat_blt_y; vals[4] = cx; vals[5] = self->orders_state.pat_blt_cx; vals[6] = cy; vals[7] = self->orders_state.pat_blt_cy; if (xrdp_orders_send_delta(self, vals, 8)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 2 bytes */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 2); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (x != self->orders_state.pat_blt_x) { present |= 0x0001; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, x - self->orders_state.pat_blt_x); } else { out_uint16_le(self->out_s, x); } self->orders_state.pat_blt_x = x; } if (y != self->orders_state.pat_blt_y) { present |= 0x0002; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, y - self->orders_state.pat_blt_y); } else { out_uint16_le(self->out_s, y); } self->orders_state.pat_blt_y = y; } if (cx != self->orders_state.pat_blt_cx) { present |= 0x0004; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cx - self->orders_state.pat_blt_cx); } else { out_uint16_le(self->out_s, cx); } self->orders_state.pat_blt_cx = cx; } if (cy != self->orders_state.pat_blt_cy) { present |= 0x0008; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cy - self->orders_state.pat_blt_cy); } else { out_uint16_le(self->out_s, cy); } self->orders_state.pat_blt_cy = cy; } if (rop != self->orders_state.pat_blt_rop) { present |= 0x0010; /* PATCOPY PATPAINT PATINVERT DSTINVERT BLACKNESS WHITENESS */ out_uint8(self->out_s, rop); self->orders_state.pat_blt_rop = rop; } if (bg_color != self->orders_state.pat_blt_bg_color) { present |= 0x0020; out_uint8(self->out_s, bg_color); out_uint8(self->out_s, bg_color >> 8); out_uint8(self->out_s, bg_color >> 16); self->orders_state.pat_blt_bg_color = bg_color; } if (fg_color != self->orders_state.pat_blt_fg_color) { present |= 0x0040; out_uint8(self->out_s, fg_color); out_uint8(self->out_s, fg_color >> 8); out_uint8(self->out_s, fg_color >> 16); self->orders_state.pat_blt_fg_color = fg_color; } if (brush == 0) /* if nil use blank one */ { /* todo can we just set style to zero */ g_memset(&blank_brush, 0, sizeof(struct xrdp_brush)); brush = &blank_brush; } if (brush->x_origin != self->orders_state.pat_blt_brush.x_origin) { present |= 0x0080; out_uint8(self->out_s, brush->x_origin); self->orders_state.pat_blt_brush.x_origin = brush->x_origin; } if (brush->y_origin != self->orders_state.pat_blt_brush.y_origin) { present |= 0x0100; out_uint8(self->out_s, brush->y_origin); self->orders_state.pat_blt_brush.y_origin = brush->y_origin; } if (brush->style != self->orders_state.pat_blt_brush.style) { present |= 0x0200; out_uint8(self->out_s, brush->style); self->orders_state.pat_blt_brush.style = brush->style; } if (brush->pattern[0] != self->orders_state.pat_blt_brush.pattern[0]) { present |= 0x0400; out_uint8(self->out_s, brush->pattern[0]); self->orders_state.pat_blt_brush.pattern[0] = brush->pattern[0]; } if (g_memcmp(brush->pattern + 1, self->orders_state.pat_blt_brush.pattern + 1, 7) != 0) { present |= 0x0800; out_uint8a(self->out_s, brush->pattern + 1, 7); g_memcpy(self->orders_state.pat_blt_brush.pattern + 1, brush->pattern + 1, 7); } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 2); return 0; } /*****************************************************************************/ /* returns error */ /* send a dest blt order */ /* max size 21 */ int xrdp_orders_dest_blt(struct xrdp_orders *self, int x, int y, int cx, int cy, int rop, struct xrdp_rect *rect) { int order_flags; int vals[8]; int present; char *present_ptr; char *order_flags_ptr; if (xrdp_orders_check(self, 21) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_DESTBLT) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_DESTBLT; if (rect != 0) { /* if clip is present, still check if it's needed */ if (x < rect->left || y < rect->top || x + cx > rect->right || y + cy > rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = x; vals[1] = self->orders_state.dest_blt_x; vals[2] = y; vals[3] = self->orders_state.dest_blt_y; vals[4] = cx; vals[5] = self->orders_state.dest_blt_cx; vals[6] = cy; vals[7] = self->orders_state.dest_blt_cy; if (xrdp_orders_send_delta(self, vals, 8)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 1 byte */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (x != self->orders_state.dest_blt_x) { present |= 0x01; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, x - self->orders_state.dest_blt_x); } else { out_uint16_le(self->out_s, x); } self->orders_state.dest_blt_x = x; } if (y != self->orders_state.dest_blt_y) { present |= 0x02; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, y - self->orders_state.dest_blt_y); } else { out_uint16_le(self->out_s, y); } self->orders_state.dest_blt_y = y; } if (cx != self->orders_state.dest_blt_cx) { present |= 0x04; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cx - self->orders_state.dest_blt_cx); } else { out_uint16_le(self->out_s, cx); } self->orders_state.dest_blt_cx = cx; } if (cy != self->orders_state.dest_blt_cy) { present |= 0x08; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cy - self->orders_state.dest_blt_cy); } else { out_uint16_le(self->out_s, cy); } self->orders_state.dest_blt_cy = cy; } if (rop != self->orders_state.dest_blt_rop) { present |= 0x10; out_uint8(self->out_s, rop); self->orders_state.dest_blt_rop = rop; } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 1); return 0; } /*****************************************************************************/ /* returns error */ /* send a line order */ /* max size 32 */ int xrdp_orders_line(struct xrdp_orders *self, int mix_mode, int startx, int starty, int endx, int endy, int rop, int bg_color, struct xrdp_pen *pen, struct xrdp_rect *rect) { int order_flags = 0; int vals[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int present = 0; char *present_ptr = (char *)NULL; char *order_flags_ptr = (char *)NULL; struct xrdp_pen blank_pen; g_memset(&blank_pen, 0, sizeof(struct xrdp_pen)); /* if mix mode or rop are out of range, mstsc build 6000+ will parse the orders wrong */ if ((mix_mode < 1) || (mix_mode > 2)) /* TRANSPARENT(1) or OPAQUE(2) */ { mix_mode = 1; } if ((rop < 1) || (rop > 0x10)) { rop = 0x0d; /* R2_COPYPEN */ } if (xrdp_orders_check(self, 32) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_LINE) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_LINE; if (rect != 0) { /* if clip is present, still check if it's needed */ if (MIN(endx, startx) < rect->left || MIN(endy, starty) < rect->top || MAX(endx, startx) >= rect->right || MAX(endy, starty) >= rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = startx; vals[1] = self->orders_state.line_startx; vals[2] = starty; vals[3] = self->orders_state.line_starty; vals[4] = endx; vals[5] = self->orders_state.line_endx; vals[6] = endy; vals[7] = self->orders_state.line_endy; if (xrdp_orders_send_delta(self, vals, 8)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 2 bytes */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 2); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (mix_mode != self->orders_state.line_mix_mode) { present |= 0x0001; out_uint16_le(self->out_s, mix_mode); self->orders_state.line_mix_mode = mix_mode; } if (startx != self->orders_state.line_startx) { present |= 0x0002; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, startx - self->orders_state.line_startx); } else { out_uint16_le(self->out_s, startx); } self->orders_state.line_startx = startx; } if (starty != self->orders_state.line_starty) { present |= 0x0004; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, starty - self->orders_state.line_starty); } else { out_uint16_le(self->out_s, starty); } self->orders_state.line_starty = starty; } if (endx != self->orders_state.line_endx) { present |= 0x0008; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, endx - self->orders_state.line_endx); } else { out_uint16_le(self->out_s, endx); } self->orders_state.line_endx = endx; } if (endy != self->orders_state.line_endy) { present |= 0x0010; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, endy - self->orders_state.line_endy); } else { out_uint16_le(self->out_s, endy); } self->orders_state.line_endy = endy; } if (bg_color != self->orders_state.line_bg_color) { present |= 0x0020; out_uint8(self->out_s, bg_color); out_uint8(self->out_s, bg_color >> 8); out_uint8(self->out_s, bg_color >> 16); self->orders_state.line_bg_color = bg_color; } if (rop != self->orders_state.line_rop) { present |= 0x0040; out_uint8(self->out_s, rop); self->orders_state.line_rop = rop; } if (pen == 0) { g_memset(&blank_pen, 0, sizeof(struct xrdp_pen)); pen = &blank_pen; } if (pen->style != self->orders_state.line_pen.style) { present |= 0x0080; out_uint8(self->out_s, pen->style); self->orders_state.line_pen.style = pen->style; } if (pen->width != self->orders_state.line_pen.width) { present |= 0x0100; out_uint8(self->out_s, pen->width); self->orders_state.line_pen.width = pen->width; } if (pen->color != self->orders_state.line_pen.color) { present |= 0x0200; out_uint8(self->out_s, pen->color); out_uint8(self->out_s, pen->color >> 8); out_uint8(self->out_s, pen->color >> 16); self->orders_state.line_pen.color = pen->color; } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 2); return 0; } /*****************************************************************************/ /* returns error */ /* send a mem blt order */ /* max size 30 */ int xrdp_orders_mem_blt(struct xrdp_orders *self, int cache_id, int color_table, int x, int y, int cx, int cy, int rop, int srcx, int srcy, int cache_idx, struct xrdp_rect *rect) { int order_flags = 0; int vals[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int present = 0; char *present_ptr = (char *)NULL; char *order_flags_ptr = (char *)NULL; if (xrdp_orders_check(self, 30) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_MEMBLT) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_MEMBLT; if (rect != 0) { /* if clip is present, still check if it's needed */ if (x < rect->left || y < rect->top || x + cx > rect->right || y + cy > rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = x; vals[1] = self->orders_state.mem_blt_x; vals[2] = y; vals[3] = self->orders_state.mem_blt_y; vals[4] = cx; vals[5] = self->orders_state.mem_blt_cx; vals[6] = cy; vals[7] = self->orders_state.mem_blt_cy; vals[8] = srcx; vals[9] = self->orders_state.mem_blt_srcx; vals[10] = srcy; vals[11] = self->orders_state.mem_blt_srcy; if (xrdp_orders_send_delta(self, vals, 12)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 2 bytes */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 2); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (cache_id != self->orders_state.mem_blt_cache_id || color_table != self->orders_state.mem_blt_color_table) { present |= 0x0001; out_uint8(self->out_s, cache_id); out_uint8(self->out_s, color_table); self->orders_state.mem_blt_cache_id = cache_id; self->orders_state.mem_blt_color_table = color_table; } if (x != self->orders_state.mem_blt_x) { present |= 0x0002; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, x - self->orders_state.mem_blt_x); } else { out_uint16_le(self->out_s, x); } self->orders_state.mem_blt_x = x; } if (y != self->orders_state.mem_blt_y) { present |= 0x0004; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, y - self->orders_state.mem_blt_y); } else { out_uint16_le(self->out_s, y); } self->orders_state.mem_blt_y = y; } if (cx != self->orders_state.mem_blt_cx) { present |= 0x0008; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cx - self->orders_state.mem_blt_cx); } else { out_uint16_le(self->out_s, cx); } self->orders_state.mem_blt_cx = cx; } if (cy != self->orders_state.mem_blt_cy) { present |= 0x0010; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, cy - self->orders_state.mem_blt_cy); } else { out_uint16_le(self->out_s, cy); } self->orders_state.mem_blt_cy = cy; } if (rop != self->orders_state.mem_blt_rop) { present |= 0x0020; out_uint8(self->out_s, rop); self->orders_state.mem_blt_rop = rop; } if (srcx != self->orders_state.mem_blt_srcx) { present |= 0x0040; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcx - self->orders_state.mem_blt_srcx); } else { out_uint16_le(self->out_s, srcx); } self->orders_state.mem_blt_srcx = srcx; } if (srcy != self->orders_state.mem_blt_srcy) { present |= 0x0080; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcy - self->orders_state.mem_blt_srcy); } else { out_uint16_le(self->out_s, srcy); } self->orders_state.mem_blt_srcy = srcy; } if (cache_idx != self->orders_state.mem_blt_cache_idx) { present |= 0x0100; out_uint16_le(self->out_s, cache_idx); self->orders_state.mem_blt_cache_idx = cache_idx; } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 2); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_orders_composite_blt(struct xrdp_orders *self, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat, struct xrdp_rect *rect) { int order_flags; int vals[20]; int present; char *present_ptr; char *order_flags_ptr; if (xrdp_orders_check(self, 80) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_COMPOSITE) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_COMPOSITE; if (rect != 0) { /* if clip is present, still check if it's needed */ if (dstx < rect->left || dsty < rect->top || dstx + width > rect->right || dsty + height > rect->bottom) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } vals[0] = srcx; vals[1] = self->orders_state.com_blt_srcx; vals[2] = srcy; vals[3] = self->orders_state.com_blt_srcy; vals[4] = mskx; vals[5] = self->orders_state.com_blt_mskx; vals[6] = msky; vals[7] = self->orders_state.com_blt_msky; vals[8] = dstx; vals[9] = self->orders_state.com_blt_dstx; vals[10] = dsty; vals[11] = self->orders_state.com_blt_dsty; vals[12] = width; vals[13] = self->orders_state.com_blt_width; vals[14] = height; vals[15] = self->orders_state.com_blt_height; vals[16] = srcwidth; vals[17] = self->orders_state.com_blt_srcwidth; vals[18] = mskwidth; vals[19] = self->orders_state.com_blt_mskwidth; if (xrdp_orders_send_delta(self, vals, 20)) { order_flags |= TS_DELTA_COORDINATES; } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 3 bytes */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 3); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (srcidx != self->orders_state.com_blt_srcidx) { present |= 0x000001; out_uint16_le(self->out_s, srcidx); self->orders_state.com_blt_srcidx = srcidx; } if (srcformat != self->orders_state.com_blt_srcformat) { present |= 0x000002; out_uint32_le(self->out_s, srcformat); self->orders_state.com_blt_srcformat = srcformat; } if (srcwidth != self->orders_state.com_blt_srcwidth) { present |= 0x000004; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcwidth - self->orders_state.com_blt_srcwidth); } else { out_uint16_le(self->out_s, srcwidth); } self->orders_state.com_blt_srcwidth = srcwidth; } if (srcrepeat != self->orders_state.com_blt_srcrepeat) { present |= 0x000008; out_uint8(self->out_s, srcrepeat); self->orders_state.com_blt_srcrepeat = srcrepeat; } if (srctransform != 0) { if (srctransform[0] != self->orders_state.com_blt_srctransform[0]) { present |= 0x000010; out_uint32_le(self->out_s, srctransform[0]); self->orders_state.com_blt_srctransform[0] = srctransform[0]; } if (g_memcmp(&(srctransform[1]), &(self->orders_state.com_blt_srctransform[1]), 36) != 0) { present |= 0x000020; out_uint32_le(self->out_s, srctransform[1]); out_uint32_le(self->out_s, srctransform[2]); out_uint32_le(self->out_s, srctransform[3]); out_uint32_le(self->out_s, srctransform[4]); out_uint32_le(self->out_s, srctransform[5]); out_uint32_le(self->out_s, srctransform[6]); out_uint32_le(self->out_s, srctransform[7]); out_uint32_le(self->out_s, srctransform[8]); out_uint32_le(self->out_s, srctransform[9]); } } else { if (self->orders_state.com_blt_srctransform[0] != 0) { present |= 0x000010; out_uint32_le(self->out_s, 0); self->orders_state.com_blt_srctransform[0] = 0; } } if (mskflags != self->orders_state.com_blt_mskflags) { present |= 0x000040; out_uint8(self->out_s, mskflags); self->orders_state.com_blt_mskflags = mskflags; } if (mskidx != self->orders_state.com_blt_mskidx) { present |= 0x000080; out_uint16_le(self->out_s, mskidx); self->orders_state.com_blt_mskidx = mskidx; } if (mskformat != self->orders_state.com_blt_mskformat) { present |= 0x000100; out_uint32_le(self->out_s, mskformat); self->orders_state.com_blt_mskformat = mskformat; } if (mskwidth != self->orders_state.com_blt_mskwidth) { present |= 0x000200; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, mskwidth - self->orders_state.com_blt_mskwidth); } else { out_uint16_le(self->out_s, mskwidth); } self->orders_state.com_blt_mskwidth = mskwidth; } if (mskrepeat != self->orders_state.com_blt_mskrepeat) { present |= 0x000400; out_uint8(self->out_s, mskrepeat); self->orders_state.com_blt_mskrepeat = mskrepeat; } if (op != self->orders_state.com_blt_op) { present |= 0x000800; out_uint8(self->out_s, op); self->orders_state.com_blt_op = op; } if (srcx != self->orders_state.com_blt_srcx) { present |= 0x001000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcx - self->orders_state.com_blt_srcx); } else { out_uint16_le(self->out_s, srcx); } self->orders_state.com_blt_srcx = srcx; } if (srcy != self->orders_state.com_blt_srcy) { present |= 0x002000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, srcy - self->orders_state.com_blt_srcy); } else { out_uint16_le(self->out_s, srcy); } self->orders_state.com_blt_srcy = srcy; } if (mskx != self->orders_state.com_blt_mskx) { present |= 0x004000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, mskx - self->orders_state.com_blt_mskx); } else { out_uint16_le(self->out_s, mskx); } self->orders_state.com_blt_mskx = mskx; } if (msky != self->orders_state.com_blt_msky) { present |= 0x008000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, msky - self->orders_state.com_blt_msky); } else { out_uint16_le(self->out_s, msky); } self->orders_state.com_blt_msky = msky; } if (dstx != self->orders_state.com_blt_dstx) { present |= 0x010000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, dstx - self->orders_state.com_blt_dstx); } else { out_uint16_le(self->out_s, dstx); } self->orders_state.com_blt_dstx = dstx; } if (dsty != self->orders_state.com_blt_dsty) { present |= 0x020000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, dsty - self->orders_state.com_blt_dsty); } else { out_uint16_le(self->out_s, dsty); } self->orders_state.com_blt_dsty = dsty; } if (width != self->orders_state.com_blt_width) { present |= 0x040000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, width - self->orders_state.com_blt_width); } else { out_uint16_le(self->out_s, width); } self->orders_state.com_blt_width = width; } if (height != self->orders_state.com_blt_height) { present |= 0x080000; if (order_flags & TS_DELTA_COORDINATES) { out_uint8(self->out_s, height - self->orders_state.com_blt_height); } else { out_uint16_le(self->out_s, height); } self->orders_state.com_blt_height = height; } if (dstformat != self->orders_state.com_blt_dstformat) { present |= 0x100000; out_uint32_le(self->out_s, dstformat); self->orders_state.com_blt_dstformat = dstformat; } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 3); return 0; } /*****************************************************************************/ /* returns error */ int xrdp_orders_text(struct xrdp_orders *self, int font, int flags, int mixmode, int fg_color, int bg_color, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len, struct xrdp_rect *rect) { int order_flags = 0; int present = 0; char *present_ptr = (char *)NULL; char *order_flags_ptr = (char *)NULL; if (xrdp_orders_check(self, 44 + data_len) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD; if (self->orders_state.last_order != RDP_ORDER_TEXT2) { order_flags |= TS_TYPE_CHANGE; } self->orders_state.last_order = RDP_ORDER_TEXT2; if (rect != 0) { /* if clip is present, still check if it's needed */ if ((box_right - box_left > 1 && (box_left < rect->left || box_top < rect->top || box_right > rect->right || box_bottom > rect->bottom)) || (clip_left < rect->left || clip_top < rect->top || clip_right > rect->right || clip_bottom > rect->bottom)) { order_flags |= TS_BOUNDS; if (xrdp_orders_last_bounds(self, rect)) { order_flags |= TS_ZERO_BOUNDS_DELTAS; } } } /* order_flags, set later, 1 byte */ order_flags_ptr = self->out_s->p; out_uint8s(self->out_s, 1); if (order_flags & TS_TYPE_CHANGE) { out_uint8(self->out_s, self->orders_state.last_order); } present = 0; /* present, set later, 3 bytes */ present_ptr = self->out_s->p; out_uint8s(self->out_s, 3); if ((order_flags & TS_BOUNDS) && !(order_flags & TS_ZERO_BOUNDS_DELTAS)) { xrdp_orders_out_bounds(self, rect); } if (font != self->orders_state.text_font) { present |= 0x000001; out_uint8(self->out_s, font); self->orders_state.text_font = font; } if (flags != self->orders_state.text_flags) { present |= 0x000002; out_uint8(self->out_s, flags); self->orders_state.text_flags = flags; } /* unknown */ if (mixmode != self->orders_state.text_mixmode) { present |= 0x000008; out_uint8(self->out_s, mixmode); self->orders_state.text_mixmode = mixmode; } if (fg_color != self->orders_state.text_fg_color) { present |= 0x000010; out_uint8(self->out_s, fg_color); out_uint8(self->out_s, fg_color >> 8); out_uint8(self->out_s, fg_color >> 16); self->orders_state.text_fg_color = fg_color; } if (bg_color != self->orders_state.text_bg_color) { present |= 0x000020; out_uint8(self->out_s, bg_color); out_uint8(self->out_s, bg_color >> 8); out_uint8(self->out_s, bg_color >> 16); self->orders_state.text_bg_color = bg_color; } if (clip_left != self->orders_state.text_clip_left) { present |= 0x000040; out_uint16_le(self->out_s, clip_left); self->orders_state.text_clip_left = clip_left; } if (clip_top != self->orders_state.text_clip_top) { present |= 0x000080; out_uint16_le(self->out_s, clip_top); self->orders_state.text_clip_top = clip_top; } if (clip_right != self->orders_state.text_clip_right) { present |= 0x000100; out_uint16_le(self->out_s, clip_right); self->orders_state.text_clip_right = clip_right; } if (clip_bottom != self->orders_state.text_clip_bottom) { present |= 0x000200; out_uint16_le(self->out_s, clip_bottom); self->orders_state.text_clip_bottom = clip_bottom; } if (box_left != self->orders_state.text_box_left) { present |= 0x000400; out_uint16_le(self->out_s, box_left); self->orders_state.text_box_left = box_left; } if (box_top != self->orders_state.text_box_top) { present |= 0x000800; out_uint16_le(self->out_s, box_top); self->orders_state.text_box_top = box_top; } if (box_right != self->orders_state.text_box_right) { present |= 0x001000; out_uint16_le(self->out_s, box_right); self->orders_state.text_box_right = box_right; } if (box_bottom != self->orders_state.text_box_bottom) { present |= 0x002000; out_uint16_le(self->out_s, box_bottom); self->orders_state.text_box_bottom = box_bottom; } if (x != self->orders_state.text_x) { present |= 0x080000; out_uint16_le(self->out_s, x); self->orders_state.text_x = x; } if (y != self->orders_state.text_y) { present |= 0x100000; out_uint16_le(self->out_s, y); self->orders_state.text_y = y; } { /* always send text */ present |= 0x200000; out_uint8(self->out_s, data_len); out_uint8a(self->out_s, data, data_len); } xrdp_order_pack_small_or_tiny(self, order_flags_ptr, order_flags, present_ptr, present, 3); return 0; } /*****************************************************************************/ /* returns error */ /* when a palette gets sent, send the main palette too */ int xrdp_orders_send_palette(struct xrdp_orders *self, int *palette, int cache_id) { int order_flags; int len; int i; if (xrdp_orders_check(self, 2000) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_palette: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] DRAWING_ORDER " "controlFlags 0x%2.2x (TS_STANDARD | TS_SECONDARY)", order_flags); len = 1027 - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); /* orderLength */ out_uint16_le(self->out_s, 0); /* extraFlags */ out_uint8(self->out_s, TS_CACHE_COLOR_TABLE); /* orderType */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] SECONDARY_DRAWING_ORDER_HEADER " "orderLength %d, extraFlags 0x0000, orderType 0x%2.2x (TS_CACHE_COLOR_TABLE)", len, TS_CACHE_COLOR_TABLE); out_uint8(self->out_s, cache_id); out_uint16_le(self->out_s, 256); /* num colors */ for (i = 0; i < 256; i++) { out_uint8(self->out_s, palette[i]); out_uint8(self->out_s, palette[i] >> 8); out_uint8(self->out_s, palette[i] >> 16); out_uint8(self->out_s, 0); } LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPEGDI] CACHE_COLOR_TABLE_ORDER " "cacheIndex %d, numberColors 256, colorTable ", cache_id); return 0; } /*****************************************************************************/ /* returns error */ /* max size width * height * Bpp + 16 */ int xrdp_orders_send_raw_bitmap(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx) { int order_flags = 0; int len = 0; int bufsize = 0; int Bpp = 0; int i = 0; int j = 0; int pixel = 0; int e = 0; int max_order_size; struct xrdp_client_info *ci; if (width > 64) { LOG(LOG_LEVEL_ERROR, "error, width > 64"); return 1; } if (height > 64) { LOG(LOG_LEVEL_ERROR, "error, height > 64"); return 1; } e = width % 4; if (e != 0) { e = 4 - e; } Bpp = (bpp + 7) / 8; bufsize = (width + e) * height * Bpp; ci = &(self->rdp_layer->client_info); max_order_size = MAX_ORDERS_SIZE(ci); while (bufsize + 16 > max_order_size) { height--; bufsize = (width + e) * height * Bpp; } if (xrdp_orders_check(self, bufsize + 16) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = (bufsize + 9) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); out_uint16_le(self->out_s, 8); /* flags */ out_uint8(self->out_s, TS_CACHE_BITMAP_UNCOMPRESSED); /* type */ out_uint8(self->out_s, cache_id); out_uint8s(self->out_s, 1); /* pad */ out_uint8(self->out_s, width + e); out_uint8(self->out_s, height); out_uint8(self->out_s, bpp); out_uint16_le(self->out_s, bufsize); out_uint16_le(self->out_s, cache_idx); if (Bpp == 4) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); out_uint8(self->out_s, pixel >> 24); } out_uint8s(self->out_s, Bpp * e); } } else if (Bpp == 3) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); } out_uint8s(self->out_s, Bpp * e); } } else if (Bpp == 2) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL16(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); } out_uint8s(self->out_s, Bpp * e); } } else if (Bpp == 1) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL8(data, j, i, width); out_uint8(self->out_s, pixel); } out_uint8s(self->out_s, Bpp * e); } } return 0; } /*****************************************************************************/ /* returns error */ /* max size width * height * Bpp + 16 */ int xrdp_orders_send_bitmap(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx) { int order_flags = 0; int len = 0; int bufsize = 0; int Bpp = 0; int i = 0; int lines_sending = 0; int e = 0; struct stream *s = NULL; struct stream *temp_s = NULL; char *p = NULL; int max_order_size; struct xrdp_client_info *ci; if (width > 64) { LOG(LOG_LEVEL_ERROR, "error, width > 64"); return 1; } if (height > 64) { LOG(LOG_LEVEL_ERROR, "error, height > 64"); return 1; } ci = &(self->rdp_layer->client_info); max_order_size = MAX_ORDERS_SIZE(ci); e = width % 4; if (e != 0) { e = 4 - e; } s = self->s; init_stream(s, 16384 * 2); temp_s = self->temp_s; init_stream(temp_s, 16384 * 2); p = s->p; i = height; if (bpp > 24) { lines_sending = xrdp_bitmap32_compress(data, width, height, s, bpp, max_order_size, i - 1, temp_s, e, 0x10); } else { lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, max_order_size, i - 1, temp_s, e); } if (lines_sending != height) { height = lines_sending; } bufsize = (int)(s->p - p); Bpp = (bpp + 7) / 8; if (xrdp_orders_check(self, bufsize + 16) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); if (self->rdp_layer->client_info.op2) { len = (bufsize + 9) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); out_uint16_le(self->out_s, 1024); /* flags */ } else { len = (bufsize + 9 + 8) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); out_uint16_le(self->out_s, 8); /* flags */ } out_uint8(self->out_s, TS_CACHE_BITMAP_COMPRESSED); /* type */ out_uint8(self->out_s, cache_id); out_uint8s(self->out_s, 1); /* pad */ out_uint8(self->out_s, width + e); out_uint8(self->out_s, height); out_uint8(self->out_s, bpp); out_uint16_le(self->out_s, bufsize/* + 8*/); out_uint16_le(self->out_s, cache_idx); if (!self->rdp_layer->client_info.op2) { out_uint8s(self->out_s, 2); /* pad */ out_uint16_le(self->out_s, bufsize); out_uint16_le(self->out_s, (width + e) * Bpp); /* line size */ out_uint16_le(self->out_s, (width + e) * Bpp * height); /* final size */ } out_uint8a(self->out_s, s->data, bufsize); return 0; } /*****************************************************************************/ /* returns error */ /* max size datasize + 18*/ /* todo, only sends one for now */ static int xrdp_orders_cache_glyph(struct xrdp_orders *self, struct xrdp_font_char *font_char, int font_index, int char_index) { int order_flags = 0; int datasize = 0; int len = 0; int flags; if (font_char->bpp == 8) /* alpha font */ { datasize = ((font_char->width + 3) & ~3) * font_char->height; flags = 8 | 0x4000; } else { datasize = FONT_DATASIZE(font_char); flags = 8; } if (xrdp_orders_check(self, datasize + 18) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = (datasize + 12) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); out_uint16_le(self->out_s, flags); out_uint8(self->out_s, TS_CACHE_GLYPH); /* type */ out_uint8(self->out_s, font_index); out_uint8(self->out_s, 1); /* num of chars */ out_uint16_le(self->out_s, char_index); out_uint16_le(self->out_s, font_char->offset); out_uint16_le(self->out_s, font_char->baseline); out_uint16_le(self->out_s, font_char->width); out_uint16_le(self->out_s, font_char->height); out_uint8a(self->out_s, font_char->data, datasize); return 0; } /*****************************************************************************/ /* returns error */ static int write_2byte_signed(struct stream *s, int value) { unsigned char byte; int negative = 0; if (value < 0) { negative = 1; value *= -1; } if (value > 0x3FFF) { return 1; } if (value >= 0x3F) { byte = ((value & 0x3F00) >> 8); if (negative) { byte |= 0x40; } out_uint8(s, byte | 0x80); byte = (value & 0xFF); out_uint8(s, byte); } else { byte = (value & 0x3F); if (negative) { byte |= 0x40; } out_uint8(s, byte); } return 0; } /*****************************************************************************/ /* returns error */ static int write_2byte_unsigned(struct stream *s, unsigned int value) { unsigned char byte; if (value > 0x7FFF) { return 1; } if (value >= 0x7F) { byte = ((value & 0x7F00) >> 8); out_uint8(s, byte | 0x80); byte = (value & 0xFF); out_uint8(s, byte); } else { byte = (value & 0x7F); out_uint8(s, byte); } return 0; } /*****************************************************************************/ /* returns error */ /* max size datasize + 15*/ /* todo, only sends one for now */ static int xrdp_orders_cache_glyph_v2(struct xrdp_orders *self, struct xrdp_font_char *font_char, int font_index, int char_index) { int order_flags = 0; int datasize = 0; int len = 0; int extra_flags; char *len_ptr; if (font_char->bpp == 8) /* alpha font */ { datasize = ((font_char->width + 3) & ~3) * font_char->height; } else { datasize = FONT_DATASIZE(font_char); } /* cacheId, flags(GLYPH_ORDER_REV2), cGlyphs */ extra_flags = (font_index & 0x000F) | (0x2 << 4) | (1 << 8); if (xrdp_orders_check(self, datasize + 15) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len_ptr = self->out_s->p; out_uint16_le(self->out_s, 0); /* set later */ out_uint16_le(self->out_s, extra_flags); out_uint8(self->out_s, TS_CACHE_GLYPH); /* type */ out_uint8(self->out_s, char_index); if (write_2byte_signed(self->out_s, font_char->offset) || write_2byte_signed(self->out_s, font_char->baseline) || write_2byte_unsigned(self->out_s, font_char->width) || write_2byte_unsigned(self->out_s, font_char->height)) { return 1; } out_uint8a(self->out_s, font_char->data, datasize); len = (self->out_s->p - len_ptr) + 1 - 13; len_ptr[0] = len & 0xFF; len_ptr[1] = (len >> 8) & 0xFF; return 0; } /*****************************************************************************/ /* returns error */ int xrdp_orders_send_font(struct xrdp_orders *self, struct xrdp_font_char *font_char, int font_index, int char_index) { if (self->rdp_layer->client_info.use_cache_glyph_v2) { return xrdp_orders_cache_glyph_v2(self, font_char, font_index, char_index); } return xrdp_orders_cache_glyph(self, font_char, font_index, char_index); } /*****************************************************************************/ /* returns error */ /* max size width * height * Bpp + 14 */ int xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx) { int order_flags = 0; int len = 0; int bufsize = 0; int Bpp = 0; int i = 0; int j = 0; int pixel = 0; int e = 0; int max_order_size; struct xrdp_client_info *ci; if (width > 64) { LOG(LOG_LEVEL_ERROR, "error, width > 64"); return 1; } if (height > 64) { LOG(LOG_LEVEL_ERROR, "error, height > 64"); return 1; } ci = &(self->rdp_layer->client_info); max_order_size = MAX_ORDERS_SIZE(ci); e = width % 4; if (e != 0) { e = 4 - e; } Bpp = (bpp + 7) / 8; bufsize = (width + e) * height * Bpp; while (bufsize + 14 > max_order_size) { height--; bufsize = (width + e) * height * Bpp; } if (xrdp_orders_check(self, bufsize + 14) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = (bufsize + 6) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); i = (((Bpp + 2) << 3) & 0x38) | (cache_id & 7); out_uint16_le(self->out_s, i); /* flags */ out_uint8(self->out_s, TS_CACHE_BITMAP_UNCOMPRESSED_REV2); /* type */ out_uint8(self->out_s, width + e); out_uint8(self->out_s, height); out_uint16_be(self->out_s, bufsize | 0x4000); i = ((cache_idx >> 8) & 0xff) | 0x80; out_uint8(self->out_s, i); i = cache_idx & 0xff; out_uint8(self->out_s, i); if (Bpp == 4) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); out_uint8(self->out_s, pixel >> 24); } out_uint8s(self->out_s, Bpp * e); } } else if (Bpp == 3) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL32(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); out_uint8(self->out_s, pixel >> 16); } out_uint8s(self->out_s, Bpp * e); } } else if (Bpp == 2) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL16(data, j, i, width); out_uint8(self->out_s, pixel); out_uint8(self->out_s, pixel >> 8); } out_uint8s(self->out_s, Bpp * e); } } else if (Bpp == 1) { for (i = height - 1; i >= 0; i--) { for (j = 0; j < width; j++) { pixel = GETPIXEL8(data, j, i, width); out_uint8(self->out_s, pixel); } out_uint8s(self->out_s, Bpp * e); } } return 0; } /*****************************************************************************/ /* returns error */ /* max size width * height * Bpp + 14 */ int xrdp_orders_send_bitmap2(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints) { int order_flags = 0; int len = 0; int bufsize = 0; int Bpp = 0; int i = 0; int lines_sending = 0; int e = 0; struct stream *s = NULL; struct stream *temp_s = NULL; char *p = NULL; int max_order_size; struct xrdp_client_info *ci; if (width > 64) { LOG(LOG_LEVEL_ERROR, "error, width > 64"); return 1; } if (height > 64) { LOG(LOG_LEVEL_ERROR, "error, height > 64"); return 1; } ci = &(self->rdp_layer->client_info); max_order_size = MAX_ORDERS_SIZE(ci); e = width % 4; if (e != 0) { e = 4 - e; } s = self->s; init_stream(s, 16384 * 2); temp_s = self->temp_s; init_stream(temp_s, 16384 * 2); p = s->p; i = height; if (bpp > 24) { lines_sending = xrdp_bitmap32_compress(data, width, height, s, bpp, max_order_size, i - 1, temp_s, e, 0x10); } else { lines_sending = xrdp_bitmap_compress(data, width, height, s, bpp, max_order_size, i - 1, temp_s, e); } if (lines_sending != height) { height = lines_sending; } bufsize = (int)(s->p - p); Bpp = (bpp + 7) / 8; if (xrdp_orders_check(self, bufsize + 14) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = (bufsize + 6) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); i = (((Bpp + 2) << 3) & 0x38) | (cache_id & 7); i = i | (0x08 << 7); /* CBR2_NO_BITMAP_COMPRESSION_HDR */ out_uint16_le(self->out_s, i); /* flags */ out_uint8(self->out_s, TS_CACHE_BITMAP_COMPRESSED_REV2); /* type */ out_uint8(self->out_s, width + e); out_uint8(self->out_s, height); out_uint16_be(self->out_s, bufsize | 0x4000); i = ((cache_idx >> 8) & 0xff) | 0x80; out_uint8(self->out_s, i); i = cache_idx & 0xff; out_uint8(self->out_s, i); out_uint8a(self->out_s, s->data, bufsize); return 0; } #if defined(XRDP_JPEG) /*****************************************************************************/ static int xrdp_orders_send_as_jpeg(struct xrdp_orders *self, int width, int height, int bpp, int hints) { if (hints & 1) { return 0; } if (bpp != 24) { return 0; } if (width * height < 64) { return 0; } return 1; } #endif #if defined(XRDP_NEUTRINORDP) /*****************************************************************************/ /* secondary drawing order (bitmap v3) using remotefx compression */ static int xrdp_orders_send_as_rfx(struct xrdp_orders *self, int width, int height, int bpp, int hints) { if (hints & 1) { return 0; } if (bpp != 24) { return 0; } LOG_DEVEL(LOG_LEVEL_DEBUG, "width %d height %d rfx_min_pixel %d", width, height, self->rfx_min_pixel); if (width * height < self->rfx_min_pixel) { return 0; } return 1; } #endif #if defined(XRDP_JPEG) || defined(XRDP_NEUTRINORDP) /*****************************************************************************/ static int xrdp_orders_out_v3(struct xrdp_orders *self, int cache_id, int cache_idx, char *buf, int bufsize, int width, int height, int bpp, int codec_id) { int Bpp; int order_flags; int len; int i; Bpp = (bpp + 7) / 8; if (xrdp_orders_check(self, bufsize + 30) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = (bufsize + 22) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); i = (((Bpp + 2) << 3) & 0x38) | (cache_id & 7); out_uint16_le(self->out_s, i); /* flags */ out_uint8(self->out_s, TS_CACHE_BITMAP_COMPRESSED_REV3); /* type */ /* cache index */ out_uint16_le(self->out_s, cache_idx); /* persistent cache key 1/2 */ out_uint32_le(self->out_s, 0); out_uint32_le(self->out_s, 0); /* bitmap data */ out_uint8(self->out_s, bpp); out_uint8(self->out_s, 0); /* reserved */ out_uint8(self->out_s, 0); /* reserved */ out_uint8(self->out_s, codec_id); out_uint16_le(self->out_s, width); out_uint16_le(self->out_s, height); out_uint32_le(self->out_s, bufsize); out_uint8a(self->out_s, buf, bufsize); return 0; } #endif /*****************************************************************************/ /* secondary drawing order (bitmap v3) using remotefx compression */ int xrdp_orders_send_bitmap3(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints) { struct xrdp_client_info *ci; #if defined(XRDP_JPEG) || defined(XRDP_NEUTRINORDP) int bufsize; struct stream *xr_s; /* xrdp stream */ #endif #if defined(XRDP_JPEG) int e; int quality; struct stream *temp_s; /* xrdp stream */ #endif #if defined(XRDP_NEUTRINORDP) STREAM *fr_s; /* FreeRDP stream */ RFX_CONTEXT *context; RFX_RECT rect; #endif ci = &(self->rdp_layer->client_info); if (ci->v3_codec_id == 0) { return 2; } if (ci->v3_codec_id == ci->rfx_codec_id) { #if defined(XRDP_NEUTRINORDP) if (!xrdp_orders_send_as_rfx(self, width, height, bpp, hints)) { return 2; } LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_orders_send_bitmap3: rfx"); context = (RFX_CONTEXT *)(self->rdp_layer->rfx_enc); make_stream(xr_s); init_stream(xr_s, 16384); fr_s = stream_new(0); stream_attach(fr_s, (tui8 *)(xr_s->data), 16384); rect.x = 0; rect.y = 0; rect.width = width; rect.height = height; rfx_compose_message(context, fr_s, &rect, 1, (tui8 *)data, width, height, width * 4); bufsize = stream_get_length(fr_s); xrdp_orders_out_v3(self, cache_id, cache_idx, (char *)(fr_s->data), bufsize, width, height, bpp, ci->v3_codec_id); stream_detach(fr_s); stream_free(fr_s); free_stream(xr_s); return 0; #else return 2; #endif } else if (ci->v3_codec_id == ci->jpeg_codec_id) { #if defined(XRDP_JPEG) if (!xrdp_orders_send_as_jpeg(self, width, height, bpp, hints)) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_bitmap3: jpeg skipped"); return 2; } LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_orders_send_bitmap3: jpeg"); e = width % 4; if (e != 0) { e = 4 - e; } make_stream(xr_s); init_stream(xr_s, 16384); make_stream(temp_s); init_stream(temp_s, 16384); quality = ci->jpeg_prop[0]; xrdp_jpeg_compress(self->jpeg_han, data, width, height, xr_s, bpp, 16384, height - 1, temp_s, e, quality); s_mark_end(xr_s); bufsize = (int)(xr_s->end - xr_s->data); xrdp_orders_out_v3(self, cache_id, cache_idx, (char *)(xr_s->data), bufsize, width + e, height, bpp, ci->v3_codec_id); free_stream(xr_s); free_stream(temp_s); return 0; #else return 2; #endif } else { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_bitmap3: todo unknown codec"); return 1; } return 0; } /*****************************************************************************/ /* returns error */ /* send a brush cache entry */ int xrdp_orders_send_brush(struct xrdp_orders *self, int width, int height, int bpp, int type, int size, char *data, int cache_id) { int order_flags = 0; int len = 0; if (xrdp_orders_check(self, size + 12) != 0) { return 1; } self->order_count++; order_flags = TS_STANDARD | TS_SECONDARY; out_uint8(self->out_s, order_flags); len = (size + 6) - 7; /* length after type minus 7 */ out_uint16_le(self->out_s, len); out_uint16_le(self->out_s, 0); /* flags */ out_uint8(self->out_s, TS_CACHE_BRUSH); /* type */ out_uint8(self->out_s, cache_id); out_uint8(self->out_s, bpp); out_uint8(self->out_s, width); out_uint8(self->out_s, height); out_uint8(self->out_s, type); out_uint8(self->out_s, size); out_uint8a(self->out_s, data, size); return 0; } /*****************************************************************************/ /* returns error */ /* send an off screen bitmap entry */ int xrdp_orders_send_create_os_surface(struct xrdp_orders *self, int id, int width, int height, struct list *del_list) { int order_flags; int cache_id; int flags; int index; int bytes; int num_del_list; bytes = 7; num_del_list = del_list->count; if (num_del_list > 0) { bytes += 2; bytes += num_del_list * 2; } if (xrdp_orders_check(self, bytes) != 0) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 1 << 2; /* type RDP_ORDER_ALTSEC_CREATE_OFFSCR_BITMAP */ out_uint8(self->out_s, order_flags); cache_id = id & 0x7fff; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_orders_send_create_os_surface: cache_id %d", cache_id); flags = cache_id; if (num_del_list > 0) { flags |= 0x8000; } out_uint16_le(self->out_s, flags); out_uint16_le(self->out_s, width); out_uint16_le(self->out_s, height); if (num_del_list > 0) { /* delete list */ out_uint16_le(self->out_s, num_del_list); for (index = 0; index < num_del_list; index++) { cache_id = list_get_item(del_list, index) & 0x7fff; out_uint16_le(self->out_s, cache_id); } } return 0; } /*****************************************************************************/ /* returns error */ int xrdp_orders_send_switch_os_surface(struct xrdp_orders *self, int id) { int order_flags; int cache_id; if (xrdp_orders_check(self, 3) != 0) { return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0 << 2; /* type RDP_ORDER_ALTSEC_SWITCH_SURFACE */ out_uint8(self->out_s, order_flags); cache_id = id & 0xffff; out_uint16_le(self->out_s, cache_id); return 0; } xrdp-0.10.1/libxrdp/xrdp_orders_rail.h000644 001751 000000 00000003757 14652432047 020030 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(_XRDP_ORDERS_RAIL_H) #define _XRDP_ORDERS_RAIL_H #include "libxrdp.h" int xrdp_orders_send_window_delete(struct xrdp_orders *self, int window_id); int xrdp_orders_send_window_cached_icon(struct xrdp_orders *self, int window_id, int cache_entry, int cache_id, int flags); int xrdp_orders_send_window_icon(struct xrdp_orders *self, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags); int xrdp_orders_send_window_new_update(struct xrdp_orders *self, int window_id, struct rail_window_state_order *window_state, int flags); int xrdp_orders_send_notify_delete(struct xrdp_orders *self, int window_id, int notify_id); int xrdp_orders_send_notify_new_update(struct xrdp_orders *self, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags); int xrdp_orders_send_monitored_desktop(struct xrdp_orders *self, struct rail_monitored_desktop_order *mdo, int flags); #endif xrdp-0.10.1/libxrdp/xrdp_fastpath.c000644 001751 000000 00000027461 14652432047 017326 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2014 * Copyright (C) Idan Freiberg 2013-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpbcgr.h" /*****************************************************************************/ struct xrdp_fastpath * xrdp_fastpath_create(struct xrdp_sec *owner, struct trans *trans) { struct xrdp_fastpath *self; self = (struct xrdp_fastpath *)g_malloc(sizeof(struct xrdp_fastpath), 1); self->sec_layer = owner; self->trans = trans; self->session = owner->rdp_layer->session; return self; } /*****************************************************************************/ void xrdp_fastpath_delete(struct xrdp_fastpath *self) { if (self == 0) { return; } g_free(self); } /*****************************************************************************/ /* returns error */ int xrdp_fastpath_reset(struct xrdp_fastpath *self) { return 0; } /*****************************************************************************/ int xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s) { int fp_hdr; int len = 0; int byte; char *holdp; holdp = s->p; if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_FP_INPUT_PDU")) { return 1; } in_uint8(s, fp_hdr); /* fpInputHeader (1 byte) */ in_uint8(s, byte); /* length 1 (1 byte) */ self->numEvents = (fp_hdr & 0x3C) >> 2; self->secFlags = (fp_hdr & 0xC0) >> 6; if (byte & 0x80) { byte &= ~(0x80); len = (byte << 8); if (!s_check_rem_and_log(s, 1, "Parsing [MS-RDPBCGR] TS_FP_INPUT_PDU length2")) { return 1; } in_uint8(s, byte); /* length 2 (1 byte) */ len += byte; } else { len = byte; } s->next_packet = holdp + len; LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_FP_INPUT_PDU " "fpInputHeader.action (ignored), fpInputHeader.numEvents %d, " "fpInputHeader.flags 0x%1.1x, length %d", self->numEvents, self->secFlags, len); return 0; } /*****************************************************************************/ /* no fragmentation */ int xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s) { int bytes; bytes = self->session->client_info->max_fastpath_frag_bytes; if (bytes < 32 * 1024) { bytes = 32 * 1024; } init_stream(s, bytes); return 0; } /*****************************************************************************/ static int xrdp_fastpath_session_callback(struct xrdp_fastpath *self, int msg, long param1, long param2, long param3, long param4) { if (self->session->callback != 0) { /* msg_type can be RDP_INPUT_SYNCHRONIZE - 0 RDP_INPUT_SCANCODE - 4 RDP_INPUT_MOUSE - 0x8001 RDP_INPUT_MOUSEX - 0x8002 */ /* call to xrdp_wm.c : callback */ self->session->callback(self->session->id, msg, param1, param2, param3, param4); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "Bug: session is NULL"); } return 0; } /*****************************************************************************/ /* no fragmentation */ int xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s) { if (trans_write_copy_s(self->trans, s) != 0) { return 1; } if (self->session->check_for_app_input) { xrdp_fastpath_session_callback(self, 0x5556, 0, 0, 0, 0); } return 0; } /*****************************************************************************/ /* FASTPATH_INPUT_EVENT_SCANCODE */ static int xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self, int eventFlags, struct stream *s) { int flags; int code; flags = 0; if (!s_check_rem_and_log(s, 1, "Parsing [MS-RDPBCGR] TS_FP_KEYBOARD_EVENT")) { return 1; } in_uint8(s, code); /* keyCode (1 byte) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_KEYBOARD_EVENT " "eventHeader.eventFlags 0x%2.2x, eventHeader.eventCode (ignored), " "keyCode %d", eventFlags, code); if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE)) { flags |= KBD_FLAG_UP; } else { flags |= KBD_FLAG_DOWN; } if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED)) { flags |= KBD_FLAG_EXT; } xrdp_fastpath_session_callback(self, RDP_INPUT_SCANCODE, code, 0, flags, 0); return 0; } /*****************************************************************************/ /* FASTPATH_INPUT_EVENT_MOUSE */ static int xrdp_fastpath_process_EVENT_MOUSE(struct xrdp_fastpath *self, int eventFlags, struct stream *s) { int pointerFlags; int xPos; int yPos; /* eventFlags MUST be zeroed out */ if (eventFlags != 0) { return 1; } if (!s_check_rem_and_log(s, 2 + 2 + 2, "Parsing [MS-RDPBCGR] TS_FP_POINTER_EVENT")) { return 1; } in_uint16_le(s, pointerFlags); /* pointerFlags (2 bytes) */ in_uint16_le(s, xPos); /* xPos (2 bytes) */ in_uint16_le(s, yPos); /* yPos (2 bytes) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_POINTER_EVENT " "eventHeader.eventFlags 0x00, eventHeader.eventCode (ignored), " "pointerFlags 0x%4.4x, xPos %d, yPos %d", pointerFlags, xPos, yPos); xrdp_fastpath_session_callback(self, RDP_INPUT_MOUSE, xPos, yPos, pointerFlags, 0); return 0; } /*****************************************************************************/ /* FASTPATH_INPUT_EVENT_MOUSEX */ static int xrdp_fastpath_process_EVENT_MOUSEX(struct xrdp_fastpath *self, int eventFlags, struct stream *s) { int pointerFlags; int xPos; int yPos; /* eventFlags MUST be zeroed out */ if (eventFlags != 0) { return 1; } if (!s_check_rem_and_log(s, 2 + 2 + 2, "Parsing [MS-RDPBCGR] TS_FP_POINTERX_EVENT")) { return 1; } in_uint16_le(s, pointerFlags); /* pointerFlags (2 bytes) */ in_uint16_le(s, xPos); /* xPos (2 bytes) */ in_uint16_le(s, yPos); /* yPos (2 bytes) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_POINTERX_EVENT " "eventHeader.eventFlags 0x%2.2x, eventHeader.eventCode (ignored), " "pointerFlags 0x%4.4x, xPos %d, yPos %d", eventFlags, pointerFlags, xPos, yPos); xrdp_fastpath_session_callback(self, RDP_INPUT_MOUSEX, xPos, yPos, pointerFlags, 0); return 0; } /*****************************************************************************/ /* FASTPATH_INPUT_EVENT_SYNC */ static int xrdp_fastpath_process_EVENT_SYNC(struct xrdp_fastpath *self, int eventFlags, struct stream *s) { /* * The eventCode bitfield (3 bits in size) MUST be set to * FASTPATH_INPUT_EVENT_SYNC (3). * The eventFlags bitfield (5 bits in size) contains flags * indicating the "on" * status of the keyboard toggle keys. */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_SYNC_EVENT" "eventHeader.eventFlags 0x%2.2x, eventHeader.eventCode (ignored), ", eventFlags); xrdp_fastpath_session_callback(self, RDP_INPUT_SYNCHRONIZE, eventFlags, 0, 0, 0); return 0; } /*****************************************************************************/ /* FASTPATH_INPUT_EVENT_UNICODE */ static int xrdp_fastpath_process_EVENT_UNICODE(struct xrdp_fastpath *self, int eventFlags, struct stream *s) { int flags; int code; flags = 0; if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPBCGR] TS_FP_UNICODE_KEYBOARD_EVENT")) { return 1; } in_uint16_le(s, code); /* unicode (2 byte) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_UNICODE_KEYBOARD_EVENT" "eventHeader.eventFlags 0x%2.2x, eventHeader.eventCode (ignored), " "unicodeCode %d", eventFlags, code); if (eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE) { flags |= KBD_FLAG_UP; } else { flags |= KBD_FLAG_DOWN; } if (eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED) { flags |= KBD_FLAG_EXT; } xrdp_fastpath_session_callback(self, RDP_INPUT_UNICODE, code, 0, flags, 0); return 0; } /*****************************************************************************/ /* FASTPATH_INPUT_EVENT */ int xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s) { int i; int eventHeader; int eventCode; int eventFlags; /* process fastpath input events */ for (i = 0; i < self->numEvents; i++) { if (!s_check_rem_and_log(s, 1, "Parsing [MS-RDPBCGR] TS_FP_INPUT_EVENT eventHeader")) { return 1; } in_uint8(s, eventHeader); eventFlags = (eventHeader & 0x1F); eventCode = (eventHeader >> 5); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FP_INPUT_EVENT" "eventHeader.eventFlags 0x%2.2x, eventHeader.eventCode 0x%1.1x", eventFlags, eventCode); switch (eventCode) { case FASTPATH_INPUT_EVENT_SCANCODE: if (xrdp_fastpath_process_EVENT_SCANCODE(self, eventFlags, s) != 0) { return 1; } break; case FASTPATH_INPUT_EVENT_MOUSE: if (xrdp_fastpath_process_EVENT_MOUSE(self, eventFlags, s) != 0) { return 1; } break; case FASTPATH_INPUT_EVENT_MOUSEX: if (xrdp_fastpath_process_EVENT_MOUSEX(self, eventFlags, s) != 0) { return 1; } break; case FASTPATH_INPUT_EVENT_SYNC: if (xrdp_fastpath_process_EVENT_SYNC(self, eventFlags, s) != 0) { return 1; } break; case FASTPATH_INPUT_EVENT_UNICODE: if (xrdp_fastpath_process_EVENT_UNICODE(self, eventFlags, s) != 0) { return 1; } break; default: LOG(LOG_LEVEL_ERROR, "xrdp_fastpath_process_input_event: " "unknown eventCode %d", eventCode); break; } } return 0; } xrdp-0.10.1/libxrdp/xrdp_channel.h000644 001751 000000 00000002666 14652432047 017131 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPEDYC : Definitions related to documentation in [MS-RDPEDYC] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPEDYC are currently correct for v20210406 of that * document */ #if !defined(XRDP_CHANNEL_H) #define XRDP_CHANNEL_H /* These are not directly defined in MS-RDPEDYC, but they are derived statuses needed to implement it. */ #define XRDP_DRDYNVC_STATUS_CLOSED 0 #define XRDP_DRDYNVC_STATUS_OPEN_SENT 1 #define XRDP_DRDYNVC_STATUS_OPEN 2 #define XRDP_DRDYNVC_STATUS_CLOSE_SENT 3 #define XRDP_DRDYNVC_STATUS_TO_STR(status) \ ((status) == XRDP_DRDYNVC_STATUS_CLOSED ? "CLOSED" : \ (status) == XRDP_DRDYNVC_STATUS_OPEN_SENT ? "OPEN_SENT" : \ (status) == XRDP_DRDYNVC_STATUS_OPEN ? "OPEN" : \ (status) == XRDP_DRDYNVC_STATUS_CLOSE_SENT ? "CLOSE_SENT" : \ "unknown" \ ) #endif /* XRDP_CHANNEL_H */ xrdp-0.10.1/libxrdp/libxrdpinc.h000644 001751 000000 00000032445 14652432047 016620 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * header file for use with libxrdp.so / xrdp.dll */ #ifndef LIBXRDPINC_H #define LIBXRDPINC_H #include "xrdp_rail.h" struct list; struct monitor_info; /* struct xrdp_client_info moved to xrdp_client_info.h */ struct xrdp_brush { int x_origin; int y_origin; int style; char pattern[8]; }; struct xrdp_pen { int style; int width; int color; }; /* 2.2.2.2.1.2.5.1 Cache Glyph Data (TS_CACHE_GLYPH_DATA) */ struct xrdp_font_char { int offset; /* x */ int baseline; /* y */ int width; /* cx */ int height; /* cy */ int incby; int bpp; char *data; }; struct xrdp_rect { int left; int top; int right; int bottom; }; struct xrdp_session { tintptr id; struct trans *trans; int (*callback)(intptr_t id, int msg, intptr_t param1, intptr_t param2, intptr_t param3, intptr_t param4); int check_for_app_input; void *rdp; void *orders; struct xrdp_client_info *client_info; int up_and_running; int (*is_term)(void); int in_process_data; /* inc / dec libxrdp_process_data calls */ struct source_info si; char *xrdp_ini; /* path to xrdp.ini */ }; struct xrdp_drdynvc_procs { int (*open_response)(intptr_t id, int chan_id, int creation_status); int (*close_response)(intptr_t id, int chan_id); int (*data_first)(intptr_t id, int chan_id, char *data, int bytes, int total_bytes); int (*data)(intptr_t id, int chan_id, char *data, int bytes); }; /* Defined in xrdp_client_info.h */ struct display_size_description; /*** * Initialise the XRDP library * * @param id Channel ID (xrdp_process* as integer type) * @param trans Transport object to use for this instance * @param xrdp_ini Path to xrdp.ini config file, or NULL for default * @return an allocated xrdp_session object */ struct xrdp_session * libxrdp_init(tbus id, struct trans *trans, const char *xrdp_ini); int libxrdp_exit(struct xrdp_session *session); int libxrdp_disconnect(struct xrdp_session *session); int libxrdp_process_incoming(struct xrdp_session *session); int EXPORT_CC libxrdp_get_pdu_bytes(const char *aheader); struct stream * libxrdp_force_read(struct trans *trans); int libxrdp_process_data(struct xrdp_session *session, struct stream *s); int libxrdp_send_palette(struct xrdp_session *session, int *palette); int libxrdp_send_bell(struct xrdp_session *session); int libxrdp_send_bitmap(struct xrdp_session *session, int width, int height, int bpp, char *data, int x, int y, int cx, int cy); int libxrdp_send_pointer(struct xrdp_session *session, int cache_idx, char *data, char *mask, int x, int y, int bpp, int width, int height); int libxrdp_set_pointer(struct xrdp_session *session, int cache_idx); int libxrdp_orders_init(struct xrdp_session *session); int libxrdp_orders_send(struct xrdp_session *session); int libxrdp_orders_force_send(struct xrdp_session *session); int libxrdp_orders_rect(struct xrdp_session *session, int x, int y, int cx, int cy, int color, struct xrdp_rect *rect); int libxrdp_orders_screen_blt(struct xrdp_session *session, int x, int y, int cx, int cy, int srcx, int srcy, int rop, struct xrdp_rect *rect); int libxrdp_orders_pat_blt(struct xrdp_session *session, int x, int y, int cx, int cy, int rop, int bg_color, int fg_color, struct xrdp_brush *brush, struct xrdp_rect *rect); int libxrdp_orders_dest_blt(struct xrdp_session *session, int x, int y, int cx, int cy, int rop, struct xrdp_rect *rect); int libxrdp_orders_line(struct xrdp_session *session, int mix_mode, int startx, int starty, int endx, int endy, int rop, int bg_color, struct xrdp_pen *pen, struct xrdp_rect *rect); int libxrdp_orders_mem_blt(struct xrdp_session *session, int cache_id, int color_table, int x, int y, int cx, int cy, int rop, int srcx, int srcy, int cache_idx, struct xrdp_rect *rect); int libxrdp_orders_composite_blt(struct xrdp_session *session, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat, struct xrdp_rect *rect); int libxrdp_orders_text(struct xrdp_session *session, int font, int flags, int mixmode, int fg_color, int bg_color, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len, struct xrdp_rect *rect); int libxrdp_orders_send_palette(struct xrdp_session *session, int *palette, int cache_id); int libxrdp_orders_send_raw_bitmap(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx); int libxrdp_orders_send_bitmap(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx); int libxrdp_orders_send_font(struct xrdp_session *session, struct xrdp_font_char *font_char, int font_index, int char_index); int libxrdp_reset(struct xrdp_session *session); int libxrdp_orders_send_raw_bitmap2(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx); int libxrdp_orders_send_bitmap2(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints); int libxrdp_orders_send_bitmap3(struct xrdp_session *session, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints); /** * Returns the number of channels in the session * * This value is one more than the last valid channel ID * * @param session RDP session * @return Number of available channels */ int libxrdp_get_channel_count(const struct xrdp_session *session); int libxrdp_query_channel(struct xrdp_session *session, int channel_id, char *channel_name, int *channel_flags); /** * Gets the channel ID for the named channel * * Channel IDs are in the range 0..(channel_count-1) * * @param session RDP session * @param name name of channel * @return channel ID, or -1 if the channel cannot be found */ int libxrdp_get_channel_id(struct xrdp_session *session, const char *name); int libxrdp_send_to_channel(struct xrdp_session *session, int channel_id, char *data, int data_len, int total_data_len, int flags); int libxrdp_disable_channel(struct xrdp_session *session, int channel_id, int is_disabled); int libxrdp_drdynvc_start(struct xrdp_session *session); int libxrdp_drdynvc_open(struct xrdp_session *session, const char *name, int flags, struct xrdp_drdynvc_procs *procs, int *chan_id); int libxrdp_drdynvc_close(struct xrdp_session *session, int chan_id); int libxrdp_drdynvc_data_first(struct xrdp_session *session, int chan_id, const char *data, int data_bytes, int total_data_bytes); int libxrdp_drdynvc_data(struct xrdp_session *session, int chan_id, const char *data, int data_bytes); int libxrdp_orders_send_brush(struct xrdp_session *session, int width, int height, int bpp, int type, int size, char *data, int cache_id); int libxrdp_orders_send_create_os_surface(struct xrdp_session *session, int id, int width, int height, struct list *del_list); int libxrdp_orders_send_switch_os_surface(struct xrdp_session *session, int id); int libxrdp_window_new_update(struct xrdp_session *session, int window_id, struct rail_window_state_order *window_state, int flags); int libxrdp_window_delete(struct xrdp_session *session, int window_id); int libxrdp_window_icon(struct xrdp_session *session, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags); int libxrdp_window_cached_icon(struct xrdp_session *session, int window_id, int cache_entry, int cache_id, int flags); int libxrdp_notify_new_update(struct xrdp_session *session, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags); int libxrdp_notify_delete(struct xrdp_session *session, int window_id, int notify_id); int libxrdp_monitored_desktop(struct xrdp_session *session, struct rail_monitored_desktop_order *mdo, int flags); int libxrdp_codec_jpeg_compress(struct xrdp_session *session, int format, char *inp_data, int width, int height, int stride, int x, int y, int cx, int cy, int quality, char *out_data, int *io_len); int libxrdp_fastpath_send_surface(struct xrdp_session *session, char *data_pad, int pad_bytes, int data_bytes, int destLeft, int dst_Top, int destRight, int destBottom, int bpp, int codecID, int width, int height); int EXPORT_CC libxrdp_fastpath_send_frame_marker(struct xrdp_session *session, int frame_action, int frame_id); int EXPORT_CC libxrdp_send_session_info(struct xrdp_session *session, const char *data, int data_bytes); int EXPORT_CC libxrdp_planar_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int flags); /** * Processes a stream that is based on either * 2.2.1.3.6 Client Monitor Data (TS_UD_CS_MONITOR) or 2.2.2.2 DISPLAYCONTROL_MONITOR_LAYOUT_PDU * and then stores the processed monitor data into the description parameter. * @param s * The stream to process. * @param description * Must be pre-allocated. Monitor data is filled in as part of processing the stream. * @param full_parameters * 0 if the monitor stream is from 2.2.1.3.6 Client Monitor Data (TS_UD_CS_MONITOR) * 1 if the monitor stream is from 2.2.2.2 DISPLAYCONTROL_MONITOR_LAYOUT_PDU * @return 0 if the data is processed, non-zero if there is an error. */ int EXPORT_CC libxrdp_process_monitor_stream(struct stream *s, struct display_size_description *description, int full_parameters); /** * Processes a stream that is based on [MS-RDPBCGR] 2.2.1.3.9 Client * Monitor Extended Data (TS_UD_CS_MONITOR_EX) * * Data is stored in a struct which has already been read by * libxrdp_process_monitor_stream() withj full_parameters set to 0. * * @param s Stream to read data from. Stream is read up to monitorAttributeSize * @param description Result of reading TS_UD_CS_MONITOR PDU * @return 0 if the data is processed, non-zero if there is an error. */ int EXPORT_CC libxrdp_process_monitor_ex_stream(struct stream *s, struct display_size_description *description); /** * Convert a list of monitors into a full description * * Monitor data is sanitised during the conversion * * @param num_monitor Monitor count (> 0) * @param monitors List of monitors * @param[out] description Display size description * * @return 0 if the data is processed, non-zero if there is an error. */ int libxrdp_init_display_size_description( unsigned int num_monitor, const struct monitor_info *monitors, struct display_size_description *description); #endif xrdp-0.10.1/libxrdp/Makefile.am000644 001751 000000 00000002230 14652432047 016332 0ustar00metawheel000000 000000 EXTRA_DIST = \ xrdp_surface.c AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common AM_CFLAGS = $(OPENSSL_CFLAGS) AM_LDFLAGS = LIBXRDP_EXTRA_LIBS = if XRDP_NEUTRINORDP AM_CPPFLAGS += -DXRDP_NEUTRINORDP LIBXRDP_EXTRA_LIBS += $(FREERDP_LIBS) endif if XRDP_RFXCODEC AM_CPPFLAGS += -DXRDP_RFXCODEC endif if XRDP_TJPEG AM_CPPFLAGS += -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ AM_LDFLAGS += @TurboJpegLibDir@ LIBXRDP_EXTRA_LIBS += -lturbojpeg else if XRDP_JPEG AM_CPPFLAGS += -DXRDP_JPEG LIBXRDP_EXTRA_LIBS += -ljpeg endif endif module_LTLIBRARIES = \ libxrdp.la libxrdp_la_SOURCES = \ libxrdp.c \ libxrdp.h \ libxrdpinc.h \ xrdp_bitmap32_compress.c \ xrdp_bitmap_compress.c \ xrdp_caps.c \ xrdp_channel.c \ xrdp_channel.h \ xrdp_fastpath.c \ xrdp_iso.c \ xrdp_jpeg_compress.c \ xrdp_mcs.c \ xrdp_mppc_enc.c \ xrdp_orders.c \ xrdp_orders_rail.c \ xrdp_orders_rail.h \ xrdp_rdp.c \ xrdp_sec.c libxrdp_la_LIBADD = \ $(top_builddir)/common/libcommon.la \ $(LIBXRDP_EXTRA_LIBS) xrdp-0.10.1/libxrdp/libxrdp.h000644 001751 000000 00000051561 14652432047 016126 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * libxrdp header */ #if !defined(LIBXRDP_H) #define LIBXRDP_H #include "arch.h" #include "parse.h" #include "trans.h" #include "xrdp_constants.h" #include "defines.h" #include "os_calls.h" #include "ssl_calls.h" #include "list.h" #include "log.h" #include "file.h" #include "libxrdpinc.h" #include "xrdp_client_info.h" #include "log.h" /* iso */ struct xrdp_iso { struct xrdp_mcs *mcs_layer; /* owner */ int rdpNegData; /* bool */ int requestedProtocol; int selectedProtocol; int failureCode; struct trans *trans; }; /* used in mcs */ struct mcs_channel_item { char name[16]; int flags; int chanid; int disabled; int pad0; }; /* mcs */ struct xrdp_mcs { struct xrdp_sec *sec_layer; /* owner */ struct xrdp_iso *iso_layer; int userid; int chanid; struct stream *client_mcs_data; struct stream *server_mcs_data; struct list *channel_list; /* This boolean is set to indicate we're expecting channel join * requests as part of the connect sequence */ int expecting_channel_join_requests; }; /* fastpath */ struct xrdp_fastpath { struct xrdp_sec *sec_layer; /* owner */ struct trans *trans; struct xrdp_session *session; int numEvents; int secFlags; }; /* Encryption Methods */ #define CRYPT_METHOD_NONE 0x00000000 #define CRYPT_METHOD_40BIT 0x00000001 #define CRYPT_METHOD_128BIT 0x00000002 #define CRYPT_METHOD_56BIT 0x00000008 #define CRYPT_METHOD_FIPS 0x00000010 /* Encryption Levels */ #define CRYPT_LEVEL_NONE 0x00000000 #define CRYPT_LEVEL_LOW 0x00000001 #define CRYPT_LEVEL_CLIENT_COMPATIBLE 0x00000002 #define CRYPT_LEVEL_HIGH 0x00000003 #define CRYPT_LEVEL_FIPS 0x00000004 /* sec */ struct xrdp_sec { struct xrdp_rdp *rdp_layer; /* owner */ struct xrdp_mcs *mcs_layer; struct xrdp_fastpath *fastpath_layer; struct xrdp_channel *chan_layer; char server_random[32]; char client_random[256]; char client_crypt_random[256 + 8]; /* 64 + 8, 256 + 8 */ struct stream client_mcs_data; struct stream server_mcs_data; int decrypt_use_count; int encrypt_use_count; char decrypt_key[16]; char encrypt_key[16]; char decrypt_update_key[16]; char encrypt_update_key[16]; int crypt_method; int rc4_key_len; /* 8 = 40 bit, 16 = 128 bit */ int crypt_level; char sign_key[16]; void *decrypt_rc4_info; void *encrypt_rc4_info; char pub_exp[4]; char pub_mod[256]; char pub_sig[64]; char pri_exp[256]; int rsa_key_bytes; /* 64 or 256 , 0 = no rdp security */ char fips_encrypt_key[24]; char fips_decrypt_key[24]; char fips_sign_key[20]; void *encrypt_fips_info; void *decrypt_fips_info; void *sign_fips_info; int is_security_header_present; /* boolean */ }; struct xrdp_drdynvc { int chan_id; int status; /* see XRDP_DRDYNVC_STATUS_* */ int flags; int pad0; int (*open_response)(intptr_t id, int chan_id, int creation_status); int (*close_response)(intptr_t id, int chan_id); int (*data_first)(intptr_t id, int chan_id, char *data, int bytes, int total_bytes); int (*data)(intptr_t id, int chan_id, char *data, int bytes); }; /* channel */ struct xrdp_channel { struct xrdp_sec *sec_layer; struct xrdp_mcs *mcs_layer; int drdynvc_channel_id; int drdynvc_state; struct stream *s; struct xrdp_drdynvc drdynvcs[256]; }; /* rdp */ struct xrdp_rdp { struct xrdp_session *session; struct xrdp_sec *sec_layer; int share_id; int mcs_channel; struct xrdp_client_info client_info; struct xrdp_mppc_enc *mppc_enc; void *rfx_enc; }; /* state */ struct xrdp_orders_state { int last_order; /* last order sent */ int clip_left; /* RDP_ORDER_BOUNDS, RDP_ORDER_LASTBOUNDS */ int clip_top; int clip_right; int clip_bottom; int rect_x; /* RDP_ORDER_RECT */ int rect_y; int rect_cx; int rect_cy; int rect_color; int scr_blt_x; /* RDP_ORDER_SCREENBLT */ int scr_blt_y; int scr_blt_cx; int scr_blt_cy; int scr_blt_rop; int scr_blt_srcx; int scr_blt_srcy; int pat_blt_x; /* RDP_ORDER_PATBLT */ int pat_blt_y; int pat_blt_cx; int pat_blt_cy; int pat_blt_rop; int pat_blt_bg_color; int pat_blt_fg_color; struct xrdp_brush pat_blt_brush; int dest_blt_x; /* RDP_ORDER_DESTBLT */ int dest_blt_y; int dest_blt_cx; int dest_blt_cy; int dest_blt_rop; int line_mix_mode; /* RDP_ORDER_LINE */ int line_startx; int line_starty; int line_endx; int line_endy; int line_bg_color; int line_rop; struct xrdp_pen line_pen; int mem_blt_color_table; /* RDP_ORDER_MEMBLT */ int mem_blt_cache_id; int mem_blt_x; int mem_blt_y; int mem_blt_cx; int mem_blt_cy; int mem_blt_rop; int mem_blt_srcx; int mem_blt_srcy; int mem_blt_cache_idx; int text_font; /* RDP_ORDER_TEXT2 */ int text_flags; int text_unknown; int text_mixmode; int text_fg_color; int text_bg_color; int text_clip_left; int text_clip_top; int text_clip_right; int text_clip_bottom; int text_box_left; int text_box_top; int text_box_right; int text_box_bottom; int text_x; int text_y; int text_len; char *text_data; int com_blt_srcidx; /* RDP_ORDER_COMPOSITE */ /* 2 */ int com_blt_srcformat; /* 2 */ int com_blt_srcwidth; /* 2 */ int com_blt_srcrepeat; /* 1 */ int com_blt_srctransform[10]; /* 40 */ int com_blt_mskflags; /* 1 */ int com_blt_mskidx; /* 2 */ int com_blt_mskformat; /* 2 */ int com_blt_mskwidth; /* 2 */ int com_blt_mskrepeat; /* 1 */ int com_blt_op; /* 1 */ int com_blt_srcx; /* 2 */ int com_blt_srcy; /* 2 */ int com_blt_mskx; /* 2 */ int com_blt_msky; /* 2 */ int com_blt_dstx; /* 2 */ int com_blt_dsty; /* 2 */ int com_blt_width; /* 2 */ int com_blt_height; /* 2 */ int com_blt_dstformat; /* 2 */ }; /* orders */ struct xrdp_orders { struct stream *out_s; struct xrdp_rdp *rdp_layer; struct xrdp_session *session; struct xrdp_wm *wm; char *order_count_ptr; /* pointer to count, set when sending */ int order_count; int order_level; /* inc for every call to xrdp_orders_init */ struct xrdp_orders_state orders_state; void *jpeg_han; int rfx_min_pixel; /* shared */ struct stream *s; struct stream *temp_s; }; #define PROTO_RDP_40 1 #define PROTO_RDP_50 2 struct xrdp_mppc_enc { int protocol_type; /* PROTO_RDP_40, PROTO_RDP_50 etc */ char *historyBuffer; /* contains uncompressed data */ char *outputBuffer; /* contains compressed data */ char *outputBufferPlus; int historyOffset; /* next free slot in historyBuffer */ int buf_len; /* length of historyBuffer, protocol dependent */ int bytes_in_opb; /* compressed bytes available in outputBuffer */ int flags; /* PACKET_COMPRESSED, PACKET_AT_FRONT, PACKET_FLUSHED etc */ int flagsHold; int first_pkt; /* this is the first pkt passing through enc */ tui16 *hash_table; }; int compress_rdp(struct xrdp_mppc_enc *enc, tui8 *srcData, int len); struct xrdp_mppc_enc * mppc_enc_new(int protocol_type); void mppc_enc_free(struct xrdp_mppc_enc *enc); /* xrdp_tcp.c */ struct xrdp_tcp * xrdp_tcp_create(struct xrdp_iso *owner, struct trans *trans); void xrdp_tcp_delete(struct xrdp_tcp *self); int xrdp_tcp_init(struct xrdp_tcp *self, struct stream *s); int xrdp_tcp_recv(struct xrdp_tcp *self, struct stream *s, int len); int xrdp_tcp_send(struct xrdp_tcp *self, struct stream *s); /* xrdp_iso.c */ struct xrdp_iso * xrdp_iso_create(struct xrdp_mcs *owner, struct trans *trans); void xrdp_iso_delete(struct xrdp_iso *self); int xrdp_iso_init(struct xrdp_iso *self, struct stream *s); int xrdp_iso_recv(struct xrdp_iso *self, struct stream *s); int xrdp_iso_send(struct xrdp_iso *self, struct stream *s); int xrdp_iso_incoming(struct xrdp_iso *self); int xrdp_iso_detect_tpkt(struct xrdp_iso *self, struct stream *s); /* xrdp_mcs.c */ struct xrdp_mcs * xrdp_mcs_create(struct xrdp_sec *owner, struct trans *trans, struct stream *client_mcs_data, struct stream *server_mcs_data); void xrdp_mcs_delete(struct xrdp_mcs *self); int xrdp_mcs_init(struct xrdp_mcs *self, struct stream *s); int xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan); int xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan); int xrdp_mcs_incoming(struct xrdp_mcs *self); int xrdp_mcs_disconnect(struct xrdp_mcs *self); /* xrdp_sec.c */ /* These are error return codes for:- 1. xrdp_sec_process_mcs_data_monitors 2. libxrdp_process_monitor_stream 3. libxrdp_process_monitor_ex_stream To clarify any reason for a non-zero response code. */ #define SEC_PROCESS_MONITORS_ERR 1 #define SEC_PROCESS_MONITORS_ERR_TOO_MANY_MONITORS 2 #define SEC_PROCESS_MONITORS_ERR_INVALID_DESKTOP 3 #define SEC_PROCESS_MONITORS_ERR_INVALID_MONITOR 4 struct xrdp_sec * xrdp_sec_create(struct xrdp_rdp *owner, struct trans *trans); void xrdp_sec_delete(struct xrdp_sec *self); int xrdp_sec_init(struct xrdp_sec *self, struct stream *s); int xrdp_sec_get_fastpath_bytes(struct xrdp_sec *self); int xrdp_sec_init_fastpath(struct xrdp_sec *self, struct stream *s); int xrdp_sec_send_fastpath(struct xrdp_sec *self, struct stream *s); int xrdp_sec_recv_fastpath(struct xrdp_sec *self, struct stream *s); int xrdp_sec_recv(struct xrdp_sec *self, struct stream *s, int *chan); int xrdp_sec_send(struct xrdp_sec *self, struct stream *s, int chan); int xrdp_sec_process_mcs_data(struct xrdp_sec *self); int xrdp_sec_incoming(struct xrdp_sec *self); int xrdp_sec_disconnect(struct xrdp_sec *self); int xrdp_sec_process_mcs_data_monitors(struct xrdp_sec *self, struct stream *s); /* xrdp_rdp.c */ /** * Reasons why output is being suppressed or restarted */ enum suppress_output_reason { /// Client has requested suppress via TS_SUPPRESS_OUTPUT_PDU XSO_REASON_CLIENT_REQUEST = (1 << 0), /// Deactivation-Reactivation Sequence [MS-RDPBCGR] 1.3.1.3 XSO_REASON_DEACTIVATE_REACTIVATE = (1 << 1), /// Dynamic resize in progress XSO_REASON_DYNAMIC_RESIZE = (1 << 2) }; struct xrdp_rdp * xrdp_rdp_create(struct xrdp_session *session, struct trans *trans); void xrdp_rdp_delete(struct xrdp_rdp *self); int xrdp_rdp_init(struct xrdp_rdp *self, struct stream *s); int xrdp_rdp_init_data(struct xrdp_rdp *self, struct stream *s); int xrdp_rdp_get_fastpath_bytes(struct xrdp_rdp *self); int xrdp_rdp_init_fastpath(struct xrdp_rdp *self, struct stream *s); int xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code); int xrdp_rdp_send(struct xrdp_rdp *self, struct stream *s, int pdu_type); int xrdp_rdp_send_data(struct xrdp_rdp *self, struct stream *s, int data_pdu_type); int xrdp_rdp_send_data_from_channel(struct xrdp_rdp *self, struct stream *s, int data_pdu_type, int channel_id, int compress); int xrdp_rdp_send_fastpath(struct xrdp_rdp *self, struct stream *s, int data_pdu_type); int xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self); int xrdp_rdp_incoming(struct xrdp_rdp *self); int xrdp_rdp_process_data(struct xrdp_rdp *self, struct stream *s); int xrdp_rdp_disconnect(struct xrdp_rdp *self); int xrdp_rdp_send_deactivate(struct xrdp_rdp *self); int xrdp_rdp_send_session_info(struct xrdp_rdp *self, const char *data, int data_bytes); /** * Request output suppress or resume * * @param self RDP struct * @param suppress (!= 0 for suppress, 0 for resume) * @param reason Why the output is being suppressed or resumed * @param left Left pixel of repaint area (ignored for suppress) * @param top Top pixel of repaint area (ignored for suppress) * @param right Right pixel of inclusive repaint area (ignored for suppress) * @param bottom Bottom pixel of inclusive repaint area (ignored for suppress) */ void xrdp_rdp_suppress_output(struct xrdp_rdp *self, int suppress, enum suppress_output_reason reason, int left, int top, int right, int bottom); /* xrdp_orders.c */ struct xrdp_orders * xrdp_orders_create(struct xrdp_session *session, struct xrdp_rdp *rdp_layer); void xrdp_orders_delete(struct xrdp_orders *self); int xrdp_orders_reset(struct xrdp_orders *self); int xrdp_orders_init(struct xrdp_orders *self); int xrdp_orders_send(struct xrdp_orders *self); int xrdp_orders_force_send(struct xrdp_orders *self); int xrdp_orders_check(struct xrdp_orders *self, int max_size); int xrdp_orders_rect(struct xrdp_orders *self, int x, int y, int cx, int cy, int color, struct xrdp_rect *rect); int xrdp_orders_screen_blt(struct xrdp_orders *self, int x, int y, int cx, int cy, int srcx, int srcy, int rop, struct xrdp_rect *rect); int xrdp_orders_pat_blt(struct xrdp_orders *self, int x, int y, int cx, int cy, int rop, int bg_color, int fg_color, struct xrdp_brush *brush, struct xrdp_rect *rect); int xrdp_orders_dest_blt(struct xrdp_orders *self, int x, int y, int cx, int cy, int rop, struct xrdp_rect *rect); int xrdp_orders_line(struct xrdp_orders *self, int mix_mode, int startx, int starty, int endx, int endy, int rop, int bg_color, struct xrdp_pen *pen, struct xrdp_rect *rect); int xrdp_orders_mem_blt(struct xrdp_orders *self, int cache_id, int color_table, int x, int y, int cx, int cy, int rop, int srcx, int srcy, int cache_idx, struct xrdp_rect *rect); int xrdp_orders_composite_blt(struct xrdp_orders *self, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat, struct xrdp_rect *rect); int xrdp_orders_text(struct xrdp_orders *self, int font, int flags, int mixmode, int fg_color, int bg_color, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len, struct xrdp_rect *rect); int xrdp_orders_send_palette(struct xrdp_orders *self, int *palette, int cache_id); int xrdp_orders_send_raw_bitmap(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx); int xrdp_orders_send_bitmap(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx); int xrdp_orders_send_font(struct xrdp_orders *self, struct xrdp_font_char *font_char, int font_index, int char_index); int xrdp_orders_send_raw_bitmap2(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx); int xrdp_orders_send_bitmap2(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints); int xrdp_orders_send_bitmap3(struct xrdp_orders *self, int width, int height, int bpp, char *data, int cache_id, int cache_idx, int hints); int xrdp_orders_send_brush(struct xrdp_orders *self, int width, int height, int bpp, int type, int size, char *data, int cache_id); int xrdp_orders_send_create_os_surface(struct xrdp_orders *self, int id, int width, int height, struct list *del_list); int xrdp_orders_send_switch_os_surface(struct xrdp_orders *self, int id); /* xrdp_bitmap_compress.c */ int xrdp_bitmap_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e); int xrdp_bitmap32_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int flags); int xrdp_jpeg_compress(void *handle, char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int quality); int xrdp_codec_jpeg_compress(void *handle, int format, /* input data format */ char *inp_data, /* input data */ int width, /* width of inp_data */ int height, /* height of inp_data */ int stride, /* inp_data stride, in bytes*/ int x, /* x loc in inp_data */ int y, /* y loc in inp_data */ int cx, /* width of area to compress */ int cy, /* height of area to compress */ int quality, /* higher numbers compress less */ char *out_data, /* dest for jpg image */ int *io_len /* length of out_data and on return len of compressed data */ ); void * xrdp_jpeg_init(void); int xrdp_jpeg_deinit(void *handle); /* xrdp_channel.c */ struct xrdp_channel * xrdp_channel_create(struct xrdp_sec *owner, struct xrdp_mcs *mcs_layer); void xrdp_channel_delete(struct xrdp_channel *self); int xrdp_channel_init(struct xrdp_channel *self, struct stream *s); int xrdp_channel_send(struct xrdp_channel *self, struct stream *s, int channel_id, int total_data_len, int flags); int xrdp_channel_process(struct xrdp_channel *self, struct stream *s, int chanid); int xrdp_channel_drdynvc_start(struct xrdp_channel *self); int xrdp_channel_drdynvc_open(struct xrdp_channel *self, const char *name, int flags, struct xrdp_drdynvc_procs *procs, int *chan_id); int xrdp_channel_drdynvc_close(struct xrdp_channel *self, int chan_id); int xrdp_channel_drdynvc_data_first(struct xrdp_channel *self, int chan_id, const char *data, int data_bytes, int total_data_bytes); int xrdp_channel_drdynvc_data(struct xrdp_channel *self, int chan_id, const char *data, int data_bytes); /* xrdp_fastpath.c */ struct xrdp_fastpath * xrdp_fastpath_create(struct xrdp_sec *owner, struct trans *trans); void xrdp_fastpath_delete(struct xrdp_fastpath *self); int xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s); int xrdp_fastpath_process_input_event(struct xrdp_fastpath *self, struct stream *s); int xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s); int xrdp_fastpath_send(struct xrdp_fastpath *self, struct stream *s); /* xrdp_caps.c */ int xrdp_caps_send_demand_active(struct xrdp_rdp *self); int xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s); #endif xrdp-0.10.1/libxrdp/xrdp_bitmap32_compress.c000644 001751 000000 00000035536 14652432047 021052 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * planar bitmap compressor * 32 bpp compression */ /* RDP 6.0 Bitmap Compression http://msdn.microsoft.com/en-us/library/cc241877.aspx */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #define FLAGS_RLE 0x10 #define FLAGS_NOALPHA 0x20 /*****************************************************************************/ /* split RGB */ static int fsplit3(char *in_data, int start_line, int width, int e, char *r_data, char *g_data, char *b_data) { #if defined(L_ENDIAN) int rp; int gp; int bp; #endif int index; int out_index; int pixel; int cy; int *ptr32; cy = 0; out_index = 0; while (start_line >= 0) { ptr32 = (int *) (in_data + start_line * width * 4); index = 0; #if defined(L_ENDIAN) while (index + 4 <= width) { pixel = *ptr32; ptr32++; rp = (pixel >> 16) & 0x000000ff; gp = (pixel >> 8) & 0x000000ff; bp = (pixel >> 0) & 0x000000ff; pixel = *ptr32; ptr32++; rp |= (pixel >> 8) & 0x0000ff00; gp |= (pixel << 0) & 0x0000ff00; bp |= (pixel << 8) & 0x0000ff00; pixel = *ptr32; ptr32++; rp |= (pixel >> 0) & 0x00ff0000; gp |= (pixel << 8) & 0x00ff0000; bp |= (pixel << 16) & 0x00ff0000; pixel = *ptr32; ptr32++; rp |= (pixel << 8) & 0xff000000; gp |= (pixel << 16) & 0xff000000; bp |= (pixel << 24) & 0xff000000; *((int *)(r_data + out_index)) = rp; *((int *)(g_data + out_index)) = gp; *((int *)(b_data + out_index)) = bp; out_index += 4; index += 4; } #endif while (index < width) { pixel = *ptr32; ptr32++; r_data[out_index] = pixel >> 16; g_data[out_index] = pixel >> 8; b_data[out_index] = pixel >> 0; out_index++; index++; } for (index = 0; index < e; index++) { r_data[out_index] = r_data[out_index - 1]; g_data[out_index] = g_data[out_index - 1]; b_data[out_index] = b_data[out_index - 1]; out_index++; } start_line--; cy++; if (out_index + width + e > 64 * 64) { break; } } return cy; } /*****************************************************************************/ /* split ARGB */ static int fsplit4(char *in_data, int start_line, int width, int e, char *a_data, char *r_data, char *g_data, char *b_data) { #if defined(L_ENDIAN) int ap; int rp; int gp; int bp; #endif int index; int out_index; int pixel; int cy; int *ptr32; cy = 0; out_index = 0; while (start_line >= 0) { ptr32 = (int *) (in_data + start_line * width * 4); index = 0; #if defined(L_ENDIAN) while (index + 4 <= width) { pixel = *ptr32; ptr32++; ap = (pixel >> 24) & 0x000000ff; rp = (pixel >> 16) & 0x000000ff; gp = (pixel >> 8) & 0x000000ff; bp = (pixel >> 0) & 0x000000ff; pixel = *ptr32; ptr32++; ap |= (pixel >> 16) & 0x0000ff00; rp |= (pixel >> 8) & 0x0000ff00; gp |= (pixel << 0) & 0x0000ff00; bp |= (pixel << 8) & 0x0000ff00; pixel = *ptr32; ptr32++; ap |= (pixel >> 8) & 0x00ff0000; rp |= (pixel >> 0) & 0x00ff0000; gp |= (pixel << 8) & 0x00ff0000; bp |= (pixel << 16) & 0x00ff0000; pixel = *ptr32; ptr32++; ap |= (pixel << 0) & 0xff000000; rp |= (pixel << 8) & 0xff000000; gp |= (pixel << 16) & 0xff000000; bp |= (pixel << 24) & 0xff000000; *((int *)(a_data + out_index)) = ap; *((int *)(r_data + out_index)) = rp; *((int *)(g_data + out_index)) = gp; *((int *)(b_data + out_index)) = bp; out_index += 4; index += 4; } #endif while (index < width) { pixel = *ptr32; ptr32++; a_data[out_index] = pixel >> 24; r_data[out_index] = pixel >> 16; g_data[out_index] = pixel >> 8; b_data[out_index] = pixel >> 0; out_index++; index++; } for (index = 0; index < e; index++) { a_data[out_index] = a_data[out_index - 1]; r_data[out_index] = r_data[out_index - 1]; g_data[out_index] = g_data[out_index - 1]; b_data[out_index] = b_data[out_index - 1]; out_index++; } start_line--; cy++; if (out_index + width + e > 64 * 64) { break; } } return cy; } /*****************************************************************************/ #define DELTA_ONE \ do { \ delta = src8[cx] - src8[0]; \ is_neg = (delta >> 7) & 1; \ dst8[cx] = (((delta ^ -is_neg) + is_neg) << 1) - is_neg; \ src8++; \ dst8++; \ } while (0) /*****************************************************************************/ static int fdelta(char *in_plane, char *out_plane, int cx, int cy) { char delta; char is_neg; char *src8; char *dst8; char *src8_end; g_memcpy(out_plane, in_plane, cx); src8 = in_plane; dst8 = out_plane; src8_end = src8 + (cx * cy - cx); while (src8 + 8 <= src8_end) { DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; DELTA_ONE; } while (src8 < src8_end) { DELTA_ONE; } return 0; } /*****************************************************************************/ static int fout(int collen, int replen, char *colptr, struct stream *s) { int code; int lcollen; int lreplen; int cont; LOG_DEVEL(LOG_LEVEL_DEBUG, "fout: collen %d replen %d", collen, replen); cont = collen > 13; while (cont) { lcollen = collen; if (lcollen > 15) { lcollen = 15; } code = lcollen << 4; out_uint8(s, code); out_uint8a(s, colptr, lcollen); colptr += lcollen; collen -= lcollen; cont = collen > 13; } cont = (collen > 0) || (replen > 0); while (cont) { lreplen = replen; if ((collen == 0) && (lreplen > 15)) { /* big run */ if (lreplen > 47) { lreplen = 47; } LOG_DEVEL(LOG_LEVEL_DEBUG, "fout: big run lreplen %d", lreplen); replen -= lreplen; code = ((lreplen & 0xF) << 4) | ((lreplen & 0xF0) >> 4); out_uint8(s, code); colptr += lreplen; } else { if (lreplen > 15) { lreplen = 15; } replen -= lreplen; if (lreplen < 3) { collen += lreplen; lreplen = 0; } code = (collen << 4) | lreplen; out_uint8(s, code); out_uint8a(s, colptr, collen); colptr += collen + lreplen; collen = 0; } cont = replen > 0; } return 0; } /*****************************************************************************/ static int fpack(char *plane, int cx, int cy, struct stream *s) { char *ptr8; char *colptr; char *lend; char *holdp; int jndex; int collen; int replen; LOG_DEVEL(LOG_LEVEL_DEBUG, "fpack:"); holdp = s->p; for (jndex = 0; jndex < cy; jndex++) { LOG_DEVEL(LOG_LEVEL_DEBUG, "line start line %d cx %d cy %d", jndex, cx, cy); ptr8 = plane + jndex * cx; LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "line content", ptr8, cx); lend = ptr8 + (cx - 1); colptr = ptr8; if (colptr[0] == 0) { collen = 0; replen = 1; } else { collen = 1; replen = 0; } while (ptr8 < lend) { if (ptr8[0] == ptr8[1]) { replen++; } else { if (replen > 0) { if (replen < 3) { collen += replen + 1; replen = 0; } else { fout(collen, replen, colptr, s); colptr = ptr8 + 1; replen = 0; collen = 1; } } else { collen++; } } ptr8++; } /* end of line */ fout(collen, replen, colptr, s); } return (int) (s->p - holdp); } /*****************************************************************************/ static int foutraw3(struct stream *s, int bytes, int header, char *r_data, char *g_data, char *b_data) { out_uint8(s, header); out_uint8a(s, r_data, bytes); out_uint8a(s, g_data, bytes); out_uint8a(s, b_data, bytes); /* pad if no RLE */ out_uint8(s, 0x00); return 0; } /*****************************************************************************/ static int foutraw4(struct stream *s, int bytes, int header, char *a_data, char *r_data, char *g_data, char *b_data) { out_uint8(s, header); out_uint8a(s, a_data, bytes); out_uint8a(s, r_data, bytes); out_uint8a(s, g_data, bytes); out_uint8a(s, b_data, bytes); /* pad if no RLE */ out_uint8(s, 0x00); return 0; } /*****************************************************************************/ /* returns the number of lines compressed */ int xrdp_bitmap32_compress(char *in_data, int width, int height, struct stream *s, int bpp, int byte_limit, int start_line, struct stream *temp_s, int e, int flags) { char *a_data; char *r_data; char *g_data; char *b_data; char *sa_data; char *sr_data; char *sg_data; char *sb_data; char *hold_p; int a_bytes; int r_bytes; int g_bytes; int b_bytes; int cx; int cy; int max_bytes; int total_bytes; int header; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_bitmap32_compress:"); max_bytes = 4 * 1024; /* need max 8, 4K planes for work */ if (max_bytes * 8 > temp_s->size) { return 0; } header = flags & 0xFF; cx = width + e; sa_data = temp_s->data; sr_data = sa_data + max_bytes; sg_data = sr_data + max_bytes; sb_data = sg_data + max_bytes; a_data = sb_data + max_bytes; r_data = a_data + max_bytes; g_data = r_data + max_bytes; b_data = g_data + max_bytes; hold_p = s->p; if (header & FLAGS_NOALPHA) { cy = fsplit3(in_data, start_line, width, e, sr_data, sg_data, sb_data); if (header & FLAGS_RLE) { fdelta(sr_data, r_data, cx, cy); fdelta(sg_data, g_data, cx, cy); fdelta(sb_data, b_data, cx, cy); while (cy > 0) { s->p = hold_p; out_uint8(s, header); r_bytes = fpack(r_data, cx, cy, s); g_bytes = fpack(g_data, cx, cy, s); b_bytes = fpack(b_data, cx, cy, s); max_bytes = cx * cy * 3; total_bytes = r_bytes + g_bytes + b_bytes; if (total_bytes > max_bytes) { if (2 + max_bytes <= byte_limit) { s->p = hold_p; foutraw3(s, cx * cy, FLAGS_NOALPHA, sr_data, sg_data, sb_data); break; } } if (1 + total_bytes <= byte_limit) { break; } cy--; } } else { while (cy > 0) { max_bytes = cx * cy * 3; if (2 + max_bytes <= byte_limit) { s->p = hold_p; foutraw3(s, cx * cy, FLAGS_NOALPHA, sr_data, sg_data, sb_data); break; } cy--; } } } else { cy = fsplit4(in_data, start_line, width, e, sa_data, sr_data, sg_data, sb_data); if (header & FLAGS_RLE) { fdelta(sa_data, a_data, cx, cy); fdelta(sr_data, r_data, cx, cy); fdelta(sg_data, g_data, cx, cy); fdelta(sb_data, b_data, cx, cy); while (cy > 0) { s->p = hold_p; out_uint8(s, header); a_bytes = fpack(a_data, cx, cy, s); r_bytes = fpack(r_data, cx, cy, s); g_bytes = fpack(g_data, cx, cy, s); b_bytes = fpack(b_data, cx, cy, s); max_bytes = cx * cy * 4; total_bytes = a_bytes + r_bytes + g_bytes + b_bytes; if (total_bytes > max_bytes) { if (2 + max_bytes <= byte_limit) { s->p = hold_p; foutraw4(s, cx * cy, 0, sa_data, sr_data, sg_data, sb_data); break; } } if (1 + total_bytes <= byte_limit) { break; } cy--; } } else { while (cy > 0) { max_bytes = cx * cy * 4; if (2 + max_bytes <= byte_limit) { s->p = hold_p; foutraw4(s, cx * cy, 0, sa_data, sr_data, sg_data, sb_data); break; } cy--; } } } return cy; } xrdp-0.10.1/libxrdp/xrdp_iso.c000644 001751 000000 00000051152 14652432047 016300 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * Copyright (C) Idan Freiberg 2013-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * iso layer * * Note: [ITU-T X.224] and [ISO/IEC 8073] are essentially two specifications * of the same protocol (see [ITU-T X.224] Appendix I – Differences between * ITU-T Rec. X.224 (1993) and ISO/IEC 8073:1992). The RDP protocol * specification [MS-RDPBCGR] makes reference to the [ITU-T X.224] specificaiton. */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "string_calls.h" #include "log.h" /*****************************************************************************/ /** * Converts a protocol mask ([MS-RDPBCGR] 2.2.1.1.1 to a string) * * @param protocol Protocol mask * @param buff Output buffer * @param bufflen total length of buff * @return As for snprintf() * * The string "RDP" is always added to the output, even if other bits * are set */ static int protocol_mask_to_str(int protocol, char *buff, int bufflen) { char delim = '|'; static const struct bitmask_string bits[] = { { PROTOCOL_SSL, "SSL" }, { PROTOCOL_HYBRID, "HYBRID" }, { PROTOCOL_RDSTLS, "RDSTLS" }, { PROTOCOL_HYBRID_EX, "HYBRID_EX"}, BITMASK_STRING_END_OF_LIST }; int rlen = g_bitmask_to_str(protocol, bits, delim, buff, bufflen); /* Append "RDP" */ if (rlen == 0) { /* String is empty */ rlen = g_snprintf(buff, bufflen, "RDP"); } else if (rlen < bufflen) { rlen += g_snprintf(buff + rlen, bufflen - rlen, "%cRDP", delim); } return rlen; } /*****************************************************************************/ struct xrdp_iso * xrdp_iso_create(struct xrdp_mcs *owner, struct trans *trans) { struct xrdp_iso *self; self = (struct xrdp_iso *) g_malloc(sizeof(struct xrdp_iso), 1); self->mcs_layer = owner; self->trans = trans; return self; } /*****************************************************************************/ void xrdp_iso_delete(struct xrdp_iso *self) { if (self == 0) { return; } g_free(self); } /*****************************************************************************/ /* returns error */ static int xrdp_iso_negotiate_security(struct xrdp_iso *self) { char requested_str[64]; const char *selected_str = ""; const char *configured_str = ""; int rv = 0; struct xrdp_client_info *client_info = &(self->mcs_layer->sec_layer->rdp_layer->client_info); /* Can we do TLS/SSL? (basic check) */ int ssl_capable = g_file_readable(client_info->certificate) && g_file_readable(client_info->key_file); /* Work out what's actually configured in xrdp.ini. The * selection happens later, but we can do some error checking here */ switch (client_info->security_layer) { case PROTOCOL_RDP: configured_str = "RDP"; break; case PROTOCOL_SSL: /* We *must* use TLS. Check we can offer it, and it's requested */ if (ssl_capable) { configured_str = "SSL"; if ((self->requestedProtocol & PROTOCOL_SSL) == 0) { LOG(LOG_LEVEL_ERROR, "Server requires TLS for security, " "but the client did not request TLS."); self->failureCode = SSL_REQUIRED_BY_SERVER; rv = 1; /* error */ } } else { configured_str = ""; LOG(LOG_LEVEL_ERROR, "Cannot accept TLS connections because " "certificate or private key file is not readable. " "certificate file: [%s], private key file: [%s]", client_info->certificate, client_info->key_file); self->failureCode = SSL_CERT_NOT_ON_SERVER; rv = 1; /* error */ } break; case PROTOCOL_HYBRID: case PROTOCOL_HYBRID_EX: default: /* We don't yet support CredSSP */ if (ssl_capable) { configured_str = "SSL|RDP"; } else { /* * Tell the user we can't offer TLS, but this isn't fatal */ configured_str = "RDP"; LOG(LOG_LEVEL_WARNING, "Cannot accept TLS connections because " "certificate or private key file is not readable. " "certificate file: [%s], private key file: [%s]", client_info->certificate, client_info->key_file); } break; } /* Currently the choice comes down to RDP or SSL */ if (rv != 0) { self->selectedProtocol = PROTOCOL_RDP; selected_str = ""; } else if (ssl_capable && (self->requestedProtocol & client_info->security_layer & PROTOCOL_SSL) != 0) { self->selectedProtocol = PROTOCOL_SSL; selected_str = "SSL"; } else { self->selectedProtocol = PROTOCOL_RDP; selected_str = "RDP"; } protocol_mask_to_str(self->requestedProtocol, requested_str, sizeof(requested_str)); LOG(LOG_LEVEL_INFO, "Security protocol: configured [%s], requested [%s]," " selected [%s]", configured_str, requested_str, selected_str); return rv; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] RDP_NEG_REQ message. * returns error */ static int xrdp_iso_process_rdp_neg_req(struct xrdp_iso *self, struct stream *s) { int flags; int len; if (!s_check_rem_and_log(s, 7, "Parsing [MS-RDPBCGR] RDP_NEG_REQ")) { return 1; } /* The type field has already been read to determine that this function should be called */ in_uint8(s, flags); /* flags */ if (flags != 0x0 && flags != 0x8 && flags != 0x1) { LOG(LOG_LEVEL_ERROR, "Unsupported [MS-RDPBCGR] RDP_NEG_REQ flags: 0x%2.2x", flags); return 1; } in_uint16_le(s, len); /* length */ if (len != 8) { LOG(LOG_LEVEL_ERROR, "Protocol error: [MS-RDPBCGR] RDP_NEG_REQ length must be 8, " "received %d", len); return 1; } in_uint32_le(s, self->requestedProtocol); /* requestedProtocols */ /* TODO: why is requestedProtocols flag value bigger than 0xb invalid? */ if (self->requestedProtocol > 0xb) { LOG(LOG_LEVEL_ERROR, "Unknown requested protocol flag [MS-RDPBCGR] RDP_NEG_REQ, " "requestedProtocol 0x%8.8x", self->requestedProtocol); return 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "Received struct [MS-RDPBCGR] RDP_NEG_REQ " "flags 0x%2.2x, length 8, requestedProtocol 0x%8.8x", flags, self->requestedProtocol); return 0; } /***************************************************************************** * Reads an X.224 PDU (X.224 section 13) preceded by a T.123 TPKT * header (T.123 section 8) * * On entry, the TPKT header length field will have been inspected and used to * set up the input stream. * * On exit, the TPKT header and the fixed part of the PDU header will have been * removed from the stream. * * @param self * @param s [in] * @param code [out] * @param len [out] * Returns error *****************************************************************************/ static int xrdp_iso_recv_msg(struct xrdp_iso *self, struct stream *s, int *code, int *len) { int ver; *code = 0; *len = 0; if (s != self->trans->in_s) { LOG(LOG_LEVEL_WARNING, "Bug: the input stream is not the same stream as the " "transport input stream"); } /* [ITU-T T.123] TPKT header is 4 bytes, then first 2 bytes of the X.224 CR-TPDU */ if (!s_check_rem_and_log(s, 6, "Parsing [ITU-T T.123] TPKT header and [ITU-T X.224] TPDU header")) { return 1; } /* [ITU-T T.123] TPKT header */ in_uint8(s, ver); /* version */ in_uint8s(s, 3); /* Skip reserved field (1 byte), plus length (2 bytes) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [ITU-T T.123] TPKT " "version %d, length (ignored)", ver); /* [ITU-T X.224] TPDU header */ in_uint8(s, *len); /* LI (length indicator) */ in_uint8(s, *code); /* TPDU code */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [ITU-T X.224] TPDU " "length indicator %d, TDPU code 0x%2.2x", *len, *code); if (ver != 3) { LOG(LOG_LEVEL_ERROR, "Unsupported [ITU-T T.123] TPKT header version: %d", ver); LOG_DEVEL_HEXDUMP(LOG_LEVEL_ERROR, "[ITU-T T.123] TPKT header", s->data, 4); return 1; } if (*len == 255) { /* X.224 13.2.1 - reserved value */ LOG(LOG_LEVEL_ERROR, "[ITU-T X.224] TPDU header: unsupported use of reserved length value"); LOG_DEVEL_HEXDUMP(LOG_LEVEL_ERROR, "[ITU-T X.224] TPDU header", s->data + 4, 4); return 1; } if (*code == ISO_PDU_DT) { /* Data PDU : X.224 13.7 class 0 */ if (!s_check_rem_and_log(s, 1, "Parsing [ITU-T X.224] DT-TPDU (Data) header")) { return 1; } in_uint8s(s, 1); /* EOT (End of TSDU Mark) (upper 1 bit) and TPDU-NR (Data TPDU Number) (lower 7 bits) */ } else { /* Other supported X.224 class 0 PDUs all have 5 bytes remaining in the fixed header : CR Connection request (13.3) CC Connection confirm (13.4) DR Disconnect request (13.5) */ if (!s_check_rem_and_log(s, 5, "Parsing [ITU-T X.224] Other PDU header")) { return 1; } in_uint8s(s, 5); /* DST-REF (2 bytes) SRC-REF (2 bytes) [CR, CC] CLASS OPTION (1 byte) or [DR] REASON (1 byte) */ } return 0; } /*****************************************************************************/ /* Process the header of a [ITU-T X.224] DT-TPDU (Data) message. * * returns error */ int xrdp_iso_recv(struct xrdp_iso *self, struct stream *s) { int code; int len; if (xrdp_iso_recv_msg(self, s, &code, &len) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_iso_recv: xrdp_iso_recv_msg failed"); return 1; } if (code != ISO_PDU_DT || len != 2) { LOG(LOG_LEVEL_ERROR, "xrdp_iso_recv only supports processing " "[ITU-T X.224] DT-TPDU (Data) headers. Received TPDU header: " "length indicator %d, TDPU code 0x%2.2x", len, code); return 1; } return 0; } /*****************************************************************************/ /* * Send a [ITU-T X.224] CC-TPDU (Connection Confirm) message with * [ITU-T T.123] TPKT header. * * returns error */ static int xrdp_iso_send_cc(struct xrdp_iso *self) { struct stream *s; char *holdp; char *len_ptr; char *len_indicator_ptr; int len; int len_indicator; make_stream(s); init_stream(s, 8192); holdp = s->p; /* [ITU-T T.123] TPKT header */ out_uint8(s, 3); /* version */ out_uint8(s, 0); /* reserved (padding) */ len_ptr = s->p; out_uint16_be(s, 0); /* length, set later */ /* [ITU-T X.224] CC-TPDU */ len_indicator_ptr = s->p; out_uint8(s, 0); /* length indicator, set later */ out_uint8(s, ISO_PDU_CC); /* Connection Confirm PDU */ out_uint16_be(s, 0); /* DST-REF */ out_uint16_be(s, 0x1234); /* SRC-REF */ out_uint8(s, 0); /* CLASS OPTION */ /* [MS-RDPBCGR] 2.2.1.2 rdpNegData */ if (self->rdpNegData) { if (self->failureCode) { /* [MS-RDPBCGR] RDP_NEG_FAILURE */ out_uint8(s, RDP_NEG_FAILURE); /* type*/ out_uint8(s, 0); /* flags (none) */ out_uint16_le(s, 8); /* length (must be 8) */ out_uint32_le(s, self->failureCode); /* failureCode */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding structure [MS-RDPBCGR] RDP_NEG_FAILURE " "flags 0, length 8, failureCode 0x%8.8x", self->failureCode); } else { /* [MS-RDPBCGR] RDP_NEG_RSP */ out_uint8(s, RDP_NEG_RSP); /* type*/ //TODO: hardcoded flags out_uint8(s, EXTENDED_CLIENT_DATA_SUPPORTED); /* flags */ out_uint16_le(s, 8); /* length (must be 8) */ out_uint32_le(s, self->selectedProtocol); /* selectedProtocol */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding structure [MS-RDPBCGR] RDP_NEG_RSP " "flags 0x%02x, length 8, selectedProtocol 0x%8.8x", EXTENDED_CLIENT_DATA_SUPPORTED, self->selectedProtocol); } } s_mark_end(s); len = (int) (s->end - holdp); len_indicator = (int) (s->end - len_indicator_ptr) - 1; len_ptr[0] = len >> 8; len_ptr[1] = len; len_indicator_ptr[0] = len_indicator; LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [ITU-T T.123] TPKT " "version 3, length %d", len); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [ITU-T X.224] CC-TPDU (Connection Confirm) " "length indicator %d, DST-REF 0, SRC-REF 0, CLASS OPTION 0", len_indicator); if (trans_write_copy_s(self->trans, s) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [ITU-T X.224] CC-TPDU (Connection Confirm) failed"); free_stream(s); return 1; } free_stream(s); return 0; } /***************************************************************************** * Process an X.224 connection request PDU * * See MS-RDPBCGR v20190923 sections 2.2.1.1 and 3.3.5.3.1. * * From the latter, in particular:- * - The length embedded in the TPKT header MUST be examined for * consistency with the received data. If there is a discrepancy, the * connection SHOULD be dropped * - If the optional routingToken field exists it MUST be ignored. * - If the optional cookie field is present it MUST be ignored. * - If both the routingToken and cookie fields are present, the server * SHOULD continue with the connection. *****************************************************************************/ /* returns error */ int xrdp_iso_incoming(struct xrdp_iso *self) { int rv = 0; int code; int len; int cc_type; struct stream *s; int expected_pdu_len; LOG_DEVEL(LOG_LEVEL_DEBUG, "[ITU-T X.224] Connection Sequence: receive connection request"); s = libxrdp_force_read(self->trans); if (s == NULL) { LOG(LOG_LEVEL_ERROR, "[ITU-T X.224] Connection Sequence: CR-TPDU (Connection Request) failed"); return 1; } if (xrdp_iso_recv_msg(self, s, &code, &len) != 0) { LOG(LOG_LEVEL_ERROR, "[ITU-T X.224] Connection Sequence: CR-TPDU (Connection Request) failed"); return 1; } if (code != ISO_PDU_CR) { LOG(LOG_LEVEL_ERROR, "xrdp_iso_incoming only supports processing " "[ITU-T X.224] CR-TPDU (Connection Request) headers. " "Received TPDU header: length indicator %d, TDPU code 0x%2.2x", len, code); return 1; } /* * Make sure the length indicator field extracted from the X.224 * connection request TPDU corresponds to the length in the TPKT header. * * We do this by seeing how the indicator field minus the counted * octets in the TPDU header (6) compares with the space left in * the stream. */ expected_pdu_len = (s->end - s->p) + 6; if (len != expected_pdu_len) { LOG(LOG_LEVEL_ERROR, "Invalid length indicator in [ITU-T X.224] CR-TPDU (Connection Request). " "expected %d, received %d", expected_pdu_len, len); return 1; } /* process connection request [MS-RDPBCGR] 2.2.1.1 */ while (s_check_rem(s, 1)) { in_uint8(s, cc_type); /* type or 'C' */ switch (cc_type) { default: LOG_DEVEL(LOG_LEVEL_WARNING, "Ignoring unknown structure type in [ITU-T X.224] CR-TPDU (Connection Request). " "type 0x%2.2x", cc_type); break; case RDP_NEG_REQ: /* rdpNegReq 1 */ self->rdpNegData = 1; if (xrdp_iso_process_rdp_neg_req(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "[ITU-T X.224] Connection Sequence: failed"); return 1; } break; case RDP_CORRELATION_INFO: /* rdpCorrelationInfo 6 */ // TODO if (!s_check_rem_and_log(s, 1 + 2 + 16 + 16, "Parsing [MS-RDPBCGR] RDP_NEG_CORRELATION_INFO")) { return 1; } in_uint8s(s, 1 + 2 + 16 + 16); LOG_DEVEL(LOG_LEVEL_TRACE, "Received struct [MS-RDPBCGR] RDP_NEG_CORRELATION_INFO " "(all fields ignored)"); break; case 'C': /* Cookie or routingToken */ /* The routingToken and cookie fields are both ASCII * strings starting with the word 'Cookie: ' and * ending with CR+LF. We ignore both, so we do * not need to distinguish them */ while (s_check_rem(s, 1)) { in_uint8(s, cc_type); if (cc_type == 0x0D && s_check_rem(s, 1)) { in_uint8(s, cc_type); if (cc_type == 0x0A) { break; } } } LOG_DEVEL(LOG_LEVEL_TRACE, "Received struct [MS-RDPBCGR] routingToken or cookie " "(ignored)"); break; } } /* negotiate client-server security layer */ rv = xrdp_iso_negotiate_security(self); /* send connection confirm back to client */ LOG_DEVEL(LOG_LEVEL_DEBUG, "[ITU-T X.224] Connection Sequence: send connection confirmation"); if (xrdp_iso_send_cc(self) != 0) { LOG(LOG_LEVEL_ERROR, "[ITU-T X.224] Connection Sequence: send connection confirmation failed"); return 1; } LOG_DEVEL(LOG_LEVEL_DEBUG, "[ITU-T X.224] Connection Sequence: completed"); return rv; } /*****************************************************************************/ /* returns error */ int xrdp_iso_init(struct xrdp_iso *self, struct stream *s) { init_stream(s, 8192 * 4); /* 32 KB */ s_push_layer(s, iso_hdr, 7); return 0; } /*****************************************************************************/ /* Sends a message with the [ITU-T T.123] TPKT header (T.123 section 8) and * [ITU-T X.224] DT-TPDU (Data) header (X.224 section 13) * returns error */ int xrdp_iso_send(struct xrdp_iso *self, struct stream *s) { int len; s_pop_layer(s, iso_hdr); len = (int) (s->end - s->p); /* [ITU-T T.123] TPKT header */ out_uint8(s, 3); /* version */ out_uint8(s, 0); /* reserved (padding) */ out_uint16_be(s, len); /* length */ /* [ITU-T X.224] DT-TPDU (Data) header */ out_uint8(s, 2); /* LI (length indicator) */ out_uint8(s, ISO_PDU_DT); /* TPDU code */ out_uint8(s, 0x80); /* EOT (End of TSDU Mark) (upper 1 bit) and TPDU-NR (Data TPDU Number) (lower 7 bits) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [ITU-T T.123] TPKT " "version 3, length %d", len); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [ITU-T X.224] DT-TPDU (Data) " "length indicator 2, TPDU code 0x%2.2x, EOT 1, TPDU-NR 0x00", ISO_PDU_DT); if (trans_write_copy_s(self->trans, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_iso_send: trans_write_copy_s failed"); return 1; } return 0; } xrdp-0.10.1/libxrdp/xrdp_rdp.c000644 001751 000000 00000155212 14652432047 016275 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * rdp layer */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "log.h" #include "ssl_calls.h" #include "string_calls.h" #if defined(XRDP_NEUTRINORDP) #include #include #endif #define FASTPATH_FRAG_SIZE (16 * 1024 - 128) /*****************************************************************************/ static int xrdp_rdp_read_config(const char *xrdp_ini, struct xrdp_client_info *client_info) { int index = 0; struct list *items = (struct list *)NULL; struct list *values = (struct list *)NULL; char *item = NULL; char *value = NULL; int pos; char *tmp = NULL; int tmp_length = 0; client_info->xrdp_keyboard_overrides.type = -1; client_info->xrdp_keyboard_overrides.subtype = -1; client_info->xrdp_keyboard_overrides.layout = -1; /* initialize (zero out) local variables: */ items = list_create(); items->auto_free = 1; values = list_create(); values->auto_free = 1; LOG_DEVEL(LOG_LEVEL_TRACE, "Reading config file %s", xrdp_ini); file_by_name_read_section(xrdp_ini, "globals", items, values); for (index = 0; index < items->count; index++) { item = (char *)list_get_item(items, index); value = (char *)list_get_item(values, index); LOG(LOG_LEVEL_DEBUG, "item %s, value %s", item, value); if (g_strcasecmp(item, "bitmap_cache") == 0) { client_info->use_bitmap_cache = g_text2bool(value); } else if (g_strcasecmp(item, "bitmap_compression") == 0) { client_info->use_bitmap_comp = g_text2bool(value); } else if (g_strcasecmp(item, "bulk_compression") == 0) { client_info->use_bulk_comp = g_text2bool(value); } else if (g_strcasecmp(item, "crypt_level") == 0) { if (g_strcasecmp(value, "none") == 0) { client_info->crypt_level = 0; } else if (g_strcasecmp(value, "low") == 0) { client_info->crypt_level = 1; } else if (g_strcasecmp(value, "medium") == 0) { client_info->crypt_level = 2; } else if (g_strcasecmp(value, "high") == 0) { client_info->crypt_level = 3; } else if (g_strcasecmp(value, "fips") == 0) { client_info->crypt_level = 4; } else { LOG(LOG_LEVEL_WARNING, "Your configured crypt level is " "undefined, 'high' will be used"); client_info->crypt_level = 3; } } else if (g_strcasecmp(item, "allow_channels") == 0) { client_info->channels_allowed = g_text2bool(value); if (client_info->channels_allowed == 0) { LOG(LOG_LEVEL_INFO, "All channels are disabled"); } } else if (g_strcasecmp(item, "allow_multimon") == 0) { client_info->multimon = g_text2bool(value); if (client_info->multimon == 0) { LOG(LOG_LEVEL_INFO, "Multi monitor server support disabled"); } } else if (g_strcasecmp(item, "max_bpp") == 0) { client_info->max_bpp = g_atoi(value); } else if (g_strcasecmp(item, "rfx_min_pixel") == 0) { client_info->rfx_min_pixel = g_atoi(value); } else if (g_strcasecmp(item, "new_cursors") == 0) { client_info->pointer_flags = g_text2bool(value) == 0 ? 2 : 0; } else if (g_strcasecmp(item, "require_credentials") == 0) { client_info->require_credentials = g_text2bool(value); } else if (g_strcasecmp(item, "enable_token_login") == 0) { client_info->enable_token_login = g_text2bool(value); } else if (g_strcasecmp(item, "use_fastpath") == 0) { if (g_strcasecmp(value, "output") == 0) { client_info->use_fast_path = 1; } else if (g_strcasecmp(value, "input") == 0) { client_info->use_fast_path = 2; } else if (g_strcasecmp(value, "both") == 0) { client_info->use_fast_path = 3; } else if (g_strcasecmp(value, "none") == 0) { client_info->use_fast_path = 0; } else { LOG(LOG_LEVEL_WARNING, "Your configured fastpath level is " "undefined, fastpath will not be used"); client_info->use_fast_path = 0; } } else if (g_strcasecmp(item, "ssl_protocols") == 0) { /* put leading/trailing comma to properly detect "TLSv1" without regex */ tmp_length = g_strlen(value) + 3; tmp = g_new(char, tmp_length); g_snprintf(tmp, tmp_length, "%s%s%s", ",", value, ","); /* replace all spaces with comma */ /* to accept space after comma */ while ((pos = g_pos(tmp, " ")) != -1) { tmp[pos] = ','; } ssl_get_protocols_from_string(tmp, &(client_info->ssl_protocols)); g_free(tmp); } else if (g_strcasecmp(item, "tls_ciphers") == 0) { client_info->tls_ciphers = g_strdup(value); } else if (g_strcasecmp(item, "security_layer") == 0) { if (g_strcasecmp(value, "rdp") == 0) { client_info->security_layer = PROTOCOL_RDP; } else if (g_strcasecmp(value, "tls") == 0) { client_info->security_layer = PROTOCOL_SSL; } else if (g_strcasecmp(value, "hybrid") == 0) { client_info->security_layer = PROTOCOL_SSL | PROTOCOL_HYBRID; } else if (g_strcasecmp(value, "negotiate") == 0) { client_info->security_layer = PROTOCOL_SSL | PROTOCOL_HYBRID | PROTOCOL_HYBRID_EX; } else { LOG(LOG_LEVEL_WARNING, "security_layer=%s is not " "recognized, will use security_layer=negotiate", value); client_info->security_layer = PROTOCOL_SSL | PROTOCOL_HYBRID | PROTOCOL_HYBRID_EX; } } else if (g_strcasecmp(item, "certificate") == 0) { g_memset(client_info->certificate, 0, sizeof(char) * 1024); if (g_strlen(value) == 0) { /* default certificate path */ g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH); LOG(LOG_LEVEL_INFO, "Using default X.509 certificate: %s", client_info->certificate); } else if (value[0] != '/') { /* default certificate path */ g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH); LOG(LOG_LEVEL_WARNING, "X.509 certificate should use absolute path, using " "default instead: %s", client_info->certificate); } else { /* use user defined certificate */ g_strncpy(client_info->certificate, value, 1023); } if (!g_file_readable(client_info->certificate)) { LOG(LOG_LEVEL_ERROR, "Cannot read certificate file %s: %s", client_info->certificate, g_get_strerror()); } } else if (g_strcasecmp(item, "key_file") == 0) { g_memset(client_info->key_file, 0, sizeof(char) * 1024); if (g_strlen(value) == 0) { /* default key_file path */ g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH); LOG(LOG_LEVEL_INFO, "Using default X.509 key file: %s", client_info->key_file); } else if (value[0] != '/') { /* default key_file path */ g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH); LOG(LOG_LEVEL_WARNING, "X.509 key file should use absolute path, using " "default instead: %s", client_info->key_file); } else { /* use user defined key_file */ g_strncpy(client_info->key_file, value, 1023); } if (!g_file_readable(client_info->key_file)) { LOG(LOG_LEVEL_ERROR, "Cannot read private key file %s: %s", client_info->key_file, g_get_strerror()); } } else if (g_strcasecmp(item, "domain_user_separator") == 0 && g_strlen(value) > 0) { g_strncpy(client_info->domain_user_separator, value, sizeof(client_info->domain_user_separator) - 1); } else if (g_strcasecmp(item, "xrdp.override_keyboard_type") == 0) { client_info->xrdp_keyboard_overrides.type = g_atoix(value); } else if (g_strcasecmp(item, "xrdp.override_keyboard_subtype") == 0) { client_info->xrdp_keyboard_overrides.subtype = g_atoix(value); } else if (g_strcasecmp(item, "xrdp.override_keylayout") == 0) { client_info->xrdp_keyboard_overrides.layout = g_atoix(value); } } list_delete(items); list_delete(values); return 0; } #if defined(XRDP_NEUTRINORDP) /*****************************************************************************/ static void cpuid(tui32 info, tui32 *eax, tui32 *ebx, tui32 *ecx, tui32 *edx) { #ifdef __GNUC__ #if defined(__i386__) || defined(__x86_64__) __asm volatile ( /* The EBX (or RBX register on x86_64) is used for the PIC base address and must not be corrupted by our inline assembly. */ #if defined(__i386__) "mov %%ebx, %%esi;" "cpuid;" "xchg %%ebx, %%esi;" #else "mov %%rbx, %%rsi;" "cpuid;" "xchg %%rbx, %%rsi;" #endif : "=a" (*eax), "=S" (*ebx), "=c" (*ecx), "=d" (*edx) : "0" (info) ); #endif #endif } /*****************************************************************************/ static tui32 xrdp_rdp_detect_cpu(void) { tui32 eax; tui32 ebx; tui32 ecx; tui32 edx; tui32 cpu_opt; eax = 0; ebx = 0; ecx = 0; edx = 0; cpu_opt = 0; cpuid(1, &eax, &ebx, &ecx, &edx); if (edx & (1 << 26)) { LOG_DEVEL(LOG_LEVEL_TRACE, "SSE2 detected"); cpu_opt |= CPU_SSE2; } return cpu_opt; } #endif /*****************************************************************************/ struct xrdp_rdp * xrdp_rdp_create(struct xrdp_session *session, struct trans *trans) { struct xrdp_rdp *self = (struct xrdp_rdp *)NULL; LOG_DEVEL(LOG_LEVEL_TRACE, "in xrdp_rdp_create"); self = (struct xrdp_rdp *)g_malloc(sizeof(struct xrdp_rdp), 1); self->session = session; self->share_id = 66538; /* read ini settings */ xrdp_rdp_read_config(session->xrdp_ini, &self->client_info); /* create sec layer */ self->sec_layer = xrdp_sec_create(self, trans); /* default 8 bit v1 color bitmap cache entries and size */ self->client_info.cache1_entries = 600; self->client_info.cache1_size = 256; self->client_info.cache2_entries = 300; self->client_info.cache2_size = 1024; self->client_info.cache3_entries = 262; self->client_info.cache3_size = 4096; /* load client ip info */ g_sck_get_peer_ip_address(trans->sck, self->client_info.client_ip, sizeof(self->client_info.client_ip), NULL); g_sck_get_peer_description(trans->sck, self->client_info.client_description, sizeof(self->client_info.client_description)); self->mppc_enc = mppc_enc_new(PROTO_RDP_50); #if defined(XRDP_NEUTRINORDP) self->rfx_enc = rfx_context_new(); rfx_context_set_cpu_opt(self->rfx_enc, xrdp_rdp_detect_cpu()); #endif self->client_info.size = sizeof(self->client_info); self->client_info.version = CLIENT_INFO_CURRENT_VERSION; LOG_DEVEL(LOG_LEVEL_TRACE, "out xrdp_rdp_create"); return self; } /*****************************************************************************/ void xrdp_rdp_delete(struct xrdp_rdp *self) { if (self == 0) { return; } xrdp_sec_delete(self->sec_layer); mppc_enc_free(self->mppc_enc); #if defined(XRDP_NEUTRINORDP) rfx_context_free((RFX_CONTEXT *)(self->rfx_enc)); #endif g_free(self->client_info.tls_ciphers); g_free(self); } /*****************************************************************************/ /* Initialize the stream for sending a [MS-RDPBCGR] Control PDU */ int xrdp_rdp_init(struct xrdp_rdp *self, struct stream *s) { if (xrdp_sec_init(self->sec_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_init: xrdp_sec_init failed"); return 1; } s_push_layer(s, rdp_hdr, 6); /* 6 = sizeof(TS_SHARECONTROLHEADER) */ return 0; } /*****************************************************************************/ /* Initialize the stream for sending a [MS-RDPBCGR] Data PDU */ int xrdp_rdp_init_data(struct xrdp_rdp *self, struct stream *s) { if (xrdp_sec_init(self->sec_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_init_data: xrdp_sec_init failed"); return 1; } s_push_layer(s, rdp_hdr, 18); /* 18 = sizeof(TS_SHAREDATAHEADER) */ return 0; } /*****************************************************************************/ /* Receives and parses pdu code from next data unit. @param self @param (in/out) s: the stream to read from. Upon return the stream is ? @param (out) code: the pdu code from the packet returns error */ int xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code) { int error = 0; int len = 0; int pdu_code = 0; int chan = 0; const tui8 *header; if (s->next_packet == 0 || s->next_packet >= s->end) { /* check for fastpath first */ header = (const tui8 *) (s->p); if (header[0] != 0x3) { if (xrdp_sec_recv_fastpath(self->sec_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_recv: xrdp_sec_recv_fastpath failed"); return 1; } /* next_packet gets set in xrdp_sec_recv_fastpath */ *code = 2; // special code for fastpath input LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_rdp_recv: out code 2 (fastpath)"); return 0; } /* not fastpath, do tpkt */ chan = 0; error = xrdp_sec_recv(self->sec_layer, s, &chan); if (error == -1) /* special code for send demand active */ { s->next_packet = 0; *code = -1; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_rdp_recv: out code -1 (send demand active)"); return 0; } if (error != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_recv: xrdp_sec_recv failed"); return 1; } if ((chan != MCS_GLOBAL_CHANNEL) && (chan > 0)) { if (chan > MCS_GLOBAL_CHANNEL) { if (xrdp_channel_process(self->sec_layer->chan_layer, s, chan) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_recv: xrdp_channel_process failed"); } } else { if (chan != 1) { LOG_DEVEL(LOG_LEVEL_WARNING, "xrdp_rdp_recv: Wrong channel Id to be handled " "by xrdp_channel_process, channel id %d", chan); } } s->next_packet = 0; *code = 0; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_rdp_recv: out code 0 (skip data) " "data processed by channel id %d", chan); return 0; } s->next_packet = s->p; } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_rdp_recv: stream not touched"); s->p = s->next_packet; } if (!s_check_rem_and_log(s, 6, "Parsing [MS-RDPBCGR] TS_SHARECONTROLHEADER")) { s->next_packet = 0; *code = 0; LOG(LOG_LEVEL_ERROR, "xrdp_rdp_recv: out code 0 (skip data) " "bad RDP packet"); return 0; } else { in_uint16_le(s, len); /* totalLength */ in_uint16_le(s, pdu_code); /* pduType */ *code = pdu_code & 0xf; in_uint8s(s, 2); /* pduSource */ s->next_packet += len; LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] TS_SHARECONTROLHEADER " "totalLength %d, pduType.type %s (%d), pduType.PDUVersion %d, " "pduSource (ignored)", len, PDUTYPE_TO_STR(*code), *code, ((pdu_code & 0xfff0) >> 4)); return 0; } } /*****************************************************************************/ /* Send a [MS-RDPBCGR] Control PDU with for the given pduType with the headers added */ int xrdp_rdp_send(struct xrdp_rdp *self, struct stream *s, int pdu_type) { int len = 0; s_pop_layer(s, rdp_hdr); len = s->end - s->p; /* TS_SHARECONTROLHEADER */ out_uint16_le(s, len); /* totalLength */ out_uint16_le(s, 0x10 | pdu_type); /* pduType */ out_uint16_le(s, self->mcs_channel); /* pduSource */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_SHARECONTROLHEADER " "totalLength %d, pduType.type %s (%d), pduType.PDUVersion %d, " "pduSource %d", len, PDUTYPE_TO_STR(pdu_type & 0xf), pdu_type & 0xf, (((0x10 | pdu_type) & 0xfff0) >> 4), self->mcs_channel); if (xrdp_sec_send(self->sec_layer, s, MCS_GLOBAL_CHANNEL) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send: xrdp_sec_send failed"); return 1; } return 0; } /*****************************************************************************/ /* Send a [MS-RDPBCGR] Data PDU for the given pduType2 from * the specified source with the headers added and data compressed */ int xrdp_rdp_send_data_from_channel(struct xrdp_rdp *self, struct stream *s, int data_pdu_type, int channel_id, int compress) { int len; int ctype; int clen; int dlen; int pdulen; int pdutype; int tocomplen; int iso_offset; int mcs_offset; int sec_offset; int rdp_offset; struct stream ls; struct xrdp_mppc_enc *mppc_enc; s_pop_layer(s, rdp_hdr); len = (int)(s->end - s->p); pdutype = 0x10 | PDUTYPE_DATAPDU; pdulen = len; dlen = len; ctype = 0; clen = len; tocomplen = pdulen - 18; if (compress && self->client_info.rdp_compression && self->session->up_and_running) { mppc_enc = self->mppc_enc; if (compress_rdp(mppc_enc, (tui8 *)(s->p + 18), tocomplen)) { clen = mppc_enc->bytes_in_opb + 18; pdulen = clen; ctype = mppc_enc->flags; iso_offset = (int)(s->iso_hdr - s->data); mcs_offset = (int)(s->mcs_hdr - s->data); sec_offset = (int)(s->sec_hdr - s->data); rdp_offset = (int)(s->rdp_hdr - s->data); /* outputBuffer has 64 bytes preceding it */ ls.data = mppc_enc->outputBuffer - (rdp_offset + 18); ls.p = ls.data + rdp_offset; ls.end = ls.p + clen; ls.size = s->end - s->data; ls.iso_hdr = ls.data + iso_offset; ls.mcs_hdr = ls.data + mcs_offset; ls.sec_hdr = ls.data + sec_offset; ls.rdp_hdr = ls.data + rdp_offset; ls.channel_hdr = 0; ls.next_packet = 0; s = &ls; } else { LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_rdp_send_data_from_channel: " "compress_rdp failed, sending " "uncompressed data. type %d, flags %d", mppc_enc->protocol_type, mppc_enc->flags); } } /* TS_SHARECONTROLHEADER */ out_uint16_le(s, pdulen); /* totalLength */ out_uint16_le(s, pdutype); /* pduType */ out_uint16_le(s, channel_id); /* pduSource */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_SHARECONTROLHEADER " "totalLength %d, pduType.type %s (%d), pduType.PDUVersion %d, " "pduSource %d", pdulen, PDUTYPE_TO_STR(pdutype & 0xf), pdutype & 0xf, ((pdutype & 0xfff0) >> 4), channel_id); /* TS_SHAREDATAHEADER */ out_uint32_le(s, self->share_id); out_uint8(s, 0); /* pad */ out_uint8(s, 1); /* streamID */ out_uint16_le(s, dlen); /* uncompressedLength */ out_uint8(s, data_pdu_type); /* pduType2 */ out_uint8(s, ctype); /* compressedType */ out_uint16_le(s, clen); /* compressedLength */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_SHAREDATAHEADER " "shareID %d, streamID 1, uncompressedLength %d, " "pduType2 0x%2.2x, compressedType 0x%2.2x, compressedLength %d", self->share_id, dlen, data_pdu_type, ctype, clen); if (xrdp_sec_send(self->sec_layer, s, MCS_GLOBAL_CHANNEL) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_data_from_channel: " "xrdp_sec_send failed"); return 1; } return 0; } /*****************************************************************************/ /* Send a [MS-RDPBCGR] Data PDU on the MCS channel for the given pduType2 * with the headers added and data compressed */ int xrdp_rdp_send_data(struct xrdp_rdp *self, struct stream *s, int data_pdu_type) { return xrdp_rdp_send_data_from_channel(self, s, data_pdu_type, self->mcs_channel, 1); } /*****************************************************************************/ /* returns the fastpath rdp byte count */ int xrdp_rdp_get_fastpath_bytes(struct xrdp_rdp *self) { if (self->client_info.rdp_compression) { return 4; } return 3; } /*****************************************************************************/ int xrdp_rdp_init_fastpath(struct xrdp_rdp *self, struct stream *s) { if (xrdp_sec_init_fastpath(self->sec_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_init_fastpath: xrdp_sec_init_fastpath failed"); return 1; } if (self->client_info.rdp_compression) { s_push_layer(s, rdp_hdr, 4); } else { s_push_layer(s, rdp_hdr, 3); } return 0; } /*****************************************************************************/ /* returns error */ /* 2.2.9.1.2.1 Fast-Path Update (TS_FP_UPDATE) * http://msdn.microsoft.com/en-us/library/cc240622.aspx */ int xrdp_rdp_send_fastpath(struct xrdp_rdp *self, struct stream *s, int data_pdu_type) { int updateHeader; int updateCode; int fragmentation; int compression; int comp_type; int comp_len; int no_comp_len; int send_len; int cont; int header_bytes; int sec_bytes; int to_comp_len; int sec_offset; int rdp_offset; struct stream frag_s; struct stream comp_s; struct stream send_s; struct xrdp_mppc_enc *mppc_enc; char comp_type_str[7]; comp_type_str[0] = '\0'; s_pop_layer(s, rdp_hdr); updateCode = data_pdu_type; if (self->client_info.rdp_compression) { compression = 2; header_bytes = 4; } else { compression = 0; header_bytes = 3; } sec_bytes = xrdp_sec_get_fastpath_bytes(self->sec_layer); fragmentation = 0; frag_s = *s; sec_offset = (int)(frag_s.sec_hdr - frag_s.data); rdp_offset = (int)(frag_s.rdp_hdr - frag_s.data); cont = 1; while (cont) { comp_type = 0; send_s = frag_s; no_comp_len = (int)(frag_s.end - frag_s.p); if (no_comp_len > FASTPATH_FRAG_SIZE) { no_comp_len = FASTPATH_FRAG_SIZE; if (fragmentation == 0) { fragmentation = 2; /* FASTPATH_FRAGMENT_FIRST */ } else if (fragmentation == 2) { fragmentation = 3; /* FASTPATH_FRAGMENT_NEXT */ } } else { if (fragmentation != 0) { fragmentation = 1; /* FASTPATH_FRAGMENT_LAST */ } } send_len = no_comp_len; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_rdp_send_fastpath: no_comp_len %d, fragmentation %d", no_comp_len, fragmentation); if ((compression != 0) && (no_comp_len > header_bytes + 16)) { to_comp_len = no_comp_len - header_bytes; mppc_enc = self->mppc_enc; if (compress_rdp(mppc_enc, (tui8 *)(frag_s.p + header_bytes), to_comp_len)) { comp_len = mppc_enc->bytes_in_opb + header_bytes; send_len = comp_len; comp_type = mppc_enc->flags; /* outputBuffer has 64 bytes preceding it */ g_memset(&comp_s, 0, sizeof(comp_s)); comp_s.data = mppc_enc->outputBuffer - (rdp_offset + header_bytes); comp_s.p = comp_s.data + rdp_offset; comp_s.end = comp_s.p + send_len; comp_s.size = send_len; comp_s.sec_hdr = comp_s.data + sec_offset; comp_s.rdp_hdr = comp_s.data + rdp_offset; send_s = comp_s; } else { LOG(LOG_LEVEL_DEBUG, "compress_rdp failed, sending uncompressed data. " "type %d, flags %d", mppc_enc->protocol_type, mppc_enc->flags); } } updateHeader = (updateCode & 15) | ((fragmentation & 3) << 4) | ((compression & 3) << 6); send_s.end = send_s.p + send_len; send_s.size = send_s.end - send_s.data; out_uint8(&send_s, updateHeader); if (compression != 0) { out_uint8(&send_s, comp_type); g_snprintf(comp_type_str, 7, "0x%4.4x", comp_type); } send_len -= header_bytes; out_uint16_le(&send_s, send_len); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] TS_FP_UPDATE " "updateCode %d, fragmentation %d, compression %d, compressionFlags %s, size %d", updateCode, fragmentation, compression, (compression ? comp_type_str : "(not present)"), send_len); if (xrdp_sec_send_fastpath(self->sec_layer, &send_s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_fastpath: xrdp_sec_send_fastpath failed"); return 1; } frag_s.p += no_comp_len; cont = frag_s.p < frag_s.end; frag_s.p -= header_bytes; frag_s.sec_hdr = frag_s.p - sec_bytes; frag_s.data = frag_s.sec_hdr; } return 0; } /*****************************************************************************/ /* Send a [MS-RDPBCGR] TS_UPDATE_SYNC or TS_FP_UPDATE_SYNCHRONIZE message depending on if the client supports the fast path capability or not */ int xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self) { struct stream *s = (struct stream *)NULL; make_stream(s); init_stream(s, 8192); if (self->client_info.use_fast_path & 1) /* fastpath output supported */ { if (xrdp_rdp_init_fastpath(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_data_update_sync: xrdp_rdp_init_fastpath failed"); free_stream(s); return 1; } } else /* slowpath */ { if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_data_update_sync: xrdp_rdp_init_data failed"); free_stream(s); return 1; } out_uint16_le(s, RDP_UPDATE_SYNCHRONIZE); /* updateType */ out_uint16_le(s, 0); /* pad */ } s_mark_end(s); if (self->client_info.use_fast_path & 1) /* fastpath output supported */ { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FP_UPDATE_SYNCHRONIZE"); if (xrdp_rdp_send_fastpath(self, s, FASTPATH_UPDATETYPE_SYNCHRONIZE) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_FP_UPDATE_SYNCHRONIZE failed"); free_stream(s); return 1; } } else /* slowpath */ { LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_UPDATE_SYNC " "updateType %s (%d)", GRAPHICS_UPDATE_TYPE_TO_STR(RDP_UPDATE_SYNCHRONIZE), RDP_UPDATE_SYNCHRONIZE); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_UPDATE) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_UPDATE_SYNC failed"); free_stream(s); return 1; } } free_stream(s); return 0; } /*****************************************************************************/ int xrdp_rdp_incoming(struct xrdp_rdp *self) { struct xrdp_iso *iso; iso = self->sec_layer->mcs_layer->iso_layer; if (xrdp_sec_incoming(self->sec_layer) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_incoming: xrdp_sec_incoming failed"); return 1; } self->mcs_channel = self->sec_layer->mcs_layer->userid + MCS_USERCHANNEL_BASE; LOG_DEVEL(LOG_LEVEL_DEBUG, "xrdp_rdp->mcs_channel %d", self->mcs_channel); /* log TLS version and cipher of TLS connections */ if (iso->selectedProtocol > PROTOCOL_RDP) { LOG(LOG_LEVEL_INFO, "TLS connection established from %s %s with cipher %s", self->client_info.client_description, iso->trans->ssl_protocol, iso->trans->cipher_name); } /* log non-TLS connections */ else { int crypt_level = self->sec_layer->crypt_level; const char *security_level = (crypt_level == CRYPT_LEVEL_NONE) ? "none" : (crypt_level == CRYPT_LEVEL_LOW) ? "low" : (crypt_level == CRYPT_LEVEL_CLIENT_COMPATIBLE) ? "medium" : (crypt_level == CRYPT_LEVEL_HIGH) ? "high" : (crypt_level == CRYPT_LEVEL_FIPS) ? "fips" : /* default */ "unknown"; LOG(LOG_LEVEL_INFO, "Non-TLS connection established from %s with security level : %s", self->client_info.client_description, security_level); } return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_POINTER_PDU message */ static int xrdp_rdp_process_data_pointer(struct xrdp_rdp *self, struct stream *s) { LOG_DEVEL(LOG_LEVEL_WARNING, "Protocol error ignored: a [MS-RDPBCGR] " "TS_SHAREDATAHEADER PDUTYPE2_POINTER was received by the server " "but this type of PDU is only suppose to be sent by the server " "to the client."); return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_INPUT_PDU_DATA message */ static int xrdp_rdp_process_data_input(struct xrdp_rdp *self, struct stream *s) { int num_events; int index; int msg_type; int device_flags; int param1; int param2; int time; if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_INPUT_PDU_DATA")) { return 1; } in_uint16_le(s, num_events); in_uint8s(s, 2); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_INPUT_PDU_DATA " "numEvents %d", num_events); for (index = 0; index < num_events; index++) { if (!s_check_rem_and_log(s, 12, "Parsing [MS-RDPBCGR] TS_INPUT_EVENT")) { return 1; } in_uint32_le(s, time); in_uint16_le(s, msg_type); in_uint16_le(s, device_flags); in_sint16_le(s, param1); in_sint16_le(s, param2); LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_INPUT_EVENT " "eventTime %d, messageType 0x%4.4x", time, msg_type); switch (msg_type) { case RDP_INPUT_SYNCHRONIZE: LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_INPUT_EVENT - TS_SYNC_EVENT " "toggleFlags 0x%8.8x", ((param2 << 16) | param1)); break; case RDP_INPUT_SCANCODE: LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_INPUT_EVENT - TS_KEYBOARD_EVENT " "keyboardFlags 0x%4.4x, keyCode %d", device_flags, param1); break; case RDP_INPUT_UNICODE: LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_INPUT_EVENT - TS_UNICODE_KEYBOARD_EVENT " "keyboardFlags 0x%4.4x, unicodeCode %d", device_flags, param1); break; case RDP_INPUT_MOUSE: LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_INPUT_EVENT - TS_POINTER_EVENT " "pointerFlags 0x%4.4x, xPos %d, yPos %d", device_flags, param1, param2); break; case RDP_INPUT_MOUSEX: LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_INPUT_EVENT - TS_POINTERX_EVENT " "pointerFlags 0x%4.4x, xPos %d, yPos %d", device_flags, param1, param2); break; default: LOG_DEVEL(LOG_LEVEL_WARNING, "Received unknown [MS-RDPBCGR] TS_INPUT_EVENT " "messageType 0x%4.4x", msg_type); break; } if (self->session->callback != 0) { /* msg_type can be RDP_INPUT_SYNCHRONIZE - 0 RDP_INPUT_SCANCODE - 4 RDP_INPUT_MOUSE - 0x8001 RDP_INPUT_MOUSEX - 0x8002 */ /* call to xrdp_wm.c : callback */ self->session->callback(self->session->id, msg_type, param1, param2, device_flags, time); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "Bug: no callback registered for xrdp_rdp_process_data_input"); } } LOG_DEVEL(LOG_LEVEL_DEBUG, "Processing [MS-RDPBCGR] TS_INPUT_PDU_DATA complete"); return 0; } /*****************************************************************************/ /* Send a [MS-RDPBCGR] TS_SYNCHRONIZE_PDU message */ static int xrdp_rdp_send_synchronise(struct xrdp_rdp *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_synchronise: xrdp_rdp_init_data failed"); free_stream(s); return 1; } out_uint16_le(s, 1); /* messageType (2 bytes) */ out_uint16_le(s, 1002); /* targetUser (2 bytes) */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_SYNCHRONIZE_PDU " "messageType 1, targetUser 1002"); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_SYNCHRONISE) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_SYNCHRONIZE_PDU failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* Send a [MS-RDPBCGR] TS_CONTROL_PDU message */ static int xrdp_rdp_send_control(struct xrdp_rdp *self, int action) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_control: xrdp_rdp_init_data failed"); free_stream(s); return 1; } out_uint16_le(s, action); out_uint16_le(s, 0); /* userid */ out_uint32_le(s, 1002); /* control id */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_CONTROL_PDU " "action %d, grantId 0, controlId 1002", action); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_CONTROL) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_CONTROL_PDU failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_CONTROL_PDU message */ static int xrdp_rdp_process_data_control(struct xrdp_rdp *self, struct stream *s) { int action; in_uint16_le(s, action); in_uint8s(s, 2); /* user id */ in_uint8s(s, 4); /* control id */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_CONTROL_PDU " "action 0x%4.4x, grantId (ignored), controlId (ignored)", action); if (action == RDP_CTL_REQUEST_CONTROL) { LOG_DEVEL(LOG_LEVEL_DEBUG, "Responding to [MS-RDPBCGR] TS_CONTROL_PDU " "action CTRLACTION_REQUEST_CONTROL with 3 messages: " "TS_SYNCHRONIZE_PDU, TS_CONTROL_PDU with CTRLACTION_COOPERATE, " " and TS_CONTROL_PDU with CTRLACTION_GRANTED_CONTROL"); xrdp_rdp_send_synchronise(self); xrdp_rdp_send_control(self, RDP_CTL_COOPERATE); xrdp_rdp_send_control(self, RDP_CTL_GRANT_CONTROL); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "Received [MS-RDPBCGR] TS_CONTROL_PDU " "action %d is unknown (skipped)", action); } return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_SYNCHRONIZE_PDU message */ static int xrdp_rdp_process_data_sync(struct xrdp_rdp *self) { LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_SYNCHRONIZE_PDU - no-op"); return 0; } /*****************************************************************************/ /* 2.2.11.2.1 Refresh Rect PDU Data (TS_REFRESH_RECT_PDU) */ static int xrdp_rdp_process_screen_update(struct xrdp_rdp *self, struct stream *s) { int index; int num_rects; int left; int top; int right; int bottom; int cx; int cy; if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_REFRESH_RECT_PDU")) { return 1; } in_uint8(s, num_rects); in_uint8s(s, 3); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_REFRESH_RECT_PDU " "numberOfAreas %d", num_rects); for (index = 0; index < num_rects; index++) { if (!s_check_rem_and_log(s, 8, "Parsing [MS-RDPBCGR] TS_RECTANGLE16")) { return 1; } /* Inclusive Rectangle (TS_RECTANGLE16) */ in_uint16_le(s, left); in_uint16_le(s, top); in_uint16_le(s, right); in_uint16_le(s, bottom); LOG_DEVEL(LOG_LEVEL_TRACE, "With field [MS-RDPBCGR] TS_RECTANGLE16 " "left %d, top %d, right %d, bottom %d", left, top, right, bottom); cx = (right - left) + 1; cy = (bottom - top) + 1; if (self->session->callback != 0) { self->session->callback(self->session->id, 0x4444, left, top, cx, cy); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "Bug: no callback registered for xrdp_rdp_process_screen_update"); } } return 0; } /*****************************************************************************/ /* Send a [MS-RDPBCGR] TS_FONT_MAP_PDU message */ static int xrdp_rdp_send_fontmap(struct xrdp_rdp *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_fontmap: xrdp_rdp_init_data failed"); free_stream(s); return 1; } out_uint16_le(s, 0); /* numberEntries */ out_uint16_le(s, 0); /* totalNumEntries */ out_uint16_le(s, 0x3); /* mapFlags (sequence flags) */ out_uint16_le(s, 0x4); /* entrySize */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_FONT_MAP_PDU " "numberEntries 0, totalNumEntries 0, mapFlags 0x0003, entrySize 4"); if (xrdp_rdp_send_data(self, s, 0x28) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_FONT_MAP_PDU failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_FONT_LIST_PDU message */ static int xrdp_rdp_process_data_font(struct xrdp_rdp *self, struct stream *s) { int seq; if (!s_check_rem_and_log(s, 6, "Parsing [MS-RDPBCGR] TS_FONT_LIST_PDU")) { return 1; } in_uint8s(s, 2); /* NumberFonts: 0x0, SHOULD be set to 0 */ in_uint8s(s, 2); /* TotalNumberFonts: 0x0, SHOULD be set to 0 */ in_uint16_le(s, seq); /* ListFlags */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_FONT_LIST_PDU " "numberFonts (ignored), totalNumFonts (ignored), listFlags 0x%4.4x", seq); /* 419 client sends Seq 1, then 2 */ /* 2600 clients sends only Seq 3 */ /* listFlags SHOULD be set to 0x0003, which is the logical OR'd value of FONTLIST_FIRST (0x0001) and FONTLIST_LAST (0x0002) */ if (seq == 2 || seq == 3) /* after second font message, we are up and */ { /* running */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Client sent FONTLIST_LAST, replying with server fontmap"); xrdp_rdp_send_fontmap(self); self->session->up_and_running = 1; LOG_DEVEL(LOG_LEVEL_INFO, "yeah, up_and_running"); xrdp_rdp_send_data_update_sync(self); /* This is also the end of an Deactivation-reactivation * sequence [MS-RDPBCGR] 1.3.1.3 */ xrdp_rdp_suppress_output(self, 0, XSO_REASON_DEACTIVATE_REACTIVATE, 0, 0, self->client_info.display_sizes.session_width, self->client_info.display_sizes.session_height); if (self->session->callback != 0) { /* call to xrdp_wm.c : callback */ self->session->callback(self->session->id, 0x555a, 0, 0, 0, 0); } } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "Received [MS-RDPBCGR] TS_FONT_LIST_PDU " "without FONTLIST_LAST in the listFlags field. Ignoring message."); } return 0; } /*****************************************************************************/ /* Send a Sending [MS-RDPBCGR] TS_SHUTDOWN_DENIED_PDU message */ static int xrdp_rdp_send_disconnect_query_response(struct xrdp_rdp *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_disconnect_query_response: xrdp_rdp_init_data failed"); free_stream(s); return 1; } s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_SHUTDOWN_DENIED_PDU"); if (xrdp_rdp_send_data(self, s, PDUTYPE2_SHUTDOWN_DENIED) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_SHUTDOWN_DENIED_PDU failed"); free_stream(s); return 1; } free_stream(s); return 0; } #if 0 /* not used */ /*****************************************************************************/ /* Send a [MS-RDPBCGR] TS_SET_ERROR_INFO_PDU message */ static int xrdp_rdp_send_disconnect_reason(struct xrdp_rdp *self, int reason) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_disconnect_reason: xrdp_rdp_init_data failed"); free_stream(s); return 1; } out_uint32_le(s, reason); s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_SET_ERROR_INFO_PDU " "errorInfo 0x%8.8x", reason); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_DISCONNECT) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_SET_ERROR_INFO_PDU failed"); free_stream(s); return 1; } free_stream(s); return 0; } #endif /*****************************************************************************/ /* Process a [MS-RDPRFX] TS_FRAME_ACKNOWLEDGE_PDU message */ static int xrdp_rdp_process_frame_ack(struct xrdp_rdp *self, struct stream *s) { int frame_id; if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPRFX] TS_FRAME_ACKNOWLEDGE_PDU")) { return 1; } in_uint32_le(s, frame_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPRFX] TS_FRAME_ACKNOWLEDGE_PDU " "frameID %d", frame_id); if (self->session->callback != 0) { /* call to xrdp_wm.c : callback */ self->session->callback(self->session->id, 0x5557, frame_id, 0, 0, 0); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "Bug: no callback registered for xrdp_rdp_process_frame_ack"); } return 0; } /*****************************************************************************/ void xrdp_rdp_suppress_output(struct xrdp_rdp *self, int suppress, enum suppress_output_reason reason, int left, int top, int right, int bottom) { int old_suppress = self->client_info.suppress_output_mask != 0; if (suppress) { self->client_info.suppress_output_mask |= (unsigned int)reason; } else { self->client_info.suppress_output_mask &= ~(unsigned int)reason; } int current_suppress = self->client_info.suppress_output_mask != 0; if (current_suppress != old_suppress && self->session->callback != 0) { self->session->callback(self->session->id, 0x5559, suppress, MAKELONG(left, top), MAKELONG(right, bottom), 0); } } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_SUPPRESS_OUTPUT_PDU message */ static int xrdp_rdp_process_suppress(struct xrdp_rdp *self, struct stream *s) { int rv = 1; int allowDisplayUpdates; int left; int top; int right; int bottom; if (s_check_rem_and_log(s, 1, "Parsing [MS-RDPBCGR] TS_SUPPRESS_OUTPUT_PDU")) { in_uint8(s, allowDisplayUpdates); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_SUPPRESS_OUTPUT_PDU " "allowDisplayUpdates %d", allowDisplayUpdates); switch (allowDisplayUpdates) { case 0: /* SUPPRESS_DISPLAY_UPDATES */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Client requested display output to be suppressed"); xrdp_rdp_suppress_output(self, 1, XSO_REASON_CLIENT_REQUEST, 0, 0, 0, 0); rv = 0; break; case 1: /* ALLOW_DISPLAY_UPDATES */ LOG_DEVEL(LOG_LEVEL_DEBUG, "Client requested display output to be enabled"); if (s_check_rem_and_log(s, 11, "Parsing [MS-RDPBCGR] Padding and TS_RECTANGLE16")) { in_uint8s(s, 3); /* pad */ in_uint16_le(s, left); in_uint16_le(s, top); in_uint16_le(s, right); in_uint16_le(s, bottom); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_RECTANGLE16 " "left %d, top %d, right %d, bottom %d", left, top, right, bottom); xrdp_rdp_suppress_output(self, 0, XSO_REASON_CLIENT_REQUEST, left, top, right, bottom); rv = 0; } break; } } return rv; } /*****************************************************************************/ /* Process a [MS-RDPBCGR] TS_SHAREDATAHEADER message based on it's pduType2 */ int xrdp_rdp_process_data(struct xrdp_rdp *self, struct stream *s) { int uncompressedLength; int pduType2; int compressedType; int compressedLength; if (!s_check_rem_and_log(s, 12, "Parsing [MS-RDPBCGR] TS_SHAREDATAHEADER")) { return 1; } in_uint8s(s, 6); /* shareID (4 bytes), padding (1 byte), streamID (1 byte) */ in_uint16_le(s, uncompressedLength); /* shareID */ in_uint8(s, pduType2); in_uint8(s, compressedType); in_uint16_le(s, compressedLength); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_SHAREDATAHEADER " "shareID (ignored), streamID (ignored), uncompressedLength %d, " "pduType2 0x%2.2x, compressedType 0x%2.2x, compressedLength %d", uncompressedLength, pduType2, compressedType, compressedLength); if (compressedType != 0) { /* don't support compression */ /* PACKET_COMPR_TYPE_8K = 0x00 */ LOG(LOG_LEVEL_ERROR, "Only RDP 4.0 bulk compression " "(PACKET_COMPR_TYPE_8K) is supported by XRDP"); return 1; } if (compressedLength > uncompressedLength) { LOG(LOG_LEVEL_ERROR, "The compressed length %d is larger than " "the uncompressed length %d, failing the processing of this " "PDU", compressedLength, uncompressedLength); return 1; } switch (pduType2) { case RDP_DATA_PDU_POINTER: /* 27(0x1b) */ xrdp_rdp_process_data_pointer(self, s); break; case RDP_DATA_PDU_INPUT: /* 28(0x1c) */ xrdp_rdp_process_data_input(self, s); break; case RDP_DATA_PDU_CONTROL: /* 20(0x14) */ xrdp_rdp_process_data_control(self, s); break; case RDP_DATA_PDU_SYNCHRONISE: /* 31(0x1f) */ xrdp_rdp_process_data_sync(self); break; case PDUTYPE2_REFRESH_RECT: xrdp_rdp_process_screen_update(self, s); break; case PDUTYPE2_SUPPRESS_OUTPUT: /* 35(0x23) */ xrdp_rdp_process_suppress(self, s); break; case PDUTYPE2_SHUTDOWN_REQUEST: /* 36(0x24) ?? disconnect query? */ /* when this message comes, send a 37 back so the client */ /* is sure the connection is alive and it can ask if user */ /* really wants to disconnect */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_SHUTDOWN_REQ_PDU"); xrdp_rdp_send_disconnect_query_response(self); /* send a 37 back */ break; case RDP_DATA_PDU_FONT2: /* 39(0x27) */ xrdp_rdp_process_data_font(self, s); break; case 56: /* PDUTYPE2_FRAME_ACKNOWLEDGE 0x38 */ xrdp_rdp_process_frame_ack(self, s); break; default: LOG(LOG_LEVEL_WARNING, "Received unknown [MS-RDPBCGR] TS_SHAREDATAHEADER pduType2 %d (ignoring)", pduType2); break; } return 0; } /*****************************************************************************/ int xrdp_rdp_disconnect(struct xrdp_rdp *self) { return xrdp_sec_disconnect(self->sec_layer); } /*****************************************************************************/ int xrdp_rdp_send_deactivate(struct xrdp_rdp *self) { struct stream *s; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init(self, s) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_deactivate: xrdp_rdp_init failed"); return 1; } /* TODO: why are all the fields missing from the TS_DEACTIVATE_ALL_PDU? */ s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_DEACTIVATE_ALL_PDU " "shareID , lengthSourceDescriptor , " "sourceDescriptor "); if (xrdp_rdp_send(self, s, PDUTYPE_DEACTIVATEALLPDU) != 0) { free_stream(s); LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_DEACTIVATE_ALL_PDU failed"); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /** Send a [MS-RDPBCGR] TS_SAVE_SESSION_INFO_PDU_DATA message. * * @param self * @param data the data to send to the client in the * TS_SAVE_SESSION_INFO_PDU_DATA message. The first 4 bytes of the data * buffer MUST by the infoType value as specified in MS-RDPBCGR 2.2.10.1.1 * @param data_bytes the length of the data buffer * @returns error code */ int xrdp_rdp_send_session_info(struct xrdp_rdp *self, const char *data, int data_bytes) { struct stream *s; if (data == NULL) { LOG(LOG_LEVEL_ERROR, "data must not be null"); return 1; } if (data_bytes < 4) { LOG(LOG_LEVEL_ERROR, "data_bytes must greater than or equal to 4"); return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_rdp_send_session_info: xrdp_rdp_init_data failed"); free_stream(s); return 1; } if (!s_check_rem_out_and_log(s, data_bytes, "Sending [MS-RDPBCGR] TS_SAVE_SESSION_INFO_PDU_DATA")) { free_stream(s); return 1; } out_uint8a(s, data, data_bytes); s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPBCGR] TS_SAVE_SESSION_INFO_PDU_DATA " "infoType 0x%8.8x, infoData ", *((unsigned int *) data)); if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_LOGON) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPBCGR] TS_SAVE_SESSION_INFO_PDU_DATA failed"); free_stream(s); return 1; } free_stream(s); return 0; } xrdp-0.10.1/libxrdp/xrdp_channel.c000644 001751 000000 00000105504 14652432047 017117 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2006-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * channel layer */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "string_calls.h" #include "xrdp_channel.h" #define CMD_DVC_OPEN_CHANNEL 0x10 #define CMD_DVC_DATA_FIRST 0x20 #define CMD_DVC_DATA 0x30 #define CMD_DVC_CLOSE_CHANNEL 0x40 #define CMD_DVC_CAPABILITY 0x50 #define XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id) \ (xrdp_channel_get_item((self), (chan_id)) != NULL \ ? xrdp_channel_get_item((self), (chan_id))->name \ : "unknown") /*****************************************************************************/ /* returns pointer or nil on error */ static struct mcs_channel_item * xrdp_channel_get_item(struct xrdp_channel *self, int channel_id) { struct mcs_channel_item *channel; if (self->mcs_layer->channel_list == NULL) { LOG(LOG_LEVEL_WARNING, "Channel list is NULL, returning NULL"); return NULL ; } channel = (struct mcs_channel_item *) list_get_item(self->mcs_layer->channel_list, channel_id); return channel; } /*****************************************************************************/ struct xrdp_channel * xrdp_channel_create(struct xrdp_sec *owner, struct xrdp_mcs *mcs_layer) { struct xrdp_channel *self; self = (struct xrdp_channel *)g_malloc(sizeof(struct xrdp_channel), 1); self->sec_layer = owner; self->mcs_layer = mcs_layer; self->drdynvc_channel_id = -1; return self; } /*****************************************************************************/ /* returns error */ void xrdp_channel_delete(struct xrdp_channel *self) { if (self == 0) { return; } free_stream(self->s); g_memset(self, 0, sizeof(struct xrdp_channel)); g_free(self); } /*****************************************************************************/ /* returns error */ int xrdp_channel_init(struct xrdp_channel *self, struct stream *s) { if (xrdp_sec_init(self->sec_layer, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_init: xrdp_sec_init failed"); return 1; } s_push_layer(s, channel_hdr, 8); return 0; } /*****************************************************************************/ /* returns error */ /* This sends data out to the secure layer. */ int xrdp_channel_send(struct xrdp_channel *self, struct stream *s, int channel_id, int total_data_len, int flags) { struct mcs_channel_item *channel; channel = xrdp_channel_get_item(self, channel_id); if (channel == NULL) { LOG(LOG_LEVEL_ERROR, "Request to send a message to non-existent channel_id %d", channel_id); return 1; } if (channel->disabled) { LOG(LOG_LEVEL_DEBUG, "Request to send a message to the disabled channel %s (%d)", channel->name, channel_id); return 0; /* not an error */ } s_pop_layer(s, channel_hdr); out_uint32_le(s, total_data_len); /* * According to 2.2.1.3.4.1 Channel Definition Structure (CHANNEL_DEF): * CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 * The value of this flag MUST be ignored by the server. The * visibility of the Channel PDU Header (section 2.2.6.1.1) is * determined by the CHANNEL_FLAG_SHOW_PROTOCOL * (0x00000010) flag as defined in the flags field (section * 2.2.6.1.1). * * That's flag makes MSTSC crash when using RAIL channel. */ // if (channel->flags & XR_CHANNEL_OPTION_SHOW_PROTOCOL) // { // flags |= CHANNEL_FLAG_SHOW_PROTOCOL; // } out_uint32_le(s, flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPBCGR] CHANNEL_PDU_HEADER " "length %d, flags 0x%8.8x", total_data_len, flags); if (xrdp_sec_send(self->sec_layer, s, channel->chanid) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_send: xrdp_sec_send failed"); return 1; } return 0; } /*****************************************************************************/ /* returns error */ /* this will inform the callback, whatever it is that some channel data is ready. the default for this is a call to xrdp_wm.c. */ static int xrdp_channel_call_callback(struct xrdp_channel *self, struct stream *s, int channel_id, int total_data_len, int flags) { struct xrdp_session *session; int rv; int size; rv = 0; session = self->sec_layer->rdp_layer->session; if (session != 0) { if (session->callback != 0) { size = (int)(s->end - s->p); /* in xrdp_wm.c */ rv = session->callback(session->id, 0x5555, MAKELONG(channel_id, flags), size, (tbus)(s->p), total_data_len); } else { LOG_DEVEL(LOG_LEVEL_WARNING, "session->callback is NULL"); } } else { LOG_DEVEL(LOG_LEVEL_WARNING, "session is NULL"); } return rv; } /*****************************************************************************/ /** * Write a variable length unsigned int (1, 2, or 4 bytes) to the stream. * * The number of bytes written is the minimum number of bytes needed to * represent the value. * * @param s the stream to write to * @param val the value to write * @return the DYNVC cbId length code for the number of bytes written (see [MS-RDPEDYC] 2.2.2.1) */ static int drdynvc_insert_uint_124(struct stream *s, uint32_t val) { int ret_val; if (val <= 0xff) { out_uint8(s, val); ret_val = 0; } else if (val <= 0xffff) { out_uint16_le(s, val); ret_val = 1; } else { out_uint32_le(s, val); ret_val = 2; } return ret_val; } /*****************************************************************************/ /** * Read a variable length unsigned int (1, 2, or 4 bytes) from the stream. * * The number of bytes read is determined by the cbId bit field flag in the * cmd argument (see [MS-RDPEDYC] 2.2.2.1). * * @param s [in] the stream to read from * @param cmd [in] the cmd byte which contains the cbId bit field flag * @param chan_id_p [out] a pointer to the value read from the stream * @return error code */ static int drdynvc_get_chan_id(struct stream *s, char cmd, uint32_t *chan_id_p) { int cbChId; int chan_id; cbChId = cmd & 0x03; if (cbChId == 0) { if (!s_check_rem_and_log(s, 1, "Parsing [MS-RDPEDYC] channel id")) { return 1; } in_uint8(s, chan_id); } else if (cbChId == 1) { if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPEDYC] channel id")) { return 1; } in_uint16_le(s, chan_id); } else { if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEDYC] channel id")) { return 1; } in_uint32_le(s, chan_id); } *chan_id_p = chan_id; return 0; } /*****************************************************************************/ /* * Process a [MS-RDPEDYC] DYNVC_CAPS_RSP message. */ static int drdynvc_process_capability_response(struct xrdp_channel *self, int cmd, struct stream *s) { struct xrdp_session *session; int cap_version; int rv; if (!s_check_rem_and_log(s, 3, "Parsing [MS-RDPEDYC] DYNVC_CAPS_RSP")) { return 1; } in_uint8s(s, 1); /* skip padding */ in_uint16_le(s, cap_version); /* Version */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPEDYC] DYNVC_CAPS_RSP " "version %d", cap_version); if ((cap_version != 2) && (cap_version != 3)) { LOG(LOG_LEVEL_ERROR, "Dynamic Virtual Channel version %d is not supported", cap_version); return 1; } self->drdynvc_state = 1; session = self->sec_layer->rdp_layer->session; rv = session->callback(session->id, 0x5558, 0, 0, 0, 0); return rv; } /*****************************************************************************/ /* * Process a [MS-RDPEDYC] DYNVC_CREATE_RSP message. */ static int drdynvc_process_open_channel_response(struct xrdp_channel *self, int cmd, struct stream *s) { struct xrdp_session *session; int creation_status; uint32_t chan_id; struct xrdp_drdynvc *drdynvc; if (drdynvc_get_chan_id(s, cmd, &chan_id) != 0) /* ChannelId */ { LOG(LOG_LEVEL_ERROR, "Parsing [MS-RDPEDYC] DYNVC_CREATE_RSP failed"); return 1; } if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEDYC] DYNVC_CREATE_RSP")) { return 1; } in_uint32_le(s, creation_status); /* CreationStatus */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPEDYC] DYNVC_CREATE_RSP " "ChannelId %d, CreationStatus %d", chan_id, creation_status); if (chan_id > 255) { LOG(LOG_LEVEL_ERROR, "Received [MS-RDPEDYC] DYNVC_CREATE_RSP for an " "invalid channel id. Max allowed 255, received %d", chan_id); return 1; } session = self->sec_layer->rdp_layer->session; drdynvc = self->drdynvcs + chan_id; if (creation_status == 0) { drdynvc->status = XRDP_DRDYNVC_STATUS_OPEN; } else { drdynvc->status = XRDP_DRDYNVC_STATUS_CLOSED; } LOG_DEVEL(LOG_LEVEL_DEBUG, "Dynamic Virtual Channel %s (%d) updated: status = %s", XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id), chan_id, XRDP_DRDYNVC_STATUS_TO_STR(drdynvc->status)); if (drdynvc->open_response != NULL) { return drdynvc->open_response(session->id, chan_id, creation_status); } LOG_DEVEL(LOG_LEVEL_WARNING, "Dynamic Virtual Channel %s (%d): " "callback 'open_response' is NULL", XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id), chan_id); return 0; } /*****************************************************************************/ /* * Process a [MS-RDPEDYC] DYNVC_CLOSE message. */ static int drdynvc_process_close_channel_response(struct xrdp_channel *self, int cmd, struct stream *s) { struct xrdp_session *session; uint32_t chan_id; struct xrdp_drdynvc *drdynvc; if (drdynvc_get_chan_id(s, cmd, &chan_id) != 0) /* ChannelId */ { LOG(LOG_LEVEL_ERROR, "drdynvc_process_close_channel_response: drdynvc_get_chan_id failed"); return 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPEDYC] DYNVC_CLOSE " "ChannelId %d", chan_id); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { LOG(LOG_LEVEL_ERROR, "Received message for an invalid " "channel id. channel id %d", chan_id); return 1; } drdynvc = self->drdynvcs + chan_id; drdynvc->status = XRDP_DRDYNVC_STATUS_CLOSED; LOG_DEVEL(LOG_LEVEL_DEBUG, "Dynamic Virtual Channel %s (%d) updated: status = %s", XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id), chan_id, XRDP_DRDYNVC_STATUS_TO_STR(drdynvc->status)); if (drdynvc->close_response != NULL) { return drdynvc->close_response(session->id, chan_id); } LOG_DEVEL(LOG_LEVEL_WARNING, "Dynamic Virtual Channel %s (%d): " "callback 'close_response' is NULL", XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id), chan_id); return 0; } /*****************************************************************************/ /* * Process a [MS-RDPEDYC] DYNVC_DATA_FIRST message. */ static int drdynvc_process_data_first(struct xrdp_channel *self, int cmd, struct stream *s) { struct xrdp_session *session; uint32_t chan_id; int len; int bytes; int total_bytes; struct xrdp_drdynvc *drdynvc; if (drdynvc_get_chan_id(s, cmd, &chan_id) != 0) /* ChannelId */ { LOG(LOG_LEVEL_ERROR, "Parsing [MS-RDPEDYC] DYNVC_DATA_FIRST failed"); return 1; } len = (cmd >> 2) & 0x03; if (len == 0) { if (!s_check_rem_and_log(s, 1, "Parsing [MS-RDPEDYC] DYNVC_DATA_FIRST")) { return 1; } in_uint8(s, total_bytes); /* Length */ } else if (len == 1) { if (!s_check_rem_and_log(s, 2, "Parsing [MS-RDPEDYC] DYNVC_DATA_FIRST")) { return 1; } in_uint16_le(s, total_bytes); /* Length */ } else { if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPEDYC] DYNVC_DATA_FIRST")) { return 1; } in_uint32_le(s, total_bytes); /* Length */ } bytes = (int) (s->end - s->p); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPEDYC] DYNVC_DATA_FIRST " "ChannelId %d, Length %d, Data (omitted from the log)", chan_id, total_bytes); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { LOG(LOG_LEVEL_ERROR, "Received [MS-RDPEDYC] DYNVC_DATA_FIRST for an " "invalid channel id. Max allowed 255, received %d", chan_id); return 1; } drdynvc = self->drdynvcs + chan_id; if (drdynvc->data_first != NULL) { return drdynvc->data_first(session->id, chan_id, s->p, bytes, total_bytes); } LOG_DEVEL(LOG_LEVEL_WARNING, "Dynamic Virtual Channel %s (%d): " "callback 'data_first' is NULL", XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id), chan_id); return 0; } /*****************************************************************************/ /* * Process a [MS-RDPEDYC] DYNVC_DATA message. */ static int drdynvc_process_data(struct xrdp_channel *self, int cmd, struct stream *s) { struct xrdp_session *session; uint32_t chan_id; int bytes; struct xrdp_drdynvc *drdynvc; if (drdynvc_get_chan_id(s, cmd, &chan_id) != 0) /* ChannelId */ { LOG(LOG_LEVEL_ERROR, "drdynvc_process_data: drdynvc_get_chan_id failed"); return 1; } bytes = (int) (s->end - s->p); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPEDYC] DYNVC_DATA " "ChannelId %d, (re-assembled) Length %d, Data (omitted from the log)", chan_id, bytes); session = self->sec_layer->rdp_layer->session; if (chan_id > 255) { LOG(LOG_LEVEL_ERROR, "Received message for an invalid " "channel id. channel id %d", chan_id); return 1; } drdynvc = self->drdynvcs + chan_id; if (drdynvc->data != NULL) { return drdynvc->data(session->id, chan_id, s->p, bytes); } LOG_DEVEL(LOG_LEVEL_WARNING, "Dynamic Virtual Channel %s (%d): " "callback 'data' is NULL", XRDP_DRDYNVC_CHANNEL_ID_TO_NAME(self, chan_id), chan_id); return 0; } /*****************************************************************************/ /** * Process a [MS-RDPBCGR] 2.2.6.1 Virtual Channel PDU and re-assemble the * data chunks as needed. */ static int xrdp_channel_process_drdynvc(struct xrdp_channel *self, struct mcs_channel_item *channel, struct stream *s) { int total_length; int length; int flags; int cmd; int rv; struct stream *ls; if (!s_check_rem_and_log(s, 8, "Parsing [MS-RDPBCGR] CHANNEL_PDU_HEADER")) { return 1; } in_uint32_le(s, total_length); /* length */ in_uint32_le(s, flags); /* flags */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] CHANNEL_PDU_HEADER " "length %d, flags 0x%8.8x", total_length, flags); ls = NULL; switch (flags & 3) { case 0: /* not first chunk and not last chunk */ length = (int) (s->end - s->p); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] data chunk (middle) " "length %d", length); if (length > s_rem_out(self->s)) { LOG(LOG_LEVEL_ERROR, "[MS-RDPBCGR] Data chunk length is bigger than " "the remaining chunk buffer size. length %d, remaining %d", length, s_rem_out(self->s)); return 1; } out_uint8a(self->s, s->p, length); /* append data to chunk buffer */ in_uint8s(s, length); /* virtualChannelData */ return 0; case 1: /* CHANNEL_FLAG_FIRST */ free_stream(self->s); make_stream(self->s); init_stream(self->s, total_length); length = (int) (s->end - s->p); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] data chunk (first) " "length %d", length); if (length > s_rem_out(self->s)) { LOG(LOG_LEVEL_ERROR, "[MS-RDPBCGR] Data chunk length is bigger than " "the remaining chunk buffer size. length %d, remaining %d", length, s_rem_out(self->s)); return 1; } out_uint8a(self->s, s->p, length); /* append data to chunk buffer */ in_uint8s(s, length); /* virtualChannelData */ return 0; case 2: /* CHANNEL_FLAG_LAST */ length = (int) (s->end - s->p); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] data chunk (last) " "length %d", length); if (length > s_rem_out(self->s)) { LOG(LOG_LEVEL_ERROR, "[MS-RDPBCGR] Data chunk length is bigger than " "the remaining chunk buffer size. length %d, remaining %d", length, s_rem_out(self->s)); return 1; } out_uint8a(self->s, s->p, length); /* append data to chunk buffer */ in_uint8s(s, length); /* virtualChannelData */ ls = self->s; break; case 3: /* CHANNEL_FLAG_FIRST and CHANNEL_FLAG_LAST */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] data chunk (first and last) " "length %d", total_length); ls = s; break; default: LOG(LOG_LEVEL_ERROR, "Received [MS-RDPBCGR] data chunk with " "unknown flag 0x%8.8x", (int) (flags & 3)); return 1; } if (ls == NULL) { LOG(LOG_LEVEL_ERROR, "BUG: ls must not be NULL"); return 1; } in_uint8(ls, cmd); /* cbId (low 2 bits), Sp (2 bits), Cmd (hi 4 bits) */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPEDYC] " "cbId %d, Sp %d, Cmd 0x%2.2x", (cmd & 0x03), (cmd & 0x0c) >> 2, (cmd & 0xf0) >> 4); rv = 1; switch (cmd & 0xf0) { case CMD_DVC_CAPABILITY: rv = drdynvc_process_capability_response(self, cmd, s); break; case CMD_DVC_OPEN_CHANNEL: rv = drdynvc_process_open_channel_response(self, cmd, s); break; case CMD_DVC_CLOSE_CHANNEL: rv = drdynvc_process_close_channel_response(self, cmd, s); break; case CMD_DVC_DATA_FIRST: rv = drdynvc_process_data_first(self, cmd, s); break; case CMD_DVC_DATA: rv = drdynvc_process_data(self, cmd, s); break; default: LOG(LOG_LEVEL_ERROR, "Received header [MS-RDPEDYC] with " "unknown command 0x%2.2x", cmd); break; } return rv; } /*****************************************************************************/ /* Process a static ([MS-RDPBCGR] 2.2.6) or dynamic (MS-RDPEDYC 2.2.3) * virtual channel message. * returns error */ /* This is called from the secure layer to process an incoming non global channel packet. 'chanid' passed in here is the mcs channel id so it MCS_GLOBAL_CHANNEL plus something. */ int xrdp_channel_process(struct xrdp_channel *self, struct stream *s, int chanid) { int length; int flags; int rv; int channel_id; struct mcs_channel_item *channel; /* this assumes that the channels are in order of chanid(mcs channel id) but they should be, see xrdp_sec_process_mcs_data_channels the first channel should be MCS_GLOBAL_CHANNEL + 1, second one should be MCS_GLOBAL_CHANNEL + 2, and so on */ channel_id = (chanid - MCS_GLOBAL_CHANNEL) - 1; channel = xrdp_channel_get_item(self, channel_id); if (channel == NULL) { LOG(LOG_LEVEL_ERROR, "Received a message for an unknown channel id. channel id %d", chanid); return 1; } if (channel->disabled) { LOG(LOG_LEVEL_WARNING, "Received a message for the disabled channel %s (%d)", channel->name, chanid); return 0; /* not an error */ } if (channel_id == self->drdynvc_channel_id) { return xrdp_channel_process_drdynvc(self, channel, s); } rv = 0; in_uint32_le(s, length); /* length */ in_uint32_le(s, flags); /* flags */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received header [MS-RDPBCGR] CHANNEL_PDU_HEADER " "length %d, flags 0x%8.8x", length, flags); rv = xrdp_channel_call_callback(self, s, channel_id, length, flags); return rv; } /*****************************************************************************/ /* Send a [MS-RDPEDYC] DYNVC_CAPS_VERSION2 message */ static int xrdp_channel_drdynvc_send_capability_request(struct xrdp_channel *self) { struct stream *s; int flags; int total_data_len; int channel_id; char *phold; /* setup stream */ make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_send_capability_request: xrdp_channel_init failed"); free_stream(s); return 1; } phold = s->p; out_uint8(s, 0x50); /* insert cbId (2 bits), Sp (2 bits), cmd (4 bits) */ out_uint8(s, 0x00); /* insert padding */ out_uint16_le(s, 2); /* insert version */ /* channel priority unused for now */ out_uint16_le(s, 0x0000); /* priority charge 0 */ out_uint16_le(s, 0x0000); /* priority charge 1 */ out_uint16_le(s, 0x0000); /* priority charge 2 */ out_uint16_le(s, 0x0000); /* priority charge 3 */ s_mark_end(s); /* send command to client */ total_data_len = (int) (s->end - phold); flags = XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_LAST; channel_id = self->drdynvc_channel_id; LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPEDYC] DYNVC_CAPS_VERSION2 " "cbId 0, Sp 0, Cmd 0x05, Version 2, PriorityCharge0 0, " "PriorityCharge1 0, PriorityCharge2 0, PriorityCharge3 0"); if (xrdp_channel_send(self, s, channel_id, total_data_len, flags) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_send_capability_request: xrdp_channel_send failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ int xrdp_channel_drdynvc_start(struct xrdp_channel *self) { int rv = 0; LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_channel_drdynvc_start: drdynvc_channel_id %d", self->drdynvc_channel_id); if (self->drdynvc_channel_id != -1) { LOG_DEVEL(LOG_LEVEL_INFO, "xrdp_channel_drdynvc_start: already started"); } else { int index; int count; struct mcs_channel_item *ci; struct mcs_channel_item *dci; dci = NULL; count = self->mcs_layer->channel_list->count; for (index = 0; index < count; index++) { ci = (struct mcs_channel_item *) list_get_item(self->mcs_layer->channel_list, index); if (ci != NULL) { if (g_strcasecmp(ci->name, DRDYNVC_SVC_CHANNEL_NAME) == 0) { dci = ci; break; } } } if (dci == NULL) { LOG(LOG_LEVEL_WARNING, "Static channel '%s' not found.", DRDYNVC_SVC_CHANNEL_NAME); rv = -1; } else if (dci->disabled) { LOG(LOG_LEVEL_WARNING, "Static channel '%s' is disabled.", DRDYNVC_SVC_CHANNEL_NAME); rv = -1; } else { self->drdynvc_channel_id = (dci->chanid - MCS_GLOBAL_CHANNEL) - 1; LOG_DEVEL(LOG_LEVEL_DEBUG, DRDYNVC_SVC_CHANNEL_NAME "Initializing Dynamic Virtual Channel with channel id %d", self->drdynvc_channel_id); xrdp_channel_drdynvc_send_capability_request(self); } } if (rv != 0) { LOG(LOG_LEVEL_WARNING, "Dynamic channels will not be available"); } return rv; } /*****************************************************************************/ /* * Send a [MS-RDPEDYC] DYNVC_CREATE_REQ message to request the creation of a channel. */ int xrdp_channel_drdynvc_open(struct xrdp_channel *self, const char *name, int flags, struct xrdp_drdynvc_procs *procs, int *chan_id) { struct stream *s; int ChId; int cbChId; int chan_pri; int static_channel_id; int name_length; int total_data_len; int static_flags; char *cmd_ptr; make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_open: xrdp_channel_init failed"); free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); /* set later */ ChId = 1; while (self->drdynvcs[ChId].status != XRDP_DRDYNVC_STATUS_CLOSED) { ChId++; if (ChId > 255) { LOG(LOG_LEVEL_ERROR, "Attempting to create a new channel when the maximum " "number of channels have already been created. " "XRDP only supports 255 open channels."); free_stream(s); return 1; } } cbChId = drdynvc_insert_uint_124(s, ChId); /* ChannelId */ name_length = g_strlen(name); out_uint8a(s, name, name_length + 1); /* ChannelName */ chan_pri = 0; /* cbId (low 2 bits), Pri (2 bits), Cmd (hi 4 bits) */ cmd_ptr[0] = CMD_DVC_OPEN_CHANNEL | ((chan_pri << 2) & 0x0c) | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPEDYC] DYNVC_CREATE_REQ " "cbId %d, Pri %d, Cmd 0x%2.2x, ChannelId %d, ChannelName [%s]", cbChId, chan_pri, CMD_DVC_OPEN_CHANNEL, ChId, name); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { LOG(LOG_LEVEL_ERROR, "Sending [MS-RDPEDYC] DYNVC_CREATE_REQ failed"); free_stream(s); return 1; } free_stream(s); *chan_id = ChId; self->drdynvcs[ChId].open_response = procs->open_response; self->drdynvcs[ChId].close_response = procs->close_response; self->drdynvcs[ChId].data_first = procs->data_first; self->drdynvcs[ChId].data = procs->data; self->drdynvcs[ChId].status = XRDP_DRDYNVC_STATUS_OPEN_SENT; return 0; } /*****************************************************************************/ /* * Send a [MS-RDPEDYC] DYNVC_CLOSE message to request the closing of a channel. */ int xrdp_channel_drdynvc_close(struct xrdp_channel *self, int chan_id) { struct stream *s; int ChId; int cbChId; int static_channel_id; int total_data_len; int static_flags; char *cmd_ptr; if ((chan_id < 0) || (chan_id > 255)) { LOG(LOG_LEVEL_ERROR, "Attempting to close an invalid channel id. " "channel id %d", chan_id); return 1; } if ((self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN) && (self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN_SENT)) { /* not open */ LOG(LOG_LEVEL_ERROR, "Attempting to close a channel that is not open. " "channel id %d, channel status %s", chan_id, XRDP_DRDYNVC_STATUS_TO_STR(self->drdynvcs[chan_id].status)); return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_close: xrdp_channel_init failed"); free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); /* set later */ ChId = chan_id; cbChId = drdynvc_insert_uint_124(s, ChId); /* ChannelId */ /* cbId (low 2 bits), Sp (2 bits), Cmd (hi 4 bits) */ cmd_ptr[0] = CMD_DVC_CLOSE_CHANNEL | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPEDYC] DYNVC_CLOSE " "cbId %d, Sp 0, Cmd 0x%2.2x, ChannelId %d", cbChId, CMD_DVC_CLOSE_CHANNEL, ChId); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_open: xrdp_channel_send failed"); free_stream(s); return 1; } free_stream(s); self->drdynvcs[ChId].status = XRDP_DRDYNVC_STATUS_CLOSE_SENT; return 0; } /*****************************************************************************/ /* * Send a [MS-RDPEDYC] DYNVC_DATA_FIRST message. */ int xrdp_channel_drdynvc_data_first(struct xrdp_channel *self, int chan_id, const char *data, int data_bytes, int total_data_bytes) { struct stream *s; int ChId; int cbChId; int cbTotalDataSize; int static_channel_id; int total_data_len; int static_flags; char *cmd_ptr; if ((chan_id < 0) || (chan_id > 255)) { LOG(LOG_LEVEL_ERROR, "Attempting to send data to an invalid " "channel id. channel id %d", chan_id); return 1; } if (self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN) { LOG(LOG_LEVEL_ERROR, "Attempting to send data to a channel that " "is not open. channel id %d, channel status %s", chan_id, XRDP_DRDYNVC_STATUS_TO_STR(self->drdynvcs[chan_id].status)); return 1; } if (data_bytes > 1590) { LOG(LOG_LEVEL_ERROR, "Payload for channel id %d is is too big. " "data_bytes %d", chan_id, data_bytes); return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_data_first: xrdp_channel_init failed"); free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); /* set later */ ChId = chan_id; cbChId = drdynvc_insert_uint_124(s, ChId); /* ChannelId */ cbTotalDataSize = drdynvc_insert_uint_124(s, total_data_bytes); /* Length */ out_uint8p(s, data, data_bytes); /* Data */ /* cbId (low 2 bits), Len (2 bits), Cmd (hi 4 bits) */ cmd_ptr[0] = CMD_DVC_DATA_FIRST | (cbTotalDataSize << 2) | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_LAST; s_mark_end(s); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPEDYC] DYNVC_DATA_FIRST " "cbId %d, Len %d, Cmd 0x%2.2x, ChannelId %d, Length %d", cbChId, cbTotalDataSize, CMD_DVC_DATA_FIRST, ChId, total_data_bytes); total_data_len = (int) (s->end - cmd_ptr); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_data_first: xrdp_channel_send failed"); free_stream(s); return 1; } free_stream(s); return 0; } /*****************************************************************************/ /* * Send a [MS-RDPEDYC] DYNVC_DATA message. */ int xrdp_channel_drdynvc_data(struct xrdp_channel *self, int chan_id, const char *data, int data_bytes) { struct stream *s; int ChId; int cbChId; int static_channel_id; int total_data_len; int static_flags; char *cmd_ptr; if ((chan_id < 0) || (chan_id > 255)) { LOG(LOG_LEVEL_ERROR, "Attempting to send data to an invalid " "channel id. channel id %d", chan_id); return 1; } if (self->drdynvcs[chan_id].status != XRDP_DRDYNVC_STATUS_OPEN) { LOG(LOG_LEVEL_ERROR, "Attempting to send data to a channel that " "is not open. channel id %d, channel status %s", chan_id, XRDP_DRDYNVC_STATUS_TO_STR(self->drdynvcs[chan_id].status)); return 1; } if (data_bytes > 1590) { LOG(LOG_LEVEL_ERROR, "Payload for channel id %d is is too big. " "data_bytes %d", chan_id, data_bytes); return 1; } make_stream(s); init_stream(s, 8192); if (xrdp_channel_init(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_data: xrdp_channel_init failed"); free_stream(s); return 1; } cmd_ptr = s->p; out_uint8(s, 0); /* set later */ ChId = chan_id; cbChId = drdynvc_insert_uint_124(s, ChId); /* ChannelId */ out_uint8p(s, data, data_bytes); /* Data */ /* cbId (low 2 bits), Sp (2 bits), Cmd (hi 4 bits) */ cmd_ptr[0] = CMD_DVC_DATA | cbChId; static_channel_id = self->drdynvc_channel_id; static_flags = XR_CHANNEL_FLAG_FIRST | XR_CHANNEL_FLAG_LAST; s_mark_end(s); total_data_len = (int) (s->end - cmd_ptr); LOG_DEVEL(LOG_LEVEL_TRACE, "Sending [MS-RDPEDYC] DYNVC_DATA " "cbId %d, Sp 0, Cmd 0x%2.2x, ChannelId %d", cbChId, CMD_DVC_DATA_FIRST, ChId); if (xrdp_channel_send(self, s, static_channel_id, total_data_len, static_flags) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_channel_drdynvc_data: xrdp_channel_send failed"); free_stream(s); return 1; } free_stream(s); return 0; } xrdp-0.10.1/libxrdp/Makefile.in000644 001751 000000 00000063367 14652432075 016366 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ @XRDP_NEUTRINORDP_TRUE@am__append_1 = -DXRDP_NEUTRINORDP @XRDP_NEUTRINORDP_TRUE@am__append_2 = $(FREERDP_LIBS) @XRDP_RFXCODEC_TRUE@am__append_3 = -DXRDP_RFXCODEC @XRDP_TJPEG_TRUE@am__append_4 = -DXRDP_JPEG -DXRDP_TJPEG @TurboJpegIncDir@ @XRDP_TJPEG_TRUE@am__append_5 = @TurboJpegLibDir@ @XRDP_TJPEG_TRUE@am__append_6 = -lturbojpeg @XRDP_JPEG_TRUE@@XRDP_TJPEG_FALSE@am__append_7 = -DXRDP_JPEG @XRDP_JPEG_TRUE@@XRDP_TJPEG_FALSE@am__append_8 = -ljpeg subdir = libxrdp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) am__DEPENDENCIES_1 = @XRDP_NEUTRINORDP_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) libxrdp_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la \ $(am__DEPENDENCIES_3) am_libxrdp_la_OBJECTS = libxrdp.lo xrdp_bitmap32_compress.lo \ xrdp_bitmap_compress.lo xrdp_caps.lo xrdp_channel.lo \ xrdp_fastpath.lo xrdp_iso.lo xrdp_jpeg_compress.lo xrdp_mcs.lo \ xrdp_mppc_enc.lo xrdp_orders.lo xrdp_orders_rail.lo \ xrdp_rdp.lo xrdp_sec.lo libxrdp_la_OBJECTS = $(am_libxrdp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libxrdp.Plo \ ./$(DEPDIR)/xrdp_bitmap32_compress.Plo \ ./$(DEPDIR)/xrdp_bitmap_compress.Plo ./$(DEPDIR)/xrdp_caps.Plo \ ./$(DEPDIR)/xrdp_channel.Plo ./$(DEPDIR)/xrdp_fastpath.Plo \ ./$(DEPDIR)/xrdp_iso.Plo ./$(DEPDIR)/xrdp_jpeg_compress.Plo \ ./$(DEPDIR)/xrdp_mcs.Plo ./$(DEPDIR)/xrdp_mppc_enc.Plo \ ./$(DEPDIR)/xrdp_orders.Plo ./$(DEPDIR)/xrdp_orders_rail.Plo \ ./$(DEPDIR)/xrdp_rdp.Plo ./$(DEPDIR)/xrdp_sec.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libxrdp_la_SOURCES) DIST_SOURCES = $(libxrdp_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ xrdp_surface.c AM_CPPFLAGS = -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common $(am__append_1) $(am__append_3) \ $(am__append_4) $(am__append_7) AM_CFLAGS = $(OPENSSL_CFLAGS) AM_LDFLAGS = $(am__append_5) LIBXRDP_EXTRA_LIBS = $(am__append_2) $(am__append_6) $(am__append_8) module_LTLIBRARIES = \ libxrdp.la libxrdp_la_SOURCES = \ libxrdp.c \ libxrdp.h \ libxrdpinc.h \ xrdp_bitmap32_compress.c \ xrdp_bitmap_compress.c \ xrdp_caps.c \ xrdp_channel.c \ xrdp_channel.h \ xrdp_fastpath.c \ xrdp_iso.c \ xrdp_jpeg_compress.c \ xrdp_mcs.c \ xrdp_mppc_enc.c \ xrdp_orders.c \ xrdp_orders_rail.c \ xrdp_orders_rail.h \ xrdp_rdp.c \ xrdp_sec.c libxrdp_la_LIBADD = \ $(top_builddir)/common/libcommon.la \ $(LIBXRDP_EXTRA_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libxrdp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libxrdp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libxrdp.la: $(libxrdp_la_OBJECTS) $(libxrdp_la_DEPENDENCIES) $(EXTRA_libxrdp_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libxrdp_la_OBJECTS) $(libxrdp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxrdp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_bitmap32_compress.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_bitmap_compress.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_caps.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_fastpath.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_iso.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_jpeg_compress.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_mcs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_mppc_enc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_orders.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_orders_rail.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_rdp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp_sec.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libxrdp.Plo -rm -f ./$(DEPDIR)/xrdp_bitmap32_compress.Plo -rm -f ./$(DEPDIR)/xrdp_bitmap_compress.Plo -rm -f ./$(DEPDIR)/xrdp_caps.Plo -rm -f ./$(DEPDIR)/xrdp_channel.Plo -rm -f ./$(DEPDIR)/xrdp_fastpath.Plo -rm -f ./$(DEPDIR)/xrdp_iso.Plo -rm -f ./$(DEPDIR)/xrdp_jpeg_compress.Plo -rm -f ./$(DEPDIR)/xrdp_mcs.Plo -rm -f ./$(DEPDIR)/xrdp_mppc_enc.Plo -rm -f ./$(DEPDIR)/xrdp_orders.Plo -rm -f ./$(DEPDIR)/xrdp_orders_rail.Plo -rm -f ./$(DEPDIR)/xrdp_rdp.Plo -rm -f ./$(DEPDIR)/xrdp_sec.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/libxrdp.Plo -rm -f ./$(DEPDIR)/xrdp_bitmap32_compress.Plo -rm -f ./$(DEPDIR)/xrdp_bitmap_compress.Plo -rm -f ./$(DEPDIR)/xrdp_caps.Plo -rm -f ./$(DEPDIR)/xrdp_channel.Plo -rm -f ./$(DEPDIR)/xrdp_fastpath.Plo -rm -f ./$(DEPDIR)/xrdp_iso.Plo -rm -f ./$(DEPDIR)/xrdp_jpeg_compress.Plo -rm -f ./$(DEPDIR)/xrdp_mcs.Plo -rm -f ./$(DEPDIR)/xrdp_mppc_enc.Plo -rm -f ./$(DEPDIR)/xrdp_orders.Plo -rm -f ./$(DEPDIR)/xrdp_orders_rail.Plo -rm -f ./$(DEPDIR)/xrdp_rdp.Plo -rm -f ./$(DEPDIR)/xrdp_sec.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/libxrdp/xrdp_surface.c000644 001751 000000 00000012043 14652432047 017132 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2013 * Copyright (C) Kevin Zhou 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "freerdp/codec/rfx.h" /*****************************************************************************/ struct xrdp_surface * xrdp_surface_create(struct xrdp_session *session, struct xrdp_fastpath *fastpath) { struct xrdp_surface *self; self = (struct xrdp_surface *)g_malloc(sizeof(struct xrdp_surface), 1); self->session = session; self->fastpath = fastpath; self->rfx_context = rfx_context_new(); self->s = stream_new(16384); return self; } /*****************************************************************************/ void xrdp_surface_delete(struct xrdp_surface *self) { STREAM *s; RFX_CONTEXT *rfx_context; if (self == 0) { return; } s = (STREAM *)(self->s); rfx_context = (RFX_CONTEXT *)(self->rfx_context); free_stream(self->out_s); stream_free(s); rfx_context_free(rfx_context); g_free(self); } /*****************************************************************************/ /* returns error */ int xrdp_surface_reset(struct xrdp_surface *self) { return 0; } /*****************************************************************************/ int xrdp_surface_init(struct xrdp_surface *self) { int width; int height; RFX_CONTEXT *rfx_context; rfx_context = (RFX_CONTEXT *)(self->rfx_context); width = self->session->client_info->width; height = self->session->client_info->height; rfx_context->mode = self->session->client_info->rfx_entropy; rfx_context->width = width; rfx_context->height = height; make_stream(self->out_s); init_stream(self->out_s, 2 * 3 * width * height + 22); return 0; } /*****************************************************************************/ int xrdp_surface_send_surface_bits(struct xrdp_surface *self, int bpp, char *data, int x, int y, int cx, int cy) { RFX_RECT rect; int Bpp; int codecId; uint32 bitmapDataLength; STREAM *s; RFX_CONTEXT *rfx_context; s = (STREAM *)(self->s); rfx_context = (RFX_CONTEXT *)(self->rfx_context); if ((bpp == 24) || (bpp == 32)) { } else { LOG(LOG_LEVEL_ERROR, "bpp = %d is not supported\n", bpp); return 1; } Bpp = 4; rect.x = 0; rect.y = 0; rect.width = cx; rect.height = cy; init_stream(self->out_s, 0); stream_set_pos(s, 0); rfx_compose_message(rfx_context, s, &rect, 1, data, cx, cy, Bpp * cx); codecId = self->session->client_info->rfx_codecId; /* surface_bits_command */ out_uint16_le(self->out_s, CMDTYPE_STREAM_SURFACE_BITS); /* cmdType */ out_uint16_le(self->out_s, x); /* destLeft */ out_uint16_le(self->out_s, y); /* destTop */ out_uint16_le(self->out_s, x + cx); /* destRight */ out_uint16_le(self->out_s, y + cy); /* destBottom */ out_uint8(self->out_s, 32); /* bpp */ out_uint8(self->out_s, 0); /* reserved1 */ out_uint8(self->out_s, 0); /* reserved2 */ out_uint8(self->out_s, codecId); /* codecId */ out_uint16_le(self->out_s, cx); /* width */ out_uint16_le(self->out_s, cy); /* height */ bitmapDataLength = stream_get_length(s); out_uint32_le(self->out_s, bitmapDataLength); /* bitmapDataLength */ /* rfx bit stream */ out_uint8p(self->out_s, s->data, bitmapDataLength); s_mark_end(self->out_s); return xrdp_fastpath_send_update_pdu(self->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, self->out_s); } /*****************************************************************************/ int xrdp_surface_send_frame_marker(struct xrdp_surface *self, uint16 frameAction, uint32 frameId) { init_stream(self->out_s, 0); out_uint16_le(self->out_s, CMDTYPE_FRAME_MARKER); out_uint16_le(self->out_s, frameAction); out_uint32_le(self->out_s, frameId); s_mark_end(self->out_s); return xrdp_fastpath_send_update_pdu(self->fastpath, FASTPATH_UPDATETYPE_SURFCMDS, self->out_s); } xrdp-0.10.1/libxrdp/xrdp_caps.c000644 001751 000000 00000157412 14652432047 016442 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * Copyright (C) Idan Freiberg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * RDP Capability Sets */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "guid.h" #include "libxrdp.h" #include "ms-rdpbcgr.h" #include "ms-rdperp.h" /** * The largest supported size for a fastpath update * (TS_MULTIFRAGMENTUPDATE_CAPABILITYSET) we advertise to the client. This * size is big enough for the tiles required for two 3840x2160 monitors * without using multiple update PDUS. * * Consult calculate_multifragmentupdate_len() below before changing this * value. */ #define MAX_MULTIFRAGMENTUPDATE_SIZE (2U * (3840 * 2160) * 16384 + 16384) /*****************************************************************************/ static int xrdp_caps_send_monitorlayout(struct xrdp_rdp *self) { struct stream *s; uint32_t i; struct display_size_description *description; int rv = 0; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init_data(self, s) != 0) { free_stream(s); return 1; } description = &self->client_info.display_sizes; out_uint32_le(s, description->monitorCount); /* monitorCount (4 bytes) */ /* TODO: validate for allowed monitors in terminal server (maybe by config?) */ for (i = 0; i < description->monitorCount; i++) { out_uint32_le(s, description->minfo[i].left); out_uint32_le(s, description->minfo[i].top); out_uint32_le(s, description->minfo[i].right); out_uint32_le(s, description->minfo[i].bottom); out_uint32_le(s, description->minfo[i].is_primary); } s_mark_end(s); // [MS-RDPBCGR] // - 2.2.12.1 - ...the pduSource field MUST be set to zero. // - 3.3.5.12.1 - The contents of this PDU SHOULD NOT be compressed rv = xrdp_rdp_send_data_from_channel(self, s, PDUTYPE2_MONITOR_LAYOUT_PDU, 0, 0); free_stream(s); return rv; } /*****************************************************************************/ static int xrdp_caps_process_general(struct xrdp_rdp *self, struct stream *s, int len) { int extraFlags; int client_does_fastpath_output; if (len < 10 + 2) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 12, remaining %d", len); return 1; } in_uint16_le(s, self->client_info.client_os_major); /* osMajorType (2 bytes) */ in_uint16_le(s, self->client_info.client_os_minor); /* osMinorType (2 bytes) */ in_uint8s(s, 6); in_uint16_le(s, extraFlags); /* extraFlags (2 bytes) */ self->client_info.op1 = extraFlags & NO_BITMAP_COMPRESSION_HDR; /* use_compact_packets is pretty much 'use rdp5' */ self->client_info.use_compact_packets = (extraFlags != 0); /* op2 is a boolean to use compact bitmap headers in bitmap cache */ /* set it to same as 'use rdp5' boolean */ self->client_info.op2 = self->client_info.use_compact_packets; /* FASTPATH_OUTPUT_SUPPORTED 0x0001 */ client_does_fastpath_output = extraFlags & FASTPATH_OUTPUT_SUPPORTED; if ((self->client_info.use_fast_path & 1) && !client_does_fastpath_output) { /* server supports fast path output and client does not, turn it off */ self->client_info.use_fast_path &= ~1; } return 0; } /*****************************************************************************/ static int xrdp_caps_process_bitmap(struct xrdp_rdp *self, struct stream *s, int len) { /* [MS-RDPBCGR] 2.2.7.1.2 */ int desktopResizeFlag; if (len < 14 + 2) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 16, remaining %d", len); return 1; } in_uint8s(s, 14); in_uint16_le(s, desktopResizeFlag); /* Work out what kind of client resizing we can do from the server */ int early_cap_flags = self->client_info.mcs_early_capability_flags; if (desktopResizeFlag == 0) { self->client_info.client_resize_mode = CRMODE_NONE; LOG(LOG_LEVEL_INFO, "Client cannot be resized by xrdp"); } else if ((early_cap_flags & RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU) == 0) { self->client_info.client_resize_mode = CRMODE_SINGLE_SCREEN; LOG(LOG_LEVEL_INFO, "Client supports single-screen resizes by xrdp"); } else { self->client_info.client_resize_mode = CRMODE_MULTI_SCREEN; LOG(LOG_LEVEL_INFO, "Client supports multi-screen resizes by xrdp"); } return 0; } /*****************************************************************************/ /* * Process [MS-RDPBCGR] TS_ORDER_CAPABILITYSET (2.2.7.1.3) message. */ static int xrdp_caps_process_order(struct xrdp_rdp *self, struct stream *s, int len) { int i; char order_caps[32]; int ex_flags; int cap_flags; if (len < 20 + 2 + 2 + 2 + 2 + 2 + 2 + 32 + 2 + 2 + 4 + 4 + 4 + 4) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 84, remaining %d", len); return 1; } in_uint8s(s, 20); /* Terminal desc, pad */ in_uint8s(s, 2); /* Cache X granularity */ in_uint8s(s, 2); /* Cache Y granularity */ in_uint8s(s, 2); /* Pad */ in_uint8s(s, 2); /* Max order level */ in_uint8s(s, 2); /* Number of fonts */ in_uint16_le(s, cap_flags); /* Capability flags */ in_uint8a(s, order_caps, 32); /* Orders supported */ g_memcpy(self->client_info.orders, order_caps, 32); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: terminalDescriptor (ignored as per protocol spec)"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: desktopSaveXGranularity (ignored as per protocol spec)"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: desktopSaveYGranularity (ignored as per protocol spec)"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: maximumOrderLevel (ignored as per protocol spec)"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: numberFonts (ignored as per protocol spec)"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderFlags 0x%4.4x", cap_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 0: DstBlt %d", order_caps[0]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 1: PatBlt %d", order_caps[1]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 2: ScrBlt %d", order_caps[2]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 3,13: MemBlt %d %d", order_caps[3], order_caps[13]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 4,14: Mem3Blt %d %d", order_caps[4], order_caps[14]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 5-6: unused index"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 7: DrawNineGrid %d", order_caps[7]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 8: LineTo %d", order_caps[8]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 9: MultiDrawNineGrid %d", order_caps[9]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 10: unused index"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 11: SaveBitmap %d", order_caps[11]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 12-14: unused index"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 15: MultiDstBlt %d", order_caps[15]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 16: MultiPatBlt %d", order_caps[16]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 17: MultiScrBlt %d", order_caps[17]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 18: MultiOpaqueRect %d", order_caps[18]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 19: FastIndex %d", order_caps[19]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 20: PolygonSC %d", order_caps[20]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 21: PolygonCB %d", order_caps[21]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 22: Polyline %d", order_caps[22]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 23: unused index"); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 24: FastGlyph %d", order_caps[24]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 25: EllipseSC %d", order_caps[25]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 26: EllipseCB %d", order_caps[26]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 27: GlyphIndex %d", order_caps[27]); LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupport index 28-31: unused index"); LOG_DEVEL_HEXDUMP(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: order_caps", order_caps, 32); in_uint8s(s, 2); /* Text capability flags */ LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: textFlags (ignored as per protocol spec)"); /* read extended order support flags */ in_uint16_le(s, ex_flags); /* Ex flags */ LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: orderSupportExFlags 0x%4.4x", ex_flags); if (cap_flags & 0x80) /* ORDER_FLAGS_EXTRA_SUPPORT */ { self->client_info.order_flags_ex = ex_flags; if (ex_flags & XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT) { LOG_DEVEL(LOG_LEVEL_INFO, "Client Capability: bitmap cache v3 supported"); self->client_info.bitmap_cache_version |= 4; } } in_uint8s(s, 4); /* Pad */ in_uint32_le(s, i); /* desktop cache size, usually 0x38400 */ self->client_info.desktop_cache = i; LOG_DEVEL(LOG_LEVEL_TRACE, "TS_ORDER_CAPABILITYSET: desktopSaveSize %d", i); in_uint8s(s, 4); /* Pad */ in_uint8s(s, 4); /* Pad */ /* check if libpainter should be used for drawing, instead of orders */ if (!(order_caps[TS_NEG_DSTBLT_INDEX] && order_caps[TS_NEG_PATBLT_INDEX] && order_caps[TS_NEG_SCRBLT_INDEX] && order_caps[TS_NEG_MEMBLT_INDEX])) { LOG_DEVEL(LOG_LEVEL_INFO, "Client Capability: not enough orders supported by client, using painter."); self->client_info.no_orders_supported = 1; } return 0; } /*****************************************************************************/ /* get the bitmap cache size */ static int xrdp_caps_process_bmpcache(struct xrdp_rdp *self, struct stream *s, int len) { int i; if (len < 24 + 2 + 2 + 2 + 2 + 2 + 2) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 36, remaining %d", len); return 1; } self->client_info.bitmap_cache_version |= 1; in_uint8s(s, 24); /* cache 1 */ in_uint16_le(s, i); i = MIN(i, XRDP_MAX_BITMAP_CACHE_IDX); i = MAX(i, 0); self->client_info.cache1_entries = i; in_uint16_le(s, self->client_info.cache1_size); /* cache 2 */ in_uint16_le(s, i); i = MIN(i, XRDP_MAX_BITMAP_CACHE_IDX); i = MAX(i, 0); self->client_info.cache2_entries = i; in_uint16_le(s, self->client_info.cache2_size); /* cache 3 */ in_uint16_le(s, i); i = MIN(i, XRDP_MAX_BITMAP_CACHE_IDX); i = MAX(i, 0); self->client_info.cache3_entries = i; in_uint16_le(s, self->client_info.cache3_size); LOG_DEVEL(LOG_LEVEL_TRACE, "cache1 entries %d size %d", self->client_info.cache1_entries, self->client_info.cache1_size); LOG_DEVEL(LOG_LEVEL_TRACE, "cache2 entries %d size %d", self->client_info.cache2_entries, self->client_info.cache2_size); LOG_DEVEL(LOG_LEVEL_TRACE, "cache3 entries %d size %d", self->client_info.cache3_entries, self->client_info.cache3_size); return 0; } /*****************************************************************************/ /* get the bitmap cache size */ static int xrdp_caps_process_bmpcache2(struct xrdp_rdp *self, struct stream *s, int len) { int Bpp = 0; int i = 0; if (len < 2 + 2 + 4 + 4 + 4) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 16, remaining %d", len); return 1; } self->client_info.bitmap_cache_version |= 2; Bpp = (self->client_info.bpp + 7) / 8; in_uint16_le(s, i); /* cache flags */ self->client_info.bitmap_cache_persist_enable = i; in_uint8s(s, 2); /* number of caches in set, 3 */ in_uint32_le(s, i); i = MIN(i, XRDP_MAX_BITMAP_CACHE_IDX); i = MAX(i, 0); self->client_info.cache1_entries = i; self->client_info.cache1_size = 256 * Bpp; in_uint32_le(s, i); i = MIN(i, XRDP_MAX_BITMAP_CACHE_IDX); i = MAX(i, 0); self->client_info.cache2_entries = i; self->client_info.cache2_size = 1024 * Bpp; in_uint32_le(s, i); i = i & 0x7fffffff; i = MIN(i, XRDP_MAX_BITMAP_CACHE_IDX); i = MAX(i, 0); self->client_info.cache3_entries = i; self->client_info.cache3_size = 4096 * Bpp; LOG_DEVEL(LOG_LEVEL_TRACE, "cache1 entries %d size %d", self->client_info.cache1_entries, self->client_info.cache1_size); LOG_DEVEL(LOG_LEVEL_TRACE, "cache2 entries %d size %d", self->client_info.cache2_entries, self->client_info.cache2_size); LOG_DEVEL(LOG_LEVEL_TRACE, "cache3 entries %d size %d", self->client_info.cache3_entries, self->client_info.cache3_size); return 0; } /*****************************************************************************/ static int xrdp_caps_process_cache_v3_codec_id(struct xrdp_rdp *self, struct stream *s, int len) { int codec_id; if (len < 1) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 1, remaining %d", len); return 1; } in_uint8(s, codec_id); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_process_cache_v3_codec_id: cache_v3_codec_id %d", codec_id); self->client_info.v3_codec_id = codec_id; return 0; } /*****************************************************************************/ /* get the number of client cursor cache */ static int xrdp_caps_process_pointer(struct xrdp_rdp *self, struct stream *s, int len) { int i; int colorPointerFlag; int no_new_cursor; if (len < 2 + 2 + 2) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_pointer: error"); return 1; } no_new_cursor = self->client_info.pointer_flags & 2; in_uint16_le(s, colorPointerFlag); self->client_info.pointer_flags = colorPointerFlag; in_uint16_le(s, i); i = MIN(i, 32); self->client_info.pointer_cache_entries = i; if (colorPointerFlag & 1) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_pointer: client supports " "new(color) cursor"); in_uint16_le(s, i); i = MIN(i, 32); self->client_info.pointer_cache_entries = i; } else { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_pointer: client does not support " "new(color) cursor"); } if (no_new_cursor) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_pointer: new(color) cursor is " "disabled by config"); self->client_info.pointer_flags = 0; } return 0; } /*****************************************************************************/ static int xrdp_caps_process_input(struct xrdp_rdp *self, struct stream *s, int len) { int inputFlags; int client_does_fastpath_input; in_uint16_le(s, inputFlags); client_does_fastpath_input = (inputFlags & INPUT_FLAG_FASTPATH_INPUT) || (inputFlags & INPUT_FLAG_FASTPATH_INPUT2); if ((self->client_info.use_fast_path & 2) && !client_does_fastpath_input) { self->client_info.use_fast_path &= ~2; } return 0; } /*****************************************************************************/ /* get the type of client brush cache */ int xrdp_caps_process_brushcache(struct xrdp_rdp *self, struct stream *s, int len) { int code; if (len < 4) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_brushcache: error"); return 1; } in_uint32_le(s, code); self->client_info.brush_cache_code = code; return 0; } /*****************************************************************************/ static int xrdp_caps_process_glyphcache(struct xrdp_rdp *self, struct stream *s, int len) { int glyph_support_level; if (len < 40 + 4 + 2 + 2) /* MS-RDPBCGR 2.2.7.1.8 */ { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_glyphcache: error"); return 1; } in_uint8s(s, 40); /* glyph cache */ in_uint8s(s, 4); /* frag cache */ in_uint16_le(s, glyph_support_level); in_uint8s(s, 2); /* pad */ if (glyph_support_level == GLYPH_SUPPORT_ENCODE) { self->client_info.use_cache_glyph_v2 = 1; } LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_process_glyphcache: support level %d ", glyph_support_level); return 0; } /*****************************************************************************/ int xrdp_caps_process_offscreen_bmpcache(struct xrdp_rdp *self, struct stream *s, int len) { int i32; if (len < 4 + 2 + 2) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_offscreen_bmpcache: error"); return 1; } in_uint32_le(s, i32); self->client_info.offscreen_support_level = i32; in_uint16_le(s, i32); self->client_info.offscreen_cache_size = i32 * 1024; in_uint16_le(s, i32); self->client_info.offscreen_cache_entries = i32; LOG(LOG_LEVEL_INFO, "xrdp_process_offscreen_bmpcache: support level %d " "cache size %d MB cache entries %d", self->client_info.offscreen_support_level, self->client_info.offscreen_cache_size, self->client_info.offscreen_cache_entries); return 0; } /*****************************************************************************/ int xrdp_caps_process_rail(struct xrdp_rdp *self, struct stream *s, int len) { int i32; if (len < 4) { LOG(LOG_LEVEL_ERROR, "Not enough bytes in the stream: " "len 4, remaining %d", len); return 1; } in_uint32_le(s, i32); self->client_info.rail_support_level = i32; LOG(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - CAPSTYPE_RAIL " "RailSupportLevel 0x%8.8x (%s%s%s%s%s%s%s%s)", self->client_info.rail_support_level, (self->client_info.rail_support_level & 0x01) ? "TS_RAIL_LEVEL_SUPPORTED " : "", (self->client_info.rail_support_level & 0x02) ? "TS_RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED " : "", (self->client_info.rail_support_level & 0x04) ? "TS_RAIL_LEVEL_SHELL_INTEGRATION_SUPPORTED " : "", (self->client_info.rail_support_level & 0x08) ? "TS_RAIL_LEVEL_LANGUAGE_IME_SYNC_SUPPORTED " : "", (self->client_info.rail_support_level & 0x10) ? "TS_RAIL_LEVEL_SERVER_TO_CLIENT_IME_SYNC_SUPPORTED " : "", (self->client_info.rail_support_level & 0x20) ? "TS_RAIL_LEVEL_HIDE_MINIMIZED_APPS_SUPPORTED " : "", (self->client_info.rail_support_level & 0x40) ? "TS_RAIL_LEVEL_WINDOW_CLOAKING_SUPPORTED " : "", (self->client_info.rail_support_level & 0x80) ? "TS_RAIL_LEVEL_HANDSHAKE_EX_SUPPORTED " : "" ); return 0; } /*****************************************************************************/ static int xrdp_caps_process_window(struct xrdp_rdp *self, struct stream *s, int len) { int i32; if (len < 4 + 1 + 2) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_window: error"); return 1; } in_uint32_le(s, i32); self->client_info.wnd_support_level = i32; in_uint8(s, i32); self->client_info.wnd_num_icon_caches = i32; in_uint16_le(s, i32); self->client_info.wnd_num_icon_cache_entries = i32; LOG(LOG_LEVEL_INFO, "xrdp_process_capset_window wnd_support_level %d, " "wnd_num_icon_caches %d, wnd_num_icon_cache_entries %d", self->client_info.wnd_support_level, self->client_info.wnd_num_icon_caches, self->client_info.wnd_num_icon_cache_entries); return 0; } /*****************************************************************************/ static int xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len) { int codec_id; int codec_count; int index; int codec_properties_length; int i1; char *codec_guid; char *next_guid; struct guid guid; char codec_guid_str[GUID_STR_SIZE]; guid_clear(&guid); if (len < 1) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_codecs: error"); return 1; } in_uint8(s, codec_count); len--; for (index = 0; index < codec_count; index++) { codec_guid = s->p; g_memcpy(guid.g, s->p, GUID_SIZE); guid_to_str(&guid, codec_guid_str); if (len < 16 + 1 + 2) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_codecs: error"); return 1; } in_uint8s(s, 16); in_uint8(s, codec_id); in_uint16_le(s, codec_properties_length); len -= 16 + 1 + 2; if (len < codec_properties_length) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_codecs: error"); return 1; } len -= codec_properties_length; next_guid = s->p + codec_properties_length; if (g_memcmp(codec_guid, XR_CODEC_GUID_NSCODEC, 16) == 0) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: NSCodec(%s), codec id [%d], properties len [%d]", codec_guid_str, codec_id, codec_properties_length); self->client_info.ns_codec_id = codec_id; i1 = MIN(64, codec_properties_length); g_memcpy(self->client_info.ns_prop, s->p, i1); self->client_info.ns_prop_len = i1; } else if (g_memcmp(codec_guid, XR_CODEC_GUID_REMOTEFX, 16) == 0) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: RemoteFX(%s), codec id [%d], properties len [%d]", codec_guid_str, codec_id, codec_properties_length); self->client_info.rfx_codec_id = codec_id; i1 = MIN(64, codec_properties_length); g_memcpy(self->client_info.rfx_prop, s->p, i1); self->client_info.rfx_prop_len = i1; } else if (g_memcmp(codec_guid, XR_CODEC_GUID_JPEG, 16) == 0) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: JPEG(%s), codec id [%d], properties len [%d]", codec_guid_str, codec_id, codec_properties_length); self->client_info.jpeg_codec_id = codec_id; i1 = MIN(64, codec_properties_length); g_memcpy(self->client_info.jpeg_prop, s->p, i1); self->client_info.jpeg_prop_len = i1; /* make sure that requested quality is between 0 to 100 */ if (self->client_info.jpeg_prop[0] < 0 || self->client_info.jpeg_prop[0] > 100) { LOG(LOG_LEVEL_WARNING, " Warning: the requested jpeg quality (%d) is invalid, " "falling back to default", self->client_info.jpeg_prop[0]); self->client_info.jpeg_prop[0] = 75; /* use default */ } LOG(LOG_LEVEL_INFO, " jpeg quality set to %d", self->client_info.jpeg_prop[0]); } else if (g_memcmp(codec_guid, XR_CODEC_GUID_H264, 16) == 0) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: H264(%s), codec id [%d], properties len [%d]", codec_guid_str, codec_id, codec_properties_length); self->client_info.h264_codec_id = codec_id; i1 = MIN(64, codec_properties_length); g_memcpy(self->client_info.h264_prop, s->p, i1); self->client_info.h264_prop_len = i1; } /* other known codec but not supported yet */ else if (g_memcmp(codec_guid, XR_CODEC_GUID_IMAGE_REMOTEFX, 16) == 0) { LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: Image RemoteFX(%s), codec id [%d], properties len [%d]", codec_guid_str, codec_id, codec_properties_length); } else { LOG(LOG_LEVEL_WARNING, "xrdp_caps_process_codecs: unknown(%s), codec id [%d], properties len [%d]", codec_guid_str, codec_id, codec_properties_length); } s->p = next_guid; } return 0; } /*****************************************************************************/ static int xrdp_caps_process_multifragmentupdate(struct xrdp_rdp *self, struct stream *s, int len) { int MaxRequestSize; in_uint32_le(s, MaxRequestSize); if (self->client_info.use_fast_path & 1) { self->client_info.max_fastpath_frag_bytes = MaxRequestSize; } return 0; } /*****************************************************************************/ static int xrdp_caps_process_largepointer(struct xrdp_rdp *self, struct stream *s, int len) { int largePointerSupportFlags; in_uint16_le(s, largePointerSupportFlags); self->client_info.large_pointer_support_flags = largePointerSupportFlags; return 0; } /*****************************************************************************/ static int xrdp_caps_process_frame_ack(struct xrdp_rdp *self, struct stream *s, int len) { LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_process_frame_ack:"); self->client_info.use_frame_acks = 1; in_uint32_le(s, self->client_info.max_unacknowledged_frame_count); if (self->client_info.max_unacknowledged_frame_count < 0) { LOG(LOG_LEVEL_WARNING, " invalid max_unacknowledged_frame_count value (%d), setting to 0", self->client_info.max_unacknowledged_frame_count); self->client_info.max_unacknowledged_frame_count = 0; } LOG_DEVEL(LOG_LEVEL_TRACE, " max_unacknowledged_frame_count %d", self->client_info.max_unacknowledged_frame_count); return 0; } /*****************************************************************************/ static int xrdp_caps_process_surface_cmds(struct xrdp_rdp *self, struct stream *s, int len) { int cmdFlags; #ifndef USE_DEVEL_LOGGING /* TODO: remove UNUSED_VAR once the `cmdFlags` variable is used for more than logging in debug mode */ UNUSED_VAR(cmdFlags); #endif LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_process_surface_cmds:"); in_uint32_le(s, cmdFlags); in_uint8s(s, 4); /* reserved */ LOG_DEVEL(LOG_LEVEL_TRACE, " cmdFlags 0x%08x", cmdFlags); return 0; } /*****************************************************************************/ /* * Process a [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU (2.2.1.13.2.1) message. */ int xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s) { int cap_len; int source_len; int num_caps; int index; int type; int len; char *p; if (!s_check_rem_and_log(s, 10, "Parsing [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU" " - header")) { return 1; } in_uint8s(s, 4); /* rdp_shareid */ in_uint8s(s, 2); /* userid */ in_uint16_le(s, source_len); /* sizeof RDP_SOURCE */ in_uint16_le(s, cap_len); if (!s_check_rem_and_log(s, source_len + 2 + 2, "Parsing [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU" " - header2")) { return 1; } in_uint8s(s, source_len); in_uint16_le(s, num_caps); in_uint8s(s, 2); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU " "shareID (ignored), originatorID (ignored), lengthSourceDescriptor %d, " "lengthCombinedCapabilities %d, sourceDescriptor (ignored), " "numberCapabilities %d", source_len, cap_len, num_caps); if ((cap_len < 0) || (cap_len > 1024 * 1024)) { LOG(LOG_LEVEL_ERROR, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU " "lengthCombinedCapabilities %d is too long (> %d)", cap_len, 1024 * 1024); return 1; } for (index = 0; index < num_caps; index++) { p = s->p; if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET")) { return 1; } in_uint16_le(s, type); in_uint16_le(s, len); LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType %d, lengthCapability %d", type, len); if (len < 4) { LOG(LOG_LEVEL_ERROR, "Protocol error [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "lengthCapability must be greater than 3, received %d", len); return 1; } if (!s_check_rem_and_log(s, len - 4, "Parsing [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET ")) { return 1; } len -= 4; switch (type) { case CAPSTYPE_GENERAL: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_GENERAL"); xrdp_caps_process_general(self, s, len); break; case CAPSTYPE_BITMAP: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_BITMAP"); xrdp_caps_process_bitmap(self, s, len); break; case CAPSTYPE_ORDER: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_ORDER"); xrdp_caps_process_order(self, s, len); break; case CAPSTYPE_BITMAPCACHE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_BITMAPCACHE"); xrdp_caps_process_bmpcache(self, s, len); break; case CAPSTYPE_CONTROL: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_CONTROL - Ignored"); break; case 6: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = 6"); xrdp_caps_process_cache_v3_codec_id(self, s, len); break; case CAPSTYPE_ACTIVATION: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_ACTIVATION - Ignored"); break; case CAPSTYPE_POINTER: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_POINTER"); xrdp_caps_process_pointer(self, s, len); break; case CAPSTYPE_SHARE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_SHARE - Ignored"); break; case CAPSTYPE_COLORCACHE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_COLORCACHE - Ignored"); break; case CAPSTYPE_SOUND: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_SOUND - Ignored"); break; case CAPSTYPE_INPUT: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_INPUT"); xrdp_caps_process_input(self, s, len); break; case CAPSTYPE_FONT: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_FONT - Ignored"); break; case CAPSTYPE_BRUSH: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_BRUSH"); xrdp_caps_process_brushcache(self, s, len); break; case CAPSTYPE_GLYPHCACHE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_GLYPHCACHE"); xrdp_caps_process_glyphcache(self, s, len); break; case CAPSTYPE_OFFSCREENCACHE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_OFFSCREENCACHE"); xrdp_caps_process_offscreen_bmpcache(self, s, len); break; case CAPSTYPE_BITMAPCACHE_REV2: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_BITMAPCACHE_REV2"); xrdp_caps_process_bmpcache2(self, s, len); break; case CAPSTYPE_VIRTUALCHANNEL: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_VIRTUALCHANNEL - Ignored"); break; case CAPSTYPE_DRAWNINGRIDCACHE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_DRAWNINGRIDCACHE - Ignored"); break; case CAPSTYPE_DRAWGDIPLUS: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_DRAWGDIPLUS - Ignored"); break; case CAPSTYPE_RAIL: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_RAIL"); xrdp_caps_process_rail(self, s, len); break; case CAPSTYPE_WINDOW: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_WINDOW"); xrdp_caps_process_window(self, s, len); break; case CAPSSETTYPE_MULTIFRAGMENTUPDATE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSSETTYPE_MULTIFRAGMENTUPDATE"); xrdp_caps_process_multifragmentupdate(self, s, len); break; case CAPSETTYPE_LARGE_POINTER: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSETTYPE_LARGE_POINTER"); xrdp_caps_process_largepointer(self, s, len); break; case CAPSETTYPE_SURFACE_COMMANDS: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSETTYPE_SURFACE_COMMANDS"); xrdp_caps_process_surface_cmds(self, s, len); break; case CAPSSETTYPE_BITMAP_CODECS: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSSETTYPE_BITMAP_CODECS"); xrdp_caps_process_codecs(self, s, len); break; case CAPSTYPE_FRAME_ACKNOWLEDGE: LOG_DEVEL(LOG_LEVEL_INFO, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = CAPSTYPE_FRAME_ACKNOWLEDGE"); xrdp_caps_process_frame_ack(self, s, len); break; default: LOG(LOG_LEVEL_WARNING, "Received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU - TS_CAPS_SET " "capabilitySetType = %d is unknown - Ignored", type); break; } s->p = p + len + 4; } if (self->client_info.no_orders_supported && (self->client_info.offscreen_support_level != 0)) { LOG(LOG_LEVEL_WARNING, "Client Capability: not enough orders " "supported by client, client wants off screen bitmap but " "offscreen bitmaps disabled"); self->client_info.offscreen_support_level = 0; self->client_info.offscreen_cache_size = 0; self->client_info.offscreen_cache_entries = 0; } if (self->client_info.use_fast_path) { if ((self->client_info.large_pointer_support_flags & LARGE_POINTER_FLAG_96x96) && (self->client_info.max_fastpath_frag_bytes < 38055)) { LOG(LOG_LEVEL_WARNING, "Client Capability: client requested " "LARGE_POINTER_FLAG_96x96 but max_fastpath_frag_bytes(%d) is less then " "the required size of 38055, 96x96 large cursor support disabled", self->client_info.max_fastpath_frag_bytes); self->client_info.large_pointer_support_flags &= ~LARGE_POINTER_FLAG_96x96; } if ((self->client_info.large_pointer_support_flags & LARGE_POINTER_FLAG_384x384) && (self->client_info.max_fastpath_frag_bytes < 608299)) { LOG(LOG_LEVEL_WARNING, "Client Capability: client requested " "LARGE_POINTER_FLAG_384x384 but max_fastpath_frag_bytes(%d) is less then " "the required size of 608299, 384x384 large cursor support disabled", self->client_info.max_fastpath_frag_bytes); self->client_info.large_pointer_support_flags &= ~LARGE_POINTER_FLAG_384x384; } } else { if (self->client_info.large_pointer_support_flags != 0) { LOG(LOG_LEVEL_WARNING, "Client Capability: client requested " "large pointers but use_fast_path is false, " "all large cursor support disabled"); self->client_info.large_pointer_support_flags = 0; } } if (self->client_info.large_pointer_support_flags & LARGE_POINTER_FLAG_96x96) { LOG(LOG_LEVEL_INFO, "Client Capability: LARGE_POINTER_FLAG_96x96 supported"); } if (self->client_info.large_pointer_support_flags & LARGE_POINTER_FLAG_384x384) { LOG(LOG_LEVEL_INFO, "Client Capability: LARGE_POINTER_FLAG_384x384 supported"); } LOG_DEVEL(LOG_LEVEL_TRACE, "Completed processing received [MS-RDPBCGR] TS_CONFIRM_ACTIVE_PDU"); return 0; } /**************************************************************************//** * Calculate the multifragmentupdate len we advertised to the client * for fastpath updates * * See [MS-RDPBCGR] 2.2.7.2.6 * * The basic logic is taken from freerdp 2.4. We try to use the highest * useful request size that will allow us to pack a complete screen * update into a single fast path PDU using any of the supported codecs. * For RemoteFX, the client MUST use at least this value * * A backstop on the maximum advertised size is implemented to prevent * extreme memory usage for large screen configurations. RDP supports a * maximum desktop size of 32768x32768, which would cause overflow for * 32-bit integers using a simple calculation. * * The codecs have to deal with the value returned by the client after * we advertise our own value, and must not assume a complete update * will fit in a single PDU */ static unsigned int calculate_multifragmentupdate_len(const struct xrdp_rdp *self) { unsigned int result = MAX_MULTIFRAGMENTUPDATE_SIZE; unsigned int x_tiles = (self->client_info.display_sizes.session_width + 63) / 64; unsigned int y_tiles = (self->client_info.display_sizes.session_height + 63) / 64; /* Check for overflow on calculation if bad parameters are supplied */ if ((x_tiles * y_tiles + 1) < (UINT_MAX / 16384)) { result = x_tiles * y_tiles * 16384; /* and add room for headers, regions, frame markers, etc. */ result += 16384; } return result; } /*****************************************************************************/ int xrdp_caps_send_demand_active(struct xrdp_rdp *self) { struct stream *s; int caps_count; int caps_size; int codec_caps_count; int codec_caps_size; int flags; char *caps_count_ptr; char *caps_size_ptr; char *caps_ptr; char *codec_caps_count_ptr; char *codec_caps_size_ptr; make_stream(s); init_stream(s, 8192); if (xrdp_rdp_init(self, s) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_send_demand_active: xrdp_rdp_init failed"); free_stream(s); return 1; } caps_count = 0; out_uint32_le(s, self->share_id); out_uint16_le(s, 4); /* 4 chars for RDP\0 */ /* 2 bytes size after num caps, set later */ caps_size_ptr = s->p; out_uint8s(s, 2); out_uint8a(s, "RDP", 4); /* 4 byte num caps, set later */ caps_count_ptr = s->p; out_uint8s(s, 4); caps_ptr = s->p; /* Output share capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_SHARE); out_uint16_le(s, CAPSTYPE_SHARE_LEN); out_uint16_le(s, self->mcs_channel); out_uint16_be(s, 0xb5e2); /* 0x73e1 */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_SHARE " "channel ID = 0x%x", self->mcs_channel); /* Output general capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_GENERAL); out_uint16_le(s, CAPSTYPE_GENERAL_LEN); out_uint16_le(s, OSMAJORTYPE_WINDOWS); out_uint16_le(s, OSMINORTYPE_WINDOWS_NT); out_uint16_le(s, 0x200); /* Protocol version */ out_uint16_le(s, 0); /* pad */ out_uint16_le(s, 0); /* Compression types */ if (self->client_info.use_fast_path & 1) { out_uint16_le(s, NO_BITMAP_COMPRESSION_HDR | FASTPATH_OUTPUT_SUPPORTED); } else { out_uint16_le(s, NO_BITMAP_COMPRESSION_HDR); } out_uint16_le(s, 0); /* Update capability */ out_uint16_le(s, 0); /* Remote unshare capability */ out_uint16_le(s, 0); /* Compression level */ out_uint8(s, 1); /* refreshRectSupport */ out_uint8(s, 1); /* suppressOutputSupport */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_GENERAL TODO"); /* Output bitmap capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_BITMAP); out_uint16_le(s, CAPSTYPE_BITMAP_LEN); out_uint16_le(s, self->client_info.bpp); /* Preferred BPP */ out_uint16_le(s, 1); /* Receive 1 BPP */ out_uint16_le(s, 1); /* Receive 4 BPP */ out_uint16_le(s, 1); /* Receive 8 BPP */ out_uint16_le(s, self->client_info.display_sizes.session_width); /* width */ out_uint16_le(s, self->client_info.display_sizes.session_height); /* height */ out_uint16_le(s, 0); /* Pad */ out_uint16_le(s, 1); /* Allow resize */ out_uint16_le(s, 1); /* bitmap compression */ out_uint16_le(s, 0); /* unknown */ out_uint16_le(s, 0); /* unknown */ out_uint16_le(s, 0); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_BITMAP TODO"); /* Output font capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_FONT); out_uint16_le(s, CAPSTYPE_FONT_LEN); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_FONT"); /* Output order capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_ORDER); out_uint16_le(s, CAPSTYPE_ORDER_LEN); out_uint8s(s, 16); out_uint32_be(s, 0x40420f00); out_uint16_le(s, 1); /* Cache X granularity */ out_uint16_le(s, 20); /* Cache Y granularity */ out_uint16_le(s, 0); /* Pad */ out_uint16_le(s, 1); /* Max order level */ out_uint16_le(s, 0x2f); /* Number of fonts */ out_uint16_le(s, 0x22); /* Capability flags */ /* caps */ out_uint8(s, 1); /* NEG_DSTBLT_INDEX 0x00 0 */ out_uint8(s, 1); /* NEG_PATBLT_INDEX 0x01 1 */ out_uint8(s, 1); /* NEG_SCRBLT_INDEX 0x02 2 */ out_uint8(s, 1); /* NEG_MEMBLT_INDEX 0x03 3 */ out_uint8(s, 0); /* NEG_MEM3BLT_INDEX 0x04 4 */ out_uint8(s, 0); /* NEG_ATEXTOUT_INDEX 0x05 5 */ out_uint8(s, 0); /* NEG_AEXTTEXTOUT_INDEX 0x06 6 */ out_uint8(s, 0); /* NEG_DRAWNINEGRID_INDEX 0x07 7 */ out_uint8(s, 1); /* NEG_LINETO_INDEX 0x08 8 */ out_uint8(s, 0); /* NEG_MULTI_DRAWNINEGRID_INDEX 0x09 9 */ out_uint8(s, 1); /* NEG_OPAQUE_RECT_INDEX 0x0A 10 */ out_uint8(s, 0); /* NEG_SAVEBITMAP_INDEX 0x0B 11 */ out_uint8(s, 0); /* NEG_WTEXTOUT_INDEX 0x0C 12 */ out_uint8(s, 0); /* NEG_MEMBLT_V2_INDEX 0x0D 13 */ out_uint8(s, 0); /* NEG_MEM3BLT_V2_INDEX 0x0E 14 */ out_uint8(s, 0); /* NEG_MULTIDSTBLT_INDEX 0x0F 15 */ out_uint8(s, 0); /* NEG_MULTIPATBLT_INDEX 0x10 16 */ out_uint8(s, 0); /* NEG_MULTISCRBLT_INDEX 0x11 17 */ out_uint8(s, 1); /* NEG_MULTIOPAQUERECT_INDEX 0x12 18 */ out_uint8(s, 0); /* NEG_FAST_INDEX_INDEX 0x13 19 */ out_uint8(s, 0); /* NEG_POLYGON_SC_INDEX 0x14 20 */ out_uint8(s, 0); /* NEG_POLYGON_CB_INDEX 0x15 21 */ out_uint8(s, 0); /* NEG_POLYLINE_INDEX 0x16 22 */ out_uint8(s, 0); /* unused 0x17 23 */ out_uint8(s, 0); /* NEG_FAST_GLYPH_INDEX 0x18 24 */ out_uint8(s, 0); /* NEG_ELLIPSE_SC_INDEX 0x19 25 */ out_uint8(s, 0); /* NEG_ELLIPSE_CB_INDEX 0x1A 26 */ out_uint8(s, 1); /* NEG_GLYPH_INDEX_INDEX 0x1B 27 */ out_uint8(s, 0); /* NEG_GLYPH_WEXTTEXTOUT_INDEX 0x1C 28 */ out_uint8(s, 0); /* NEG_GLYPH_WLONGTEXTOUT_INDEX 0x1D 29 */ out_uint8(s, 0); /* NEG_GLYPH_WLONGEXTTEXTOUT_INDEX 0x1E 30 */ out_uint8(s, 0); /* unused 0x1F 31 */ out_uint16_le(s, 0x6a1); /* declare support of bitmap cache rev3 */ out_uint16_le(s, XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT); out_uint32_le(s, 0x0f4240); /* desk save */ out_uint32_le(s, 0x0f4240); /* desk save */ out_uint32_le(s, 1); /* ? */ out_uint32_le(s, 0); /* ? */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_ORDER " "TODO"); /* Output bmpcodecs capability set */ caps_count++; out_uint16_le(s, CAPSSETTYPE_BITMAP_CODECS); codec_caps_size_ptr = s->p; out_uint8s(s, 2); /* cap len set later */ codec_caps_count = 0; codec_caps_count_ptr = s->p; out_uint8s(s, 1); /* bitmapCodecCount set later */ /* nscodec */ codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_NSCODEC, 16); out_uint8(s, 1); /* codec id, must be 1 */ out_uint16_le(s, 3); /* codecPropertiesLength */ out_uint8(s, 0x01); /* fAllowDynamicFidelity */ out_uint8(s, 0x01); /* fAllowSubsampling */ out_uint8(s, 0x03); /* colorLossLevel */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "NSCODEC " "fAllowDynamicFidelity = 0x01," "fAllowSubsampling = 0x01," "colorLossLevel = 0x03"); #if defined(XRDP_RFXCODEC) || defined(XRDP_NEUTRINORDP) /* remotefx */ codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_REMOTEFX, 16); out_uint8(s, 0); /* codec id, client sets */ out_uint16_le(s, 4); /* codecPropertiesLength */ out_uint32_le(s, 0); /* reserved */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "REMOTEFX"); /* image remotefx */ codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_IMAGE_REMOTEFX, 16); out_uint8(s, 0); /* codec id, client sets */ out_uint16_le(s, 4); /* codecPropertiesLength */ out_uint32_le(s, 0); /* reserved */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "IMAGE_REMOTEFX"); #endif /* jpeg */ codec_caps_count++; out_uint8a(s, XR_CODEC_GUID_JPEG, 16); out_uint8(s, 0); /* codec id, client sets */ out_uint16_le(s, 1); /* codecPropertiesLength */ out_uint8(s, 75); /* jpeg compression ratio */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "JPEG: " "jpeg compression ratio = 75"); /* calculate and set size and count */ codec_caps_size = (int)(s->p - codec_caps_size_ptr); codec_caps_size += 2; /* 2 bytes for CAPSTYPE_BMPCODECS above */ codec_caps_size_ptr[0] = codec_caps_size; codec_caps_size_ptr[1] = codec_caps_size >> 8; codec_caps_count_ptr[0] = codec_caps_count; /* Output color cache capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_COLORCACHE); out_uint16_le(s, CAPSTYPE_COLORCACHE_LEN); out_uint16_le(s, 6); /* cache size */ out_uint16_le(s, 0); /* pad */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_COLORCACHE: " "colorTableCacheSize = 6"); /* Output pointer capability set */ caps_count++; out_uint16_le(s, CAPSTYPE_POINTER); out_uint16_le(s, CAPSTYPE_POINTER_LEN); out_uint16_le(s, 1); /* Colour pointer */ out_uint16_le(s, 0x19); /* Cache size */ out_uint16_le(s, 0x19); /* Cache size */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_POINTER: " "colorPointerFlag = true" "colorPointerCacheSize = 0x19" "pointerCacheSize = 0x19"); /* Output input capability set */ /* https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/b3bc76ae-9ee5-454f-b197-ede845ca69cc */ caps_count++; out_uint16_le(s, CAPSTYPE_INPUT); out_uint16_le(s, CAPSTYPE_INPUT_LEN); flags = INPUT_FLAG_SCANCODES | INPUT_FLAG_MOUSEX | INPUT_FLAG_UNICODE | TS_INPUT_FLAG_MOUSE_HWHEEL; if (self->client_info.use_fast_path & 2) { flags |= INPUT_FLAG_FASTPATH_INPUT | INPUT_FLAG_FASTPATH_INPUT2; } out_uint16_le(s, flags); out_uint8s(s, 82); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_INPUT: " "inputFlags = 0x%x", flags); if (self->client_info.rail_enable) /* MS-RDPERP 3.3.5.1.4 */ { /* Remote Programs Capability Set */ caps_count++; out_uint16_le(s, CAPSTYPE_RAIL); out_uint16_le(s, 8); /* LengthCapability: MS-RDPERP 2.2.1.1.1 */ out_uint32_le(s, 3); /* See: https://msdn.microsoft.com/en-us/library/cc242518.aspx TS_RAIL_LEVEL_SUPPORTED TS_RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_RAIL: " "RailSupportLevel = " "TS_RAIL_LEVEL_SUPPORTED | TS_RAIL_LEVEL_DOCKED_LANGBAR_SUPPORTED"); /* Window List Capability Set */ caps_count++; out_uint16_le(s, CAPSTYPE_WINDOW); out_uint16_le(s, 11); /* LengthCapability: MS-RDPERP 2.2.1.1.2 */ out_uint32_le(s, TS_WINDOW_LEVEL_SUPPORTED_EX); out_uint8(s, 3); /* NumIconCaches */ out_uint16_le(s, 12); /* NumIconCacheEntries */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_WINDOW: " "WndSupportLevel = TS_WINDOW_LEVEL_SUPPORTED_EX, " "NumIconCaches = 3," "NumIconCacheEntries = 12"); } /* 6 - bitmap cache v3 codecid */ caps_count++; out_uint16_le(s, 0x0006); out_uint16_le(s, 5); out_uint8(s, 0); /* client sets */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "0x0006 = 0"); if (self->client_info.use_fast_path & FASTPATH_OUTPUT_SUPPORTED) /* fastpath output on */ { unsigned int max_request_size = calculate_multifragmentupdate_len(self); caps_count++; out_uint16_le(s, CAPSSETTYPE_MULTIFRAGMENTUPDATE); out_uint16_le(s, CAPSSETTYPE_MULTIFRAGMENTUPDATE_LEN); out_uint32_le(s, max_request_size); LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSSETTYPE_MULTIFRAGMENTUPDATE = %d", max_request_size); /* large pointer 96x96 */ caps_count++; out_uint16_le(s, CAPSETTYPE_LARGE_POINTER); out_uint16_le(s, CAPSETTYPE_LARGE_POINTER_LEN); out_uint16_le(s, LARGE_POINTER_FLAG_96x96); /* frame acks */ caps_count++; out_uint16_le(s, CAPSTYPE_FRAME_ACKNOWLEDGE); out_uint16_le(s, CAPSTYPE_FRAME_ACKNOWLEDGE_LEN); out_uint32_le(s, 2); /* 2 frames in flight */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSTYPE_FRAME_ACKNOWLEDGE = 2 frames"); /* surface commands */ caps_count++; out_uint16_le(s, CAPSETTYPE_SURFACE_COMMANDS); out_uint16_le(s, CAPSETTYPE_SURFACE_COMMANDS_LEN); out_uint32_le(s, (SURFCMDS_SETSURFACEBITS | SURFCMDS_FRAMEMARKER | SURFCMDS_STREAMSUFRACEBITS)); /* cmdFlags */ out_uint32_le(s, 0); /* reserved */ LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: Server Capability " "CAPSETTYPE_SURFACE_COMMANDS = " "SURFCMDS_SETSURFACEBITS | SURFCMDS_FRAMEMARKER | SURFCMDS_STREAMSUFRACEBITS"); } out_uint8s(s, 4); /* pad */ s_mark_end(s); caps_size = (int)(s->end - caps_ptr); caps_size_ptr[0] = caps_size; caps_size_ptr[1] = caps_size >> 8; caps_count_ptr[0] = caps_count; caps_count_ptr[1] = caps_count >> 8; caps_count_ptr[2] = caps_count >> 16; caps_count_ptr[3] = caps_count >> 24; LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: sending PDUTYPE_DEMANDACTIVEPDU " "message with the server's capabilities"); if (xrdp_rdp_send(self, s, PDUTYPE_DEMANDACTIVEPDU) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_send_demand_active: xrdp_rdp_send failed"); free_stream(s); return 1; } /* send Monitor Layout PDU for multi-monitor */ int early_cap_flags = self->client_info.mcs_early_capability_flags; if ((early_cap_flags & RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU) != 0 && self->client_info.display_sizes.monitorCount > 0 && self->client_info.multimon == 1) { LOG_DEVEL(LOG_LEVEL_TRACE, "xrdp_caps_send_demand_active: sending monitor layout pdu"); if (xrdp_caps_send_monitorlayout(self) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_caps_send_demand_active: error sending monitor layout pdu"); } } free_stream(s); return 0; } xrdp-0.10.1/libxrdp/xrdp_orders_rail.c000644 001751 000000 00000077064 14652432047 020025 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "libxrdp.h" #include "ms-rdpegdi.h" #include "xrdp_rail.h" #include "string_calls.h" /* [MS-RDPERP]: Remote Desktop Protocol: Remote Programs Virtual Channel Extension http://msdn.microsoft.com/en-us/library/cc242568(v=prot.10) */ /*****************************************************************************/ /* RAIL */ /* returns error */ int xrdp_orders_send_window_delete(struct xrdp_orders *self, int window_id) { int order_size; int order_flags; int field_present_flags; order_size = 11; if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_window_delete: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ field_present_flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_STATE_DELETED; out_uint32_le(self->out_s, field_present_flags); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_WINDOW_ORDER_HEADER " "OrderSize %d, " "FieldsPresentFlags 0x%8.8x (WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_STATE_DELETED), " "WindowId 0x%8.8x", order_size, field_present_flags, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] Deleted Window"); return 0; } /*****************************************************************************/ /* RAIL */ /* returns error */ /* flags can contain WINDOW_ORDER_STATE_NEW and/or WINDOW_ORDER_FIELD_ICON_BIG */ int xrdp_orders_send_window_cached_icon(struct xrdp_orders *self, int window_id, int cache_entry, int cache_id, int flags) { int order_size; int order_flags; int field_present_flags; order_size = 14; if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_window_cached_icon: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ field_present_flags = flags | WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_CACHED_ICON; out_uint32_le(self->out_s, field_present_flags); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_WINDOW_ORDER_HEADER " "OrderSize %d, FieldsPresentFlags 0x%8.8x, WindowId 0x%8.8x", order_size, field_present_flags, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] Cached Icon"); /* CacheEntry (2 bytes) */ out_uint16_le(self->out_s, cache_entry); /* CacheId (1 byte) */ out_uint8(self->out_s, cache_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order field [MS-RDPERP] TS_CACHED_ICON_INFO " "CacheEntry %d, CacheId %d", cache_entry, cache_id); return 0; } /*****************************************************************************/ /* RAIL */ /* returns error */ static int xrdp_orders_send_ts_icon(struct stream *s, int cache_entry, int cache_id, struct rail_icon_info *icon_info) { int use_cmap; use_cmap = 0; if ((icon_info->bpp == 1) || (icon_info->bpp == 2) || (icon_info->bpp == 4)) { use_cmap = 1; } /* TS_ICON_INFO */ out_uint16_le(s, cache_entry); out_uint8(s, cache_id); out_uint8(s, icon_info->bpp); out_uint16_le(s, icon_info->width); out_uint16_le(s, icon_info->height); if (use_cmap) { out_uint16_le(s, icon_info->cmap_bytes); } out_uint16_le(s, icon_info->mask_bytes); out_uint16_le(s, icon_info->data_bytes); out_uint8p(s, icon_info->mask, icon_info->mask_bytes); if (use_cmap) { out_uint8p(s, icon_info->cmap, icon_info->cmap_bytes); } out_uint8p(s, icon_info->data, icon_info->data_bytes); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order fields [MS-RDPERP] TS_ICON_INFO " "CacheEntry %d, CacheId %d, Bpp %d, Width %d, Height %d, " "CbColorTable <%s>, " "CbBitsMask %d, CbBitsColor %d, BitsMask , " "ColorTable <%s>, " "BitsColor ", cache_entry, cache_id, icon_info->bpp, icon_info->width, icon_info->height, (use_cmap ? "present, omitted from log" : "not present"), icon_info->mask_bytes, icon_info->data_bytes, (use_cmap ? "present, omitted from log" : "not present") ); return 0; } /*****************************************************************************/ /* RAIL */ /* returns error */ /* flags can contain WINDOW_ORDER_STATE_NEW and/or WINDOW_ORDER_FIELD_ICON_BIG */ int xrdp_orders_send_window_icon(struct xrdp_orders *self, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags) { int order_size; int order_flags; int field_present_flags; int use_cmap; use_cmap = 0; if ((icon_info->bpp == 1) || (icon_info->bpp == 2) || (icon_info->bpp == 4)) { use_cmap = 1; } order_size = 23 + icon_info->mask_bytes + icon_info->data_bytes; if (use_cmap) { order_size += icon_info->cmap_bytes + 2; } if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_window_icon: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ field_present_flags = flags | WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_ICON; out_uint32_le(self->out_s, field_present_flags); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_WINDOW_ORDER_HEADER " "OrderSize %d, FieldsPresentFlags 0x%8.8x, WindowId 0x%8.8x", order_size, field_present_flags, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] Window Icon"); xrdp_orders_send_ts_icon(self->out_s, cache_entry, cache_id, icon_info); return 0; } /*****************************************************************************/ /* returns error */ static int xrdp_orders_send_as_unicode(struct stream *s, const char *text) { unsigned int text_len = strlen(text); int i32 = utf8_as_utf16_word_count(text, text_len) * 2; out_uint16_le(s, i32); out_utf8_as_utf16_le(s, text, text_len); return 0; } /*****************************************************************************/ static int xrdp_orders_get_unicode_bytes(const char *text) { unsigned int text_len = strlen(text); /* Add 1 to word size to include length ([MS-RDPERP] 2.2.1.2.1) */ return (utf8_as_utf16_word_count(text, text_len) + 1) * 2; } /*****************************************************************************/ /* RAIL */ /* returns error */ /* flags can contain WINDOW_ORDER_STATE_NEW */ int xrdp_orders_send_window_new_update(struct xrdp_orders *self, int window_id, struct rail_window_state_order *window_state, int flags) { int order_size; int order_flags; int field_present_flags; int index; order_size = 11; field_present_flags = flags | WINDOW_ORDER_TYPE_WINDOW; if (field_present_flags & WINDOW_ORDER_FIELD_OWNER) { /* ownerWindowId (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_STYLE) { /* style (4 bytes) */ order_size += 4; /* extendedStyle (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_SHOW) { /* showState (1 byte) */ order_size += 1; } if (field_present_flags & WINDOW_ORDER_FIELD_TITLE) { /* titleInfo */ order_size += xrdp_orders_get_unicode_bytes(window_state->title_info); } if (field_present_flags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET) { /* clientOffsetX (4 bytes) */ order_size += 4; /* clientOffsetY (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) { /* clientAreaWidth (4 bytes) */ order_size += 4; /* clientAreaHeight (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_RP_CONTENT) { /* RPContent (1 byte) */ order_size += 1; } if (field_present_flags & WINDOW_ORDER_FIELD_ROOT_PARENT) { /* rootParentHandle (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_WND_OFFSET) { /* windowOffsetX (4 bytes) */ order_size += 4; /* windowOffsetY (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA) { /* windowClientDeltaX (4 bytes) */ order_size += 4; /* windowClientDeltaY (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_WND_SIZE) { /* windowWidth (4 bytes) */ order_size += 4; /* windowHeight (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_WND_RECTS) { /* numWindowRects (2 bytes) */ order_size += 2; order_size += 8 * window_state->num_window_rects; } if (field_present_flags & WINDOW_ORDER_FIELD_VIS_OFFSET) { /* visibleOffsetX (4 bytes) */ order_size += 4; /* visibleOffsetY (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_VISIBILITY) { /* numVisibilityRects (2 bytes) */ order_size += 2; order_size += 8 * window_state->num_visibility_rects; } if (order_size < 12) { /* no flags set */ return 0; } if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_window_new_update: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ out_uint32_le(self->out_s, field_present_flags); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_WINDOW_ORDER_HEADER " "OrderSize %d, FieldsPresentFlags 0x%8.8x, WindowId 0x%8.8x", order_size, field_present_flags, window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] New or Existing Window (TS_WINDOW_INFO)"); if (field_present_flags & WINDOW_ORDER_FIELD_OWNER) { /* ownerWindowId (4 bytes) */ out_uint32_le(self->out_s, window_state->owner_window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "OwnerWindowId 0x%8.8x", window_state->owner_window_id); } if (field_present_flags & WINDOW_ORDER_FIELD_STYLE) { /* style (4 bytes) */ out_uint32_le(self->out_s, window_state->style); /* extendedStyle (4 bytes) */ out_uint32_le(self->out_s, window_state->extended_style); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "Style 0x%8.8x, ExtendedStyle 0x%8.8x", window_state->style, window_state->extended_style); } if (field_present_flags & WINDOW_ORDER_FIELD_SHOW) { /* showState (1 byte) */ out_uint8(self->out_s, window_state->show_state); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "ShowState 0x%2.2x", window_state->show_state); } if (field_present_flags & WINDOW_ORDER_FIELD_TITLE) { /* titleInfo */ xrdp_orders_send_as_unicode(self->out_s, window_state->title_info); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "TitleInfo %s", window_state->title_info); } if (field_present_flags & WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET) { /* clientOffsetX (4 bytes) */ out_uint32_le(self->out_s, window_state->client_offset_x); /* clientOffsetY (4 bytes) */ out_uint32_le(self->out_s, window_state->client_offset_y); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "ClientOffsetX %d, ClientOffsetY %d", window_state->client_offset_x, window_state->client_offset_y); } /* TODO: The [MS-RDPERP] spec says that: * The ClientAreaWidth and ClientAreaHeight field only appears if the WndSupportLevel field of the * Window List Capability Set message is set to TS_WINDOW_LEVEL_SUPPORTED_EX * (as specified in [MS-RDPERP] section 2.2.1.1.2) */ if (field_present_flags & WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE) { /* clientAreaWidth (4 bytes) */ out_uint32_le(self->out_s, window_state->client_area_width); /* clientAreaHeight (4 bytes) */ out_uint32_le(self->out_s, window_state->client_area_height); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "ClientAreaWidth %d, ClientAreaHeight %d", window_state->client_area_width, window_state->client_area_height); } /* TODO: The [MS-RDPERP] spec section 2.2.1.3.1.2.1 has the following additional fields: * WindowLeftResizeMargin (optional) * WindowRightResizeMargin (optional) * WindowTopResizeMargin (optional) * WindowBottomResizeMargin (optional) */ /* TODO: The [MS-RDPERP] spec says that: * The RPContent field only appears if the WndSupportLevel field of the * Window List Capability Set message is set to TS_WINDOW_LEVEL_SUPPORTED_EX * (as specified in [MS-RDPERP] section 2.2.1.1.2) */ if (field_present_flags & WINDOW_ORDER_FIELD_RP_CONTENT) { /* RPContent (1 byte) */ out_uint8(self->out_s, window_state->rp_content); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "RPContent 0x%2.2x", window_state->rp_content); } /* TODO: The [MS-RDPERP] spec says that: * The RootParentHandle field only appears if the WndSupportLevel field of the * Window List Capability Set message is set to TS_WINDOW_LEVEL_SUPPORTED_EX * (as specified in [MS-RDPERP] section 2.2.1.1.2) */ if (field_present_flags & WINDOW_ORDER_FIELD_ROOT_PARENT) { /* rootParentHandle (4 bytes) */ out_uint32_le(self->out_s, window_state->root_parent_handle); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "RootParentHandle 0x%8.8x", window_state->root_parent_handle); } if (field_present_flags & WINDOW_ORDER_FIELD_WND_OFFSET) { /* windowOffsetX (4 bytes) */ out_uint32_le(self->out_s, window_state->window_offset_x); /* windowOffsetY (4 bytes) */ out_uint32_le(self->out_s, window_state->window_offset_y); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "WindowOffsetX %d, WindowOffsetY %d", window_state->window_offset_x, window_state->window_offset_y); } if (field_present_flags & WINDOW_ORDER_FIELD_WND_CLIENT_DELTA) { /* windowClientDeltaX (4 bytes) */ out_uint32_le(self->out_s, window_state->window_client_delta_x); /* windowClientDeltaY (4 bytes) */ out_uint32_le(self->out_s, window_state->window_client_delta_y); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "WindowClientDeltaX %d, WindowClientDeltaY %d", window_state->window_client_delta_x, window_state->window_client_delta_y); } if (field_present_flags & WINDOW_ORDER_FIELD_WND_SIZE) { /* windowWidth (4 bytes) */ out_uint32_le(self->out_s, window_state->window_width); /* windowHeight (4 bytes) */ out_uint32_le(self->out_s, window_state->window_height); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "WindowWidth %d, WindowHeight %d", window_state->window_width, window_state->window_height); } if (field_present_flags & WINDOW_ORDER_FIELD_WND_RECTS) { /* numWindowRects (2 bytes) */ out_uint16_le(self->out_s, window_state->num_window_rects); for (index = 0; index < window_state->num_window_rects; index++) { out_uint16_le(self->out_s, window_state->window_rects[index].left); out_uint16_le(self->out_s, window_state->window_rects[index].top); out_uint16_le(self->out_s, window_state->window_rects[index].right); out_uint16_le(self->out_s, window_state->window_rects[index].bottom); } LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "NumWindowRects %d, WindowRects ", window_state->num_window_rects); } if (field_present_flags & WINDOW_ORDER_FIELD_VIS_OFFSET) { /* visibleOffsetX (4 bytes) */ out_uint32_le(self->out_s, window_state->visible_offset_x); /* visibleOffsetY (4 bytes) */ out_uint32_le(self->out_s, window_state->visible_offset_y); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "VisibleOffsetX %d, VisibleOffsetY %d", window_state->visible_offset_x, window_state->visible_offset_y); } if (field_present_flags & WINDOW_ORDER_FIELD_VISIBILITY) { /* numVisibilityRects (2 bytes) */ out_uint16_le(self->out_s, window_state->num_visibility_rects); for (index = 0; index < window_state->num_visibility_rects; index++) { out_uint16_le(self->out_s, window_state->visibility_rects[index].left); out_uint16_le(self->out_s, window_state->visibility_rects[index].top); out_uint16_le(self->out_s, window_state->visibility_rects[index].right); out_uint16_le(self->out_s, window_state->visibility_rects[index].bottom); } LOG_DEVEL(LOG_LEVEL_TRACE, "Adding optional field [MS-RDPERP] TS_WINDOW_INFO " "NumVisibilityRects %d, VisibilityRects ", window_state->num_visibility_rects); } /* TODO: The [MS-RDPERP] spec section 2.2.1.3.1.2.1 has the following additional fields: * OverlayDescription (optional, variable) * TaskbarButton (optional) * EnforceServerZOrder (optional) * AppBarState (optional) * AppBarEdge (optional) */ return 0; } /*****************************************************************************/ /* RAIL */ /* returns error */ int xrdp_orders_send_notify_delete(struct xrdp_orders *self, int window_id, int notify_id) { int order_size; int order_flags; int field_present_flags; order_size = 15; if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_notify_delete: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ field_present_flags = WINDOW_ORDER_TYPE_NOTIFY | WINDOW_ORDER_STATE_DELETED; out_uint32_le(self->out_s, field_present_flags); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); /* notifyIconId (4 bytes) */ out_uint32_le(self->out_s, notify_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_NOTIFYICON_ORDER_HEADER " "OrderSize %d, FieldsPresentFlags 0x%8.8x, WindowId 0x%8.8x, NotifyIconId 0x%8.8x", order_size, field_present_flags, window_id, notify_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] Deleted Notification Icons"); return 0; } /*****************************************************************************/ /* RAIL */ /* returns error */ /* flags can contain WINDOW_ORDER_STATE_NEW */ int xrdp_orders_send_notify_new_update(struct xrdp_orders *self, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags) { int order_size; int order_flags; int field_present_flags; int use_cmap; order_size = 15; field_present_flags = flags | WINDOW_ORDER_TYPE_NOTIFY; if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_VERSION) { /* Version (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_TIP) { /* ToolTip (variable) UNICODE_STRING */ order_size += xrdp_orders_get_unicode_bytes(notify_state->tool_tip); } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) { /* InfoTip (variable) TS_NOTIFY_ICON_INFOTIP */ /* UNICODE_STRING */ order_size += xrdp_orders_get_unicode_bytes(notify_state->infotip.title); /* UNICODE_STRING */ order_size += xrdp_orders_get_unicode_bytes(notify_state->infotip.text); /* Timeout (4 bytes) */ /* InfoFlags (4 bytes) */ order_size += 8; } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_STATE) { /* State (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_ICON) { /* Icon (variable) */ use_cmap = 0; if ((notify_state->icon_info.bpp == 1) || (notify_state->icon_info.bpp == 2) || (notify_state->icon_info.bpp == 4)) { use_cmap = 1; } order_size += 12 + notify_state->icon_info.mask_bytes + notify_state->icon_info.data_bytes; if (use_cmap) { order_size += notify_state->icon_info.cmap_bytes + 2; } } if (field_present_flags & WINDOW_ORDER_CACHED_ICON) { /* CachedIcon (3 bytes) */ order_size += 3; } if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_notify_new_update: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ out_uint8(self->out_s, order_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ out_uint32_le(self->out_s, field_present_flags); /* windowId (4 bytes) */ out_uint32_le(self->out_s, window_id); /* notifyIconId (4 bytes) */ out_uint32_le(self->out_s, notify_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_NOTIFYICON_ORDER_HEADER " "OrderSize %d, FieldsPresentFlags 0x%8.8x, WindowId 0x%8.8x, NotifyIconId 0x%8.8x", order_size, field_present_flags, window_id, notify_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] New or Existing Notification Icons"); if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_VERSION) { /* Version (4 bytes) */ out_uint32_le(self->out_s, notify_state->version); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order optional field [MS-RDPERP] " "Version %d", notify_state->version); } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_TIP) { /* ToolTip (variable) UNICODE_STRING */ xrdp_orders_send_as_unicode(self->out_s, notify_state->tool_tip); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order optional field [MS-RDPERP] " "ToolTip %s", notify_state->tool_tip); } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) { /* InfoTip (variable) TS_NOTIFY_ICON_INFOTIP */ out_uint32_le(self->out_s, notify_state->infotip.timeout); out_uint32_le(self->out_s, notify_state->infotip.flags); xrdp_orders_send_as_unicode(self->out_s, notify_state->infotip.text); xrdp_orders_send_as_unicode(self->out_s, notify_state->infotip.title); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order optional field [MS-RDPERP] TS_NOTIFY_ICON_INFOTIP " "Timeout %d, InfoFlags 0x%8.8x, InfoTipText %s, Title %s", notify_state->infotip.timeout, notify_state->infotip.flags, notify_state->infotip.text, notify_state->infotip.title); } if (field_present_flags & WINDOW_ORDER_FIELD_NOTIFY_STATE) { /* State (4 bytes) */ out_uint32_le(self->out_s, notify_state->state); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order optional field [MS-RDPERP] " "State %d", notify_state->state); } if (field_present_flags & WINDOW_ORDER_ICON) { /* Icon (variable) */ xrdp_orders_send_ts_icon(self->out_s, notify_state->icon_cache_entry, notify_state->icon_cache_id, ¬ify_state->icon_info); } if (field_present_flags & WINDOW_ORDER_CACHED_ICON) { /* CacheEntry (2 bytes) */ out_uint16_le(self->out_s, notify_state->icon_cache_entry); /* CacheId (1 byte) */ out_uint8(self->out_s, notify_state->icon_cache_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order field [MS-RDPERP] TS_CACHED_ICON_INFO " "CacheEntry %d, CacheId %d", notify_state->icon_cache_entry, notify_state->icon_cache_id); } return 0; } /*****************************************************************************/ /* RAIL */ /* returns error */ /* used for both Non-Monitored Desktop and Actively Monitored Desktop */ int xrdp_orders_send_monitored_desktop(struct xrdp_orders *self, struct rail_monitored_desktop_order *mdo, int flags) { int order_size; int order_flags; int field_present_flags; int index; order_size = 7; field_present_flags = flags | WINDOW_ORDER_TYPE_DESKTOP; if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND) { /* ActiveWindowId (4 bytes) */ order_size += 4; } if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER) { /* NumWindowIds (1 byte) */ order_size += 1; /* WindowIds (variable) */ order_size += mdo->num_window_ids * 4; } if (xrdp_orders_check(self, order_size) != 0) { LOG(LOG_LEVEL_ERROR, "xrdp_orders_send_monitored_desktop: xrdp_orders_check failed"); return 1; } self->order_count++; order_flags = TS_SECONDARY; order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */ LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPEGDI] ALTSEC_DRAWING_ORDER_HEADER " "controlFlags.class 0x%1.1x (TS_SECONDARY), " "controlFlags.orderType 0x%2.2x (TS_ALTSEC_WINDOW)", (order_flags & 0x3), (order_flags >> 2)); out_uint8(self->out_s, order_flags); /* orderSize (2 bytes) */ out_uint16_le(self->out_s, order_size); /* FieldsPresentFlags (4 bytes) */ out_uint32_le(self->out_s, field_present_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding header [MS-RDPERP] TS_DESKTOP_ORDER_HEADER " "OrderSize %d, FieldsPresentFlags 0x%8.8x", order_size, field_present_flags); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order [MS-RDPERP] %s", ((field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_NONE) ? "Non-Monitored Desktop" : "Actively Monitored Desktop")); if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND) { /* ActiveWindowId (4 bytes) */ out_uint32_le(self->out_s, mdo->active_window_id); LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order optional field [MS-RDPERP] " "ActiveWindowId 0x%8.8x", mdo->active_window_id); } if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER) { /* NumWindowIds (1 byte) */ out_uint8(self->out_s, mdo->num_window_ids); /* WindowIds (variable) */ for (index = 0; index < mdo->num_window_ids; index++) { out_uint32_le(self->out_s, mdo->window_ids[index]); } LOG_DEVEL(LOG_LEVEL_TRACE, "Adding order optional field [MS-RDPERP] " "NumWindowIds %d, WindowIds ", mdo->num_window_ids); } return 0; } xrdp-0.10.1/mc/Makefile.am000644 001751 000000 00000000616 14652432047 015273 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libmc.la libmc_la_SOURCES = \ mc.c \ mc.h libmc_la_LIBADD = \ $(top_builddir)/common/libcommon.la if !MACOS libmc_la_LDFLAGS = -avoid-version -module endif xrdp-0.10.1/mc/Makefile.in000644 001751 000000 00000053574 14652432075 015320 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = mc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libmc_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libmc_la_OBJECTS = mc.lo libmc_la_OBJECTS = $(am_libmc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libmc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmc_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/mc.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libmc_la_SOURCES) DIST_SOURCES = $(libmc_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libmc.la libmc_la_SOURCES = \ mc.c \ mc.h libmc_la_LIBADD = \ $(top_builddir)/common/libcommon.la @MACOS_FALSE@libmc_la_LDFLAGS = -avoid-version -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libmc.la: $(libmc_la_OBJECTS) $(libmc_la_DEPENDENCIES) $(EXTRA_libmc_la_DEPENDENCIES) $(AM_V_CCLD)$(libmc_la_LINK) -rpath $(moduledir) $(libmc_la_OBJECTS) $(libmc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mc.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/mc.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/mc.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/mc/mc.h000644 001751 000000 00000011403 14652432047 014003 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * media center */ #ifndef MC_H #define MC_H /* include other h files */ #include "arch.h" #include "parse.h" #include "os_calls.h" #include "defines.h" #define CURRENT_MOD_VER 3 struct source_info; /* Defined in xrdp_client_info.h */ struct monitor_info; struct mod { int size; /* size of this struct */ int version; /* internal version */ /* client functions */ int (*mod_start)(struct mod *v, int w, int h, int bpp); int (*mod_connect)(struct mod *v); int (*mod_event)(struct mod *v, int msg, long param1, long param2, long param3, long param4); int (*mod_signal)(struct mod *v); int (*mod_end)(struct mod *v); int (*mod_set_param)(struct mod *v, const char *name, const char *value); int (*mod_session_change)(struct mod *v, int, int); int (*mod_get_wait_objs)(struct mod *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int (*mod_check_wait_objs)(struct mod *v); tintptr mod_dumby[100 - 9]; /* align, 100 minus the number of mod functions above */ /* server functions */ int (*server_begin_update)(struct mod *v); int (*server_end_update)(struct mod *v); int (*server_fill_rect)(struct mod *v, int x, int y, int cx, int cy); int (*server_screen_blt)(struct mod *v, int x, int y, int cx, int cy, int srcx, int srcy); int (*server_paint_rect)(struct mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy); int (*server_set_cursor)(struct mod *v, int x, int y, char *data, char *mask); int (*server_palette)(struct mod *v, int *palette); int (*server_msg)(struct mod *v, const char *msg, int code); int (*server_is_term)(void); int (*server_set_clip)(struct mod *v, int x, int y, int cx, int cy); int (*server_reset_clip)(struct mod *v); int (*server_set_fgcolor)(struct mod *v, int fgcolor); int (*server_set_bgcolor)(struct mod *v, int bgcolor); int (*server_set_opcode)(struct mod *v, int opcode); int (*server_set_mixmode)(struct mod *v, int mixmode); int (*server_set_brush)(struct mod *v, int x_origin, int y_origin, int style, char *pattern); int (*server_set_pen)(struct mod *v, int style, int width); int (*server_draw_line)(struct mod *v, int x1, int y1, int x2, int y2); int (*server_add_char)(struct mod *v, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_draw_text)(struct mod *v, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int (*client_monitor_resize)(struct mod *v, int width, int height, int num_monitors, const struct monitor_info *monitors); int (*server_monitor_resize_done)(struct mod *v); int (*server_get_channel_count)(struct mod *v); int (*server_query_channel)(struct mod *v, int index, char *channel_name, int *channel_flags); int (*server_get_channel_id)(struct mod *v, const char *name); int (*server_send_to_channel)(struct mod *v, int channel_id, char *data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct mod *v); int (*server_chansrv_in_use)(struct mod *v); tintptr server_dumby[100 - 28]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; struct source_info *si; /* mod data */ int sck; int width; int height; int bpp; }; #endif // MC_H xrdp-0.10.1/mc/mc.c000644 001751 000000 00000006053 14652432047 014003 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * media center */ #if defined(HAVE_CONFIG_H) #include #endif #include "mc.h" #include "log.h" /*****************************************************************************/ /* return error */ int lib_mod_start(struct mod *mod, int w, int h, int bpp) { LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_start"); mod->width = w; mod->height = h; mod->bpp = bpp; LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_start"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_connect(struct mod *mod) { LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_connect"); LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_connect"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_event(struct mod *mod, int msg, long param1, long param2, long param3, long param4) { LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_event"); LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_event"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_signal(struct mod *mod) { LOG_DEVEL(LOG_LEVEL_TRACE, "in lib_mod_signal"); LOG_DEVEL(LOG_LEVEL_TRACE, "out lib_mod_signal"); return 0; } /******************************************************************************/ /* return error */ int lib_mod_end(struct mod *mod) { return 0; } /******************************************************************************/ /* return error */ int lib_mod_set_param(struct mod *mod, const char *name, const char *value) { return 0; } /******************************************************************************/ tintptr EXPORT_CC mod_init(void) { struct mod *mod; mod = (struct mod *)g_malloc(sizeof(struct mod), 1); mod->size = sizeof(struct mod); mod->version = CURRENT_MOD_VER; mod->handle = (tintptr) mod; mod->mod_connect = lib_mod_connect; mod->mod_start = lib_mod_start; mod->mod_event = lib_mod_event; mod->mod_signal = lib_mod_signal; mod->mod_end = lib_mod_end; mod->mod_set_param = lib_mod_set_param; return (tintptr) mod; } /******************************************************************************/ int EXPORT_CC mod_exit(tintptr handle) { struct mod *mod = (struct mod *) handle; if (mod == 0) { return 0; } g_free(mod); return 0; } xrdp-0.10.1/waitforx/Makefile.in000644 001751 000000 00000052071 14652432075 016553 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ pkglibexec_PROGRAMS = waitforx$(EXEEXT) subdir = waitforx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(pkglibexecdir)" PROGRAMS = $(pkglibexec_PROGRAMS) am_waitforx_OBJECTS = waitforx.$(OBJEXT) waitforx_OBJECTS = $(am_waitforx_OBJECTS) waitforx_DEPENDENCIES = $(top_builddir)/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/waitforx.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(waitforx_SOURCES) DIST_SOURCES = $(waitforx_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_LDFLAGS = $(X_LIBS) -lX11 -lXrandr AM_CPPFLAGS = \ -I$(top_srcdir)/sesman/sesexec \ -I$(top_srcdir)/common AM_CFLAGS = $(X_CFLAGS) waitforx_SOURCES = waitforx.c waitforx_LDADD = \ $(top_builddir)/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign waitforx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign waitforx/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || 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)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && $(am__rm_f) $$files clean-pkglibexecPROGRAMS: $(am__rm_f) $(pkglibexec_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(pkglibexec_PROGRAMS:$(EXEEXT)=) waitforx$(EXEEXT): $(waitforx_OBJECTS) $(waitforx_DEPENDENCIES) $(EXTRA_waitforx_DEPENDENCIES) @rm -f waitforx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(waitforx_OBJECTS) $(waitforx_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitforx.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(pkglibexecdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibexecPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/waitforx.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-pkglibexecPROGRAMS 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 ./$(DEPDIR)/waitforx.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkglibexecPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-pkglibexecPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibexecPROGRAMS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkglibexecPROGRAMS .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/waitforx/waitforx.c000644 001751 000000 00000007346 14652432047 016521 0ustar00metawheel000000 000000 #include #include #include #include #include #include #include "config_ac.h" #include "os_calls.h" #include "string_calls.h" #include "xwait.h" // For return status codes #define ATTEMPTS 10 #define ALARM_WAIT 30 /*****************************************************************************/ static void alarm_handler(int signal_num) { /* Avoid printf() in signal handler (see signal-safety(7)) * * Prefix the message with a newline in case another message * has been partly output */ const char msg[] = "\nTimed out waiting for RandR outputs\n"; g_file_write(1, msg, g_strlen(msg)); exit(XW_STATUS_TIMED_OUT); } /*****************************************************************************/ static Display * open_display(const char *display) { Display *dpy = NULL; unsigned int wait = ATTEMPTS; unsigned int n; for (n = 1; n <= ATTEMPTS; ++n) { printf("Opening display %s. Attempt %u of %u\n", display, n, wait); dpy = XOpenDisplay(display); if (dpy != NULL) { printf("Opened display %s\n", display); break; } g_sleep(1000); } return dpy; } /*****************************************************************************/ /** * Wait for the RandR extension (if in use) to be available * * @param dpy Display * @return 0 if/when outputs are available, 1 otherwise */ static int wait_for_r_and_r(Display *dpy) { int error_base = 0; int event_base = 0; unsigned int outputs = 0; unsigned int wait = ATTEMPTS; unsigned int n; XRRScreenResources *res = NULL; if (!XRRQueryExtension(dpy, &event_base, &error_base)) { printf("RandR not supported on display %s\n", DisplayString(dpy)); return 0; } for (n = 1; n <= wait; ++n) { printf("Waiting for outputs. Attempt %u of %u\n", n, wait); res = XRRGetScreenResources(dpy, DefaultRootWindow(dpy)); if (res != NULL) { if (res->noutput > 0) { outputs = res->noutput; } XRRFreeScreenResources(res); } if (outputs > 0) { printf("Display %s ready with %u RandR outputs\n", DisplayString(dpy), outputs); return 0; } g_sleep(1000); } printf("Unable to find any RandR outputs\n"); return 1; } /*****************************************************************************/ static void usage(const char *argv0, int status) { printf("Usage: %s -d display\n", argv0); exit(status); } /*****************************************************************************/ int main(int argc, char **argv) { const char *display_name = NULL; int opt; int status = XW_STATUS_MISC_ERROR; Display *dpy = NULL; /* Disable stdout buffering so any messages are passed immediately * to sesman */ setvbuf(stdout, NULL, _IONBF, 0); while ((opt = getopt(argc, argv, "d:")) != -1) { switch (opt) { case 'd': display_name = optarg; break; default: /* '?' */ usage(argv[0], status); } } if (!display_name) { usage(argv[0], status); } g_set_alarm(alarm_handler, ALARM_WAIT); dpy = open_display(display_name); if (!dpy) { printf("Unable to open display %s\n", display_name); status = XW_STATUS_FAILED_TO_START; } else { if (wait_for_r_and_r(dpy) == 0) { status = XW_STATUS_OK; } XCloseDisplay(dpy); } return status; } xrdp-0.10.1/waitforx/Makefile.am000644 001751 000000 00000000411 14652432047 016530 0ustar00metawheel000000 000000 pkglibexec_PROGRAMS = \ waitforx AM_LDFLAGS = $(X_LIBS) -lX11 -lXrandr AM_CPPFLAGS = \ -I$(top_srcdir)/sesman/sesexec \ -I$(top_srcdir)/common AM_CFLAGS = $(X_CFLAGS) waitforx_SOURCES = waitforx.c waitforx_LDADD = \ $(top_builddir)/common/libcommon.la xrdp-0.10.1/xrdpapi/vrplayer.c000644 001751 000000 00000005047 14652432047 016322 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2012-2013 LK.Rashinkar@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * a program that uses xrdpapi and ffmpeg to redirect media streams * to a FreeRDP client where it is decompressed and played locally * */ /****************************************************************************** * build instructions: make -f vrplayer.mk * setup environment: export LD_LIBRARY_PATH=".libs:../xrdpvr/.libs" * run vrplayer: vrplayer *****************************************************************************/ #if defined(HAVE_CONFIG_H) #include #endif #ifdef __WIN32__ #include #endif #include #include #include #include #include #include #include "xrdpapi.h" #include "xrdpvr.h" void extract_32(uint32_t *value, char *buf) { *value = ((buf[3] << 24) & 0xff000000) | ((buf[2] << 16) & 0x00ff0000) | ((buf[1] << 8) & 0x0000ff00) | (buf[0] & 0x000000ff); } int main(int argc, char **argv) { void *channel; int written = 0; int first_time = 1; if (argc < 2) { printf("usage: vrplayer >\n"); return 1; } /* open a virtual channel and connect to remote client */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "xrdpvr", 0); if (channel == NULL) { fprintf(stderr, "WTSVirtualChannelOpenEx() failed\n"); return 1; } /* initialize the player */ if (xrdpvr_init_player(channel, 101, argv[1])) { fprintf(stderr, "failed to initialize the player\n"); return 1; } /* send compressed media data to client; client will decompress */ /* the media and play it locally */ xrdpvr_play_media(channel, 101, argv[1]); /* perform clean up */ xrdpvr_deinit_player(channel, 101); WTSVirtualChannelClose(channel); return 0; } xrdp-0.10.1/xrdpapi/simple.c000644 001751 000000 00000011146 14652432047 015744 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2013 * Copyright (C) Laxmikant Rashinkar 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * sample program to demonstrate use of xrdpapi * */ /* * build instructions: * gcc simple.c -o simple -I.. -I../common -L./.libs -L../common/.libs \ * -DHAVE_CONFIG_H -lxrdpapi -lcommon */ #if defined(HAVE_CONFIG_H) #include #endif #ifdef __WIN32__ #include #endif #include "xrdpapi.h" #include "log.h" #include #include #include #include #include /* forward declarations */ int run_echo_test(void); int run_tsmf_test(void); int main(int argc, char **argv) { int result; struct log_config *lc; if ((lc = log_config_init_for_console(LOG_LEVEL_DEBUG, NULL)) != NULL) { log_start_from_param(lc); } if (argc > 1 && strcasecmp(argv[1], "echo") == 0) { result = run_echo_test(); } else if (argc > 1 && strcasecmp(argv[1], "tsmf") == 0) { result = run_tsmf_test(); } else { printf("usage: simple \n"); result = 1; } if (lc != NULL) { log_config_free(lc); log_end(); } return result; } /** * perform an ECHO test with a Microsoft Windows RDP client * * A Microsoft Windows RDP client echos data written * to a dynamic virtual channel named ECHO * * NOTE: THIS TEST WILL FAIL IF CONNECTED FROM A NON * WINDOWS RDP CLIENT * * @return 0 on success, -1 on failure */ int run_echo_test(void) { char out_buf[8192]; char in_buf[1700]; void *channel; int bytes_left; int rv; int count; int pkt_count; unsigned int i; unsigned int bytes_written; unsigned int bytes_read; unsigned char c; char *rd_ptr; char *wr_ptr; /* fill out_buf[] with incremental values */ for (i = 0, c = 0; i < 8192; i++, c++) { out_buf[i] = (char)c; } /* open a virtual channel named ECHO */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "ECHO", WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW); if (channel == NULL) { printf("### WTSVirtualChannelOpenEx() failed!\n"); return -1; } bytes_left = 8192; wr_ptr = out_buf; rd_ptr = out_buf; pkt_count = 1; while (bytes_left > 0) { /* write data to virtual channel */ count = (bytes_left > 1700) ? 1700 : bytes_left; rv = WTSVirtualChannelWrite(channel, wr_ptr, count, &bytes_written); if ((rv == 0) || (bytes_written == 0)) { printf("### WTSVirtualChannelWrite() failed\n"); return -1; } count = bytes_written; while (count) { /* read back the echo */ rv = WTSVirtualChannelRead(channel, 5000, in_buf, count, &bytes_read); if ((rv == 0) || (bytes_read == 0)) { printf("### WTSVirtualChannelRead() failed\n"); return -1; } /* validate the echo */ for (i = 0; i < bytes_read; i++, rd_ptr++) { if (*rd_ptr != (unsigned char) in_buf[i]) { printf("### data mismatch: expected 0x%x got 0x%x\n", (unsigned char) *rd_ptr, (unsigned char) in_buf[i]); return -1; } } count -= bytes_read; } bytes_left -= bytes_written; wr_ptr += bytes_written; printf("### pkt %d passed echo test\n", pkt_count++); } WTSVirtualChannelClose(channel); return 0; } int run_tsmf_test(void) { void *channel; printf("this test not yet implemented!\n"); return 1; /* open virtual channel */ channel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "TSMF", WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW); if (channel == NULL) { printf("### WTSVirtualChannelOpenEx() failed!\n"); return 1; } WTSVirtualChannelClose(channel); return 0; } xrdp-0.10.1/xrdpapi/xrdpapi.c000644 001751 000000 00000032663 14652432047 016131 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2013 * Copyright (C) Laxmikant Rashinkar 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "log.h" #include "xrdp_sockets.h" #include "string_calls.h" #include "xrdpapi.h" struct wts_obj { int fd; int display_num; }; /* helper functions used by WTSxxx API - do not invoke directly */ static int can_send(int sck, int millis, int restart); static int can_recv(int sck, int millis, int restart); static int mysend(int sck, const void *adata, int bytes); static int myrecv(int sck, void *adata, int bytes); /* * Opens a handle to the server end of a specified virtual channel - this * call is deprecated - use WTSVirtualChannelOpenEx() instead * * @param hServer * @param SessionId - current session ID; *must* be WTS_CURRENT_SERVER_HANDLE * @param pVirtualName - virtual channel name when using SVC * - name of endpoint listener when using DVC * * @return a valid pointer on success, NULL on error ******************************************************************************/ void * WTSVirtualChannelOpen(void *hServer, unsigned int SessionId, const char *pVirtualName) { if (hServer != WTS_CURRENT_SERVER_HANDLE) { return 0; } return WTSVirtualChannelOpenEx(SessionId, pVirtualName, 0); } /* * Opens a handle to the server end of a specified virtual channel * * @param SessionId - current session ID; *must* be WTS_CURRENT_SERVER_HANDLE * @param pVirtualName - virtual channel name when using SVC * - name of endpoint listener when using DVC * @param flags - type of channel and channel priority if DVC * * @return a valid pointer on success, NULL on error ******************************************************************************/ void * WTSVirtualChannelOpenEx(unsigned int SessionId, const char *pVirtualName, unsigned int flags) { struct wts_obj *wts; int bytes; unsigned long long1; struct sockaddr_un s; char *connect_data; int chan_name_bytes; int lerrno; if (SessionId != WTS_CURRENT_SESSION) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: bad SessionId"); return 0; } wts = (struct wts_obj *) calloc(1, sizeof(struct wts_obj)); if (wts == NULL) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: calloc failed"); return 0; } wts->fd = -1; wts->display_num = g_get_display_num_from_display(getenv("DISPLAY")); if (wts->display_num < 0) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: fatal error; invalid DISPLAY"); free(wts); return NULL; } /* we use unix domain socket to communicate with chansrv */ if ((wts->fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: socket failed"); free(wts); return NULL; } /* set non blocking */ long1 = fcntl(wts->fd, F_GETFL); long1 = long1 | O_NONBLOCK; if (fcntl(wts->fd, F_SETFL, long1) < 0) { LOG(LOG_LEVEL_WARNING, "WTSVirtualChannelOpenEx: set non-block mode failed"); } /* connect to chansrv session */ memset(&s, 0, sizeof(struct sockaddr_un)); s.sun_family = AF_UNIX; bytes = sizeof(s.sun_path); snprintf(s.sun_path, bytes - 1, CHANSRV_API_STR, getuid(), wts->display_num); s.sun_path[bytes - 1] = 0; bytes = sizeof(struct sockaddr_un); if (connect(wts->fd, (struct sockaddr *) &s, bytes) < 0) { lerrno = errno; if ((lerrno == EWOULDBLOCK) || (lerrno == EAGAIN) || (lerrno == EINPROGRESS)) { /* ok */ } else { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: connect failed"); free(wts); return NULL; } } /* wait for connection to complete */ if (!can_send(wts->fd, 500, 1)) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: can_send failed"); free(wts); return NULL; } chan_name_bytes = strlen(pVirtualName); bytes = 4 + 4 + 4 + chan_name_bytes + 4; LOG_DEVEL(LOG_LEVEL_DEBUG, "WTSVirtualChannelOpenEx: chan_name_bytes %d bytes %d pVirtualName %s", chan_name_bytes, bytes, pVirtualName); connect_data = (char *) calloc(bytes, 1); if (connect_data == NULL) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: calloc failed"); free(wts); return NULL; } connect_data[0] = (bytes >> 0) & 0xFF; connect_data[1] = (bytes >> 8) & 0xFF; connect_data[2] = (bytes >> 16) & 0xFF; connect_data[3] = (bytes >> 24) & 0xFF; /* version here(4-7), just leave 0 */ connect_data[8] = (chan_name_bytes >> 0) & 0xFF; connect_data[9] = (chan_name_bytes >> 8) & 0xFF; connect_data[10] = (chan_name_bytes >> 16) & 0xFF; connect_data[11] = (chan_name_bytes >> 24) & 0xFF; memcpy(connect_data + 12, pVirtualName, chan_name_bytes); connect_data[4 + 4 + 4 + chan_name_bytes + 0] = (flags >> 0) & 0xFF; connect_data[4 + 4 + 4 + chan_name_bytes + 1] = (flags >> 8) & 0xFF; connect_data[4 + 4 + 4 + chan_name_bytes + 2] = (flags >> 16) & 0xFF; connect_data[4 + 4 + 4 + chan_name_bytes + 3] = (flags >> 24) & 0xFF; LOG_DEVEL(LOG_LEVEL_DEBUG, "WTSVirtualChannelOpenEx: calling mysend with %d bytes", bytes); if (mysend(wts->fd, connect_data, bytes) != bytes) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: mysend failed"); free(wts); return NULL; } LOG_DEVEL(LOG_LEVEL_DEBUG, "WTSVirtualChannelOpenEx: sent ok"); if (!can_recv(wts->fd, 500, 1)) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: can_recv failed"); free(wts); return NULL; } /* get response */ if (myrecv(wts->fd, connect_data, 4) != 4) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: myrecv failed"); free(wts); return NULL; } if ((connect_data[0] != 0) || (connect_data[1] != 0) || (connect_data[2] != 0) || (connect_data[3] != 0)) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelOpenEx: connect_data not ok"); free(wts); return NULL; } return wts; } /* * Prevent receiving SIGPIPE on disconnect using either MSG_NOSIGNAL (Linux) * or SO_NOSIGPIPE (Mac OS X) */ #if !defined(MSG_NOSIGNAL) #define MSG_NOSIGNAL 0 #endif /*****************************************************************************/ static int mysend(int sck, const void *adata, int bytes) { int sent; int error; const char *data; #if defined(SO_NOSIGPIPE) const int on = 1; setsockopt(sck, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)); #endif data = (const char *) adata; sent = 0; while (sent < bytes) { if (can_send(sck, 100, 0)) { error = send(sck, data + sent, bytes - sent, MSG_NOSIGNAL); if (error < 1) { return -1; } sent += error; } } return sent; } /*****************************************************************************/ static int myrecv(int sck, void *adata, int bytes) { int recd; int error; char *data; #if defined(SO_NOSIGPIPE) const int on = 1; setsockopt(sck, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on)); #endif data = (char *) adata; recd = 0; while (recd < bytes) { if (can_recv(sck, 100, 0)) { error = recv(sck, data + recd, bytes - recd, MSG_NOSIGNAL); if (error < 1) { return -1; } recd += error; } } return recd; } /* * write data to client connection * * @return 1 on success, 0 on error *****************************************************************************/ int WTSVirtualChannelWrite(void *hChannelHandle, const char *Buffer, unsigned int Length, unsigned int *pBytesWritten) { struct wts_obj *wts; int rv; wts = (struct wts_obj *) hChannelHandle; *pBytesWritten = 0; if (wts == 0) { LOG(LOG_LEVEL_ERROR, "WTSVirtualChannelWrite: wts is NULL"); return 0; } if (!can_send(wts->fd, 0, 0)) { return 1; /* can't write now, ok to try again */ } rv = mysend(wts->fd, Buffer, Length); LOG_DEVEL(LOG_LEVEL_DEBUG, "WTSVirtualChannelWrite: mysend() returned %d", rv); if (rv >= 0) { /* success, but zero bytes may have been written */ *pBytesWritten = rv; return 1; } /* fatal error */ return 0; } /* * read data from a client connection * * @return 1 on success, 0 on error *****************************************************************************/ int WTSVirtualChannelRead(void *hChannelHandle, unsigned int TimeOut, char *Buffer, unsigned int BufferSize, unsigned int *pBytesRead) { struct wts_obj *wts; int rv; int lerrno; wts = (struct wts_obj *)hChannelHandle; if (wts == 0) { return 0; } if (can_recv(wts->fd, TimeOut, 0)) { rv = recv(wts->fd, Buffer, BufferSize, 0); if (rv == -1) { lerrno = errno; if ((lerrno == EWOULDBLOCK) || (lerrno == EAGAIN) || (lerrno == EINPROGRESS)) { *pBytesRead = 0; return 1; } return 0; } else if (rv == 0) { return 0; } else if (rv > 0) { *pBytesRead = rv; return 1; } } *pBytesRead = 0; return 1; } /*****************************************************************************/ int WTSVirtualChannelClose(void *hChannelHandle) { struct wts_obj *wts; wts = (struct wts_obj *)hChannelHandle; if (wts == NULL) { return 0; } if (wts->fd != -1) { close(wts->fd); } free(wts); return 1; } /*****************************************************************************/ int WTSVirtualChannelQuery(void *hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, void **ppBuffer, unsigned int *pBytesReturned) { struct wts_obj *wts; wts = (struct wts_obj *)hChannelHandle; if (wts == NULL) { return 0; } if (WtsVirtualClass == WTSVirtualFileHandle) { *pBytesReturned = 4; *ppBuffer = malloc(4); if (*ppBuffer == NULL) { return 0; } memcpy(*ppBuffer, &(wts->fd), 4); } return 1; } /*****************************************************************************/ void WTSFreeMemory(void *pMemory) { if (pMemory != NULL) { free(pMemory); } } /***************************************************************************** ** ** ** ** ** Helper functions used by WTSxxx API - do not invoke directly ** ** ** ** ** *****************************************************************************/ /* * check if socket is in a writable state - i.e will not block on write * * @param sck socket to check * @param millis timeout value in milliseconds * @param restart Try again if interrupted, even if this exceeds the timeout * * @return 0 if write will block * @return 1 if write will not block ******************************************************************************/ static int can_send(int sck, int millis, int restart) { int rv = 0; struct pollfd pollfd; int status; pollfd.fd = sck; pollfd.events = POLLOUT; pollfd.revents = 0; do { status = poll(&pollfd, 1, millis); } while (status < 0 && errno == EINTR && restart); if (status > 0) { if ((pollfd.revents & POLLOUT) != 0) { rv = 1; } } return rv; } /*****************************************************************************/ static int can_recv(int sck, int millis, int restart) { int rv = 0; struct pollfd pollfd; int status; pollfd.fd = sck; pollfd.events = POLLIN; pollfd.revents = 0; do { status = poll(&pollfd, 1, millis); } while (status < 0 && errno == EINTR && restart); if (status > 0) { if ((pollfd.revents & (POLLIN | POLLHUP)) != 0) { rv = 1; } } return rv; } xrdp-0.10.1/xrdpapi/vrplayer.mk000644 001751 000000 00000000232 14652432047 016476 0ustar00metawheel000000 000000 CFLAGS = -I../xrdpvr LIBS = -L./.libs -L../xrdpvr/.libs -lxrdpapi -lxrdpvr -lavformat vrplayer: vrplayer.o gcc $(CFLAGS) vrplayer.c -o vrplayer $(LIBS) xrdp-0.10.1/xrdpapi/Makefile.am000644 001751 000000 00000001140 14652432047 016334 0ustar00metawheel000000 000000 EXTRA_DIST = \ simple.c \ vrplayer.c \ vrplayer.mk AM_CPPFLAGS = \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libxrdpapi.la libxrdpapi_la_SOURCES = \ xrdpapi.c \ xrdpapi.h libxrdpapi_la_LIBADD = \ $(top_builddir)/common/libcommon.la # Build the 'simple' example program, so it's added to the CI noinst_PROGRAMS = xrdp-xrdpapi-simple xrdp_xrdpapi_simple_SOURCES = \ simple.c # If you change this, update the standalone build instructions in simple.c xrdp_xrdpapi_simple_LDADD = \ libxrdpapi.la \ $(top_builddir)/common/libcommon.la xrdp-0.10.1/xrdpapi/xrdpapi.h000644 001751 000000 00000005100 14652432047 016120 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2013 * Copyright (C) Thomas Goddard 2012-2013 * Copyright (C) Laxmikant Rashinkar 2012-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * xrdpapi header, do not use os_calls.h, arch.h or any xrdp internal headers * this file is included in 3rd party apps */ #if !defined(XRDPAPI_H_) #define XRDPAPI_H_ #ifdef __cplusplus extern "C" { #endif #define WTS_CURRENT_SERVER_HANDLE 0x00000000 #define WTS_CURRENT_SESSION 0xffffffff #define WTS_CHANNEL_OPTION_STATIC 0x00000000 #define WTS_CHANNEL_OPTION_DYNAMIC 0x00000001 #define WTS_CHANNEL_OPTION_DYNAMIC_NO_COMPRESS 0x00000001 #define WTS_CHANNEL_OPTION_DYNAMIC_PRI_LOW 0x00000001 #define WTS_CHANNEL_OPTION_DYNAMIC_PRI_MED 0x00000002 #define WTS_CHANNEL_OPTION_DYNAMIC_PRI_HIGH 0x00000003 #define WTS_CHANNEL_OPTION_DYNAMIC_PRI_REAL 0x00000004 typedef enum _WTS_VIRTUAL_CLASS { WTSVirtualClientData, WTSVirtualFileHandle } WTS_VIRTUAL_CLASS; /* * Reference: * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383464(v=vs.85).aspx */ void *WTSVirtualChannelOpen(void *hServer, unsigned int SessionId, const char *pVirtualName); void *WTSVirtualChannelOpenEx(unsigned int SessionId, const char *pVirtualName, unsigned int flags); int WTSVirtualChannelWrite(void *hChannelHandle, const char *Buffer, unsigned int Length, unsigned int *pBytesWritten); int WTSVirtualChannelRead(void *hChannelHandle, unsigned int TimeOut, char *Buffer, unsigned int BufferSize, unsigned int *pBytesRead); int WTSVirtualChannelClose(void *hChannelHandle); int WTSVirtualChannelQuery(void *hChannelHandle, WTS_VIRTUAL_CLASS WtsVirtualClass, void **ppBuffer, unsigned int *pBytesReturned); void WTSFreeMemory(void *pMemory); #ifdef __cplusplus } #endif #endif /* XRDPAPI_H_ */ xrdp-0.10.1/xrdpapi/Makefile.in000644 001751 000000 00000055536 14652432075 016370 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = xrdp-xrdpapi-simple$(EXEEXT) subdir = xrdpapi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libxrdpapi_la_DEPENDENCIES = $(top_builddir)/common/libcommon.la am_libxrdpapi_la_OBJECTS = xrdpapi.lo libxrdpapi_la_OBJECTS = $(am_libxrdpapi_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_xrdp_xrdpapi_simple_OBJECTS = simple.$(OBJEXT) xrdp_xrdpapi_simple_OBJECTS = $(am_xrdp_xrdpapi_simple_OBJECTS) xrdp_xrdpapi_simple_DEPENDENCIES = libxrdpapi.la \ $(top_builddir)/common/libcommon.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/simple.Po ./$(DEPDIR)/xrdpapi.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libxrdpapi_la_SOURCES) $(xrdp_xrdpapi_simple_SOURCES) DIST_SOURCES = $(libxrdpapi_la_SOURCES) $(xrdp_xrdpapi_simple_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ simple.c \ vrplayer.c \ vrplayer.mk AM_CPPFLAGS = \ -DXRDP_SOCKET_ROOT_PATH=\"${socketdir}\" \ -I$(top_srcdir)/common module_LTLIBRARIES = \ libxrdpapi.la libxrdpapi_la_SOURCES = \ xrdpapi.c \ xrdpapi.h libxrdpapi_la_LIBADD = \ $(top_builddir)/common/libcommon.la xrdp_xrdpapi_simple_SOURCES = \ simple.c # If you change this, update the standalone build instructions in simple.c xrdp_xrdpapi_simple_LDADD = \ libxrdpapi.la \ $(top_builddir)/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign xrdpapi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign xrdpapi/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libxrdpapi.la: $(libxrdpapi_la_OBJECTS) $(libxrdpapi_la_DEPENDENCIES) $(EXTRA_libxrdpapi_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libxrdpapi_la_OBJECTS) $(libxrdpapi_la_LIBADD) $(LIBS) xrdp-xrdpapi-simple$(EXEEXT): $(xrdp_xrdpapi_simple_OBJECTS) $(xrdp_xrdpapi_simple_DEPENDENCIES) $(EXTRA_xrdp_xrdpapi_simple_DEPENDENCIES) @rm -f xrdp-xrdpapi-simple$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xrdp_xrdpapi_simple_OBJECTS) $(xrdp_xrdpapi_simple_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdpapi.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/simple.Po -rm -f ./$(DEPDIR)/xrdpapi.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/simple.Po -rm -f ./$(DEPDIR)/xrdpapi.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/neutrinordp/xrdp-color.h000644 001751 000000 00000001614 14652432047 017452 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol Server * freerdp wrapper * * Copyright 2011-2012 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __XRDP_COLOR_H #define __XRDP_COLOR_H char * convert_bitmap(int in_bpp, int out_bpp, char *bmpdata, int width, int height, int *palette); int convert_color(int in_bpp, int out_bpp, int in_color, int *palette); #endif xrdp-0.10.1/neutrinordp/xrdp-neutrinordp.h000644 001751 000000 00000024154 14652432047 020711 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol Server * freerdp wrapper * * Copyright 2011-2013 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef XRDP_NEUTRINORDP_H #define XRDP_NEUTRINORDP_H #include "arch.h" #include "xrdp_constants.h" #include "xrdp_client_info.h" /* Incomplete type definitions, referenced below */ struct rail_window_state_order; struct rail_notify_state_order; struct rail_monitored_desktop_order; struct rail_icon_info; struct bitmap_item { int width; int height; char *data; }; struct brush_item { int bpp; int width; int height; char *data; char b8x8[8]; }; struct pointer_item { int hotx; int hoty; char data[32 * 32 * 4]; char mask[32 * 32 / 8]; int bpp; }; #define CURRENT_MOD_VER 4 struct source_info; struct kbd_overrides { int type; int subtype; int fn_keys; int layout; int layout_mask; }; struct mod { int size; /* size of this struct */ int version; /* internal version */ /* client functions */ int (*mod_start)(struct mod *v, int w, int h, int bpp); int (*mod_connect)(struct mod *v); int (*mod_event)(struct mod *v, int msg, long param1, long param2, long param3, long param4); int (*mod_signal)(struct mod *v); int (*mod_end)(struct mod *v); int (*mod_set_param)(struct mod *v, const char *name, const char *value); int (*mod_session_change)(struct mod *v, int, int); int (*mod_get_wait_objs)(struct mod *v, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout); int (*mod_check_wait_objs)(struct mod *v); int (*mod_frame_ack)(struct mod *mod, int flags, int frame_id); int (*mod_suppress_output)(struct mod *mod, int suppress, int left, int top, int right, int bottom); int (*mod_server_monitor_resize)(struct mod *mod, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress); int (*mod_server_monitor_full_invalidate)(struct mod *mod, int width, int height); int (*mod_server_version_message)(struct mod *mod); tintptr mod_dumby[100 - 14]; /* align, 100 minus the number of mod functions above */ /* server functions */ int (*server_begin_update)(struct mod *v); int (*server_end_update)(struct mod *v); int (*server_fill_rect)(struct mod *v, int x, int y, int cx, int cy); int (*server_screen_blt)(struct mod *v, int x, int y, int cx, int cy, int srcx, int srcy); int (*server_paint_rect)(struct mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy); int (*server_set_pointer)(struct mod *v, int x, int y, char *data, char *mask); int (*server_palette)(struct mod *v, int *palette); int (*server_msg)(struct mod *v, const char *msg, int code); int (*server_is_term)(void); int (*server_set_clip)(struct mod *v, int x, int y, int cx, int cy); int (*server_reset_clip)(struct mod *v); int (*server_set_fgcolor)(struct mod *v, int fgcolor); int (*server_set_bgcolor)(struct mod *v, int bgcolor); int (*server_set_opcode)(struct mod *v, int opcode); int (*server_set_mixmode)(struct mod *v, int mixmode); int (*server_set_brush)(struct mod *v, int x_origin, int y_origin, int style, char *pattern); int (*server_set_pen)(struct mod *v, int style, int width); int (*server_draw_line)(struct mod *v, int x1, int y1, int x2, int y2); int (*server_add_char)(struct mod *v, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_draw_text)(struct mod *v, int font, int flags, int mixmode, int clip_left, int clip_top, int clip_right, int clip_bottom, int box_left, int box_top, int box_right, int box_bottom, int x, int y, char *data, int data_len); int (*client_monitor_resize)(struct mod *v, int width, int height, int num_monitors, const struct monitor_info *monitors); int (*server_monitor_resize_done)(struct mod *v); int (*server_get_channel_count)(struct mod *v); int (*server_query_channel)(struct mod *v, int index, char *channel_name, int *channel_flags); int (*server_get_channel_id)(struct mod *v, const char *name); int (*server_send_to_channel)(struct mod *v, int channel_id, char *data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct mod *v); int (*server_chansrv_in_use)(struct mod *v); /* off screen bitmaps */ int (*server_create_os_surface)(struct mod *v, int rdpindex, int width, int height); int (*server_switch_os_surface)(struct mod *v, int rdpindex); int (*server_delete_os_surface)(struct mod *v, int rdpindex); int (*server_paint_rect_os)(struct mod *mod, int x, int y, int cx, int cy, int rdpindex, int srcx, int srcy); int (*server_set_hints)(struct mod *mod, int hints, int mask); /* rail */ int (*server_window_new_update)(struct mod *mod, int window_id, struct rail_window_state_order *window_state, int flags); int (*server_window_delete)(struct mod *mod, int window_id); int (*server_window_icon)(struct mod *mod, int window_id, int cache_entry, int cache_id, struct rail_icon_info *icon_info, int flags); int (*server_window_cached_icon)(struct mod *mod, int window_id, int cache_entry, int cache_id, int flags); int (*server_notify_new_update)(struct mod *mod, int window_id, int notify_id, struct rail_notify_state_order *notify_state, int flags); int (*server_notify_delete)(struct mod *mod, int window_id, int notify_id); int (*server_monitored_desktop)(struct mod *mod, struct rail_monitored_desktop_order *mdo, int flags); int (*server_set_pointer_ex)(struct mod *mod, int x, int y, char *data, char *mask, int bpp); int (*server_add_char_alpha)(struct mod *mod, int font, int character, int offset, int baseline, int width, int height, char *data); int (*server_create_os_surface_bpp)(struct mod *v, int rdpindex, int width, int height, int bpp); int (*server_paint_rect_bpp)(struct mod *v, int x, int y, int cx, int cy, char *data, int width, int height, int srcx, int srcy, int bpp); int (*server_composite)(struct mod *v, int srcidx, int srcformat, int srcwidth, int srcrepeat, int *srctransform, int mskflags, int mskidx, int mskformat, int mskwidth, int mskrepeat, int op, int srcx, int srcy, int mskx, int msky, int dstx, int dsty, int width, int height, int dstformat); int (*server_paint_rects)(struct mod *v, int num_drects, short *drects, int num_crects, short *crects, char *data, int width, int height, int flags, int frame_id); int (*server_session_info)(struct mod *v, const char *data, int data_bytes); tintptr server_dumby[100 - 47]; /* align, 100 minus the number of server functions above */ /* common */ tintptr handle; /* pointer to self as long */ tintptr wm; tintptr painter; struct source_info *si; /* mod data */ int sck; int width; int height; int bpp; int colormap[256]; char *chan_buf; int chan_buf_valid; int chan_buf_bytes; int vmaj; int vmin; int vrev; char username[INFO_CLIENT_MAX_CB_LEN]; char password[INFO_CLIENT_MAX_CB_LEN]; char domain[INFO_CLIENT_MAX_CB_LEN]; int bool_keyBoardSynced ; /* Numlock can be out of sync, we hold state here to resolve */ int keyBoardLockInfo ; /* Holds initial numlock capslock state */ struct xrdp_client_info client_info; struct rdp_freerdp *inst; struct bitmap_item bitmap_cache[4][4096]; struct brush_item brush_cache[64]; struct pointer_item pointer_cache[32]; char pamusername[255]; int allow_client_experiencesettings; int perf_settings_override_mask; /* Performance bits overridden in ini file */ int perf_settings_values_mask; /* Values of overridden performance bits */ int allow_client_kbd_settings; struct kbd_overrides kbd_overrides; /* neutrinordp.overide_kbd_* values */ }; #endif // XRDP_NEUTRINORDP_H xrdp-0.10.1/neutrinordp/Makefile.am000644 001751 000000 00000001032 14652432047 017236 0ustar00metawheel000000 000000 AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common \ $(FREERDP_CFLAGS) module_LTLIBRARIES = \ libxrdpneutrinordp.la libxrdpneutrinordp_la_SOURCES = \ xrdp-color.c \ xrdp-color.h \ xrdp-neutrinordp.c \ xrdp-neutrinordp.h libxrdpneutrinordp_la_LIBADD = \ $(top_builddir)/common/libcommon.la \ $(FREERDP_LIBS) libxrdpneutrinordp_la_LDFLAGS = -avoid-version -module xrdp-0.10.1/neutrinordp/xrdp-neutrinordp.c000644 001751 000000 00000250433 14652432047 020705 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol Server * freerdp wrapper * * Copyright 2011-2013 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include // FreeRDP defines some macros that we have different values for. // To catch this we need to include the freerdp includes before our // local ones (see gcc bug #16358) #undef WM_LBUTTONUP #undef WM_LBUTTONDOWN #undef WM_RBUTTONUP #undef WM_RBUTTONDOWN #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp-neutrinordp.h" #include "xrdp-color.h" #include "xrdp_rail.h" #include "trans.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" #if defined(VERSION_STRUCT_RDP_FREERDP) #if VERSION_STRUCT_RDP_FREERDP > 1 #define NEUTRINORDP_HAS_SUPPRESS_OUTPUT #endif #endif /* Max amount of buffered output data before we stop generating more */ #define MAX_QUEUED_MODULE_OUTPUT_DATA 50000 struct mod_context { rdpContext _p; struct mod *modi; }; typedef struct mod_context modContext; /*****************************************************************************/ static void verifyColorMap(struct mod *mod) { int i; for (i = 0; i < 255; i++) { if (mod->colormap[i] != 0) { return ; } } LOG(LOG_LEVEL_WARNING, "The colormap is all NULL"); } /*****************************************************************************/ static int get_queued_module_output_data(struct mod *mod) { return (mod->si != NULL) ? mod->si->source[XRDP_SOURCE_MOD] : 0; } /*****************************************************************************/ /* return error */ static int lxrdp_start(struct mod *mod, int w, int h, int bpp) { rdpSettings *settings; LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_start: w %d h %d bpp %d", w, h, bpp); settings = mod->inst->settings; settings->width = w; settings->height = h; settings->color_depth = bpp; mod->bpp = bpp; settings->encryption = 1; settings->tls_security = 1; settings->nla_security = 0; settings->rdp_security = 1; return 0; } /******************************************************************************/ /* return error */ static void set_keyboard_overrides(struct mod *mod) { const struct kbd_overrides *ko = &mod->kbd_overrides; rdpSettings *settings = mod->inst->settings; if (mod->allow_client_kbd_settings) { settings->kbd_type = mod->client_info.keyboard_type; settings->kbd_subtype = mod->client_info.keyboard_subtype; /* Define the most common number of function keys, 12. because we can't get it from client. */ settings->kbd_fn_keys = 12; settings->kbd_layout = mod->client_info.keylayout; /* Exception processing for each RDP Keyboard type */ if (mod->client_info.keyboard_type == 0x00) { /* 0x00000000 : Set on Server */ LOG(LOG_LEVEL_WARNING, "keyboard_type:[0x%02x] ,Set on Server", mod->client_info.keyboard_type); } else if (mod->client_info.keyboard_type == 0x04) { /* 0x00000004 : IBM enhanced (101- or 102-key) keyboard */ /* Nothing to do. */ } else if (mod->client_info.keyboard_type == 0x07) { /* 0x00000007 : Japanese keyboard */ /* Nothing to do. */ } } if (ko->type != 0) { LOG(LOG_LEVEL_INFO, "overrode kbd_type 0x%02X with 0x%02X", settings->kbd_type, ko->type); settings->kbd_type = ko->type; } if (ko->subtype != 0) { LOG(LOG_LEVEL_INFO, "overrode kbd_subtype 0x%02X with 0x%02X", settings->kbd_subtype, ko->subtype); settings->kbd_subtype = ko->subtype; } if (ko->fn_keys != 0) { LOG(LOG_LEVEL_INFO, "overrode kbd_fn_keys %d with %d", settings->kbd_fn_keys, ko->fn_keys); settings->kbd_fn_keys = ko->fn_keys; } if (ko->layout != 0) { LOG(LOG_LEVEL_INFO, "overrode kbd_layout 0x%08X with 0x%08X", settings->kbd_layout, ko->layout); settings->kbd_layout = ko->layout; } if (ko->layout_mask != 0) { LOG(LOG_LEVEL_INFO, "Masked kbd_layout 0x%08X to 0x%08X", settings->kbd_layout, settings->kbd_layout & ko->layout_mask); settings->kbd_layout &= ko->layout_mask; } LOG(LOG_LEVEL_INFO, "NeutrinoRDP proxy remote keyboard settings, " "kbd_type:[0x%02X], kbd_subtype:[0x%02X], " "kbd_fn_keys:[%02d], kbd_layout:[0x%08X]", settings->kbd_type, settings->kbd_subtype, settings->kbd_fn_keys, settings->kbd_layout); } static int lxrdp_connect(struct mod *mod) { boolean ok; set_keyboard_overrides(mod); LOG_DEVEL(LOG_LEVEL_TRACE, "lxrdp_connect:"); ok = freerdp_connect(mod->inst); LOG_DEVEL(LOG_LEVEL_INFO, "lxrdp_connect: freerdp_connect returned %d", ok); if (!ok) { LOG_DEVEL(LOG_LEVEL_INFO, "Failure to connect"); #ifdef ERRORSTART if (connectErrorCode != 0) { char buf[128]; if (connectErrorCode < ERRORSTART) { if (strerror_r(connectErrorCode, buf, 128) != 0) { g_snprintf(buf, 128, "Errorcode from connect : %d", connectErrorCode); } } else { switch (connectErrorCode) { case PREECONNECTERROR: g_snprintf(buf, 128, "The error code from connect is " "PREECONNECTERROR"); break; case UNDEFINEDCONNECTERROR: g_snprintf(buf, 128, "The error code from connect is " "UNDEFINEDCONNECTERROR"); break; case POSTCONNECTERROR: g_snprintf(buf, 128, "The error code from connect is " "POSTCONNECTERROR"); break; case DNSERROR: g_snprintf(buf, 128, "The DNS system generated an error"); break; case DNSNAMENOTFOUND: g_snprintf(buf, 128, "The DNS system could not find the " "specified name"); break; case CONNECTERROR: g_snprintf(buf, 128, "A general connect error was returned"); break; case MCSCONNECTINITIALERROR: g_snprintf(buf, 128, "The error code from connect is " "MCSCONNECTINITIALERROR"); break; case TLSCONNECTERROR: g_snprintf(buf, 128, "Error in TLS handshake"); break; case AUTHENTICATIONERROR: g_snprintf(buf, 128, "Authentication error check your password " "and username"); break; case INSUFFICIENTPRIVILEGESERROR: g_snprintf(buf, 128, "Insufficient privileges on target server"); break; default: g_snprintf(buf, 128, "Unhandled Errorcode from connect : %d", connectErrorCode); break; } } LOG(LOG_LEVEL_INFO, buf); mod->server_msg(mod, buf, 0); } #else { /* This version of freerdp returns no useful information at * all */ mod->server_msg(mod, "Neutrinordp connect failed.", 0); mod->server_msg(mod, "No more information is available", 0); mod->server_msg(mod, "Check host is up" " and credentials are correct", 0); } #endif LOG(LOG_LEVEL_ERROR, "NeutrinoRDP proxy connection: status [Failed]," " RDP client [%s], RDP server [%s:%d], RDP server username [%s]," " xrdp pamusername [%s], xrdp process id [%d]", mod->client_info.client_description, mod->inst->settings->hostname, mod->inst->settings->port, mod->inst->settings->username, mod->pamusername, g_getpid()); return 1; } else { LOG(LOG_LEVEL_INFO, "NeutrinoRDP proxy connection: status [Success]," " RDP client [%s], RDP server [%s:%d], RDP server username [%s]," " xrdp pamusername [%s], xrdp process id [%d]", mod->client_info.client_description, mod->inst->settings->hostname, mod->inst->settings->port, mod->inst->settings->username, mod->pamusername, g_getpid()); } return 0; } /******************************************************************************/ /* return error */ static int lxrdp_event(struct mod *mod, int msg, long param1, long param2, long param3, long param4) { int x; int y; int cx; int cy; int flags; int size; int total_size; int chanid; int lchid; char *data; LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_event: msg %d", msg); switch (msg) { case WM_KEYDOWN: /* Before we handle the first character we synchronize capslock and numlock. */ /* We collect the state during the first synchronize ( see msg 17) */ if (!mod->bool_keyBoardSynced) { LOG_DEVEL(LOG_LEVEL_DEBUG, "Additional Sync event handled : %d", mod->keyBoardLockInfo); mod->inst->input->SynchronizeEvent(mod->inst->input, mod->keyBoardLockInfo); mod->bool_keyBoardSynced = 1; } mod->inst->input->KeyboardEvent(mod->inst->input, param4, param3); break; case WM_KEYUP: mod->inst->input->KeyboardEvent(mod->inst->input, param4, param3); break; case WM_KEYBRD_SYNC: LOG_DEVEL(LOG_LEVEL_DEBUG, "Synchronized event handled : %ld", param1); /* In some situations the Synchronize event come to early. Therefore we store this information and use it when we receive the first keyboard event Without this fix numlock and capslock can come out of sync. */ mod->inst->input->SynchronizeEvent(mod->inst->input, param1); if (!mod->bool_keyBoardSynced) { mod->keyBoardLockInfo = param1; } break; case WM_MOUSEMOVE: /* mouse move */ LOG_DEVEL(LOG_LEVEL_DEBUG, "mouse move %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_MOVE; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_LBUTTONUP: LOG_DEVEL(LOG_LEVEL_DEBUG, "left button up %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_BUTTON1; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_LBUTTONDOWN: LOG_DEVEL(LOG_LEVEL_DEBUG, "left button down %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_BUTTON1 | PTR_FLAGS_DOWN; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_RBUTTONUP: LOG_DEVEL(LOG_LEVEL_DEBUG, "right button up %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_BUTTON2; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_RBUTTONDOWN: LOG_DEVEL(LOG_LEVEL_DEBUG, "right button down %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_BUTTON2 | PTR_FLAGS_DOWN; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_BUTTON3UP: /* middle button up */ LOG_DEVEL(LOG_LEVEL_DEBUG, "middle button up %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_BUTTON3; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_BUTTON3DOWN: /* middle button down */ LOG_DEVEL(LOG_LEVEL_DEBUG, "middle button down %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_FLAGS_BUTTON3 | PTR_FLAGS_DOWN; mod->inst->input->MouseEvent(mod->inst->input, flags, x, y); break; case WM_BUTTON4UP: /* wheel up */ flags = PTR_FLAGS_WHEEL | 0x0078; mod->inst->input->MouseEvent(mod->inst->input, flags, 0, 0); break; case WM_BUTTON4DOWN: break; case WM_BUTTON5UP: /* wheel down */ flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088; mod->inst->input->MouseEvent(mod->inst->input, flags, 0, 0); break; case WM_BUTTON5DOWN: break; case WM_BUTTON8UP: LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button8 up %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_XFLAGS_BUTTON1; mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y); break; case WM_BUTTON8DOWN: LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button8 down %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_DOWN; mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y); break; case WM_BUTTON9UP: LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button9 up %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_XFLAGS_BUTTON2; mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y); break; case WM_BUTTON9DOWN: LOG_DEVEL(LOG_LEVEL_DEBUG, "extended mouse button9 down %ld %ld", param1, param2); x = param1; y = param2; flags = PTR_XFLAGS_BUTTON2 | PTR_XFLAGS_DOWN; mod->inst->input->ExtendedMouseEvent(mod->inst->input, flags, x, y); break; case WM_INVALIDATE: LOG_DEVEL(LOG_LEVEL_DEBUG, "Invalidate request sent from client"); x = (param1 >> 16) & 0xffff; y = (param1 >> 0) & 0xffff; cx = (param2 >> 16) & 0xffff; cy = (param2 >> 0) & 0xffff; mod->inst->SendInvalidate(mod->inst, -1, x, y, cx, cy); break; case WM_CHANNEL_DATA: chanid = LOWORD(param1); flags = HIWORD(param1); size = (int)param2; data = (char *)param3; total_size = (int)param4; LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_event: client to server ,chanid= %d flags= %d", chanid, flags); if ((chanid < 0) || (chanid >= mod->inst->settings->num_channels)) { LOG(LOG_LEVEL_WARNING, "lxrdp_event: error chanid %d", chanid); break; } lchid = mod->inst->settings->channels[chanid].channel_id; switch (flags & 3) { case 3: mod->inst->SendChannelData(mod->inst, lchid, (tui8 *)data, total_size); break; case 2: /* end */ g_memcpy(mod->chan_buf + mod->chan_buf_valid, data, size); mod->chan_buf_valid += size; mod->inst->SendChannelData(mod->inst, lchid, (tui8 *)(mod->chan_buf), total_size); g_free(mod->chan_buf); mod->chan_buf = 0; mod->chan_buf_bytes = 0; mod->chan_buf_valid = 0; break; case 1: /* start */ g_free(mod->chan_buf); mod->chan_buf = (char *)g_malloc(total_size, 0); mod->chan_buf_bytes = total_size; mod->chan_buf_valid = 0; g_memcpy(mod->chan_buf + mod->chan_buf_valid, data, size); mod->chan_buf_valid += size; break; default: /* middle */ g_memcpy(mod->chan_buf + mod->chan_buf_valid, data, size); mod->chan_buf_valid += size; break; } break; default: LOG(LOG_LEVEL_WARNING, "Unhandled message type in eventhandler %d", msg); break; } return 0; } /******************************************************************************/ /* return error */ static int lxrdp_signal(struct mod *mod) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_signal:"); return 0; } /******************************************************************************/ /* return error */ static int lxrdp_end(struct mod *mod) { int i; int j; for (j = 0; j < 4; j++) { for (i = 0; i < 4096; i++) { g_free(mod->bitmap_cache[j][i].data); } } for (i = 0; i < 64; i++) { if (mod->brush_cache[i].data != mod->brush_cache[i].b8x8) { g_free(mod->brush_cache[i].data); } } LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_end:"); LOG(LOG_LEVEL_INFO, "NeutrinoRDP proxy connection: status [Disconnect]," " RDP client [%s], RDP server [%s:%d], RDP server username [%s]," " xrdp pamusername [%s], xrdp process id [%d]", mod->client_info.client_description, mod->inst->settings->hostname, mod->inst->settings->port, mod->inst->settings->username, mod->pamusername, g_getpid()); return 0; } /******************************************************************************/ /* return error */ static int lxrdp_set_param(struct mod *mod, const char *name, const char *value) { rdpSettings *settings; if (g_strcmp(name, "password") == 0 || g_strcmp(name, "pampassword") == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_set_param: name [%s] value [******]", name); } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_set_param: name [%s] value [%s]", name, value); } settings = mod->inst->settings; if (g_strcmp(name, "hostname") == 0) { } else if (g_strcmp(name, "ip") == 0) { settings->hostname = g_strdup(value); } else if (g_strcmp(name, "port") == 0) { settings->port = g_atoi(value); } else if (g_strcmp(name, "keylayout") == 0) { LOG(LOG_LEVEL_DEBUG, "%s:[0x%08X]", name, g_atoi(value)); } else if (g_strcmp(name, "name") == 0) { } else if (g_strcmp(name, "lib") == 0) { } else if (g_strcmp(name, "username") == 0) { g_strncpy(mod->username, value, 255); } else if (g_strcmp(name, "domain") == 0) { g_strncpy(mod->domain, value, 255); } else if (g_strcmp(name, "password") == 0) { g_strncpy(mod->password, value, 255); } else if (g_strcmp(name, "client_info") == 0) { g_memcpy(&(mod->client_info), value, sizeof(mod->client_info)); /* This is a Struct and cannot be printed in next else*/ LOG_DEVEL(LOG_LEVEL_DEBUG, "Client_info struct ignored"); } else if (g_strcmp(name, "program") == 0) { settings->shell = g_strdup(value); } else if (g_strcmp(name, "nla") == 0) { settings->nla_security = g_text2bool(value); } else if (g_strcmp(name, "enable_dynamic_resizing") == 0) { settings->desktop_resize = g_text2bool(value); } else if (g_strcmp(name, "pamusername") == 0) { g_strncpy(mod->pamusername, value, 255); } else if (g_strcmp(name, "pampassword") == 0 || g_strcmp(name, "pamsessionmng") == 0) { /* Valid (but unused) parameters not logged */ } else if (g_strcmp(name, "channel.rdpdr") == 0 || g_strcmp(name, "channel.rdpsnd") == 0 || g_strcmp(name, "channel.cliprdr") == 0 || g_strcmp(name, "channel.drdynvc") == 0) { /* Valid (but unused) parameters not logged */ } else if (g_strcmp(name, "perf.allow_client_experiencesettings") == 0) { mod->allow_client_experiencesettings = g_text2bool(value); } else if (g_strcmp(name, "perf.wallpaper") == 0) { mod->perf_settings_override_mask |= PERF_DISABLE_WALLPAPER; if (!g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_DISABLE_WALLPAPER; } } else if (g_strcmp(name, "perf.font_smoothing") == 0) { mod->perf_settings_override_mask |= PERF_ENABLE_FONT_SMOOTHING; if (g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_ENABLE_FONT_SMOOTHING; } } else if (g_strcmp(name, "perf.desktop_composition") == 0) { mod->perf_settings_override_mask |= PERF_ENABLE_DESKTOP_COMPOSITION; if (g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_ENABLE_DESKTOP_COMPOSITION; } } else if (g_strcmp(name, "perf.full_window_drag") == 0) { mod->perf_settings_override_mask |= PERF_DISABLE_FULLWINDOWDRAG; if (!g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_DISABLE_FULLWINDOWDRAG; } } else if (g_strcmp(name, "perf.menu_anims") == 0) { mod->perf_settings_override_mask |= PERF_DISABLE_MENUANIMATIONS; if (!g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_DISABLE_MENUANIMATIONS; } } else if (g_strcmp(name, "perf.themes") == 0) { mod->perf_settings_override_mask |= PERF_DISABLE_THEMING; if (!g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_DISABLE_THEMING; } } else if (g_strcmp(name, "perf.cursor_blink") == 0) { mod->perf_settings_override_mask |= PERF_DISABLE_CURSORSETTINGS; if (!g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_DISABLE_CURSORSETTINGS; } } else if (g_strcmp(name, "perf.cursor_shadow") == 0) { mod->perf_settings_override_mask |= PERF_DISABLE_CURSOR_SHADOW; if (!g_text2bool(value)) { mod->perf_settings_values_mask |= PERF_DISABLE_CURSOR_SHADOW; } } else if (g_strcmp(name, "neutrinordp.allow_client_keyboardLayout") == 0) { mod->allow_client_kbd_settings = g_text2bool(value); } else if (g_strcmp(name, "neutrinordp.override_keyboardLayout_mask") == 0) { /* Keyboard values are stored for later processing */ mod->kbd_overrides.layout_mask = g_atoix(value); } else if (g_strcmp(name, "neutrinordp.override_kbd_type") == 0) { mod->kbd_overrides.type = g_atoix(value); } else if (g_strcmp(name, "neutrinordp.override_kbd_subtype") == 0) { mod->kbd_overrides.subtype = g_atoix(value); } else if (g_strcmp(name, "neutrinordp.override_kbd_fn_keys") == 0) { mod->kbd_overrides.fn_keys = g_atoix(value); } else if (g_strcmp(name, "neutrinordp.override_kbd_layout") == 0) { mod->kbd_overrides.layout = g_atoix(value); } else { LOG(LOG_LEVEL_WARNING, "lxrdp_set_param: unknown name [%s] value [%s]", name, value); } return 0; } /******************************************************************************/ static int lxrdp_session_change(struct mod *mod, int a, int b) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_session_change: - no code here"); return 0; } /******************************************************************************/ static int lxrdp_get_wait_objs(struct mod *mod, tbus *read_objs, int *rcount, tbus *write_objs, int *wcount, int *timeout) { void **rfds; void **wfds; boolean ok; LOG_DEVEL(LOG_LEVEL_TRACE, "lxrdp_get_wait_objs:"); /* * Don't check this module for activity if our queued output data * has already reached the limit */ if (get_queued_module_output_data(mod) > MAX_QUEUED_MODULE_OUTPUT_DATA) { *rcount = 0; *wcount = 0; } else { rfds = (void **)read_objs; wfds = (void **)write_objs; ok = freerdp_get_fds(mod->inst, rfds, rcount, wfds, wcount); if (!ok) { LOG(LOG_LEVEL_ERROR, "lxrdp_get_wait_objs: freerdp_get_fds failed"); return 1; } } return 0; } /******************************************************************************/ static int lxrdp_check_wait_objs(struct mod *mod) { boolean ok; LOG_DEVEL(LOG_LEVEL_TRACE, "lxrdp_check_wait_objs:"); /* * Only process the freerdp file descriptors if our queued output data * has not reached the limit */ if (get_queued_module_output_data(mod) <= MAX_QUEUED_MODULE_OUTPUT_DATA) { /* * Before checking the file descriptors, set the source info * current source, so any data queued on output trans objects * gets attributed to this module */ if (mod->si) { mod->si->cur_source = XRDP_SOURCE_MOD; } ok = freerdp_check_fds(mod->inst); if (mod->si) { mod->si->cur_source = XRDP_SOURCE_NONE; } if (!ok) { LOG(LOG_LEVEL_ERROR, "lxrdp_check_wait_objs: freerdp_check_fds failed"); return 1; } } return 0; } /******************************************************************************/ static int lxrdp_frame_ack(struct mod *mod, int flags, int frame_id) { return 0; } /******************************************************************************/ static int lxrdp_suppress_output(struct mod *mod, int suppress, int left, int top, int right, int bottom) { #if defined(NEUTRINORDP_HAS_SUPPRESS_OUTPUT) mod->inst->SendSuppressOutput(mod->inst, !suppress, left, top, right, bottom); #endif return 0; } /******************************************************************************/ static int lxrdp_server_version_message(struct mod *mod) { return 0; } /******************************************************************************/ static int lxrdp_server_monitor_resize(struct mod *mod, int width, int height, int num_monitors, const struct monitor_info *monitors, int *in_progress) { *in_progress = 0; return 0; } /******************************************************************************/ static int lxrdp_server_monitor_full_invalidate(struct mod *mod, int width, int height) { return 0; } /******************************************************************************/ static void lfreerdp_begin_paint(rdpContext *context) { struct mod *mod; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_begin_paint:"); mod = ((struct mod_context *)context)->modi; mod->server_begin_update(mod); } /******************************************************************************/ static void lfreerdp_end_paint(rdpContext *context) { struct mod *mod; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_end_paint:"); mod = ((struct mod_context *)context)->modi; mod->server_end_update(mod); } /******************************************************************************/ static void lfreerdp_set_bounds(rdpContext *context, rdpBounds *bounds) { struct mod *mod; int x; int y; int cx; int cy; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_set_bounds: %p", bounds); mod = ((struct mod_context *)context)->modi; if (bounds != 0) { x = bounds->left; y = bounds->top; cx = (bounds->right - bounds->left) + 1; cy = (bounds->bottom - bounds->top) + 1; mod->server_set_clip(mod, x, y, cx, cy); } else { mod->server_reset_clip(mod); } } /******************************************************************************/ static void lfreerdp_bitmap_update(rdpContext *context, BITMAP_UPDATE *bitmap) { struct mod *mod; int index; int cx; int cy; int server_bpp; int server_Bpp; int client_bpp; int j; int line_bytes; BITMAP_DATA *bd; char *dst_data; char *dst_data1; char *src; char *dst; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_bitmap_update: %d %d", bitmap->number, bitmap->count); server_bpp = mod->inst->settings->color_depth; server_Bpp = (server_bpp + 7) / 8; client_bpp = mod->bpp; for (index = 0; index < bitmap->number; index++) { bd = &bitmap->rectangles[index]; cx = (bd->destRight - bd->destLeft) + 1; cy = (bd->destBottom - bd->destTop) + 1; line_bytes = server_Bpp * bd->width; dst_data = (char *)g_malloc(bd->height * line_bytes + 16, 0); if (bd->compressed) { LOG_DEVEL(LOG_LEVEL_DEBUG, "decompress size : %d", bd->bitmapLength); if (!bitmap_decompress(bd->bitmapDataStream, (tui8 *)dst_data, bd->width, bd->height, bd->bitmapLength, server_bpp, server_bpp)) { LOG(LOG_LEVEL_WARNING, "Failure to decompress the bitmap"); } } else { /* bitmap is upside down */ LOG_DEVEL(LOG_LEVEL_DEBUG, "bitmap upside down"); src = (char *)(bd->bitmapDataStream); dst = dst_data + bd->height * line_bytes; for (j = 0; j < bd->height; j++) { dst -= line_bytes; g_memcpy(dst, src, line_bytes); src += line_bytes; } } dst_data1 = convert_bitmap(server_bpp, client_bpp, dst_data, bd->width, bd->height, mod->colormap); mod->server_paint_rect(mod, bd->destLeft, bd->destTop, cx, cy, dst_data1, bd->width, bd->height, 0, 0); if (dst_data1 != dst_data) { g_free(dst_data1); } g_free(dst_data); } } /******************************************************************************/ static void lfreerdp_dst_blt(rdpContext *context, DSTBLT_ORDER *dstblt) { struct mod *mod; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_dst_blt:"); mod->server_set_opcode(mod, dstblt->bRop); mod->server_fill_rect(mod, dstblt->nLeftRect, dstblt->nTopRect, dstblt->nWidth, dstblt->nHeight); mod->server_set_opcode(mod, 0xcc); } /******************************************************************************/ static void lfreerdp_pat_blt(rdpContext *context, PATBLT_ORDER *patblt) { struct mod *mod; int idx; int fgcolor; int bgcolor; int server_bpp; int client_bpp; struct brush_item *bi; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_pat_blt:"); server_bpp = mod->inst->settings->color_depth; client_bpp = mod->bpp; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pat_blt: bpp %d %d", server_bpp, client_bpp); fgcolor = convert_color(server_bpp, client_bpp, patblt->foreColor, mod->colormap); bgcolor = convert_color(server_bpp, client_bpp, patblt->backColor, mod->colormap); LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pat_blt: nLeftRect %d nTopRect %d " "nWidth %d nHeight %d fgcolor 0x%8.8x bgcolor 0x%8.8x", patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight, fgcolor, bgcolor); if (fgcolor == bgcolor) { LOG(LOG_LEVEL_WARNING, "Warning same color on both bg and fg"); } mod->server_set_mixmode(mod, 1); mod->server_set_opcode(mod, patblt->bRop); mod->server_set_fgcolor(mod, fgcolor); mod->server_set_bgcolor(mod, bgcolor); if (patblt->brush.style & 0x80) { idx = patblt->brush.hatch; if ((idx < 0) || (idx >= 64)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_pat_blt: error patblt->brush.hatch, " "Expected min 0, max 63. Actual %d", idx); return; } bi = mod->brush_cache + idx; mod->server_set_brush(mod, patblt->brush.x, patblt->brush.y, 3, bi->b8x8); } else { mod->server_set_brush(mod, patblt->brush.x, patblt->brush.y, patblt->brush.style, (char *)(patblt->brush.p8x8)); } mod->server_fill_rect(mod, patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); mod->server_set_opcode(mod, 0xcc); mod->server_set_mixmode(mod, 0); } /******************************************************************************/ static void lfreerdp_scr_blt(rdpContext *context, SCRBLT_ORDER *scrblt) { struct mod *mod; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_scr_blt:"); mod->server_set_opcode(mod, scrblt->bRop); mod->server_screen_blt(mod, scrblt->nLeftRect, scrblt->nTopRect, scrblt->nWidth, scrblt->nHeight, scrblt->nXSrc, scrblt->nYSrc); mod->server_set_opcode(mod, 0xcc); } /******************************************************************************/ static void lfreerdp_opaque_rect(rdpContext *context, OPAQUE_RECT_ORDER *opaque_rect) { struct mod *mod; int server_bpp; int client_bpp; int fgcolor; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_opaque_rect:"); server_bpp = mod->inst->settings->color_depth; client_bpp = mod->bpp; fgcolor = convert_color(server_bpp, client_bpp, opaque_rect->color, mod->colormap); LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_opaque_rect: nLeftRect %d nTopRect %d " "nWidth %d nHeight %d fgcolor 0x%8.8x", opaque_rect->nLeftRect, opaque_rect->nTopRect, opaque_rect->nWidth, opaque_rect->nHeight, fgcolor); mod->server_set_fgcolor(mod, fgcolor); mod->server_fill_rect(mod, opaque_rect->nLeftRect, opaque_rect->nTopRect, opaque_rect->nWidth, opaque_rect->nHeight); } /******************************************************************************/ static void lfreerdp_mem_blt(rdpContext *context, MEMBLT_ORDER *memblt) { int id; int idx; struct mod *mod; struct bitmap_item *bi; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_mem_blt: cacheId %d cacheIndex %d", memblt->cacheId, memblt->cacheIndex); id = memblt->cacheId; idx = memblt->cacheIndex; if (idx == 32767) /* BITMAPCACHE_WAITING_LIST_INDEX */ { idx = 4096 - 1; } if ((id < 0) || (id >= 4)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_mem_blt: bad id [%d]", id); return; } if ((idx < 0) || (idx >= 4096)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_mem_blt: bad idx [%d]", idx); return; } bi = &(mod->bitmap_cache[id][idx]); mod->server_set_opcode(mod, memblt->bRop); mod->server_paint_rect(mod, memblt->nLeftRect, memblt->nTopRect, memblt->nWidth, memblt->nHeight, bi->data, bi->width, bi->height, memblt->nXSrc, memblt->nYSrc); mod->server_set_opcode(mod, 0xcc); } /******************************************************************************/ static void lfreerdp_glyph_index(rdpContext *context, GLYPH_INDEX_ORDER *glyph_index) { struct mod *mod; int server_bpp; int client_bpp; int fgcolor; int bgcolor; int opLeft; int opTop; int opRight; int opBottom; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_glyph_index:"); server_bpp = mod->inst->settings->color_depth; client_bpp = mod->bpp; fgcolor = convert_color(server_bpp, client_bpp, glyph_index->foreColor, mod->colormap); bgcolor = convert_color(server_bpp, client_bpp, glyph_index->backColor, mod->colormap); LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_glyph_index: " "bkLeft %d bkTop %d width %d height %d " "opLeft %d opTop %d width %d height %d " "cbData %d fgcolor 0x%8.8x bgcolor 0x%8.8x fOpRedundant %d", glyph_index->bkLeft, glyph_index->bkTop, glyph_index->bkRight - glyph_index->bkLeft, glyph_index->bkBottom - glyph_index->bkTop, glyph_index->opLeft, glyph_index->opTop, glyph_index->opRight - glyph_index->opLeft, glyph_index->opBottom - glyph_index->opTop, glyph_index->cbData, fgcolor, bgcolor, glyph_index->fOpRedundant); mod->server_set_bgcolor(mod, fgcolor); mod->server_set_fgcolor(mod, bgcolor); opLeft = glyph_index->opLeft; opTop = glyph_index->opTop; opRight = glyph_index->opRight; opBottom = glyph_index->opBottom; #if 1 /* workarounds for freerdp not using fOpRedundant in glyph.c::update_gdi_glyph_index */ if (glyph_index->fOpRedundant) { opLeft = glyph_index->bkLeft; opTop = glyph_index->bkTop; opRight = glyph_index->bkRight; opBottom = glyph_index->bkBottom; } #endif mod->server_draw_text(mod, glyph_index->cacheId, glyph_index->flAccel, glyph_index->fOpRedundant, glyph_index->bkLeft, glyph_index->bkTop, glyph_index->bkRight, glyph_index->bkBottom, opLeft, opTop, opRight, opBottom, glyph_index->x, glyph_index->y, (char *)(glyph_index->data), glyph_index->cbData); } /******************************************************************************/ static void lfreerdp_line_to(rdpContext *context, LINE_TO_ORDER *line_to) { struct mod *mod; int server_bpp; int client_bpp; int fgcolor; int bgcolor; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_line_to:"); mod->server_set_opcode(mod, line_to->bRop2); server_bpp = mod->inst->settings->color_depth; client_bpp = mod->bpp; fgcolor = convert_color(server_bpp, client_bpp, line_to->penColor, mod->colormap); bgcolor = convert_color(server_bpp, client_bpp, line_to->backColor, mod->colormap); mod->server_set_fgcolor(mod, fgcolor); mod->server_set_bgcolor(mod, bgcolor); mod->server_set_pen(mod, line_to->penStyle, line_to->penWidth); mod->server_draw_line(mod, line_to->nXStart, line_to->nYStart, line_to->nXEnd, line_to->nYEnd); mod->server_set_opcode(mod, 0xcc); } /******************************************************************************/ static void lfreerdp_cache_bitmap(rdpContext *context, CACHE_BITMAP_ORDER *cache_bitmap_order) { LOG_DEVEL(LOG_LEVEL_INFO, "lfreerdp_cache_bitmap: - no code here"); } /******************************************************************************/ /* Turn the bitmap upside down*/ static void lfreerdp_upsidedown(uint8 *destination, CACHE_BITMAP_V2_ORDER *cache_bitmap_v2_order, int server_Bpp) { tui8 *src; tui8 *dst; int line_bytes; int j; if (destination == NULL) { LOG(LOG_LEVEL_ERROR, "lfreerdp_upsidedown: destination pointer is NULL !!!"); return; } line_bytes = server_Bpp * cache_bitmap_v2_order->bitmapWidth; src = cache_bitmap_v2_order->bitmapDataStream; dst = destination + ((cache_bitmap_v2_order->bitmapHeight) * line_bytes); for (j = 0; j < cache_bitmap_v2_order->bitmapHeight; j++) { dst -= line_bytes; g_memcpy(dst, src, line_bytes); src += line_bytes; } } /******************************************************************************/ static void lfreerdp_cache_bitmapV2(rdpContext *context, CACHE_BITMAP_V2_ORDER *cache_bitmap_v2_order) { char *dst_data; char *dst_data1; int bytes; int width; int height; int id; int idx; int flags; int server_bpp; int server_Bpp; int client_bpp; struct mod *mod; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_cache_bitmapV2: %d %d 0x%8.8x compressed %d", cache_bitmap_v2_order->cacheId, cache_bitmap_v2_order->cacheIndex, cache_bitmap_v2_order->flags, cache_bitmap_v2_order->compressed); mod = ((struct mod_context *)context)->modi; id = cache_bitmap_v2_order->cacheId; idx = cache_bitmap_v2_order->cacheIndex; flags = cache_bitmap_v2_order->flags; if (flags & 0x10) /* CBR2_DO_NOT_CACHE */ { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_cache_bitmapV2: CBR2_DO_NOT_CACHE"); idx = 4096 - 1; } if ((id < 0) || (id >= 4)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_cache_bitmapV2: bad id [%d]", id); return; } if ((idx < 0) || (idx >= 4096)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_cache_bitmapV2: bad idx [%d]", idx); return; } server_bpp = mod->inst->settings->color_depth; server_Bpp = (server_bpp + 7) / 8; client_bpp = mod->bpp; width = cache_bitmap_v2_order->bitmapWidth; height = cache_bitmap_v2_order->bitmapHeight; bytes = width * height * server_Bpp + 16; dst_data = (char *)g_malloc(bytes, 0); if (cache_bitmap_v2_order->compressed) { bitmap_decompress(cache_bitmap_v2_order->bitmapDataStream, (tui8 *)dst_data, width, height, cache_bitmap_v2_order->bitmapLength, server_bpp, server_bpp); } else { /* Uncompressed bitmaps are upside down */ lfreerdp_upsidedown((tui8 *)dst_data, cache_bitmap_v2_order, server_Bpp); LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_cache_bitmapV2: upside down progressed"); } dst_data1 = convert_bitmap(server_bpp, client_bpp, dst_data, width, height, mod->colormap); g_free(mod->bitmap_cache[id][idx].data); mod->bitmap_cache[id][idx].width = width; mod->bitmap_cache[id][idx].height = height; mod->bitmap_cache[id][idx].data = dst_data1; if (dst_data != dst_data1) { g_free(dst_data); } } /******************************************************************************/ static void lfreerdp_cache_glyph(rdpContext *context, CACHE_GLYPH_ORDER *cache_glyph_order) { int index; GLYPH_DATA *gd; struct mod *mod; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_cache_glyph: %d", cache_glyph_order->cGlyphs); for (index = 0; index < cache_glyph_order->cGlyphs; index++) { gd = cache_glyph_order->glyphData[index]; LOG_DEVEL(LOG_LEVEL_DEBUG, " %d %d %d %d %d", gd->cacheIndex, gd->x, gd->y, gd->cx, gd->cy); mod->server_add_char(mod, cache_glyph_order->cacheId, gd->cacheIndex, gd->x, gd->y, gd->cx, gd->cy, (char *)(gd->aj)); free(gd->aj); gd->aj = 0; free(gd); cache_glyph_order->glyphData[index] = 0; } free(cache_glyph_order->unicodeCharacters); cache_glyph_order->unicodeCharacters = 0; } /******************************************************************************/ static void lfreerdp_cache_brush(rdpContext *context, CACHE_BRUSH_ORDER *cache_brush_order) { int idx; int bytes; int bpp; int cx; int cy; struct mod *mod; mod = ((struct mod_context *)context)->modi; bpp = cache_brush_order->bpp; cx = cache_brush_order->cx; cy = cache_brush_order->cy; idx = cache_brush_order->index; bytes = cache_brush_order->length; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_cache_brush: bpp %d cx %d cy %d idx %d bytes %d", bpp, cx, cy, idx, bytes); if ((idx < 0) || (idx >= 64)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_cache_brush: error idx %d", idx); return; } if ((bpp != 1) || (cx != 8) || (cy != 8)) { LOG(LOG_LEVEL_ERROR, "lfreerdp_cache_brush: error unsupported brush " "bpp %d cx %d cy %d", bpp, cx, cy); return; } mod->brush_cache[idx].bpp = bpp; mod->brush_cache[idx].width = cx; mod->brush_cache[idx].height = cy; mod->brush_cache[idx].data = mod->brush_cache[idx].b8x8; if (bytes > 8) { bytes = 8; } g_memset(mod->brush_cache[idx].data, 0, 8); if (bytes > 0) { if (bytes > 8) { LOG_DEVEL(LOG_LEVEL_INFO, "lfreerdp_cache_brush: bytes too big %d", bytes); bytes = 8; } g_memcpy(mod->brush_cache[idx].data, cache_brush_order->data, bytes); } LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_cache_brush: out bpp %d cx %d cy %d idx %d bytes %d", bpp, cx, cy, idx, bytes); free(cache_brush_order->data); cache_brush_order->data = 0; } /******************************************************************************/ static void lfreerdp_pointer_position(rdpContext *context, POINTER_POSITION_UPDATE *pointer_position) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_position: - no code here"); } /******************************************************************************/ static void lfreerdp_pointer_system(rdpContext *context, POINTER_SYSTEM_UPDATE *pointer_system) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_system: - no code here type value = %d", pointer_system->type); } /******************************************************************************/ static void lfreerdp_pointer_color(rdpContext *context, POINTER_COLOR_UPDATE *pointer_color) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_color: - no code here"); } /******************************************************************************/ static int lfreerdp_get_pixel(void *bits, int width, int height, int bpp, int delta, int x, int y) { int start; int shift; int pixel; tui8 *src8; if (bpp == 1) { src8 = (tui8 *)bits; start = (y * delta) + x / 8; shift = x % 8; pixel = (src8[start] & (0x80 >> shift)) != 0; return pixel ? 0xffffff : 0; } else if (bpp == 32) { src8 = (tui8 *)bits; src8 += y * delta + x * 4; pixel = ((int *)(src8))[0]; return pixel; } else { LOG(LOG_LEVEL_WARNING, "lfreerdp_get_pixel: unknown bpp %d", bpp); } return 0; } /******************************************************************************/ static int lfreerdp_set_pixel(int pixel, void *bits, int width, int height, int bpp, int delta, int x, int y) { tui8 *dst8; int start; int shift; if (bpp == 1) { dst8 = (tui8 *)bits; start = (y * delta) + x / 8; shift = x % 8; if (pixel) { dst8[start] = dst8[start] | (0x80 >> shift); } else { dst8[start] = dst8[start] & ~(0x80 >> shift); } } else if (bpp == 24) { dst8 = (tui8 *)bits; dst8 += y * delta + x * 3; dst8[0] = (pixel >> 0) & 0xff; dst8[1] = (pixel >> 8) & 0xff; dst8[2] = (pixel >> 16) & 0xff; } else if (bpp == 32) { dst8 = (tui8 *)bits; dst8 += y * delta + x * 4; ((int *)(dst8))[0] = pixel; } else { LOG(LOG_LEVEL_WARNING, "lfreerdp_set_pixel: unknown bpp %d", bpp); } return 0; } /******************************************************************************/ static int lfreerdp_convert_color_image(void *dst, int dst_width, int dst_height, int dst_bpp, int dst_delta, void *src, int src_width, int src_height, int src_bpp, int src_delta) { int i; int j; int pixel; for (j = 0; j < dst_height; j++) { for (i = 0; i < dst_width; i++) { pixel = lfreerdp_get_pixel(src, src_width, src_height, src_bpp, src_delta, i, j); lfreerdp_set_pixel(pixel, dst, dst_width, dst_height, dst_bpp, dst_delta, i, j); } } return 0; } /******************************************************************************/ static void lfreerdp_pointer_new(rdpContext *context, POINTER_NEW_UPDATE *pointer_new) { struct mod *mod; int index; int bytes_per_pixel; int bits_per_pixel; tui8 *dst; tui8 *src; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_new:"); LOG_DEVEL(LOG_LEVEL_DEBUG, " bpp %d", pointer_new->xorBpp); LOG_DEVEL(LOG_LEVEL_DEBUG, " width %d height %d", pointer_new->colorPtrAttr.width, pointer_new->colorPtrAttr.height); LOG_DEVEL(LOG_LEVEL_DEBUG, " lengthXorMask %d lengthAndMask %d", pointer_new->colorPtrAttr.lengthXorMask, pointer_new->colorPtrAttr.lengthAndMask); index = pointer_new->colorPtrAttr.cacheIndex; if (index >= 32) { LOG(LOG_LEVEL_ERROR, "lfreerdp_pointer_new: pointer index too big"); return ; } if (pointer_new->xorBpp == 1 && pointer_new->colorPtrAttr.width == 32 && pointer_new->colorPtrAttr.height == 32) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_new:"); mod->pointer_cache[index].hotx = pointer_new->colorPtrAttr.xPos; mod->pointer_cache[index].hoty = pointer_new->colorPtrAttr.yPos; mod->pointer_cache[index].bpp = 0; dst = (tui8 *)(mod->pointer_cache[index].data); dst += 32 * 32 * 3 - 32 * 3; src = pointer_new->colorPtrAttr.xorMaskData; lfreerdp_convert_color_image(dst, 32, 32, 24, 32 * -3, src, 32, 32, 1, 32 / 8); dst = (tui8 *)(mod->pointer_cache[index].mask); dst += ( 32 * 32 / 8) - (32 / 8); src = pointer_new->colorPtrAttr.andMaskData; lfreerdp_convert_color_image(dst, 32, 32, 1, 32 / -8, src, 32, 32, 1, 32 / 8); } else if (pointer_new->xorBpp >= 8 && pointer_new->colorPtrAttr.width == 32 && pointer_new->colorPtrAttr.height == 32) { bytes_per_pixel = (pointer_new->xorBpp + 7) / 8; bits_per_pixel = pointer_new->xorBpp; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_new: bpp %d Bpp %d", bits_per_pixel, bytes_per_pixel); mod->pointer_cache[index].hotx = pointer_new->colorPtrAttr.xPos; mod->pointer_cache[index].hoty = pointer_new->colorPtrAttr.yPos; mod->pointer_cache[index].bpp = bits_per_pixel; memcpy(mod->pointer_cache[index].data, pointer_new->colorPtrAttr.xorMaskData, 32 * 32 * bytes_per_pixel); memcpy(mod->pointer_cache[index].mask, pointer_new->colorPtrAttr.andMaskData, 32 * (32 / 8)); } else { LOG(LOG_LEVEL_WARNING, "lfreerdp_pointer_new: error bpp %d width %d height %d index: %d", pointer_new->xorBpp, pointer_new->colorPtrAttr.width, pointer_new->colorPtrAttr.height, index); } mod->server_set_pointer_ex(mod, mod->pointer_cache[index].hotx, mod->pointer_cache[index].hoty, mod->pointer_cache[index].data, mod->pointer_cache[index].mask, mod->pointer_cache[index].bpp); free(pointer_new->colorPtrAttr.xorMaskData); pointer_new->colorPtrAttr.xorMaskData = 0; free(pointer_new->colorPtrAttr.andMaskData); pointer_new->colorPtrAttr.andMaskData = 0; } /******************************************************************************/ static void lfreerdp_pointer_cached(rdpContext *context, POINTER_CACHED_UPDATE *pointer_cached) { struct mod *mod; int index; mod = ((struct mod_context *)context)->modi; index = pointer_cached->cacheIndex; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pointer_cached:%d", index); mod->server_set_pointer_ex(mod, mod->pointer_cache[index].hotx, mod->pointer_cache[index].hoty, mod->pointer_cache[index].data, mod->pointer_cache[index].mask, mod->pointer_cache[index].bpp); } /******************************************************************************/ static void lfreerdp_polygon_cb(rdpContext *context, POLYGON_CB_ORDER *polygon_cb) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_polygon_cb called:- not supported!!!!!!!!!!!!!!!!!!!!"); } /******************************************************************************/ static void lfreerdp_polygon_sc(rdpContext *context, POLYGON_SC_ORDER *polygon_sc) { struct mod *mod; int i; struct { short x, y; } points[4]; int fgcolor; int server_bpp, client_bpp; mod = ((struct mod_context *)context)->modi; LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_polygon_sc :%d(points) %d(color) %d(fillmode) " "%d(bRop) %d(cbData) %d(x) %d(y)", polygon_sc->nDeltaEntries, polygon_sc->brushColor, polygon_sc->fillMode, polygon_sc->bRop2, polygon_sc->cbData, polygon_sc->xStart, polygon_sc->yStart); if (polygon_sc->nDeltaEntries == 3) { server_bpp = mod->inst->settings->color_depth; client_bpp = mod->bpp; points[0].x = polygon_sc->xStart; points[0].y = polygon_sc->yStart; for (i = 0; i < polygon_sc->nDeltaEntries; i++) { points[i + 1].x = 0; // polygon_sc->points[i].x; points[i + 1].y = 0; // polygon_sc->points[i].y; } fgcolor = convert_color(server_bpp, client_bpp, polygon_sc->brushColor, mod->colormap); mod->server_set_opcode(mod, polygon_sc->bRop2); mod->server_set_bgcolor(mod, 255); mod->server_set_fgcolor(mod, fgcolor); mod->server_set_pen(mod, 1, 1); // style, width // TODO replace with correct brush; this is a workaround // This workaround handles the text cursor in microsoft word. mod->server_draw_line(mod, polygon_sc->xStart, polygon_sc->yStart, polygon_sc->xStart, polygon_sc->yStart + points[2].y); // mod->server_fill_rect(mod, points[0].x, points[0].y, // points[0].x-points[3].x, points[0].y-points[2].y); // mod->server_set_brush(mod,); // howto use this on our indata?? mod->server_set_opcode(mod, 0xcc); } else { LOG(LOG_LEVEL_WARNING, "Not handled number of points in lfreerdp_polygon_sc"); } } /******************************************************************************/ static void lfreerdp_synchronize(rdpContext *context) { /* Uncomment these two lines when needed */ #if 0 struct mod *mod; mod = ((struct mod_context *)context)->modi; #endif LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_synchronize received - not handled"); } /******************************************************************************/ static boolean lfreerdp_pre_connect(freerdp *instance) { struct mod *mod; int index; int error; int num_chans; int target_chan; int ch_flags; char ch_name[256]; const char *ch_names[MAX_STATIC_CHANNELS]; char *dst_ch_name; LOG_DEVEL(LOG_LEVEL_INFO, "lfreerdp_pre_connect:"); mod = ((struct mod_context *)(instance->context))->modi; verifyColorMap(mod); num_chans = mod->server_get_channel_count(mod); if (num_chans < 0) { LOG(LOG_LEVEL_ERROR, "lfreerdp_pre_connect: Can't get channel count"); num_chans = 0; } target_chan = 0; for (index = 0 ; index < num_chans; ++index) { error = mod->server_query_channel(mod, index, ch_name, &ch_flags); if (error == 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_pre_connect: " "got channel [%s], id [%d], flags [0x%8.8x]", ch_name, index, ch_flags); if (g_strcmp(ch_name, DRDYNVC_SVC_CHANNEL_NAME) == 0) { /* xrdp currently reserves dynamic channels for its * exclusive use (e.g. for GFX support) */ LOG(LOG_LEVEL_INFO, "Channel '%s' not passed to module", ch_name); } else if (target_chan < MAX_STATIC_CHANNELS) { dst_ch_name = instance->settings->channels[target_chan].name; ch_names[target_chan] = dst_ch_name; g_memset(dst_ch_name, 0, CHANNEL_NAME_LEN + 1); g_snprintf(dst_ch_name, CHANNEL_NAME_LEN + 1, "%s", ch_name); instance->settings->channels[target_chan].options = ch_flags; ++target_chan; } } } g_strnjoin(ch_name, sizeof(ch_name), ",", ch_names, target_chan); LOG(LOG_LEVEL_INFO, "Static channels (from %d) passed to module : %s", num_chans, ch_name); instance->settings->num_channels = target_chan; instance->settings->offscreen_bitmap_cache = 0; instance->settings->draw_nine_grid = 0; instance->settings->glyph_cache = true; /* GLYPH_SUPPORT_FULL and GLYPH_SUPPORT_PARTIAL seem to be the same */ /* disabled as workaround for corrupted display like black bars left of cmd with W2K8 */ /* instance->settings->glyphSupportLevel = GLYPH_SUPPORT_FULL; */ instance->settings->glyphSupportLevel = GLYPH_SUPPORT_NONE; instance->settings->order_support[NEG_DSTBLT_INDEX] = 1; /* 0x00 */ instance->settings->order_support[NEG_PATBLT_INDEX] = 1; instance->settings->order_support[NEG_SCRBLT_INDEX] = 1; instance->settings->order_support[NEG_MEMBLT_INDEX] = 1; instance->settings->order_support[NEG_MEM3BLT_INDEX] = 0; instance->settings->order_support[NEG_ATEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_AEXTTEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_DRAWNINEGRID_INDEX] = 0; instance->settings->order_support[NEG_LINETO_INDEX] = 1; /* 0x08 */ instance->settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = 0; instance->settings->order_support[NEG_OPAQUE_RECT_INDEX] = 1; instance->settings->order_support[NEG_SAVEBITMAP_INDEX] = 0; instance->settings->order_support[NEG_WTEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_MEMBLT_V2_INDEX] = 1; instance->settings->order_support[NEG_MEM3BLT_V2_INDEX] = 0; instance->settings->order_support[NEG_MULTIDSTBLT_INDEX] = 0; instance->settings->order_support[NEG_MULTIPATBLT_INDEX] = 0; /* 0x10 */ instance->settings->order_support[NEG_MULTISCRBLT_INDEX] = 0; instance->settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = 0; instance->settings->order_support[NEG_FAST_INDEX_INDEX] = 0; instance->settings->order_support[NEG_POLYGON_SC_INDEX] = 0; instance->settings->order_support[NEG_POLYGON_CB_INDEX] = 0; instance->settings->order_support[NEG_POLYLINE_INDEX] = 0; /* 0x17 missing */ instance->settings->order_support[NEG_FAST_GLYPH_INDEX] = 0; /* 0x18 */ instance->settings->order_support[NEG_ELLIPSE_SC_INDEX] = 0; instance->settings->order_support[NEG_ELLIPSE_CB_INDEX] = 0; /* disabled as workaround for corrupted display like black bars left of cmd with W2K8 */ /* instance->settings->order_support[NEG_GLYPH_INDEX_INDEX] = 1; */ instance->settings->order_support[NEG_GLYPH_INDEX_INDEX] = 0; instance->settings->order_support[NEG_GLYPH_WEXTTEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_GLYPH_WLONGTEXTOUT_INDEX] = 0; instance->settings->order_support[NEG_GLYPH_WLONGEXTTEXTOUT_INDEX] = 0; /* 0x1F missing*/ instance->settings->bitmap_cache = 1; instance->settings->bitmapCacheV2NumCells = 3; // 5; instance->settings->bitmapCacheV2CellInfo[0].numEntries = 600; // 0x78; instance->settings->bitmapCacheV2CellInfo[0].persistent = 0; instance->settings->bitmapCacheV2CellInfo[1].numEntries = 600; //0x78; // 600; instance->settings->bitmapCacheV2CellInfo[1].persistent = 0; instance->settings->bitmapCacheV2CellInfo[2].numEntries = 2048; //0x150; // 2048; instance->settings->bitmapCacheV2CellInfo[2].persistent = 0; instance->settings->bitmapCacheV2CellInfo[3].numEntries = 4096; // 4096; instance->settings->bitmapCacheV2CellInfo[3].persistent = 0; instance->settings->bitmapCacheV2CellInfo[4].numEntries = 2048; // 2048; instance->settings->bitmapCacheV2CellInfo[4].persistent = 0; instance->settings->bitmap_cache_v3 = 1; instance->settings->username = g_strdup(mod->username); instance->settings->password = g_strdup(mod->password); instance->settings->domain = g_strdup(mod->domain); if (mod->client_info.rail_enable && (mod->client_info.rail_support_level > 0)) { LOG_DEVEL(LOG_LEVEL_INFO, "Railsupport !!!!!!!!!!!!!!!!!!"); instance->settings->remote_app = 1; instance->settings->rail_langbar_supported = 1; instance->settings->workarea = 1; instance->settings->performance_flags = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG; instance->settings->num_icon_caches = mod->client_info.wnd_num_icon_caches; instance->settings->num_icon_cache_entries = mod->client_info.wnd_num_icon_cache_entries; } else { LOG_DEVEL(LOG_LEVEL_DEBUG, "Special PerformanceFlags changed"); instance->settings->performance_flags = PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS | PERF_DISABLE_THEMING; // | PERF_DISABLE_CURSOR_SHADOW | PERF_DISABLE_CURSORSETTINGS; } /* Allow users or administrators to configure the mstsc experience settings. #1903 */ if ((mod->allow_client_experiencesettings == 1) && (mod->client_info.mcs_connection_type == CONNECTION_TYPE_AUTODETECT)) { /* auto-detect not yet supported - use default performance settings */ } else if (mod->allow_client_experiencesettings == 1) { instance->settings->performance_flags = (mod->client_info.rdp5_performanceflags & /* Mask to avoid accepting invalid flags. */ (PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS | PERF_DISABLE_THEMING | PERF_DISABLE_CURSOR_SHADOW | PERF_DISABLE_CURSORSETTINGS | PERF_ENABLE_FONT_SMOOTHING | PERF_ENABLE_DESKTOP_COMPOSITION)); LOG(LOG_LEVEL_DEBUG, "RDP client experience settings, " "rdp5_performance_flags:[0x%08x], " "masked performance_flags:[0x%08x]", mod->client_info.rdp5_performanceflags, instance->settings->performance_flags); if (mod->client_info.rail_enable && (mod->client_info.rail_support_level > 0)) { instance->settings->performance_flags |= (PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG); LOG(LOG_LEVEL_DEBUG, "Add in performance setting for Railsupport:" "[0x%08x]", PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG); } } LOG(LOG_LEVEL_DEBUG, "before overriding performance_flags:[0x%08x]", instance->settings->performance_flags); LOG(LOG_LEVEL_DEBUG, "perf_settings_override_mask:[0x%08x], " "perf_settings_values_mask:[0x%08x]", mod->perf_settings_override_mask, mod->perf_settings_values_mask); /* Clear bits for any overridden performance settings */ instance->settings->performance_flags &= ~mod->perf_settings_override_mask; /* Add in overridden performance settings */ instance->settings->performance_flags |= mod->perf_settings_values_mask; LOG(LOG_LEVEL_DEBUG, "final performance_flags:[0x%08x]", instance->settings->performance_flags); instance->settings->compression = 0; instance->settings->ignore_certificate = 1; // Multi Monitor Settings const struct display_size_description *display_sizes = &mod->client_info.display_sizes; instance->settings->num_monitors = display_sizes->monitorCount; for (index = 0; index < display_sizes->monitorCount; index++) { instance->settings->monitors[index].x = display_sizes->minfo[index].left; instance->settings->monitors[index].y = display_sizes->minfo[index].top; instance->settings->monitors[index].width = display_sizes->minfo[index].right; instance->settings->monitors[index].height = display_sizes->minfo[index].bottom; instance->settings->monitors[index].is_primary = display_sizes->minfo[index].is_primary; } instance->update->BeginPaint = lfreerdp_begin_paint; instance->update->EndPaint = lfreerdp_end_paint; instance->update->SetBounds = lfreerdp_set_bounds; instance->update->BitmapUpdate = lfreerdp_bitmap_update; instance->update->Synchronize = lfreerdp_synchronize; instance->update->primary->DstBlt = lfreerdp_dst_blt; instance->update->primary->PatBlt = lfreerdp_pat_blt; instance->update->primary->ScrBlt = lfreerdp_scr_blt; instance->update->primary->OpaqueRect = lfreerdp_opaque_rect; instance->update->primary->MemBlt = lfreerdp_mem_blt; instance->update->primary->GlyphIndex = lfreerdp_glyph_index; instance->update->primary->LineTo = lfreerdp_line_to; instance->update->primary->PolygonSC = lfreerdp_polygon_sc ; instance->update->primary->PolygonCB = lfreerdp_polygon_cb; instance->update->secondary->CacheBitmap = lfreerdp_cache_bitmap; instance->update->secondary->CacheBitmapV2 = lfreerdp_cache_bitmapV2; instance->update->secondary->CacheGlyph = lfreerdp_cache_glyph; instance->update->secondary->CacheBrush = lfreerdp_cache_brush; instance->update->pointer->PointerPosition = lfreerdp_pointer_position; instance->update->pointer->PointerSystem = lfreerdp_pointer_system; instance->update->pointer->PointerColor = lfreerdp_pointer_color; instance->update->pointer->PointerNew = lfreerdp_pointer_new; instance->update->pointer->PointerCached = lfreerdp_pointer_cached; if ((mod->username[0] != 0) && (mod->password[0] != 0)) { /* since we have username and password, we can try nla */ instance->settings->nla_security = 1; } else { instance->settings->nla_security = 0; } return 1; } /*****************************************************************************/ void lrail_WindowCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, WINDOW_STATE_ORDER *window_state) { int index; struct mod *mod; struct rail_window_state_order wso; UNICONV *uniconv; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_WindowCreate:"); uniconv = freerdp_uniconv_new(); mod = ((struct mod_context *)context)->modi; memset(&wso, 0, sizeof(wso)); /* copy the window state order */ wso.owner_window_id = window_state->ownerWindowId; wso.style = window_state->style; wso.extended_style = window_state->extendedStyle; wso.show_state = window_state->showState; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE) { wso.title_info = freerdp_uniconv_in(uniconv, window_state->titleInfo.string, window_state->titleInfo.length); } LOG_DEVEL(LOG_LEVEL_DEBUG, "lrail_WindowCreate: %s", wso.title_info); wso.client_offset_x = window_state->clientOffsetX; wso.client_offset_y = window_state->clientOffsetY; wso.client_area_width = window_state->clientAreaWidth; wso.client_area_height = window_state->clientAreaHeight; wso.rp_content = window_state->RPContent; wso.root_parent_handle = window_state->rootParentHandle; wso.window_offset_x = window_state->windowOffsetX; wso.window_offset_y = window_state->windowOffsetY; wso.window_client_delta_x = window_state->windowClientDeltaX; wso.window_client_delta_y = window_state->windowClientDeltaY; wso.window_width = window_state->windowWidth; wso.window_height = window_state->windowHeight; wso.num_window_rects = window_state->numWindowRects; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS) { wso.window_rects = (struct rail_window_rect *) g_malloc(sizeof(struct rail_window_rect) * wso.num_window_rects, 0); for (index = 0; index < wso.num_window_rects; index++) { wso.window_rects[index].left = window_state->windowRects[index].left; wso.window_rects[index].top = window_state->windowRects[index].top; wso.window_rects[index].right = window_state->windowRects[index].right; wso.window_rects[index].bottom = window_state->windowRects[index].bottom; } } wso.visible_offset_x = window_state->visibleOffsetX; wso.visible_offset_y = window_state->visibleOffsetY; wso.num_visibility_rects = window_state->numVisibilityRects; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY) { wso.visibility_rects = (struct rail_window_rect *) g_malloc(sizeof(struct rail_window_rect) * wso.num_visibility_rects, 0); for (index = 0; index < wso.num_visibility_rects; index++) { wso.visibility_rects[index].left = window_state->visibilityRects[index].left; wso.visibility_rects[index].top = window_state->visibilityRects[index].top; wso.visibility_rects[index].right = window_state->visibilityRects[index].right; wso.visibility_rects[index].bottom = window_state->visibilityRects[index].bottom; } } mod->server_window_new_update(mod, orderInfo->windowId, &wso, orderInfo->fieldFlags); free(wso.title_info); g_free(wso.window_rects); g_free(wso.visibility_rects); } /*****************************************************************************/ void lrail_WindowUpdate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, WINDOW_STATE_ORDER *window_state) { LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_WindowUpdate:"); lrail_WindowCreate(context, orderInfo, window_state); } /*****************************************************************************/ void lrail_WindowDelete(rdpContext *context, WINDOW_ORDER_INFO *orderInfo) { struct mod *mod; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_WindowDelete:"); mod = ((struct mod_context *)context)->modi; mod->server_window_delete(mod, orderInfo->windowId); } /*****************************************************************************/ void lrail_WindowIcon(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, WINDOW_ICON_ORDER *window_icon) { struct mod *mod; struct rail_icon_info rii; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_WindowIcon:"); mod = ((struct mod_context *)context)->modi; memset(&rii, 0, sizeof(rii)); rii.bpp = window_icon->iconInfo->bpp; rii.width = window_icon->iconInfo->width; rii.height = window_icon->iconInfo->height; rii.cmap_bytes = window_icon->iconInfo->cbColorTable; rii.mask_bytes = window_icon->iconInfo->cbBitsMask; rii.data_bytes = window_icon->iconInfo->cbBitsColor; rii.mask = (char *)(window_icon->iconInfo->bitsMask); rii.cmap = (char *)(window_icon->iconInfo->colorTable); rii.data = (char *)(window_icon->iconInfo->bitsColor); mod->server_window_icon(mod, orderInfo->windowId, window_icon->iconInfo->cacheEntry, window_icon->iconInfo->cacheId, &rii, orderInfo->fieldFlags); } /*****************************************************************************/ void lrail_WindowCachedIcon(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, WINDOW_CACHED_ICON_ORDER *window_cached_icon) { struct mod *mod; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_WindowCachedIcon:"); mod = ((struct mod_context *)context)->modi; mod->server_window_cached_icon(mod, orderInfo->windowId, window_cached_icon->cachedIcon.cacheEntry, window_cached_icon->cachedIcon.cacheId, orderInfo->fieldFlags); } /*****************************************************************************/ void lrail_NotifyIconCreate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, NOTIFY_ICON_STATE_ORDER *notify_icon_state) { struct mod *mod; struct rail_notify_state_order rnso; UNICONV *uniconv; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_NotifyIconCreate:"); uniconv = freerdp_uniconv_new(); mod = ((struct mod_context *)context)->modi; memset(&rnso, 0, sizeof(rnso)); rnso.version = notify_icon_state->version; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_TIP) { rnso.tool_tip = freerdp_uniconv_in(uniconv, notify_icon_state->toolTip.string, notify_icon_state->toolTip.length); } if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP) { rnso.infotip.timeout = notify_icon_state->infoTip.timeout; rnso.infotip.flags = notify_icon_state->infoTip.flags; rnso.infotip.text = freerdp_uniconv_in(uniconv, notify_icon_state->infoTip.text.string, notify_icon_state->infoTip.text.length); rnso.infotip.title = freerdp_uniconv_in(uniconv, notify_icon_state->infoTip.title.string, notify_icon_state->infoTip.title.length); } rnso.state = notify_icon_state->state; rnso.icon_cache_entry = notify_icon_state->icon.cacheEntry; rnso.icon_cache_id = notify_icon_state->icon.cacheId; rnso.icon_info.bpp = notify_icon_state->icon.bpp; rnso.icon_info.width = notify_icon_state->icon.width; rnso.icon_info.height = notify_icon_state->icon.height; rnso.icon_info.cmap_bytes = notify_icon_state->icon.cbColorTable; rnso.icon_info.mask_bytes = notify_icon_state->icon.cbBitsMask; rnso.icon_info.data_bytes = notify_icon_state->icon.cbBitsColor; rnso.icon_info.mask = (char *)(notify_icon_state->icon.bitsMask); rnso.icon_info.cmap = (char *)(notify_icon_state->icon.colorTable); rnso.icon_info.data = (char *)(notify_icon_state->icon.bitsColor); mod->server_notify_new_update(mod, orderInfo->windowId, orderInfo->notifyIconId, &rnso, orderInfo->fieldFlags); free(rnso.tool_tip); free(rnso.infotip.text); free(rnso.infotip.title); } /*****************************************************************************/ void lrail_NotifyIconUpdate(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, NOTIFY_ICON_STATE_ORDER *notify_icon_state) { LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_NotifyIconUpdate:"); lrail_NotifyIconCreate(context, orderInfo, notify_icon_state); } /*****************************************************************************/ void lrail_NotifyIconDelete(rdpContext *context, WINDOW_ORDER_INFO *orderInfo) { struct mod *mod; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_NotifyIconDelete:"); mod = ((struct mod_context *)context)->modi; mod->server_notify_delete(mod, orderInfo->windowId, orderInfo->notifyIconId); } /*****************************************************************************/ void lrail_MonitoredDesktop(rdpContext *context, WINDOW_ORDER_INFO *orderInfo, MONITORED_DESKTOP_ORDER *monitored_desktop) { int index; struct mod *mod; struct rail_monitored_desktop_order rmdo; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_MonitoredDesktop:"); mod = ((struct mod_context *)context)->modi; memset(&rmdo, 0, sizeof(rmdo)); rmdo.active_window_id = monitored_desktop->activeWindowId; rmdo.num_window_ids = monitored_desktop->numWindowIds; if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER) { if (rmdo.num_window_ids > 0) { rmdo.window_ids = (int *)g_malloc(sizeof(int) * rmdo.num_window_ids, 0); for (index = 0; index < rmdo.num_window_ids; index++) { rmdo.window_ids[index] = monitored_desktop->windowIds[index]; } } } mod->server_monitored_desktop(mod, &rmdo, orderInfo->fieldFlags); g_free(rmdo.window_ids); } /*****************************************************************************/ void lrail_NonMonitoredDesktop(rdpContext *context, WINDOW_ORDER_INFO *orderInfo) { struct mod *mod; struct rail_monitored_desktop_order rmdo; LOG_DEVEL(LOG_LEVEL_TRACE, "lrail_NonMonitoredDesktop:"); mod = ((struct mod_context *)context)->modi; memset(&rmdo, 0, sizeof(rmdo)); mod->server_monitored_desktop(mod, &rmdo, orderInfo->fieldFlags); } /******************************************************************************/ static boolean lfreerdp_post_connect(freerdp *instance) { struct mod *mod; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_post_connect:"); mod = ((struct mod_context *)(instance->context))->modi; g_memset(mod->password, 0, sizeof(mod->password)); mod->inst->update->window->WindowCreate = lrail_WindowCreate; mod->inst->update->window->WindowUpdate = lrail_WindowUpdate; mod->inst->update->window->WindowDelete = lrail_WindowDelete; mod->inst->update->window->WindowIcon = lrail_WindowIcon; mod->inst->update->window->WindowCachedIcon = lrail_WindowCachedIcon; mod->inst->update->window->NotifyIconCreate = lrail_NotifyIconCreate; mod->inst->update->window->NotifyIconUpdate = lrail_NotifyIconUpdate; mod->inst->update->window->NotifyIconDelete = lrail_NotifyIconDelete; mod->inst->update->window->MonitoredDesktop = lrail_MonitoredDesktop; mod->inst->update->window->NonMonitoredDesktop = lrail_NonMonitoredDesktop; return 1; } /******************************************************************************/ static void lfreerdp_context_new(freerdp *instance, rdpContext *context) { LOG_DEVEL(LOG_LEVEL_INFO, "lfreerdp_context_new: %p", context); } /******************************************************************************/ static void lfreerdp_context_free(freerdp *instance, rdpContext *context) { LOG_DEVEL(LOG_LEVEL_INFO, "lfreerdp_context_free: - no code here"); } /******************************************************************************/ static int lfreerdp_receive_channel_data(freerdp *instance, int channelId, uint8 *data, int size, int flags, int total_size) { struct mod *mod; int lchid; int index; int error; mod = ((struct mod_context *)(instance->context))->modi; lchid = -1; for (index = 0; index < instance->settings->num_channels; index++) { if (instance->settings->channels[index].channel_id == channelId) { lchid = index; break; } } if (lchid >= 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_receive_channel_data: server to client, chanid: %d", lchid); error = mod->server_send_to_channel(mod, lchid, (char *)data, size, total_size, flags); if (error != 0) { LOG(LOG_LEVEL_ERROR, "lfreerdp_receive_channel_data: error %d", error); } } else { LOG(LOG_LEVEL_ERROR, "lfreerdp_receive_channel_data: bad lchid"); } return 0; } /******************************************************************************/ static boolean lfreerdp_authenticate(freerdp *instance, char **username, char **password, char **domain) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_authenticate: - no code here"); return 1; } /******************************************************************************/ static boolean lfreerdp_verify_certificate(freerdp *instance, char *subject, char *issuer, char *fingerprint) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_verify_certificate: - no code here"); return 1; } /******************************************************************************/ static int lfreerdp_session_info(freerdp *instance, uint8 *data, int data_bytes) { struct mod *mod; int error; LOG_DEVEL(LOG_LEVEL_TRACE, "lfreerdp_session_info:"); error = 0; mod = ((struct mod_context *)(instance->context))->modi; if (mod != 0) { LOG_DEVEL(LOG_LEVEL_DEBUG, "lfreerdp_session_info: mod->server_session_info %p", mod->server_session_info); if (mod->server_session_info != 0) { error = mod->server_session_info(mod, (char *)data, data_bytes); } } return error; } /******************************************************************************/ tintptr EXPORT_CC mod_init(void) { struct mod *mod; modContext *lcon; LOG_DEVEL(LOG_LEVEL_TRACE, "mod_init:"); mod = (struct mod *)g_malloc(sizeof(struct mod), 1); freerdp_get_version(&(mod->vmaj), &(mod->vmin), &(mod->vrev)); LOG(LOG_LEVEL_INFO, " FreeRDP version major %d minor %d revision %d", mod->vmaj, mod->vmin, mod->vrev); mod->size = sizeof(struct mod); mod->version = CURRENT_MOD_VER; mod->handle = (tintptr) mod; mod->mod_connect = lxrdp_connect; mod->mod_start = lxrdp_start; mod->mod_event = lxrdp_event; mod->mod_signal = lxrdp_signal; mod->mod_end = lxrdp_end; mod->mod_set_param = lxrdp_set_param; mod->mod_session_change = lxrdp_session_change; mod->mod_get_wait_objs = lxrdp_get_wait_objs; mod->mod_check_wait_objs = lxrdp_check_wait_objs; mod->mod_frame_ack = lxrdp_frame_ack; mod->mod_suppress_output = lxrdp_suppress_output; mod->mod_server_version_message = lxrdp_server_version_message; mod->mod_server_monitor_resize = lxrdp_server_monitor_resize; mod->mod_server_monitor_full_invalidate = lxrdp_server_monitor_full_invalidate; mod->inst = freerdp_new(); mod->inst->PreConnect = lfreerdp_pre_connect; mod->inst->PostConnect = lfreerdp_post_connect; mod->inst->context_size = sizeof(modContext); mod->inst->ContextNew = lfreerdp_context_new; mod->inst->ContextFree = lfreerdp_context_free; mod->inst->ReceiveChannelData = lfreerdp_receive_channel_data; mod->inst->Authenticate = lfreerdp_authenticate; mod->inst->VerifyCertificate = lfreerdp_verify_certificate; #if defined(VERSION_STRUCT_RDP_FREERDP) #if VERSION_STRUCT_RDP_FREERDP > 0 mod->inst->SessionInfo = lfreerdp_session_info; #endif #endif freerdp_context_new(mod->inst); lcon = (modContext *)(mod->inst->context); lcon->modi = mod; LOG_DEVEL(LOG_LEVEL_DEBUG, "mod_init: mod %p", mod); return (tintptr) mod; } /******************************************************************************/ int EXPORT_CC mod_exit(tintptr handle) { struct mod *mod = (struct mod *) handle; LOG_DEVEL(LOG_LEVEL_TRACE, "mod_exit:"); if (mod == 0) { return 0; } if (mod->inst == NULL) { LOG(LOG_LEVEL_ERROR, "mod_exit - null pointer for inst:"); g_free(mod); return 0 ; } freerdp_disconnect(mod->inst); if ((mod->vmaj == 1) && (mod->vmin == 0) && (mod->vrev == 1)) { /* this version has a bug with double free in freerdp_free */ } else { freerdp_context_free(mod->inst); } freerdp_free(mod->inst); g_free(mod); return 0; } xrdp-0.10.1/neutrinordp/xrdp-color.c000644 001751 000000 00000020150 14652432047 017441 0ustar00metawheel000000 000000 /** * FreeRDP: A Remote Desktop Protocol Server * freerdp wrapper * * Copyright 2011-2012 Jay Sorg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include "xrdp-neutrinordp.h" #include "defines.h" #include "log.h" #include "os_calls.h" #include "string_calls.h" char * convert_bitmap(int in_bpp, int out_bpp, char *bmpdata, int width, int height, int *palette) { char *out; char *src; char *dst; int i; int j; int red; int green; int blue; int pixel; if ((in_bpp == 8) && (out_bpp == 8)) { out = (char *)g_malloc(width * height, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui8 *)src); pixel = palette[pixel]; SPLITCOLOR32(red, green, blue, pixel); pixel = COLOR8(red, green, blue); *dst = pixel; src++; dst++; } } return out; } if ((in_bpp == 8) && (out_bpp == 16)) { out = (char *)g_malloc(width * height * 2, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui8 *)src); pixel = palette[pixel]; SPLITCOLOR32(red, green, blue, pixel); pixel = COLOR16(red, green, blue); *((tui16 *)dst) = pixel; src++; dst += 2; } } return out; } if ((in_bpp == 8) && (out_bpp == 24)) { out = (char *)g_malloc(width * height * 4, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui8 *)src); pixel = palette[pixel]; SPLITCOLOR32(red, green, blue, pixel); pixel = COLOR24RGB(red, green, blue); *((tui32 *)dst) = pixel; src++; dst += 4; } } return out; } if ((in_bpp == 15) && (out_bpp == 16)) { out = (char *)g_malloc(width * height * 2, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui16 *)src); SPLITCOLOR15(red, green, blue, pixel); pixel = COLOR16(red, green, blue); *((tui16 *)dst) = pixel; src += 2; dst += 2; } } return out; } if ((in_bpp == 15) && (out_bpp == 24)) { out = (char *)g_malloc(width * height * 4, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui16 *)src); SPLITCOLOR15(red, green, blue, pixel); pixel = COLOR24RGB(red, green, blue); *((tui32 *)dst) = pixel; src += 2; dst += 4; } } return out; } if ((in_bpp == 15) && (out_bpp == 15)) { return bmpdata; } if ((in_bpp == 16) && (out_bpp == 16)) { return bmpdata; } if ((in_bpp == 16) && (out_bpp == 24)) { out = (char *)g_malloc(width * height * 4, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui16 *)src); SPLITCOLOR16(red, green, blue, pixel); pixel = COLOR24RGB(red, green, blue); *((tui32 *)dst) = pixel; src += 2; dst += 4; } } return out; } if ((in_bpp == 24) && (out_bpp == 24)) { out = (char *)g_malloc(width * height * 4, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { blue = *((tui8 *)src); src++; green = *((tui8 *)src); src++; red = *((tui8 *)src); src++; pixel = COLOR24RGB(red, green, blue); *((tui32 *)dst) = pixel; dst += 4; } } return out; } if ((in_bpp == 32) && (out_bpp == 24)) { return bmpdata; } if ((in_bpp == 32) && (out_bpp == 32)) { return bmpdata; } if ((in_bpp == 16) && (out_bpp == 32)) { out = (char *)g_malloc(width * height * 4, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { pixel = *((tui16 *)src); SPLITCOLOR16(red, green, blue, pixel); pixel = COLOR24RGB(red, green, blue); *((tui32 *)dst) = pixel; src += 2; dst += 4; } } return out; } LOG(LOG_LEVEL_WARNING, "convert_bitmap: error unknown conversion from %d to %d", in_bpp, out_bpp); return 0; } /*****************************************************************************/ /* returns color or 0 */ int convert_color(int in_bpp, int out_bpp, int in_color, int *palette) { int pixel; int red; int green; int blue; if ((in_bpp == 1) && (out_bpp == 24)) { pixel = in_color == 0 ? 0 : 0xffffff; return pixel; } if ((in_bpp == 8) && (out_bpp == 8)) { pixel = palette[in_color]; SPLITCOLOR32(red, green, blue, pixel); pixel = COLOR8(red, green, blue); return pixel; } if ((in_bpp == 8) && (out_bpp == 16)) { pixel = palette[in_color]; SPLITCOLOR32(red, green, blue, pixel); pixel = COLOR16(red, green, blue); return pixel; } if ((in_bpp == 8) && (out_bpp == 24)) { pixel = palette[in_color]; SPLITCOLOR32(red, green, blue, pixel); pixel = COLOR24BGR(red, green, blue); return pixel; } if ((in_bpp == 15) && (out_bpp == 16)) { pixel = in_color; SPLITCOLOR15(red, green, blue, pixel); pixel = COLOR16(red, green, blue); return pixel; } if ((in_bpp == 15) && (out_bpp == 24)) { pixel = in_color; SPLITCOLOR15(red, green, blue, pixel); pixel = COLOR24BGR(red, green, blue); return pixel; } if ((in_bpp == 15) && (out_bpp == 15)) { return in_color; } if ((in_bpp == 16) && (out_bpp == 16)) { return in_color; } if ((in_bpp == 16) && (out_bpp == 24)) { pixel = in_color; SPLITCOLOR16(red, green, blue, pixel); pixel = COLOR24BGR(red, green, blue); return pixel; } if ((in_bpp == 16) && (out_bpp == 32)) { pixel = in_color; SPLITCOLOR16(red, green, blue, pixel); pixel = COLOR24BGR(red, green, blue); return pixel; } if ((in_bpp == 24) && (out_bpp == 24)) { return in_color; } if ((in_bpp == 32) && (out_bpp == 24)) { return in_color; } if ((in_bpp == 32) && (out_bpp == 32)) { return in_color; } LOG(LOG_LEVEL_WARNING, "convert_color: error unknown conversion from %d to %d", in_bpp, out_bpp); return 0; } xrdp-0.10.1/neutrinordp/Makefile.in000644 001751 000000 00000055063 14652432075 017265 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = neutrinordp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) am__DEPENDENCIES_1 = libxrdpneutrinordp_la_DEPENDENCIES = \ $(top_builddir)/common/libcommon.la $(am__DEPENDENCIES_1) am_libxrdpneutrinordp_la_OBJECTS = xrdp-color.lo xrdp-neutrinordp.lo libxrdpneutrinordp_la_OBJECTS = $(am_libxrdpneutrinordp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libxrdpneutrinordp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libxrdpneutrinordp_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/xrdp-color.Plo \ ./$(DEPDIR)/xrdp-neutrinordp.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libxrdpneutrinordp_la_SOURCES) DIST_SOURCES = $(libxrdpneutrinordp_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common \ $(FREERDP_CFLAGS) module_LTLIBRARIES = \ libxrdpneutrinordp.la libxrdpneutrinordp_la_SOURCES = \ xrdp-color.c \ xrdp-color.h \ xrdp-neutrinordp.c \ xrdp-neutrinordp.h libxrdpneutrinordp_la_LIBADD = \ $(top_builddir)/common/libcommon.la \ $(FREERDP_LIBS) libxrdpneutrinordp_la_LDFLAGS = -avoid-version -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign neutrinordp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign neutrinordp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libxrdpneutrinordp.la: $(libxrdpneutrinordp_la_OBJECTS) $(libxrdpneutrinordp_la_DEPENDENCIES) $(EXTRA_libxrdpneutrinordp_la_DEPENDENCIES) $(AM_V_CCLD)$(libxrdpneutrinordp_la_LINK) -rpath $(moduledir) $(libxrdpneutrinordp_la_OBJECTS) $(libxrdpneutrinordp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp-color.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xrdp-neutrinordp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/xrdp-color.Plo -rm -f ./$(DEPDIR)/xrdp-neutrinordp.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/xrdp-color.Plo -rm -f ./$(DEPDIR)/xrdp-neutrinordp.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/pkgconfig/xrdp.pc.in000644 001751 000000 00000000312 14652432047 016506 0ustar00metawheel000000 000000 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: xrdp Description: An open source Remote Desktop Protocol (RDP) server Version: @VERSION@ Cflags: -I${includedir} xrdp-0.10.1/pkgconfig/Makefile.am000644 001751 000000 00000000067 14652432047 016643 0ustar00metawheel000000 000000 pkgconfigdir = @pkgconfigdir@ pkgconfig_DATA = xrdp.pc xrdp-0.10.1/pkgconfig/xrdp-uninstalled.pc.in000644 001751 000000 00000000274 14652432047 021035 0ustar00metawheel000000 000000 abs_top_srcdir=@abs_top_srcdir@ includedir=${abs_top_srcdir}/common Name: xrdp Description: An open source Remote Desktop Protocol (RDP) server Version: @VERSION@ Cflags: -I${includedir} xrdp-0.10.1/pkgconfig/Makefile.in000644 001751 000000 00000040143 14652432075 016654 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = pkgconfig ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = xrdp.pc xrdp-uninstalled.pc CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/xrdp-uninstalled.pc.in $(srcdir)/xrdp.pc.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgconfig_DATA = xrdp.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign pkgconfig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign pkgconfig/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): xrdp.pc: $(top_builddir)/config.status $(srcdir)/xrdp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ xrdp-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/xrdp-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgconfigdir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am \ uninstall-pkgconfigDATA .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/third_party/COPYING-THIRD-PARTY000644 001751 000000 00000002261 14652432047 017767 0ustar00metawheel000000 000000 -- tomlc99: TOML C library MIT License Copyright (c) CK Tan https://github.com/cktan/tomlc99 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- xrdp-0.10.1/third_party/README.md000644 001751 000000 00000001475 14652432047 016454 0ustar00metawheel000000 000000 # Third-Party Software Components Under this directory, third-party software/libraries developed independently of xrdp are imported as git submodules or subtree. Each third-party software is subject to its own software license. See [COPYING-THIRD-PARTY](third_party/COPYING-THIRD-PARTY) for full license statement of all third-party components. ``` third_party └── tomlc99 ······ TOML C library (MIT License) ``` ## Developer's Note In order to show all license terms in xrdp, follow the steps below after adding new third-party libraries. 1. Install [adobe/bin2c](https://github.com/adobe/bin2c) to your development environment 2. Write all third-party license terms to `COPYING-THIRD-PARTY` 3. Run `make -f Makefile.copying` to generate `copying_third_party.h` 4. Commit generated `copying_third_party.h` xrdp-0.10.1/third_party/Makefile.am000644 001751 000000 00000000216 14652432047 017221 0ustar00metawheel000000 000000 EXTRA_DIST = \ copying_third_party.h \ COPYING-THIRD-PARTY \ Makefile.copying \ README.md xrdp-0.10.1/third_party/copying_third_party.h000644 001751 000000 00000002610 14652432047 021417 0ustar00metawheel000000 000000 #include const char copying_third_party[] = "\ -- tomlc99: TOML C library\n\ \n\ MIT License\n\ \n\ Copyright (c) CK Tan\n\ https://github.com/cktan/tomlc99\n\ \n\ Permission is hereby granted, free of charge, to any person obtaining a copy\n\ of this software and associated documentation files (the \"Software\"), to deal\n\ in the Software without restriction, including without limitation the rights\n\ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\ copies of the Software, and to permit persons to whom the Software is\n\ furnished to do so, subject to the following conditions:\n\ \n\ The above copyright notice and this permission notice shall be included in all\n\ copies or substantial portions of the Software.\n\ \n\ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n\ SOFTWARE.\n\ \n\ --------------------------------------------------------------------------------\n\ "; const size_t copying_third_party_len = sizeof(copying_third_party) - 1; xrdp-0.10.1/third_party/Makefile.in000644 001751 000000 00000033242 14652432075 017240 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = third_party ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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 = SOURCES = DIST_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) am__DIST_COMMON = $(srcdir)/Makefile.in README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ copying_third_party.h \ COPYING-THIRD-PARTY \ Makefile.copying \ README.md all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign third_party/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign third_party/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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-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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/third_party/tomlc99/000755 001751 000000 00000000000 14652432104 016460 5ustar00metawheel000000 000000 xrdp-0.10.1/third_party/Makefile.copying000644 001751 000000 00000000246 14652432047 020277 0ustar00metawheel000000 000000 copying: copying_third_party.h copying_third_party.h: bin2c copying_third_party < COPYING-THIRD-PARTY > copying_third_party.h clean: rm -f copying_third_party.h xrdp-0.10.1/third_party/tomlc99/README.md000644 001751 000000 00000011271 14652432047 017747 0ustar00metawheel000000 000000 # tomlc99 TOML in c99; v1.0 compliant. If you are looking for a C++ library, you might try this wrapper: [https://github.com/cktan/tomlcpp](https://github.com/cktan/tomlcpp). * Compatible with [TOML v1.0.0](https://toml.io/en/v1.0.0). * Tested with multiple test suites, including [BurntSushi/toml-test](https://github.com/BurntSushi/toml-test) and [iarna/toml-spec-tests](https://github.com/iarna/toml-spec-tests). * Provides very simple and intuitive interface. ## Usage Please see the `toml.h` file for details. The following is a simple example that parses this config file: ```toml [server] host = "www.example.com" port = [ 8080, 8181, 8282 ] ``` These are the usual steps for getting values from a file: 1. Parse the TOML file. 2. Traverse and locate a table in TOML. 3. Extract values from the table. 4. Free up allocated memory. Below is an example of parsing the values from the example table. ```c #include #include #include #include #include "toml.h" static void error(const char* msg, const char* msg1) { fprintf(stderr, "ERROR: %s%s\n", msg, msg1?msg1:""); exit(1); } int main() { FILE* fp; char errbuf[200]; // 1. Read and parse toml file fp = fopen("sample.toml", "r"); if (!fp) { error("cannot open sample.toml - ", strerror(errno)); } toml_table_t* conf = toml_parse_file(fp, errbuf, sizeof(errbuf)); fclose(fp); if (!conf) { error("cannot parse - ", errbuf); } // 2. Traverse to a table. toml_table_t* server = toml_table_in(conf, "server"); if (!server) { error("missing [server]", ""); } // 3. Extract values toml_datum_t host = toml_string_in(server, "host"); if (!host.ok) { error("cannot read server.host", ""); } toml_array_t* portarray = toml_array_in(server, "port"); if (!portarray) { error("cannot read server.port", ""); } printf("host: %s\n", host.u.s); printf("port: "); for (int i = 0; ; i++) { toml_datum_t port = toml_int_at(portarray, i); if (!port.ok) break; printf("%d ", (int)port.u.i); } printf("\n"); // 4. Free memory free(host.u.s); toml_free(conf); return 0; } ``` #### Accessing Table Content TOML tables are dictionaries where lookups are done using string keys. In general, all access functions on tables are named `toml_*_in(...)`. In the normal case, you know the key and its content type, and retrievals can be done using one of these functions: ```c toml_string_in(tab, key); toml_bool_in(tab, key); toml_int_in(tab, key); toml_double_in(tab, key); toml_timestamp_in(tab, key); toml_table_in(tab, key); toml_array_in(tab, key); ``` You can also interrogate the keys in a table using an integer index: ```c toml_table_t* tab = toml_parse_file(...); for (int i = 0; ; i++) { const char* key = toml_key_in(tab, i); if (!key) break; printf("key %d: %s\n", i, key); } ``` #### Accessing Array Content TOML arrays can be deref-ed using integer indices. In general, all access methods on arrays are named `toml_*_at()`. To obtain the size of an array: ```c int size = toml_array_nelem(arr); ``` To obtain the content of an array, use a valid index and call one of these functions: ```c toml_string_at(arr, idx); toml_bool_at(arr, idx); toml_int_at(arr, idx); toml_double_at(arr, idx); toml_timestamp_at(arr, idx); toml_table_at(arr, idx); toml_array_at(arr, idx); ``` #### toml_datum_t Some `toml_*_at` and `toml_*_in` functions return a toml_datum_t structure. The `ok` flag in the structure indicates if the function call was successful. If so, you may proceed to read the value corresponding to the type of the content. For example: ``` toml_datum_t host = toml_string_in(tab, "host"); if (host.ok) { printf("host: %s\n", host.u.s); free(host.u.s); /* FREE applies to string and timestamp types only */ } ``` ** IMPORTANT: if the accessed value is a string or a timestamp, you must call `free(datum.u.s)` or `free(datum.u.ts)` respectively after usage. ** ## Building and installing A normal *make* suffices. You can also simply include the `toml.c` and `toml.h` files in your project. Invoking `make install` will install the header and library files into /usr/local/{include,lib}. Alternatively, specify `make install prefix=/a/file/path` to install into /a/file/path/{include,lib}. ## Testing To test against the standard test set provided by BurntSushi/toml-test: ```sh % make % cd test1 % bash build.sh # do this once % bash run.sh # this will run the test suite ``` To test against the standard test set provided by iarna/toml: ```sh % make % cd test2 % bash build.sh # do this once % bash run.sh # this will run the test suite ``` xrdp-0.10.1/third_party/tomlc99/toml.h000644 001751 000000 00000015465 14652432047 017625 0ustar00metawheel000000 000000 /* MIT License Copyright (c) CK Tan https://github.com/cktan/tomlc99 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TOML_H #define TOML_H #ifdef _MSC_VER #pragma warning(disable: 4996) #endif #include #include #ifdef __cplusplus #define TOML_EXTERN extern "C" #else #define TOML_EXTERN extern #endif typedef struct toml_timestamp_t toml_timestamp_t; typedef struct toml_table_t toml_table_t; typedef struct toml_array_t toml_array_t; typedef struct toml_datum_t toml_datum_t; /* Parse a file. Return a table on success, or 0 otherwise. * Caller must toml_free(the-return-value) after use. */ TOML_EXTERN toml_table_t *toml_parse_file(FILE *fp, char *errbuf, int errbufsz); /* Parse a string containing the full config. * Return a table on success, or 0 otherwise. * Caller must toml_free(the-return-value) after use. */ TOML_EXTERN toml_table_t *toml_parse(char *conf, /* NUL terminated, please. */ char *errbuf, int errbufsz); /* Free the table returned by toml_parse() or toml_parse_file(). Once * this function is called, any handles accessed through this tab * directly or indirectly are no longer valid. */ TOML_EXTERN void toml_free(toml_table_t *tab); /* Timestamp types. The year, month, day, hour, minute, second, z * fields may be NULL if they are not relevant. e.g. In a DATE * type, the hour, minute, second and z fields will be NULLs. */ struct toml_timestamp_t { struct { /* internal. do not use. */ int year, month, day; int hour, minute, second, millisec; char z[10]; } __buffer; int *year, *month, *day; int *hour, *minute, *second, *millisec; char *z; }; /*----------------------------------------------------------------- * Enhanced access methods */ struct toml_datum_t { int ok; union { toml_timestamp_t *ts; /* ts must be freed after use */ char *s; /* string value. s must be freed after use */ int b; /* bool value */ int64_t i; /* int value */ double d; /* double value */ } u; }; /* on arrays: */ /* ... retrieve size of array. */ TOML_EXTERN int toml_array_nelem(const toml_array_t *arr); /* ... retrieve values using index. */ TOML_EXTERN toml_datum_t toml_string_at(const toml_array_t *arr, int idx); TOML_EXTERN toml_datum_t toml_bool_at(const toml_array_t *arr, int idx); TOML_EXTERN toml_datum_t toml_int_at(const toml_array_t *arr, int idx); TOML_EXTERN toml_datum_t toml_double_at(const toml_array_t *arr, int idx); TOML_EXTERN toml_datum_t toml_timestamp_at(const toml_array_t *arr, int idx); /* ... retrieve array or table using index. */ TOML_EXTERN toml_array_t *toml_array_at(const toml_array_t *arr, int idx); TOML_EXTERN toml_table_t *toml_table_at(const toml_array_t *arr, int idx); /* on tables: */ /* ... retrieve the key in table at keyidx. Return 0 if out of range. */ TOML_EXTERN const char *toml_key_in(const toml_table_t *tab, int keyidx); /* ... returns 1 if key exists in tab, 0 otherwise */ TOML_EXTERN int toml_key_exists(const toml_table_t *tab, const char *key); /* ... retrieve values using key. */ TOML_EXTERN toml_datum_t toml_string_in(const toml_table_t *arr, const char *key); TOML_EXTERN toml_datum_t toml_bool_in(const toml_table_t *arr, const char *key); TOML_EXTERN toml_datum_t toml_int_in(const toml_table_t *arr, const char *key); TOML_EXTERN toml_datum_t toml_double_in(const toml_table_t *arr, const char *key); TOML_EXTERN toml_datum_t toml_timestamp_in(const toml_table_t *arr, const char *key); /* .. retrieve array or table using key. */ TOML_EXTERN toml_array_t *toml_array_in(const toml_table_t *tab, const char *key); TOML_EXTERN toml_table_t *toml_table_in(const toml_table_t *tab, const char *key); /*----------------------------------------------------------------- * lesser used */ /* Return the array kind: 't'able, 'a'rray, 'v'alue, 'm'ixed */ TOML_EXTERN char toml_array_kind(const toml_array_t *arr); /* For array kind 'v'alue, return the type of values i:int, d:double, b:bool, s:string, t:time, D:date, T:timestamp, 'm'ixed 0 if unknown */ TOML_EXTERN char toml_array_type(const toml_array_t *arr); /* Return the key of an array */ TOML_EXTERN const char *toml_array_key(const toml_array_t *arr); /* Return the number of key-values in a table */ TOML_EXTERN int toml_table_nkval(const toml_table_t *tab); /* Return the number of arrays in a table */ TOML_EXTERN int toml_table_narr(const toml_table_t *tab); /* Return the number of sub-tables in a table */ TOML_EXTERN int toml_table_ntab(const toml_table_t *tab); /* Return the key of a table*/ TOML_EXTERN const char *toml_table_key(const toml_table_t *tab); /*-------------------------------------------------------------- * misc */ TOML_EXTERN int toml_utf8_to_ucs(const char *orig, int len, int64_t *ret); TOML_EXTERN int toml_ucs_to_utf8(int64_t code, char buf[6]); TOML_EXTERN void toml_set_memutil(void *(*xxmalloc)(size_t), void (*xxfree)(void *)); /*-------------------------------------------------------------- * deprecated */ /* A raw value, must be processed by toml_rto* before using. */ typedef const char *toml_raw_t; TOML_EXTERN toml_raw_t toml_raw_in(const toml_table_t *tab, const char *key); TOML_EXTERN toml_raw_t toml_raw_at(const toml_array_t *arr, int idx); TOML_EXTERN int toml_rtos(toml_raw_t s, char **ret); TOML_EXTERN int toml_rtob(toml_raw_t s, int *ret); TOML_EXTERN int toml_rtoi(toml_raw_t s, int64_t *ret); TOML_EXTERN int toml_rtod(toml_raw_t s, double *ret); TOML_EXTERN int toml_rtod_ex(toml_raw_t s, double *ret, char *buf, int buflen); TOML_EXTERN int toml_rtots(toml_raw_t s, toml_timestamp_t *ret); #endif /* TOML_H */ xrdp-0.10.1/third_party/tomlc99/Makefile.am000644 001751 000000 00000000513 14652432047 020521 0ustar00metawheel000000 000000 EXTRA_DIST = \ toml.c \ toml.h \ LICENSE # See src/Makefile # '-x c' forces gcc to be used if we are using g++ for CI testing AM_CFLAGS = -x c -std=c99 -std=c99 -Wall -Wextra -fpic module_LTLIBRARIES = libtoml.la libtoml_la_SOURCES = toml.c toml.h libtoml_la_LDFLAGS = -version-info 1:0 include_headers = toml.h xrdp-0.10.1/third_party/tomlc99/LICENSE000644 001751 000000 00000002103 14652432047 017467 0ustar00metawheel000000 000000 MIT License Copyright (c) CK Tan https://github.com/cktan/tomlc99 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xrdp-0.10.1/third_party/tomlc99/toml.c000644 001751 000000 00000155371 14652432047 017621 0ustar00metawheel000000 000000 /* MIT License Copyright (c) CK Tan https://github.com/cktan/tomlc99 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define _POSIX_C_SOURCE 200809L #include "toml.h" #include #include #include #include #include #include #include #include static void *(*ppmalloc)(size_t) = malloc; static void (*ppfree)(void *) = free; void toml_set_memutil(void *(*xxmalloc)(size_t), void (*xxfree)(void *)) { if (xxmalloc) ppmalloc = xxmalloc; if (xxfree) ppfree = xxfree; } #define ALIGN8(sz) (((sz) + 7) & ~7) #define MALLOC(a) ppmalloc(a) #define FREE(a) ppfree(a) #define malloc(x) error - forbidden - use MALLOC instead #define free(x) error - forbidden - use FREE instead #define calloc(x, y) error - forbidden - use CALLOC instead static void *CALLOC(size_t nmemb, size_t sz) { int nb = ALIGN8(sz) * nmemb; void *p = MALLOC(nb); if (p) { memset(p, 0, nb); } return p; } // some old platforms define strdup macro -- drop it. #undef strdup #define strdup(x) error - forbidden - use STRDUP instead static char *STRDUP(const char *s) { int len = strlen(s); char *p = MALLOC(len + 1); if (p) { memcpy(p, s, len); p[len] = 0; } return p; } // some old platforms define strndup macro -- drop it. #undef strndup #define strndup(x) error - forbiden - use STRNDUP instead static char *STRNDUP(const char *s, size_t n) { size_t len = strnlen(s, n); char *p = MALLOC(len + 1); if (p) { memcpy(p, s, len); p[len] = 0; } return p; } /** * Convert a char in utf8 into UCS, and store it in *ret. * Return #bytes consumed or -1 on failure. */ int toml_utf8_to_ucs(const char *orig, int len, int64_t *ret) { const unsigned char *buf = (const unsigned char *)orig; unsigned i = *buf++; int64_t v; /* 0x00000000 - 0x0000007F: 0xxxxxxx */ if (0 == (i >> 7)) { if (len < 1) return -1; v = i; return *ret = v, 1; } /* 0x00000080 - 0x000007FF: 110xxxxx 10xxxxxx */ if (0x6 == (i >> 5)) { if (len < 2) return -1; v = i & 0x1f; for (int j = 0; j < 1; j++) { i = *buf++; if (0x2 != (i >> 6)) return -1; v = (v << 6) | (i & 0x3f); } return *ret = v, (const char *)buf - orig; } /* 0x00000800 - 0x0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx */ if (0xE == (i >> 4)) { if (len < 3) return -1; v = i & 0x0F; for (int j = 0; j < 2; j++) { i = *buf++; if (0x2 != (i >> 6)) return -1; v = (v << 6) | (i & 0x3f); } return *ret = v, (const char *)buf - orig; } /* 0x00010000 - 0x001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ if (0x1E == (i >> 3)) { if (len < 4) return -1; v = i & 0x07; for (int j = 0; j < 3; j++) { i = *buf++; if (0x2 != (i >> 6)) return -1; v = (v << 6) | (i & 0x3f); } return *ret = v, (const char *)buf - orig; } /* 0x00200000 - 0x03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ if (0x3E == (i >> 2)) { if (len < 5) return -1; v = i & 0x03; for (int j = 0; j < 4; j++) { i = *buf++; if (0x2 != (i >> 6)) return -1; v = (v << 6) | (i & 0x3f); } return *ret = v, (const char *)buf - orig; } /* 0x04000000 - 0x7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ if (0x7e == (i >> 1)) { if (len < 6) return -1; v = i & 0x01; for (int j = 0; j < 5; j++) { i = *buf++; if (0x2 != (i >> 6)) return -1; v = (v << 6) | (i & 0x3f); } return *ret = v, (const char *)buf - orig; } return -1; } /** * Convert a UCS char to utf8 code, and return it in buf. * Return #bytes used in buf to encode the char, or * -1 on error. */ int toml_ucs_to_utf8(int64_t code, char buf[6]) { /* http://stackoverflow.com/questions/6240055/manually-converting-unicode-codepoints-into-utf-8-and-utf-16 */ /* The UCS code values 0xd800–0xdfff (UTF-16 surrogates) as well * as 0xfffe and 0xffff (UCS noncharacters) should not appear in * conforming UTF-8 streams. */ if (0xd800 <= code && code <= 0xdfff) return -1; if (0xfffe <= code && code <= 0xffff) return -1; /* 0x00000000 - 0x0000007F: 0xxxxxxx */ if (code < 0) return -1; if (code <= 0x7F) { buf[0] = (unsigned char)code; return 1; } /* 0x00000080 - 0x000007FF: 110xxxxx 10xxxxxx */ if (code <= 0x000007FF) { buf[0] = (unsigned char) (0xc0 | (code >> 6)); buf[1] = (unsigned char) (0x80 | (code & 0x3f)); return 2; } /* 0x00000800 - 0x0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx */ if (code <= 0x0000FFFF) { buf[0] = (unsigned char) (0xe0 | (code >> 12)); buf[1] = (unsigned char) (0x80 | ((code >> 6) & 0x3f)); buf[2] = (unsigned char) (0x80 | (code & 0x3f)); return 3; } /* 0x00010000 - 0x001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ if (code <= 0x001FFFFF) { buf[0] = (unsigned char) (0xf0 | (code >> 18)); buf[1] = (unsigned char) (0x80 | ((code >> 12) & 0x3f)); buf[2] = (unsigned char) (0x80 | ((code >> 6) & 0x3f)); buf[3] = (unsigned char) (0x80 | (code & 0x3f)); return 4; } /* 0x00200000 - 0x03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ if (code <= 0x03FFFFFF) { buf[0] = (unsigned char) (0xf8 | (code >> 24)); buf[1] = (unsigned char) (0x80 | ((code >> 18) & 0x3f)); buf[2] = (unsigned char) (0x80 | ((code >> 12) & 0x3f)); buf[3] = (unsigned char) (0x80 | ((code >> 6) & 0x3f)); buf[4] = (unsigned char) (0x80 | (code & 0x3f)); return 5; } /* 0x04000000 - 0x7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ if (code <= 0x7FFFFFFF) { buf[0] = (unsigned char) (0xfc | (code >> 30)); buf[1] = (unsigned char) (0x80 | ((code >> 24) & 0x3f)); buf[2] = (unsigned char) (0x80 | ((code >> 18) & 0x3f)); buf[3] = (unsigned char) (0x80 | ((code >> 12) & 0x3f)); buf[4] = (unsigned char) (0x80 | ((code >> 6) & 0x3f)); buf[5] = (unsigned char) (0x80 | (code & 0x3f)); return 6; } return -1; } /* * TOML has 3 data structures: value, array, table. * Each of them can have identification key. */ typedef struct toml_keyval_t toml_keyval_t; struct toml_keyval_t { const char *key; /* key to this value */ const char *val; /* the raw value */ }; typedef struct toml_arritem_t toml_arritem_t; struct toml_arritem_t { int valtype; /* for value kind: 'i'nt, 'd'ouble, 'b'ool, 's'tring, 't'ime, 'D'ate, 'T'imestamp */ char *val; toml_array_t *arr; toml_table_t *tab; }; struct toml_array_t { const char *key; /* key to this array */ int kind; /* element kind: 'v'alue, 'a'rray, or 't'able, 'm'ixed */ int type; /* for value kind: 'i'nt, 'd'ouble, 'b'ool, 's'tring, 't'ime, 'D'ate, 'T'imestamp, 'm'ixed */ int nitem; /* number of elements */ toml_arritem_t *item; }; struct toml_table_t { const char *key; /* key to this table */ bool implicit; /* table was created implicitly */ bool readonly; /* no more modification allowed */ /* key-values in the table */ int nkval; toml_keyval_t **kval; /* arrays in the table */ int narr; toml_array_t **arr; /* tables in the table */ int ntab; toml_table_t **tab; }; static inline void xfree(const void *x) { if (x) FREE((void *)(intptr_t)x); } enum tokentype_t { INVALID, DOT, COMMA, EQUAL, LBRACE, RBRACE, NEWLINE, LBRACKET, RBRACKET, STRING, }; typedef enum tokentype_t tokentype_t; typedef struct token_t token_t; struct token_t { tokentype_t tok; int lineno; char *ptr; /* points into context->start */ int len; int eof; }; typedef struct context_t context_t; struct context_t { char *start; char *stop; char *errbuf; int errbufsz; token_t tok; toml_table_t *root; toml_table_t *curtab; struct { int top; char *key[10]; token_t tok[10]; } tpath; }; #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #define FLINE __FILE__ ":" TOSTRING(__LINE__) static int next_token(context_t *ctx, int dotisspecial); /* Error reporting. Call when an error is detected. Always return -1. */ static int e_outofmemory(context_t *ctx, const char *fline) { snprintf(ctx->errbuf, ctx->errbufsz, "ERROR: out of memory (%s)", fline); return -1; } static int e_internal(context_t *ctx, const char *fline) { snprintf(ctx->errbuf, ctx->errbufsz, "internal error (%s)", fline); return -1; } static int e_syntax(context_t *ctx, int lineno, const char *msg) { snprintf(ctx->errbuf, ctx->errbufsz, "line %d: %s", lineno, msg); return -1; } static int e_badkey(context_t *ctx, int lineno) { snprintf(ctx->errbuf, ctx->errbufsz, "line %d: bad key", lineno); return -1; } static int e_keyexists(context_t *ctx, int lineno) { snprintf(ctx->errbuf, ctx->errbufsz, "line %d: key exists", lineno); return -1; } static int e_forbid(context_t *ctx, int lineno, const char *msg) { snprintf(ctx->errbuf, ctx->errbufsz, "line %d: %s", lineno, msg); return -1; } static void *expand(void *p, int sz, int newsz) { void *s = MALLOC(newsz); if (!s) return 0; memcpy(s, p, sz); FREE(p); return s; } static void **expand_ptrarr(void **p, int n) { void **s = MALLOC((n + 1) * sizeof(void *)); if (!s) return 0; s[n] = 0; memcpy(s, p, n * sizeof(void *)); FREE(p); return s; } static toml_arritem_t *expand_arritem(toml_arritem_t *p, int n) { toml_arritem_t *pp = expand(p, n * sizeof(*p), (n + 1) * sizeof(*p)); if (!pp) return 0; memset(&pp[n], 0, sizeof(pp[n])); return pp; } static char *norm_lit_str(const char *src, int srclen, int multiline, char *errbuf, int errbufsz) { char *dst = 0; /* will write to dst[] and return it */ int max = 0; /* max size of dst[] */ int off = 0; /* cur offset in dst[] */ const char *sp = src; const char *sq = src + srclen; int ch; /* scan forward on src */ for (;;) { if (off >= max - 10) { /* have some slack for misc stuff */ int newmax = max + 50; char *x = expand(dst, max, newmax); if (!x) { xfree(dst); snprintf(errbuf, errbufsz, "out of memory"); return 0; } dst = x; max = newmax; } /* finished? */ if (sp >= sq) break; ch = *sp++; /* control characters other than tab is not allowed */ if ((0 <= ch && ch <= 0x08) || (0x0a <= ch && ch <= 0x1f) || (ch == 0x7f)) { if (!(multiline && (ch == '\r' || ch == '\n'))) { xfree(dst); snprintf(errbuf, errbufsz, "invalid char U+%04x", ch); return 0; } } // a plain copy suffice dst[off++] = ch; } dst[off++] = 0; return dst; } /* * Convert src to raw unescaped utf-8 string. * Returns NULL if error with errmsg in errbuf. */ static char *norm_basic_str(const char *src, int srclen, int multiline, char *errbuf, int errbufsz) { char *dst = 0; /* will write to dst[] and return it */ int max = 0; /* max size of dst[] */ int off = 0; /* cur offset in dst[] */ const char *sp = src; const char *sq = src + srclen; int ch; /* scan forward on src */ for (;;) { if (off >= max - 10) { /* have some slack for misc stuff */ int newmax = max + 50; char *x = expand(dst, max, newmax); if (!x) { xfree(dst); snprintf(errbuf, errbufsz, "out of memory"); return 0; } dst = x; max = newmax; } /* finished? */ if (sp >= sq) break; ch = *sp++; if (ch != '\\') { /* these chars must be escaped: U+0000 to U+0008, U+000A to U+001F, U+007F */ if ((0 <= ch && ch <= 0x08) || (0x0a <= ch && ch <= 0x1f) || (ch == 0x7f)) { if (!(multiline && (ch == '\r' || ch == '\n'))) { xfree(dst); snprintf(errbuf, errbufsz, "invalid char U+%04x", ch); return 0; } } // a plain copy suffice dst[off++] = ch; continue; } /* ch was backslash. we expect the escape char. */ if (sp >= sq) { snprintf(errbuf, errbufsz, "last backslash is invalid"); xfree(dst); return 0; } /* for multi-line, we want to kill line-ending-backslash ... */ if (multiline) { // if there is only whitespace after the backslash ... if (sp[strspn(sp, " \t\r")] == '\n') { /* skip all the following whitespaces */ sp += strspn(sp, " \t\r\n"); continue; } } /* get the escaped char */ ch = *sp++; switch (ch) { case 'u': case 'U': { int64_t ucs = 0; int nhex = (ch == 'u' ? 4 : 8); for (int i = 0; i < nhex; i++) { if (sp >= sq) { snprintf(errbuf, errbufsz, "\\%c expects %d hex chars", ch, nhex); xfree(dst); return 0; } ch = *sp++; int v = ('0' <= ch && ch <= '9') ? ch - '0' : (('A' <= ch && ch <= 'F') ? ch - 'A' + 10 : -1); if (-1 == v) { snprintf(errbuf, errbufsz, "invalid hex chars for \\u or \\U"); xfree(dst); return 0; } ucs = ucs * 16 + v; } int n = toml_ucs_to_utf8(ucs, &dst[off]); if (-1 == n) { snprintf(errbuf, errbufsz, "illegal ucs code in \\u or \\U"); xfree(dst); return 0; } off += n; } continue; case 'b': ch = '\b'; break; case 't': ch = '\t'; break; case 'n': ch = '\n'; break; case 'f': ch = '\f'; break; case 'r': ch = '\r'; break; case '"': ch = '"'; break; case '\\': ch = '\\'; break; default: snprintf(errbuf, errbufsz, "illegal escape char \\%c", ch); xfree(dst); return 0; } dst[off++] = ch; } // Cap with NUL and return it. dst[off++] = 0; return dst; } /* Normalize a key. Convert all special chars to raw unescaped utf-8 chars. */ static char *normalize_key(context_t *ctx, token_t strtok) { const char *sp = strtok.ptr; const char *sq = strtok.ptr + strtok.len; int lineno = strtok.lineno; char *ret; int ch = *sp; char ebuf[80]; /* handle quoted string */ if (ch == '\'' || ch == '\"') { /* if ''' or """, take 3 chars off front and back. Else, take 1 char off. */ int multiline = 0; if (sp[1] == ch && sp[2] == ch) { sp += 3, sq -= 3; multiline = 1; } else sp++, sq--; if (ch == '\'') { /* for single quote, take it verbatim. */ if (!(ret = STRNDUP(sp, sq - sp))) { e_outofmemory(ctx, FLINE); return 0; } } else { /* for double quote, we need to normalize */ ret = norm_basic_str(sp, sq - sp, multiline, ebuf, sizeof(ebuf)); if (!ret) { e_syntax(ctx, lineno, ebuf); return 0; } } /* newlines are not allowed in keys */ if (strchr(ret, '\n')) { xfree(ret); e_badkey(ctx, lineno); return 0; } return ret; } /* for bare-key allow only this regex: [A-Za-z0-9_-]+ */ const char *xp; for (xp = sp; xp != sq; xp++) { int k = *xp; if (isalnum(k)) continue; if (k == '_' || k == '-') continue; e_badkey(ctx, lineno); return 0; } /* dup and return it */ if (!(ret = STRNDUP(sp, sq - sp))) { e_outofmemory(ctx, FLINE); return 0; } return ret; } /* * Look up key in tab. Return 0 if not found, or * 'v'alue, 'a'rray or 't'able depending on the element. */ static int check_key(toml_table_t *tab, const char *key, toml_keyval_t **ret_val, toml_array_t **ret_arr, toml_table_t **ret_tab) { int i; void *dummy; if (!ret_tab) ret_tab = (toml_table_t **)&dummy; if (!ret_arr) ret_arr = (toml_array_t **)&dummy; if (!ret_val) ret_val = (toml_keyval_t **)&dummy; *ret_tab = 0; *ret_arr = 0; *ret_val = 0; for (i = 0; i < tab->nkval; i++) { if (0 == strcmp(key, tab->kval[i]->key)) { *ret_val = tab->kval[i]; return 'v'; } } for (i = 0; i < tab->narr; i++) { if (0 == strcmp(key, tab->arr[i]->key)) { *ret_arr = tab->arr[i]; return 'a'; } } for (i = 0; i < tab->ntab; i++) { if (0 == strcmp(key, tab->tab[i]->key)) { *ret_tab = tab->tab[i]; return 't'; } } return 0; } static int key_kind(toml_table_t *tab, const char *key) { return check_key(tab, key, 0, 0, 0); } /* Create a keyval in the table. */ static toml_keyval_t *create_keyval_in_table(context_t *ctx, toml_table_t *tab, token_t keytok) { /* first, normalize the key to be used for lookup. * remember to free it if we error out. */ char *newkey = normalize_key(ctx, keytok); if (!newkey) return 0; /* if key exists: error out. */ toml_keyval_t *dest = 0; if (key_kind(tab, newkey)) { xfree(newkey); e_keyexists(ctx, keytok.lineno); return 0; } /* make a new entry */ int n = tab->nkval; toml_keyval_t **base; if (0 == (base = (toml_keyval_t **)expand_ptrarr((void **)tab->kval, n))) { xfree(newkey); e_outofmemory(ctx, FLINE); return 0; } tab->kval = base; if (0 == (base[n] = (toml_keyval_t *)CALLOC(1, sizeof(*base[n])))) { xfree(newkey); e_outofmemory(ctx, FLINE); return 0; } dest = tab->kval[tab->nkval++]; /* save the key in the new value struct */ dest->key = newkey; return dest; } /* Create a table in the table. */ static toml_table_t *create_keytable_in_table(context_t *ctx, toml_table_t *tab, token_t keytok) { /* first, normalize the key to be used for lookup. * remember to free it if we error out. */ char *newkey = normalize_key(ctx, keytok); if (!newkey) return 0; /* if key exists: error out */ toml_table_t *dest = 0; if (check_key(tab, newkey, 0, 0, &dest)) { xfree(newkey); /* don't need this anymore */ /* special case: if table exists, but was created implicitly ... */ if (dest && dest->implicit) { /* we make it explicit now, and simply return it. */ dest->implicit = false; return dest; } e_keyexists(ctx, keytok.lineno); return 0; } /* create a new table entry */ int n = tab->ntab; toml_table_t **base; if (0 == (base = (toml_table_t **)expand_ptrarr((void **)tab->tab, n))) { xfree(newkey); e_outofmemory(ctx, FLINE); return 0; } tab->tab = base; if (0 == (base[n] = (toml_table_t *)CALLOC(1, sizeof(*base[n])))) { xfree(newkey); e_outofmemory(ctx, FLINE); return 0; } dest = tab->tab[tab->ntab++]; /* save the key in the new table struct */ dest->key = newkey; return dest; } /* Create an array in the table. */ static toml_array_t *create_keyarray_in_table(context_t *ctx, toml_table_t *tab, token_t keytok, char kind) { /* first, normalize the key to be used for lookup. * remember to free it if we error out. */ char *newkey = normalize_key(ctx, keytok); if (!newkey) return 0; /* if key exists: error out */ if (key_kind(tab, newkey)) { xfree(newkey); /* don't need this anymore */ e_keyexists(ctx, keytok.lineno); return 0; } /* make a new array entry */ int n = tab->narr; toml_array_t **base; if (0 == (base = (toml_array_t **)expand_ptrarr((void **)tab->arr, n))) { xfree(newkey); e_outofmemory(ctx, FLINE); return 0; } tab->arr = base; if (0 == (base[n] = (toml_array_t *)CALLOC(1, sizeof(*base[n])))) { xfree(newkey); e_outofmemory(ctx, FLINE); return 0; } toml_array_t *dest = tab->arr[tab->narr++]; /* save the key in the new array struct */ dest->key = newkey; dest->kind = kind; return dest; } static toml_arritem_t *create_value_in_array(context_t *ctx, toml_array_t *parent) { const int n = parent->nitem; toml_arritem_t *base = expand_arritem(parent->item, n); if (!base) { e_outofmemory(ctx, FLINE); return 0; } parent->item = base; parent->nitem++; return &parent->item[n]; } /* Create an array in an array */ static toml_array_t *create_array_in_array(context_t *ctx, toml_array_t *parent) { const int n = parent->nitem; toml_arritem_t *base = expand_arritem(parent->item, n); if (!base) { e_outofmemory(ctx, FLINE); return 0; } toml_array_t *ret = (toml_array_t *)CALLOC(1, sizeof(toml_array_t)); if (!ret) { e_outofmemory(ctx, FLINE); return 0; } base[n].arr = ret; parent->item = base; parent->nitem++; return ret; } /* Create a table in an array */ static toml_table_t *create_table_in_array(context_t *ctx, toml_array_t *parent) { int n = parent->nitem; toml_arritem_t *base = expand_arritem(parent->item, n); if (!base) { e_outofmemory(ctx, FLINE); return 0; } toml_table_t *ret = (toml_table_t *)CALLOC(1, sizeof(toml_table_t)); if (!ret) { e_outofmemory(ctx, FLINE); return 0; } base[n].tab = ret; parent->item = base; parent->nitem++; return ret; } static int skip_newlines(context_t *ctx, int isdotspecial) { while (ctx->tok.tok == NEWLINE) { if (next_token(ctx, isdotspecial)) return -1; if (ctx->tok.eof) break; } return 0; } static int parse_keyval(context_t *ctx, toml_table_t *tab); static inline int eat_token(context_t *ctx, tokentype_t typ, int isdotspecial, const char *fline) { if (ctx->tok.tok != typ) return e_internal(ctx, fline); if (next_token(ctx, isdotspecial)) return -1; return 0; } /* We are at '{ ... }'. * Parse the table. */ static int parse_inline_table(context_t *ctx, toml_table_t *tab) { if (eat_token(ctx, LBRACE, 1, FLINE)) return -1; for (;;) { if (ctx->tok.tok == NEWLINE) return e_syntax(ctx, ctx->tok.lineno, "newline not allowed in inline table"); /* until } */ if (ctx->tok.tok == RBRACE) break; if (ctx->tok.tok != STRING) return e_syntax(ctx, ctx->tok.lineno, "expect a string"); if (parse_keyval(ctx, tab)) return -1; if (ctx->tok.tok == NEWLINE) return e_syntax(ctx, ctx->tok.lineno, "newline not allowed in inline table"); /* on comma, continue to scan for next keyval */ if (ctx->tok.tok == COMMA) { if (eat_token(ctx, COMMA, 1, FLINE)) return -1; continue; } break; } if (eat_token(ctx, RBRACE, 1, FLINE)) return -1; tab->readonly = 1; return 0; } static int valtype(const char *val) { toml_timestamp_t ts; if (*val == '\'' || *val == '"') return 's'; if (0 == toml_rtob(val, 0)) return 'b'; if (0 == toml_rtoi(val, 0)) return 'i'; if (0 == toml_rtod(val, 0)) return 'd'; if (0 == toml_rtots(val, &ts)) { if (ts.year && ts.hour) return 'T'; /* timestamp */ if (ts.year) return 'D'; /* date */ return 't'; /* time */ } return 'u'; /* unknown */ } /* We are at '[...]' */ static int parse_array(context_t *ctx, toml_array_t *arr) { if (eat_token(ctx, LBRACKET, 0, FLINE)) return -1; for (;;) { if (skip_newlines(ctx, 0)) return -1; /* until ] */ if (ctx->tok.tok == RBRACKET) break; switch (ctx->tok.tok) { case STRING: { /* set array kind if this will be the first entry */ if (arr->kind == 0) arr->kind = 'v'; else if (arr->kind != 'v') arr->kind = 'm'; char *val = ctx->tok.ptr; int vlen = ctx->tok.len; /* make a new value in array */ toml_arritem_t *newval = create_value_in_array(ctx, arr); if (!newval) return e_outofmemory(ctx, FLINE); if (!(newval->val = STRNDUP(val, vlen))) return e_outofmemory(ctx, FLINE); newval->valtype = valtype(newval->val); /* set array type if this is the first entry */ if (arr->nitem == 1) arr->type = newval->valtype; else if (arr->type != newval->valtype) arr->type = 'm'; /* mixed */ if (eat_token(ctx, STRING, 0, FLINE)) return -1; break; } case LBRACKET: { /* [ [array], [array] ... ] */ /* set the array kind if this will be the first entry */ if (arr->kind == 0) arr->kind = 'a'; else if (arr->kind != 'a') arr->kind = 'm'; toml_array_t *subarr = create_array_in_array(ctx, arr); if (!subarr) return -1; if (parse_array(ctx, subarr)) return -1; break; } case LBRACE: { /* [ {table}, {table} ... ] */ /* set the array kind if this will be the first entry */ if (arr->kind == 0) arr->kind = 't'; else if (arr->kind != 't') arr->kind = 'm'; toml_table_t *subtab = create_table_in_array(ctx, arr); if (!subtab) return -1; if (parse_inline_table(ctx, subtab)) return -1; break; } default: return e_syntax(ctx, ctx->tok.lineno, "syntax error"); } if (skip_newlines(ctx, 0)) return -1; /* on comma, continue to scan for next element */ if (ctx->tok.tok == COMMA) { if (eat_token(ctx, COMMA, 0, FLINE)) return -1; continue; } break; } if (eat_token(ctx, RBRACKET, 1, FLINE)) return -1; return 0; } /* handle lines like these: key = "value" key = [ array ] key = { table } */ static int parse_keyval(context_t *ctx, toml_table_t *tab) { if (tab->readonly) { return e_forbid(ctx, ctx->tok.lineno, "cannot insert new entry into existing table"); } token_t key = ctx->tok; if (eat_token(ctx, STRING, 1, FLINE)) return -1; if (ctx->tok.tok == DOT) { /* handle inline dotted key. e.g. physical.color = "orange" physical.shape = "round" */ toml_table_t *subtab = 0; { char *subtabstr = normalize_key(ctx, key); if (!subtabstr) return -1; subtab = toml_table_in(tab, subtabstr); xfree(subtabstr); } if (!subtab) { subtab = create_keytable_in_table(ctx, tab, key); if (!subtab) return -1; } if (next_token(ctx, 1)) return -1; if (parse_keyval(ctx, subtab)) return -1; return 0; } if (ctx->tok.tok != EQUAL) { return e_syntax(ctx, ctx->tok.lineno, "missing ="); } if (next_token(ctx, 0)) return -1; switch (ctx->tok.tok) { case STRING: { /* key = "value" */ toml_keyval_t *keyval = create_keyval_in_table(ctx, tab, key); if (!keyval) return -1; token_t val = ctx->tok; assert(keyval->val == 0); if (!(keyval->val = STRNDUP(val.ptr, val.len))) return e_outofmemory(ctx, FLINE); if (next_token(ctx, 1)) return -1; return 0; } case LBRACKET: { /* key = [ array ] */ toml_array_t *arr = create_keyarray_in_table(ctx, tab, key, 0); if (!arr) return -1; if (parse_array(ctx, arr)) return -1; return 0; } case LBRACE: { /* key = { table } */ toml_table_t *nxttab = create_keytable_in_table(ctx, tab, key); if (!nxttab) return -1; if (parse_inline_table(ctx, nxttab)) return -1; return 0; } default: return e_syntax(ctx, ctx->tok.lineno, "syntax error"); } return 0; } typedef struct tabpath_t tabpath_t; struct tabpath_t { int cnt; token_t key[10]; }; /* at [x.y.z] or [[x.y.z]] * Scan forward and fill tabpath until it enters ] or ]] * There will be at least one entry on return. */ static int fill_tabpath(context_t *ctx) { int lineno = ctx->tok.lineno; int i; /* clear tpath */ for (i = 0; i < ctx->tpath.top; i++) { char **p = &ctx->tpath.key[i]; xfree(*p); *p = 0; } ctx->tpath.top = 0; for (;;) { if (ctx->tpath.top >= 10) return e_syntax(ctx, lineno, "table path is too deep; max allowed is 10."); if (ctx->tok.tok != STRING) return e_syntax(ctx, lineno, "invalid or missing key"); char *key = normalize_key(ctx, ctx->tok); if (!key) return -1; ctx->tpath.tok[ctx->tpath.top] = ctx->tok; ctx->tpath.key[ctx->tpath.top] = key; ctx->tpath.top++; if (next_token(ctx, 1)) return -1; if (ctx->tok.tok == RBRACKET) break; if (ctx->tok.tok != DOT) return e_syntax(ctx, lineno, "invalid key"); if (next_token(ctx, 1)) return -1; } if (ctx->tpath.top <= 0) return e_syntax(ctx, lineno, "empty table selector"); return 0; } /* Walk tabpath from the root, and create new tables on the way. * Sets ctx->curtab to the final table. */ static int walk_tabpath(context_t *ctx) { /* start from root */ toml_table_t *curtab = ctx->root; for (int i = 0; i < ctx->tpath.top; i++) { const char *key = ctx->tpath.key[i]; toml_keyval_t *nextval = 0; toml_array_t *nextarr = 0; toml_table_t *nexttab = 0; switch (check_key(curtab, key, &nextval, &nextarr, &nexttab)) { case 't': /* found a table. nexttab is where we will go next. */ break; case 'a': /* found an array. nexttab is the last table in the array. */ if (nextarr->kind != 't') return e_internal(ctx, FLINE); if (nextarr->nitem == 0) return e_internal(ctx, FLINE); nexttab = nextarr->item[nextarr->nitem - 1].tab; break; case 'v': return e_keyexists(ctx, ctx->tpath.tok[i].lineno); default: { /* Not found. Let's create an implicit table. */ int n = curtab->ntab; toml_table_t **base = (toml_table_t **)expand_ptrarr((void **)curtab->tab, n); if (0 == base) return e_outofmemory(ctx, FLINE); curtab->tab = base; if (0 == (base[n] = (toml_table_t *)CALLOC(1, sizeof(*base[n])))) return e_outofmemory(ctx, FLINE); if (0 == (base[n]->key = STRDUP(key))) return e_outofmemory(ctx, FLINE); nexttab = curtab->tab[curtab->ntab++]; /* tabs created by walk_tabpath are considered implicit */ nexttab->implicit = true; } break; } /* switch to next tab */ curtab = nexttab; } /* save it */ ctx->curtab = curtab; return 0; } /* handle lines like [x.y.z] or [[x.y.z]] */ static int parse_select(context_t *ctx) { assert(ctx->tok.tok == LBRACKET); /* true if [[ */ int llb = (ctx->tok.ptr + 1 < ctx->stop && ctx->tok.ptr[1] == '['); /* need to detect '[[' on our own because next_token() will skip whitespace, and '[ [' would be taken as '[[', which is wrong. */ /* eat [ or [[ */ if (eat_token(ctx, LBRACKET, 1, FLINE)) return -1; if (llb) { assert(ctx->tok.tok == LBRACKET); if (eat_token(ctx, LBRACKET, 1, FLINE)) return -1; } if (fill_tabpath(ctx)) return -1; /* For [x.y.z] or [[x.y.z]], remove z from tpath. */ token_t z = ctx->tpath.tok[ctx->tpath.top - 1]; xfree(ctx->tpath.key[ctx->tpath.top - 1]); ctx->tpath.top--; /* set up ctx->curtab */ if (walk_tabpath(ctx)) return -1; if (!llb) { /* [x.y.z] -> create z = {} in x.y */ toml_table_t *curtab = create_keytable_in_table(ctx, ctx->curtab, z); if (!curtab) return -1; ctx->curtab = curtab; } else { /* [[x.y.z]] -> create z = [] in x.y */ toml_array_t *arr = 0; { char *zstr = normalize_key(ctx, z); if (!zstr) return -1; arr = toml_array_in(ctx->curtab, zstr); xfree(zstr); } if (!arr) { arr = create_keyarray_in_table(ctx, ctx->curtab, z, 't'); if (!arr) return -1; } if (arr->kind != 't') return e_syntax(ctx, z.lineno, "array mismatch"); /* add to z[] */ toml_table_t *dest; { toml_table_t *t = create_table_in_array(ctx, arr); if (!t) return -1; if (0 == (t->key = STRDUP("__anon__"))) return e_outofmemory(ctx, FLINE); dest = t; } ctx->curtab = dest; } if (ctx->tok.tok != RBRACKET) { return e_syntax(ctx, ctx->tok.lineno, "expects ]"); } if (llb) { if (!(ctx->tok.ptr + 1 < ctx->stop && ctx->tok.ptr[1] == ']')) { return e_syntax(ctx, ctx->tok.lineno, "expects ]]"); } if (eat_token(ctx, RBRACKET, 1, FLINE)) return -1; } if (eat_token(ctx, RBRACKET, 1, FLINE)) return -1; if (ctx->tok.tok != NEWLINE) return e_syntax(ctx, ctx->tok.lineno, "extra chars after ] or ]]"); return 0; } toml_table_t *toml_parse(char *conf, char *errbuf, int errbufsz) { context_t ctx; // clear errbuf if (errbufsz <= 0) errbufsz = 0; if (errbufsz > 0) errbuf[0] = 0; // init context memset(&ctx, 0, sizeof(ctx)); ctx.start = conf; ctx.stop = ctx.start + strlen(conf); ctx.errbuf = errbuf; ctx.errbufsz = errbufsz; // start with an artificial newline of length 0 ctx.tok.tok = NEWLINE; ctx.tok.lineno = 1; ctx.tok.ptr = conf; ctx.tok.len = 0; // make a root table if (0 == (ctx.root = CALLOC(1, sizeof(*ctx.root)))) { e_outofmemory(&ctx, FLINE); // Do not goto fail, root table not set up yet return 0; } // set root as default table ctx.curtab = ctx.root; /* Scan forward until EOF */ for (token_t tok = ctx.tok; !tok.eof; tok = ctx.tok) { switch (tok.tok) { case NEWLINE: if (next_token(&ctx, 1)) goto fail; break; case STRING: if (parse_keyval(&ctx, ctx.curtab)) goto fail; if (ctx.tok.tok != NEWLINE) { e_syntax(&ctx, ctx.tok.lineno, "extra chars after value"); goto fail; } if (eat_token(&ctx, NEWLINE, 1, FLINE)) goto fail; break; case LBRACKET: /* [ x.y.z ] or [[ x.y.z ]] */ if (parse_select(&ctx)) goto fail; break; default: e_syntax(&ctx, tok.lineno, "syntax error"); goto fail; } } /* success */ for (int i = 0; i < ctx.tpath.top; i++) xfree(ctx.tpath.key[i]); return ctx.root; fail: // Something bad has happened. Free resources and return error. for (int i = 0; i < ctx.tpath.top; i++) xfree(ctx.tpath.key[i]); toml_free(ctx.root); return 0; } toml_table_t *toml_parse_file(FILE *fp, char *errbuf, int errbufsz) { int bufsz = 0; char *buf = 0; int off = 0; /* read from fp into buf */ while (!feof(fp)) { if (off == bufsz) { int xsz = bufsz + 1000; char *x = expand(buf, bufsz, xsz); if (!x) { snprintf(errbuf, errbufsz, "out of memory"); xfree(buf); return 0; } buf = x; bufsz = xsz; } errno = 0; int n = fread(buf + off, 1, bufsz - off, fp); if (ferror(fp)) { snprintf(errbuf, errbufsz, "%s", errno ? strerror(errno) : "Error reading file"); xfree(buf); return 0; } off += n; } /* tag on a NUL to cap the string */ if (off == bufsz) { int xsz = bufsz + 1; char *x = expand(buf, bufsz, xsz); if (!x) { snprintf(errbuf, errbufsz, "out of memory"); xfree(buf); return 0; } buf = x; bufsz = xsz; } buf[off] = 0; /* parse it, cleanup and finish */ toml_table_t *ret = toml_parse(buf, errbuf, errbufsz); xfree(buf); return ret; } static void xfree_kval(toml_keyval_t *p) { if (!p) return; xfree(p->key); xfree(p->val); xfree(p); } static void xfree_tab(toml_table_t *p); static void xfree_arr(toml_array_t *p) { if (!p) return; xfree(p->key); const int n = p->nitem; for (int i = 0; i < n; i++) { toml_arritem_t *a = &p->item[i]; if (a->val) xfree(a->val); else if (a->arr) xfree_arr(a->arr); else if (a->tab) xfree_tab(a->tab); } xfree(p->item); xfree(p); } static void xfree_tab(toml_table_t *p) { int i; if (!p) return; xfree(p->key); for (i = 0; i < p->nkval; i++) xfree_kval(p->kval[i]); xfree(p->kval); for (i = 0; i < p->narr; i++) xfree_arr(p->arr[i]); xfree(p->arr); for (i = 0; i < p->ntab; i++) xfree_tab(p->tab[i]); xfree(p->tab); xfree(p); } void toml_free(toml_table_t *tab) { xfree_tab(tab); } static void set_token(context_t *ctx, tokentype_t tok, int lineno, char *ptr, int len) { token_t t; t.tok = tok; t.lineno = lineno; t.ptr = ptr; t.len = len; t.eof = 0; ctx->tok = t; } static void set_eof(context_t *ctx, int lineno) { set_token(ctx, NEWLINE, lineno, ctx->stop, 0); ctx->tok.eof = 1; } /* Scan p for n digits compositing entirely of [0-9] */ static int scan_digits(const char *p, int n) { int ret = 0; for (; n > 0 && isdigit(*p); n--, p++) { ret = 10 * ret + (*p - '0'); } return n ? -1 : ret; } static int scan_date(const char *p, int *YY, int *MM, int *DD) { int year, month, day; year = scan_digits(p, 4); month = (year >= 0 && p[4] == '-') ? scan_digits(p + 5, 2) : -1; day = (month >= 0 && p[7] == '-') ? scan_digits(p + 8, 2) : -1; if (YY) *YY = year; if (MM) *MM = month; if (DD) *DD = day; return (year >= 0 && month >= 0 && day >= 0) ? 0 : -1; } static int scan_time(const char *p, int *hh, int *mm, int *ss) { int hour, minute, second; hour = scan_digits(p, 2); minute = (hour >= 0 && p[2] == ':') ? scan_digits(p + 3, 2) : -1; second = (minute >= 0 && p[5] == ':') ? scan_digits(p + 6, 2) : -1; if (hh) *hh = hour; if (mm) *mm = minute; if (ss) *ss = second; return (hour >= 0 && minute >= 0 && second >= 0) ? 0 : -1; } static int scan_string(context_t *ctx, char *p, int lineno, int dotisspecial) { char *orig = p; if (0 == strncmp(p, "'''", 3)) { char *q = p + 3; while (1) { q = strstr(q, "'''"); if (0 == q) { return e_syntax(ctx, lineno, "unterminated triple-s-quote"); } while (q[3] == '\'') q++; break; } set_token(ctx, STRING, lineno, orig, q + 3 - orig); return 0; } if (0 == strncmp(p, "\"\"\"", 3)) { char *q = p + 3; while (1) { q = strstr(q, "\"\"\""); if (0 == q) { return e_syntax(ctx, lineno, "unterminated triple-d-quote"); } if (q[-1] == '\\') { q++; continue; } while (q[3] == '\"') q++; break; } // the string is [p+3, q-1] int hexreq = 0; /* #hex required */ int escape = 0; for (p += 3; p < q; p++) { if (escape) { escape = 0; if (strchr("btnfr\"\\", *p)) continue; if (*p == 'u') { hexreq = 4; continue; } if (*p == 'U') { hexreq = 8; continue; } if (p[strspn(p, " \t\r")] == '\n') continue; /* allow for line ending backslash */ return e_syntax(ctx, lineno, "bad escape char"); } if (hexreq) { hexreq--; if (strchr("0123456789ABCDEF", *p)) continue; return e_syntax(ctx, lineno, "expect hex char"); } if (*p == '\\') { escape = 1; continue; } } if (escape) return e_syntax(ctx, lineno, "expect an escape char"); if (hexreq) return e_syntax(ctx, lineno, "expected more hex char"); set_token(ctx, STRING, lineno, orig, q + 3 - orig); return 0; } if ('\'' == *p) { for (p++; *p && *p != '\n' && *p != '\''; p++) ; if (*p != '\'') { return e_syntax(ctx, lineno, "unterminated s-quote"); } set_token(ctx, STRING, lineno, orig, p + 1 - orig); return 0; } if ('\"' == *p) { int hexreq = 0; /* #hex required */ int escape = 0; for (p++; *p; p++) { if (escape) { escape = 0; if (strchr("btnfr\"\\", *p)) continue; if (*p == 'u') { hexreq = 4; continue; } if (*p == 'U') { hexreq = 8; continue; } return e_syntax(ctx, lineno, "bad escape char"); } if (hexreq) { hexreq--; if (strchr("0123456789ABCDEF", *p)) continue; return e_syntax(ctx, lineno, "expect hex char"); } if (*p == '\\') { escape = 1; continue; } if (*p == '\'') { if (p[1] == '\'' && p[2] == '\'') { return e_syntax(ctx, lineno, "triple-s-quote inside string lit"); } continue; } if (*p == '\n') break; if (*p == '"') break; } if (*p != '"') { return e_syntax(ctx, lineno, "unterminated quote"); } set_token(ctx, STRING, lineno, orig, p + 1 - orig); return 0; } /* check for timestamp without quotes */ if (0 == scan_date(p, 0, 0, 0) || 0 == scan_time(p, 0, 0, 0)) { // forward thru the timestamp p += strspn(p, "0123456789.:+-Tt Zz"); // squeeze out any spaces at end of string for (; p[-1] == ' '; p--) ; // tokenize set_token(ctx, STRING, lineno, orig, p - orig); return 0; } /* literals */ for (; *p && *p != '\n'; p++) { int ch = *p; if (ch == '.' && dotisspecial) break; if ('A' <= ch && ch <= 'Z') continue; if ('a' <= ch && ch <= 'z') continue; if (strchr("0123456789+-_.", ch)) continue; break; } set_token(ctx, STRING, lineno, orig, p - orig); return 0; } static int next_token(context_t *ctx, int dotisspecial) { int lineno = ctx->tok.lineno; char *p = ctx->tok.ptr; int i; /* eat this tok */ for (i = 0; i < ctx->tok.len; i++) { if (*p++ == '\n') lineno++; } /* make next tok */ while (p < ctx->stop) { /* skip comment. stop just before the \n. */ if (*p == '#') { for (p++; p < ctx->stop && *p != '\n'; p++) ; continue; } if (dotisspecial && *p == '.') { set_token(ctx, DOT, lineno, p, 1); return 0; } switch (*p) { case ',': set_token(ctx, COMMA, lineno, p, 1); return 0; case '=': set_token(ctx, EQUAL, lineno, p, 1); return 0; case '{': set_token(ctx, LBRACE, lineno, p, 1); return 0; case '}': set_token(ctx, RBRACE, lineno, p, 1); return 0; case '[': set_token(ctx, LBRACKET, lineno, p, 1); return 0; case ']': set_token(ctx, RBRACKET, lineno, p, 1); return 0; case '\n': set_token(ctx, NEWLINE, lineno, p, 1); return 0; case '\r': case ' ': case '\t': /* ignore white spaces */ p++; continue; } return scan_string(ctx, p, lineno, dotisspecial); } set_eof(ctx, lineno); return 0; } const char *toml_key_in(const toml_table_t *tab, int keyidx) { if (keyidx < tab->nkval) return tab->kval[keyidx]->key; keyidx -= tab->nkval; if (keyidx < tab->narr) return tab->arr[keyidx]->key; keyidx -= tab->narr; if (keyidx < tab->ntab) return tab->tab[keyidx]->key; return 0; } int toml_key_exists(const toml_table_t *tab, const char *key) { int i; for (i = 0; i < tab->nkval; i++) { if (0 == strcmp(key, tab->kval[i]->key)) return 1; } for (i = 0; i < tab->narr; i++) { if (0 == strcmp(key, tab->arr[i]->key)) return 1; } for (i = 0; i < tab->ntab; i++) { if (0 == strcmp(key, tab->tab[i]->key)) return 1; } return 0; } toml_raw_t toml_raw_in(const toml_table_t *tab, const char *key) { int i; for (i = 0; i < tab->nkval; i++) { if (0 == strcmp(key, tab->kval[i]->key)) return tab->kval[i]->val; } return 0; } toml_array_t *toml_array_in(const toml_table_t *tab, const char *key) { int i; for (i = 0; i < tab->narr; i++) { if (0 == strcmp(key, tab->arr[i]->key)) return tab->arr[i]; } return 0; } toml_table_t *toml_table_in(const toml_table_t *tab, const char *key) { int i; for (i = 0; i < tab->ntab; i++) { if (0 == strcmp(key, tab->tab[i]->key)) return tab->tab[i]; } return 0; } toml_raw_t toml_raw_at(const toml_array_t *arr, int idx) { return (0 <= idx && idx < arr->nitem) ? arr->item[idx].val : 0; } char toml_array_kind(const toml_array_t *arr) { return arr->kind; } char toml_array_type(const toml_array_t *arr) { if (arr->kind != 'v') return 0; if (arr->nitem == 0) return 0; return arr->type; } int toml_array_nelem(const toml_array_t *arr) { return arr->nitem; } const char *toml_array_key(const toml_array_t *arr) { return arr ? arr->key : (const char *)NULL; } int toml_table_nkval(const toml_table_t *tab) { return tab->nkval; } int toml_table_narr(const toml_table_t *tab) { return tab->narr; } int toml_table_ntab(const toml_table_t *tab) { return tab->ntab; } const char *toml_table_key(const toml_table_t *tab) { return tab ? tab->key : (const char *)NULL; } toml_array_t *toml_array_at(const toml_array_t *arr, int idx) { return (0 <= idx && idx < arr->nitem) ? arr->item[idx].arr : 0; } toml_table_t *toml_table_at(const toml_array_t *arr, int idx) { return (0 <= idx && idx < arr->nitem) ? arr->item[idx].tab : 0; } static int parse_millisec(const char *p, const char **endp); int toml_rtots(toml_raw_t src_, toml_timestamp_t *ret) { if (!src_) return -1; const char *p = src_; int must_parse_time = 0; memset(ret, 0, sizeof(*ret)); int *year = &ret->__buffer.year; int *month = &ret->__buffer.month; int *day = &ret->__buffer.day; int *hour = &ret->__buffer.hour; int *minute = &ret->__buffer.minute; int *second = &ret->__buffer.second; int *millisec = &ret->__buffer.millisec; /* parse date YYYY-MM-DD */ if (0 == scan_date(p, year, month, day)) { ret->year = year; ret->month = month; ret->day = day; p += 10; if (*p) { // parse the T or space separator if (*p != 'T' && *p != 't' && *p != ' ') return -1; must_parse_time = 1; p++; } } /* parse time HH:MM:SS */ if (0 == scan_time(p, hour, minute, second)) { ret->hour = hour; ret->minute = minute; ret->second = second; /* optionally, parse millisec */ p += 8; if (*p == '.') { p++; /* skip '.' */ const char *qq; *millisec = parse_millisec(p, &qq); ret->millisec = millisec; p = qq; } if (*p) { /* parse and copy Z */ char *z = ret->__buffer.z; ret->z = z; if (*p == 'Z' || *p == 'z') { *z++ = 'Z'; p++; *z = 0; } else if (*p == '+' || *p == '-') { *z++ = *p++; if (!(isdigit(p[0]) && isdigit(p[1]))) return -1; *z++ = *p++; *z++ = *p++; if (*p == ':') { *z++ = *p++; if (!(isdigit(p[0]) && isdigit(p[1]))) return -1; *z++ = *p++; *z++ = *p++; } *z = 0; } } } if (*p != 0) return -1; if (must_parse_time && !ret->hour) return -1; return 0; } /* Raw to boolean */ int toml_rtob(toml_raw_t src, int *ret_) { if (!src) return -1; int dummy; int *ret = ret_ ? ret_ : &dummy; if (0 == strcmp(src, "true")) { *ret = 1; return 0; } if (0 == strcmp(src, "false")) { *ret = 0; return 0; } return -1; } /* Raw to integer */ int toml_rtoi(toml_raw_t src, int64_t *ret_) { if (!src) return -1; char buf[100]; char *p = buf; char *q = p + sizeof(buf); const char *s = src; int base = 0; int64_t dummy; int64_t *ret = ret_ ? ret_ : &dummy; /* allow +/- */ if (s[0] == '+' || s[0] == '-') *p++ = *s++; /* disallow +_100 */ if (s[0] == '_') return -1; /* if 0* ... */ if ('0' == s[0]) { switch (s[1]) { case 'x': base = 16; s += 2; break; case 'o': base = 8; s += 2; break; case 'b': base = 2; s += 2; break; case '\0': return *ret = 0, 0; default: /* ensure no other digits after it */ if (s[1]) return -1; } } /* just strip underscores and pass to strtoll */ while (*s && p < q) { int ch = *s++; if (ch == '_') { // disallow '__' if (s[0] == '_') return -1; // numbers cannot end with '_' if (s[0] == '\0') return -1; continue; /* skip _ */ } *p++ = ch; } // if not at end-of-string or we ran out of buffer ... if (*s || p == q) return -1; /* cap with NUL */ *p = 0; /* Run strtoll on buf to get the integer */ char *endp; errno = 0; *ret = strtoll(buf, &endp, base); return (errno || *endp) ? -1 : 0; } int toml_rtod_ex(toml_raw_t src, double *ret_, char *buf, int buflen) { if (!src) return -1; char *p = buf; char *q = p + buflen; const char *s = src; double dummy; double *ret = ret_ ? ret_ : &dummy; /* allow +/- */ if (s[0] == '+' || s[0] == '-') *p++ = *s++; /* disallow +_1.00 */ if (s[0] == '_') return -1; /* decimal point, if used, must be surrounded by at least one digit on each * side */ { char *dot = strchr(s, '.'); if (dot) { if (dot == s || !isdigit(dot[-1]) || !isdigit(dot[1])) return -1; } } /* zero must be followed by . or 'e', or NUL */ if (s[0] == '0' && s[1] && !strchr("eE.", s[1])) return -1; /* just strip underscores and pass to strtod */ while (*s && p < q) { int ch = *s++; if (ch == '_') { // disallow '__' if (s[0] == '_') return -1; // disallow last char '_' if (s[0] == 0) return -1; continue; /* skip _ */ } *p++ = ch; } if (*s || p == q) return -1; /* reached end of string or buffer is full? */ /* cap with NUL */ *p = 0; /* Run strtod on buf to get the value */ char *endp; errno = 0; *ret = strtod(buf, &endp); return (errno || *endp) ? -1 : 0; } int toml_rtod(toml_raw_t src, double *ret_) { char buf[100]; return toml_rtod_ex(src, ret_, buf, sizeof(buf)); } int toml_rtos(toml_raw_t src, char **ret) { int multiline = 0; const char *sp; const char *sq; *ret = 0; if (!src) return -1; int qchar = src[0]; int srclen = strlen(src); if (!(qchar == '\'' || qchar == '"')) { return -1; } // triple quotes? if (qchar == src[1] && qchar == src[2]) { multiline = 1; sp = src + 3; sq = src + srclen - 3; /* last 3 chars in src must be qchar */ if (!(sp <= sq && sq[0] == qchar && sq[1] == qchar && sq[2] == qchar)) return -1; /* skip new line immediate after qchar */ if (sp[0] == '\n') sp++; else if (sp[0] == '\r' && sp[1] == '\n') sp += 2; } else { sp = src + 1; sq = src + srclen - 1; /* last char in src must be qchar */ if (!(sp <= sq && *sq == qchar)) return -1; } if (qchar == '\'') { *ret = norm_lit_str(sp, sq - sp, multiline, 0, 0); } else { *ret = norm_basic_str(sp, sq - sp, multiline, 0, 0); } return *ret ? 0 : -1; } toml_datum_t toml_string_at(const toml_array_t *arr, int idx) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtos(toml_raw_at(arr, idx), &ret.u.s)); return ret; } toml_datum_t toml_bool_at(const toml_array_t *arr, int idx) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtob(toml_raw_at(arr, idx), &ret.u.b)); return ret; } toml_datum_t toml_int_at(const toml_array_t *arr, int idx) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtoi(toml_raw_at(arr, idx), &ret.u.i)); return ret; } toml_datum_t toml_double_at(const toml_array_t *arr, int idx) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtod(toml_raw_at(arr, idx), &ret.u.d)); return ret; } toml_datum_t toml_timestamp_at(const toml_array_t *arr, int idx) { toml_timestamp_t ts; toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtots(toml_raw_at(arr, idx), &ts)); if (ret.ok) { ret.ok = !!(ret.u.ts = MALLOC(sizeof(*ret.u.ts))); if (ret.ok) { *ret.u.ts = ts; if (ret.u.ts->year) ret.u.ts->year = &ret.u.ts->__buffer.year; if (ret.u.ts->month) ret.u.ts->month = &ret.u.ts->__buffer.month; if (ret.u.ts->day) ret.u.ts->day = &ret.u.ts->__buffer.day; if (ret.u.ts->hour) ret.u.ts->hour = &ret.u.ts->__buffer.hour; if (ret.u.ts->minute) ret.u.ts->minute = &ret.u.ts->__buffer.minute; if (ret.u.ts->second) ret.u.ts->second = &ret.u.ts->__buffer.second; if (ret.u.ts->millisec) ret.u.ts->millisec = &ret.u.ts->__buffer.millisec; if (ret.u.ts->z) ret.u.ts->z = ret.u.ts->__buffer.z; } } return ret; } toml_datum_t toml_string_in(const toml_table_t *arr, const char *key) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); toml_raw_t raw = toml_raw_in(arr, key); if (raw) { ret.ok = (0 == toml_rtos(raw, &ret.u.s)); } return ret; } toml_datum_t toml_bool_in(const toml_table_t *arr, const char *key) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtob(toml_raw_in(arr, key), &ret.u.b)); return ret; } toml_datum_t toml_int_in(const toml_table_t *arr, const char *key) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtoi(toml_raw_in(arr, key), &ret.u.i)); return ret; } toml_datum_t toml_double_in(const toml_table_t *arr, const char *key) { toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtod(toml_raw_in(arr, key), &ret.u.d)); return ret; } toml_datum_t toml_timestamp_in(const toml_table_t *arr, const char *key) { toml_timestamp_t ts; toml_datum_t ret; memset(&ret, 0, sizeof(ret)); ret.ok = (0 == toml_rtots(toml_raw_in(arr, key), &ts)); if (ret.ok) { ret.ok = !!(ret.u.ts = MALLOC(sizeof(*ret.u.ts))); if (ret.ok) { *ret.u.ts = ts; if (ret.u.ts->year) ret.u.ts->year = &ret.u.ts->__buffer.year; if (ret.u.ts->month) ret.u.ts->month = &ret.u.ts->__buffer.month; if (ret.u.ts->day) ret.u.ts->day = &ret.u.ts->__buffer.day; if (ret.u.ts->hour) ret.u.ts->hour = &ret.u.ts->__buffer.hour; if (ret.u.ts->minute) ret.u.ts->minute = &ret.u.ts->__buffer.minute; if (ret.u.ts->second) ret.u.ts->second = &ret.u.ts->__buffer.second; if (ret.u.ts->millisec) ret.u.ts->millisec = &ret.u.ts->__buffer.millisec; if (ret.u.ts->z) ret.u.ts->z = ret.u.ts->__buffer.z; } } return ret; } static int parse_millisec(const char *p, const char **endp) { int ret = 0; int unit = 100; /* unit in millisec */ for (; '0' <= *p && *p <= '9'; p++, unit /= 10) { ret += (*p - '0') * unit; } *endp = p; return ret; } xrdp-0.10.1/third_party/tomlc99/Makefile.in000644 001751 000000 00000053565 14652432075 020552 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = third_party/tomlc99 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) libtoml_la_LIBADD = am_libtoml_la_OBJECTS = toml.lo libtoml_la_OBJECTS = $(am_libtoml_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libtoml_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libtoml_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/toml.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libtoml_la_SOURCES) DIST_SOURCES = $(libtoml_la_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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ toml.c \ toml.h \ LICENSE # See src/Makefile # '-x c' forces gcc to be used if we are using g++ for CI testing AM_CFLAGS = -x c -std=c99 -std=c99 -Wall -Wextra -fpic module_LTLIBRARIES = libtoml.la libtoml_la_SOURCES = toml.c toml.h libtoml_la_LDFLAGS = -version-info 1:0 include_headers = toml.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign third_party/tomlc99/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign third_party/tomlc99/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libtoml.la: $(libtoml_la_OBJECTS) $(libtoml_la_DEPENDENCIES) $(EXTRA_libtoml_la_DEPENDENCIES) $(AM_V_CCLD)$(libtoml_la_LINK) -rpath $(moduledir) $(libtoml_la_OBJECTS) $(libtoml_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toml.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(moduledir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/toml.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/toml.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/common/pixman-region.h000644 001751 000000 00000004615 14652432047 017061 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2016 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * region, from pixman.h */ #ifndef PIXMAN_PIXMAN_H__ #define PIXMAN_PIXMAN_H__ typedef int pixman_bool_t; struct pixman_region16_data { long size; long numRects; }; struct pixman_box16 { signed short x1, y1, x2, y2; }; struct pixman_region16 { struct pixman_box16 extents; struct pixman_region16_data *data; }; enum _pixman_region_overlap_t { PIXMAN_REGION_OUT, PIXMAN_REGION_IN, PIXMAN_REGION_PART }; typedef enum _pixman_region_overlap_t pixman_region_overlap_t; typedef struct pixman_region16_data pixman_region16_data_t; typedef struct pixman_box16 pixman_box16_t; typedef struct pixman_region16 pixman_region16_t; /* creation/destruction */ void pixman_region_init (pixman_region16_t *region); void pixman_region_init_rect (pixman_region16_t *region, int x, int y, unsigned int width, unsigned int height); void pixman_region_fini (pixman_region16_t *region); pixman_bool_t pixman_region_union (pixman_region16_t *new_reg, pixman_region16_t *reg1, pixman_region16_t *reg2); pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d, pixman_region16_t *reg_m, pixman_region16_t *reg_s); pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg, pixman_region16_t *reg1, pixman_region16_t *reg2); pixman_box16_t *pixman_region_rectangles (pixman_region16_t *region, int *n_rects); pixman_bool_t pixman_region_not_empty (pixman_region16_t *region); pixman_box16_t *pixman_region_extents (pixman_region16_t *region); #endif xrdp-0.10.1/common/ms-rdpbcgr.h000644 001751 000000 00000060642 14652432047 016346 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPBCGR : Definitions from [MS-RDPBCGR] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPBCGR are currently correct for v20190923 of that * document */ #if !defined(MS_RDPBCGR_H) #define MS_RDPBCGR_H /* RDP Security Negotiation codes */ #define RDP_NEG_REQ 0x01 /* MS-RDPBCGR 2.2.1.1.1 */ #define RDP_NEG_RSP 0x02 /* MS-RDPBCGR 2.2.1.2.1 */ #define RDP_NEG_FAILURE 0x03 /* MS-RDPBCGR 2.2.1.2.2 */ #define RDP_CORRELATION_INFO 0x06 /* MS-RDPBCGR 2.2.1.1.2 */ /* Protocol types codes (2.2.1.1.1, 2.2.1.2.1) */ #define PROTOCOL_RDP 0x00000000 #define PROTOCOL_SSL 0x00000001 #define PROTOCOL_HYBRID 0x00000002 #define PROTOCOL_RDSTLS 0x00000004 #define PROTOCOL_HYBRID_EX 0x00000008 /* Negotiation packet flags (2.2.1.2.1) */ #define EXTENDED_CLIENT_DATA_SUPPORTED 0x01 #define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02 #define NEGRSP_RESERVED 0x04 #define RESTRICTED_ADMIN_MODE_SUPPORTED 0x08 #define REDIRECTED_AUTHENTICATION_MODE_SUPPORTED 0x10 /* RDP Negotiation Failure Codes (2.2.1.2.2) */ #define SSL_REQUIRED_BY_SERVER 0x00000001 #define SSL_NOT_ALLOWED_BY_SERVER 0x00000002 #define SSL_CERT_NOT_ON_SERVER 0x00000003 #define INCONSISTENT_FLAGS 0x00000004 #define HYBRID_REQUIRED_BY_SERVER 0x00000005 #define SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER 0x00000006 /* TS_UD_HEADER: type ((2.2.1.3.1) */ /* TODO: to be renamed */ #define SEC_TAG_CLI_INFO 0xc001 /* CS_CORE? */ #define SEC_TAG_CLI_CRYPT 0xc002 /* CS_SECURITY? */ #define SEC_TAG_CLI_CHANNELS 0xc003 /* CS_CHANNELS? */ #define SEC_TAG_CLI_4 0xc004 /* CS_CLUSTER? */ #define SEC_TAG_CLI_MONITOR 0xc005 /* CS_MONITOR */ #define SEC_TAG_CLI_MONITOR_EX 0xc008 /* CS_MONITOR_EX */ #define SEC_TAG_SRV_INFO 0x0c01 /* SC_CORE */ #define SEC_TAG_SRV_CRYPT 0x0c02 /* SC_SECURITY */ #define SEC_TAG_SRV_CHANNELS 0x0c03 /* SC_NET? */ /* Client Core Data: colorDepth, postBeta2ColorDepth (2.2.1.3.2) */ #define RNS_UD_COLOR_4BPP 0xCA00 #define RNS_UD_COLOR_8BPP 0xCA01 #define RNS_UD_COLOR_16BPP_555 0xCA02 #define RNS_UD_COLOR_16BPP_565 0xCA03 #define RNS_UD_COLOR_24BPP 0xCA04 /* Client Core Data: supportedColorDepths (2.2.1.3.2) */ #define RNS_UD_24BPP_SUPPORT 0x0001 #define RNS_UD_16BPP_SUPPORT 0x0002 #define RNS_UD_15BPP_SUPPORT 0x0004 #define RNS_UD_32BPP_SUPPORT 0x0008 /* Client Core Data: earlyCapabilityFlags (2.2.1.3.2) */ #define RNS_UD_CS_WANT_32BPP_SESSION 0x0002 #define RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU 0x0040 #define RNS_UD_CS_SUPPORT_DYNVC_GFX_PROTOCOL 0x0100 /* Client Core Data: connectionType (2.2.1.3.2) */ #define CONNECTION_TYPE_MODEM 0x01 #define CONNECTION_TYPE_BROADBAND_LOW 0x02 #define CONNECTION_TYPE_SATELLITE 0x03 #define CONNECTION_TYPE_BROADBAND_HIGH 0x04 #define CONNECTION_TYPE_WAN 0x05 #define CONNECTION_TYPE_LAN 0x06 #define CONNECTION_TYPE_AUTODETECT 0x07 /* TS_UD_CS_NET (2.2.1.3.4) */ /* This isn't explicitly named in MS-RDPBCGR */ #define MAX_STATIC_CHANNELS 31 /* Channel definition structure CHANNEL_DEF (2.2.1.3.4.1) */ #define CHANNEL_NAME_LEN 7 /* These names are also not explicitly defined in MS-RDPBCGR */ #define CLIPRDR_SVC_CHANNEL_NAME "cliprdr" #define DRDYNVC_SVC_CHANNEL_NAME "drdynvc" #define RAIL_SVC_CHANNEL_NAME "rail" #define RDPSND_SVC_CHANNEL_NAME "rdpsnd" #define RDPDR_SVC_CHANNEL_NAME "rdpdr" /* 2.2.1.3.6 Client Monitor Data */ /* monitorCount (4 bytes): A 32-bit, unsigned integer. The number of display */ /* monitor definitions in the monitorDefArray field (the maximum allowed is 16). */ #define CLIENT_MONITOR_DATA_MAXIMUM_MONITORS 16 /* 2.2.1.3.6 Client Monitor Data */ /* The maximum width of the virtual desktop resulting from the union of the monitors */ /* contained in the monitorDefArray field MUST NOT exceed 32,766 pixels. Similarly, */ /* the maximum height of the virtual desktop resulting from the union of the monitors */ /* contained in the monitorDefArray field MUST NOT exceed 32,766 pixels. */ /* The minimum permitted size of the virtual desktop is 200 x 200 pixels. */ #define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_WIDTH 0xC8 // 200 #define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_DESKTOP_HEIGHT 0xC8 // 200 #define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_WIDTH 0x7FFE // 32766 #define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_DESKTOP_HEIGHT 0x7FFE // 32766 /* 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */ #define TS_MONITOR_PRIMARY 0x00000001 /* Options field */ /* NOTE: XR_ prefixed to avoid conflict with FreeRDP */ #define XR_CHANNEL_OPTION_INITIALIZED 0x80000000 #define XR_CHANNEL_OPTION_ENCRYPT_RDP 0x40000000 #define XR_CHANNEL_OPTION_ENCRYPT_SC 0x20000000 #define XR_CHANNEL_OPTION_ENCRYPT_CS 0x10000000 #define XR_CHANNEL_OPTION_PRI_HIGH 0x08000000 #define XR_CHANNEL_OPTION_PRI_MED 0x04000000 #define XR_CHANNEL_OPTION_PRI_LOW 0x02000000 #define XR_CHANNEL_OPTION_COMPRESS_RDP 0x00800000 #define XR_CHANNEL_OPTION_COMPRESS 0x00400000 #define XR_CHANNEL_OPTION_SHOW_PROTOCOL 0x00200000 #define REMOTE_CONTROL_PERSISTENT 0x00100000 /* Server Proprietary Certificate (2.2.1.4.3.1.1) */ /* TODO: to be renamed */ #define SEC_TAG_PUBKEY 0x0006 /* BB_RSA_KEY_BLOB */ #define SEC_TAG_KEYSIG 0x0008 /* BB_SIGNATURE_KEY_BLOB */ /* Info Packet (TS_INFO_PACKET): flags (2.2.1.11.1.1) */ /* TODO: to be renamed */ #define RDP_LOGON_AUTO 0x0008 #define RDP_LOGON_NORMAL 0x0033 #define RDP_COMPRESSION 0x0080 #define RDP_LOGON_BLOB 0x0100 #define RDP_LOGON_LEAVE_AUDIO 0x2000 #define RDP_LOGON_RAIL 0x8000 /* Extended Info Packet: clientAddress (2.2.1.11.1.1.1) */ #define EXTENDED_INFO_MAX_CLIENT_ADDR_LENGTH 80 /* Extended Info Packet: performanceFlags (2.2.1.11.1.1.1) */ /* TODO: to be renamed */ #define RDP5_DISABLE_NOTHING 0x00 #define RDP5_NO_WALLPAPER 0x01 #define RDP5_NO_FULLWINDOWDRAG 0x02 #define RDP5_NO_MENUANIMATIONS 0x04 #define RDP5_NO_THEMING 0x08 #define RDP5_NO_CURSOR_SHADOW 0x20 #define RDP5_NO_CURSORSETTINGS 0x40 /* disables cursor blinking */ /* LICENSE_PREAMBLE (2.2.1.12.1.1) */ #define ERROR_ALERT 0xff #define PREAMBLE_VERSION_3_0 0x03 /* LICENSE_BINARY_BLOB (2.2.1.12.1.2) */ #define BB_ERROR_BLOB 0x0004 /* LICENSE_ERROR_MESSAGE (2.2.1.12.1.3) */ #define STATUS_VALID_CLIENT 0x00000007 #define ST_NO_TRANSITION 0x00000002 /* Maps to generalCapabilitySet in T.128 page 138 */ /* Capability Set: capabilitySetType (2.2.1.13.1.1.1) */ #define CAPSTYPE_GENERAL 0x0001 #define CAPSTYPE_GENERAL_LEN 0x18 #define CAPSTYPE_BITMAP 0x0002 #define CAPSTYPE_BITMAP_LEN 0x1C #define CAPSTYPE_ORDER 0x0003 #define CAPSTYPE_ORDER_LEN 0x58 #define ORDER_CAP_NEGOTIATE 2 /* NEGOTIATEORDERSUPPORT? not used */ #define ORDER_CAP_NOSUPPORT 4 /* not used */ #define CAPSTYPE_BITMAPCACHE 0x0004 #define CAPSTYPE_BITMAPCACHE_LEN 0x28 #define CAPSTYPE_CONTROL 0x0005 #define CAPSTYPE_CONTROL_LEN 0x0C #define CAPSTYPE_ACTIVATION 0x0007 #define CAPSTYPE_ACTIVATION_LEN 0x0C #define CAPSTYPE_POINTER 0x0008 #define CAPSTYPE_POINTER_LEN 0x0a #define CAPSTYPE_POINTER_MONO_LEN 0x08 #define CAPSTYPE_SHARE 0x0009 #define CAPSTYPE_SHARE_LEN 0x08 #define CAPSTYPE_COLORCACHE 0x000A #define CAPSTYPE_COLORCACHE_LEN 0x08 #define CAPSTYPE_SOUND 0x000C #define CAPSTYPE_INPUT 0x000D #define CAPSTYPE_INPUT_LEN 0x58 #define CAPSTYPE_FONT 0x000E #define CAPSTYPE_FONT_LEN 0x04 #define CAPSTYPE_BRUSH 0x000F #define CAPSTYPE_BRUSH_LEN 0x08 #define CAPSTYPE_GLYPHCACHE 0x0010 #define CAPSTYPE_OFFSCREENCACHE 0x0011 #define CAPSTYPE_BITMAPCACHE_HOSTSUPPORT 0x0012 #define CAPSTYPE_BITMAPCACHE_HOSTSUPPORT_LEN 0x08 #define CAPSTYPE_BITMAPCACHE_REV2 0x0013 #define CAPSTYPE_BITMAPCACHE_REV2_LEN 0x28 #define BMPCACHE2_FLAG_PERSIST ((long)1<<31) #define CAPSTYPE_VIRTUALCHANNEL 0x0014 #define CAPSTYPE_VIRTUALCHANNEL_LEN 0x08 #define CAPSTYPE_DRAWNINGRIDCACHE 0x0015 #define CAPSTYPE_DRAWGDIPLUS 0x0016 #define CAPSTYPE_RAIL 0x0017 #define CAPSTYPE_WINDOW 0x0018 #define CAPSSETTYPE_COMPDESK 0x0019 #define CAPSSETTYPE_COMPDESK_LEN 0x06 #define CAPSSETTYPE_MULTIFRAGMENTUPDATE 0x001A #define CAPSSETTYPE_MULTIFRAGMENTUPDATE_LEN 0x08 #define CAPSETTYPE_LARGE_POINTER 0x001B #define CAPSETTYPE_LARGE_POINTER_LEN 0x06 #define CAPSETTYPE_SURFACE_COMMANDS 0x001C #define CAPSETTYPE_SURFACE_COMMANDS_LEN 0x0C #define CAPSSETTYPE_BITMAP_CODECS 0x001D #define CAPSSETTYPE_BITMAP_CODECS_LEN 0x1C #define CAPSTYPE_FRAME_ACKNOWLEDGE 0x001E #define CAPSTYPE_FRAME_ACKNOWLEDGE_LEN 0x08 /* Control PDU Data: action (2.2.1.15.1) */ /* TODO: to be renamed */ #define RDP_CTL_REQUEST_CONTROL 1 /* CTRLACTION_REQUEST_CONTROL */ #define RDP_CTL_GRANT_CONTROL 2 #define RDP_CTL_DETACH 3 #define RDP_CTL_COOPERATE 4 /* RDP5 disconnect PDU */ /* Set Error Info PDU Data: errorInfo (2.2.5.1.1) */ /* TODO: to be renamed */ #define exDiscReasonNoInfo 0x0000 #define exDiscReasonAPIInitiatedDisconnect 0x0001 #define exDiscReasonAPIInitiatedLogoff 0x0002 #define exDiscReasonServerIdleTimeout 0x0003 #define exDiscReasonServerLogonTimeout 0x0004 #define exDiscReasonReplacedByOtherConnection 0x0005 #define exDiscReasonOutOfMemory 0x0006 #define exDiscReasonServerDeniedConnection 0x0007 #define exDiscReasonServerDeniedConnectionFips 0x0008 #define exDiscReasonLicenseInternal 0x0100 #define exDiscReasonLicenseNoLicenseServer 0x0101 #define exDiscReasonLicenseNoLicense 0x0102 #define exDiscReasonLicenseErrClientMsg 0x0103 #define exDiscReasonLicenseHwidDoesntMatchLicense 0x0104 #define exDiscReasonLicenseErrClientLicense 0x0105 #define exDiscReasonLicenseCantFinishProtocol 0x0106 #define exDiscReasonLicenseClientEndedProtocol 0x0107 #define exDiscReasonLicenseErrClientEncryption 0x0108 #define exDiscReasonLicenseCantUpgradeLicense 0x0109 #define exDiscReasonLicenseNoRemoteConnections 0x010a /* Virtual channel PDU (2.2.6.1) */ #define CHANNEL_CHUNK_LENGTH 1600 /* Channel PDU Header flags (2.2.6.1.1) */ /* NOTE: XR_ prefixed to avoid conflict with FreeRDP */ #define XR_CHANNEL_FLAG_FIRST 0x00000001 #define XR_CHANNEL_FLAG_LAST 0x00000002 #define XR_CHANNEL_FLAG_SHOW_PROTOCOL 0x00000010 /* General Capability Set: osMajorType (2.2.7.1.1) */ #define OSMAJORTYPE_UNSPECIFIED 0x0000 #define OSMAJORTYPE_WINDOWS 0x0001 #define OSMAJORTYPE_OS2 0x0002 #define OSMAJORTYPE_MACINTOSH 0x0003 #define OSMAJORTYPE_UNIX 0x0004 #define OSMAJORTYPE_IOS 0x0005 #define OSMAJORTYPE_OSX 0x0006 #define OSMAJORTYPE_ANDROID 0x0007 #define OSMAJORTYPE_CHROME_OS 0x0008 /* General Capability Set: osMinorType (2.2.7.1.1) */ #define OSMINORTYPE_UNSPECIFIED 0x0000 #define OSMINORTYPE_WINDOWS_31X 0x0001 #define OSMINORTYPE_WINDOWS_95 0x0002 #define OSMINORTYPE_WINDOWS_NT 0x0003 #define OSMINORTYPE_OS2_V21 0x0004 #define OSMINORTYPE_POWER_PC 0x0005 #define OSMINORTYPE_MACINTOSH 0x0006 #define OSMINORTYPE_NATIVE_XSERVER 0x0007 #define OSMINORTYPE_PSEUDO_XSERVER 0x0008 #define OSMINORTYPE_WINDOWS_RT 0x0009 /* General Capability Set: protocolVersion (2.2.7.1.1) */ #define TS_CAPS_PROTOCOLVERSION 0x0200 /* General Capability Set: extraFlags (2.2.7.1.1) */ #define FASTPATH_OUTPUT_SUPPORTED 0x0001 #define NO_BITMAP_COMPRESSION_HDR 0x0400 #define LONG_CREDENTIALS_SUPPORTED 0x0004 #define AUTORECONNECT_SUPPORTED 0x0008 #define ENC_SALTED_CHECKSUM 0x0010 /* Order Capability Set: orderSupportExFlags (2.2.7.1.3) */ /* NOTE: XR_ prefixed to avoid conflict with FreeRDP */ #define XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT 0x0002 #define XR_ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT 0x0004 /* Order Capability Set: orderFlags (2.2.7.1.3) */ #define NEGOTIATEORDERSUPPORT 0x0002 #define ZEROBOUNDSDELTASUPPORT 0x0008 #define COLORINDEXSUPPORT 0x0020 #define SOLIDPATTERNBRUSHONLY 0x0040 #define ORDERFLAGS_EXTRA_FLAGS 0x0080 /* Order Capability Set: orderSupport (2.2.7.1.3) */ #define TS_NEG_DSTBLT_INDEX 0x00 #define TS_NEG_PATBLT_INDEX 0x01 #define TS_NEG_SCRBLT_INDEX 0x02 #define TS_NEG_MEMBLT_INDEX 0x03 #define TS_NEG_MEM3BLT_INDEX 0x04 /* 0x05 */ /* 0x06 */ #define TS_NEG_DRAWNINEGRID_INDEX 0x07 #define TS_NEG_LINETO_INDEX 0x08 #define TS_NEG_MULTI_DRAWNINEGRID_INDEX 0x09 /* 0x0A */ #define TS_NEG_SAVEBITMAP_INDEX 0x0B /* 0x0C */ /* 0x0D */ /* 0x0E */ #define TS_NEG_MULTIDSTBLT_INDEX 0x0F #define TS_NEG_MULTIPATBLT_INDEX 0x10 #define TS_NEG_MULTISCRBLT_INDEX 0x11 #define TS_NEG_MULTIOPAQUERECT_INDEX 0x12 #define TS_NEG_FAST_INDEX_INDEX 0x13 #define TS_NEG_POLYGON_SC_INDEX 0x14 #define TS_NEG_POLYGON_CB_INDEX 0x15 #define TS_NEG_POLYLINE_INDEX 0x16 /* 0x17 */ #define TS_NEG_FAST_GLYPH_INDEX 0x18 #define TS_NEG_ELLIPSE_SC_INDEX 0x19 #define TS_NEG_ELLIPSE_CB_INDEX 0x1A #define TS_NEG_INDEX_INDEX 0x1B /* 0x1C */ /* 0x1D */ /* 0x1E */ /* 0x1F */ /* Input Capability Set: inputFlags (2.2.7.1.6) */ #define INPUT_FLAG_SCANCODES 0x0001 #define INPUT_FLAG_MOUSEX 0x0004 #define INPUT_FLAG_FASTPATH_INPUT 0x0008 #define INPUT_FLAG_UNICODE 0x0010 #define INPUT_FLAG_FASTPATH_INPUT2 0x0020 #define INPUT_FLAG_UNUSED1 0x0040 #define INPUT_FLAG_UNUSED2 0x0080 #define TS_INPUT_FLAG_MOUSE_HWHEEL 0x0100 #define TS_INPUT_FLAG_QOE_TIMESTAMPS 0x0200 /* Glyph Cache Capability Set: GlyphSupportLevel (2.2.7.1.8) */ #define GLYPH_SUPPORT_NONE 0x0000 #define GLYPH_SUPPORT_PARTIAL 0x0001 #define GLYPH_SUPPORT_FULL 0x0002 #define GLYPH_SUPPORT_ENCODE 0x0003 /* Desktop Composition Capability Set: CompDeskSupportLevel (2.2.7.2.8) */ #define COMPDESK_NOT_SUPPORTED 0x0000 #define COMPDESK_SUPPORTED 0x0001 /* Surface Commands Capability Set: cmdFlags (2.2.7.2.9) */ #define SURFCMDS_SETSURFACEBITS 0x00000002 #define SURFCMDS_FRAMEMARKER 0x00000010 #define SURFCMDS_STREAMSUFRACEBITS 0x00000040 /* Bitmap Codec: codecGUID (2.2.7.2.10.1.1) */ /* CODEC_GUID_NSCODEC CA8D1BB9-000F-154F-589F-AE2D1A87E2D6 */ #define XR_CODEC_GUID_NSCODEC \ "\xb9\x1b\x8d\xca\x0f\x00\x4f\x15\x58\x9f\xae\x2d\x1a\x87\xe2\xd6" /* CODEC_GUID_REMOTEFX 76772F12-BD72-4463-AFB3-B73C9C6F7886 */ #define XR_CODEC_GUID_REMOTEFX \ "\x12\x2F\x77\x76\x72\xBD\x63\x44\xAF\xB3\xB7\x3C\x9C\x6F\x78\x86" /* CODEC_GUID_IMAGE_REMOTEFX 2744CCD4-9D8A-4E74-803C-0ECBEEA19C54 */ #define XR_CODEC_GUID_IMAGE_REMOTEFX \ "\xD4\xCC\x44\x27\x8A\x9D\x74\x4E\x80\x3C\x0E\xCB\xEE\xA1\x9C\x54" /* MFVideoFormat_H264 34363248-0000-0010-8000-00AA00389B71 */ #define XR_CODEC_GUID_H264 \ "\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71" /* CODEC_GUID_JPEG 1BAF4CE6-9EED-430C-869A-CB8B37B66237 */ #define XR_CODEC_GUID_JPEG \ "\xE6\x4C\xAF\x1B\xED\x9E\x0C\x43\x86\x9A\xCB\x8B\x37\xB6\x62\x37" /* CODEC_GUID_PNG 0E0C858D-28E0-45DB-ADAA-0F83E57CC560 */ #define XR_CODEC_GUID_PNG \ "\x8D\x85\x0C\x0E\xE0\x28\xDB\x45\xAD\xAA\x0F\x83\xE5\x7C\xC5\x60" /* CODEC_GUID_IGNORE 0C4351A6-3535-42AE-910C-CDFCE5760B58 */ #define XR_CODEC_GUID_IGNORE \ "\xA6\x51\x43\x0C\x35\x35\xAE\x42\x91\x0C\xCD\xFC\xE5\x76\x0B\x58" /* PDU Types (2.2.8.1.1.1.1) */ #define PDUTYPE_DEMANDACTIVEPDU 0x1 #define PDUTYPE_CONFIRMACTIVEPDU 0x3 #define PDUTYPE_DEACTIVATEALLPDU 0x6 #define PDUTYPE_DATAPDU 0x7 #define PDUTYPE_SERVER_REDIR_PKT 0xA #define PDUTYPE_TO_STR(pdu_type) \ ((pdu_type) == PDUTYPE_DEMANDACTIVEPDU ? "PDUTYPE_DEMANDACTIVEPDU" : \ (pdu_type) == PDUTYPE_CONFIRMACTIVEPDU ? "PDUTYPE_CONFIRMACTIVEPDU" : \ (pdu_type) == PDUTYPE_DEACTIVATEALLPDU ? "PDUTYPE_DEACTIVATEALLPDU" : \ (pdu_type) == PDUTYPE_DATAPDU ? "PDUTYPE_DATAPDU" : \ (pdu_type) == PDUTYPE_SERVER_REDIR_PKT ? "PDUTYPE_SERVER_REDIR_PKT" : \ "unknown" \ ) /* Share Data Header: pduType2 (2.2.8.1.1.1.2) */ /* TODO: to be renamed */ #define RDP_DATA_PDU_UPDATE 2 /* PDUTYPE2_UPDATE */ #define RDP_DATA_PDU_CONTROL 20 #define RDP_DATA_PDU_POINTER 27 #define RDP_DATA_PDU_INPUT 28 #define RDP_DATA_PDU_SYNCHRONISE 31 #define PDUTYPE2_REFRESH_RECT 33 #define RDP_DATA_PDU_PLAY_SOUND 34 #define PDUTYPE2_SUPPRESS_OUTPUT 35 #define PDUTYPE2_SHUTDOWN_REQUEST 36 #define PDUTYPE2_SHUTDOWN_DENIED 37 #define RDP_DATA_PDU_LOGON 38 #define RDP_DATA_PDU_FONT2 39 #define RDP_DATA_PDU_DISCONNECT 47 #define PDUTYPE2_MONITOR_LAYOUT_PDU 55 /* TS_SECURITY_HEADER: flags (2.2.8.1.1.2.1) */ #define SEC_EXCHANGE_PKT 0x0001 #define SEC_ENCRYPT 0x0008 #define SEC_INFO_PKT 0x0040 #define SEC_LICENSE_PKT 0x0080 #define SEC_LICENSE_ENCRYPT_CS 0x0280 /* Slow-Path Input Event: messageType (2.2.8.1.1.3.1.1) */ /* TODO: to be renamed */ #define RDP_INPUT_SYNCHRONIZE 0 #define RDP_INPUT_CODEPOINT 1 #define RDP_INPUT_VIRTKEY 2 #define RDP_INPUT_SCANCODE 4 #define RDP_INPUT_UNICODE 5 #define RDP_INPUT_MOUSE 0x8001 #define RDP_INPUT_MOUSEX 0x8002 /* Keyboard Event: keyboardFlags (2.2.8.1.1.3.1.1.1) */ /* TODO: to be renamed */ #define KBD_FLAG_RIGHT 0x0001 #define KBD_FLAG_EXT 0x0100 /* KBDFLAGS_EXTENDED */ #define KBD_FLAG_QUIET 0x1000 #define KBD_FLAG_DOWN 0x4000 #define KBD_FLAG_UP 0x8000 /* Mouse Event: pointerFlags (2.2.8.1.1.3.1.1.3) */ #define PTRFLAGS_HWHEEL 0x0400 #define PTRFLAGS_WHEEL 0x0200 #define PTRFLAGS_WHEEL_NEGATIVE 0x0100 #define WheelRotationMask 0x01FF #define PTRFLAGS_MOVE 0x0800 #define PTRFLAGS_DOWN 0x8000 #define PTRFLAGS_BUTTON1 0x1000 #define PTRFLAGS_BUTTON2 0x2000 #define PTRFLAGS_BUTTON3 0x4000 /* Extended Mouse Event: pointerFlags (2.2.8.1.1.3.1.1.4) */ #define PTRXFLAGS_DOWN 0x8000 #define PTRXFLAGS_BUTTON1 0x0001 #define PTRXFLAGS_BUTTON2 0x0002 /* Synchronize Event: toggleFlags (2.2.8.1.1.3.1.1.5) */ /* TODO: to be renamed */ #define KBD_FLAG_SCROLL 0x0001 /* TS_SYNC_SCROLL_LOCK */ #define KBD_FLAG_NUMLOCK 0x0002 #define KBD_FLAG_CAPITAL 0x0004 #define TS_SYNC_KANA_LOCK 0x0008 /* Client Fast-Path Input Event PDU 2.2.8.1.2 */ #define FASTPATH_INPUT_ENCRYPTED 0x2 /* Fast-Path Input Event: eventCode (2.2.8.1.2.2) */ #define FASTPATH_INPUT_EVENT_SCANCODE 0x0 #define FASTPATH_INPUT_EVENT_MOUSE 0x1 #define FASTPATH_INPUT_EVENT_MOUSEX 0x2 #define FASTPATH_INPUT_EVENT_SYNC 0x3 #define FASTPATH_INPUT_EVENT_UNICODE 0x4 #define FASTPATH_INPUT_EVENT_QOE_TIMESTAMP 0x6 /* Fast-Path Keyboard Event: eventHeader (2.2.8.1.2.2.1) */ #define FASTPATH_INPUT_KBDFLAGS_RELEASE 0x01 #define FASTPATH_INPUT_KBDFLAGS_EXTENDED 0x02 #define FASTPATH_INPUT_KBDFLAGS_EXTENDED1 0x04 /* Slow-Path Graphics Update: updateType (2.2.9.1.1.3.1) */ /* TODO: to be renamed */ #define RDP_UPDATE_ORDERS 0 #define RDP_UPDATE_BITMAP 1 #define RDP_UPDATE_PALETTE 2 #define RDP_UPDATE_SYNCHRONIZE 3 #define GRAPHICS_UPDATE_TYPE_TO_STR(type) \ ((type) == RDP_UPDATE_ORDERS ? "RDP_UPDATE_ORDERS" : \ (type) == RDP_UPDATE_BITMAP ? "RDP_UPDATE_BITMAP" : \ (type) == RDP_UPDATE_PALETTE ? "RDP_UPDATE_PALETTE" : \ (type) == RDP_UPDATE_SYNCHRONIZE ? "RDP_UPDATE_SYNCHRONIZE" : \ "unknown" \ ) /* Server Pointer Update PDU: messageType (2.2.9.1.1.4) */ /* TODO: to be renamed */ #define RDP_POINTER_SYSTEM 1 /* TS_PTRMSGTYPE_SYSTEM */ #define RDP_POINTER_MOVE 3 #define RDP_POINTER_COLOR 6 #define RDP_POINTER_CACHED 7 #define RDP_POINTER_POINTER 8 /* System Pointer Update: systemPointerType (2.2.9.1.1.4.3) */ #define RDP_NULL_POINTER 0 #define RDP_DEFAULT_POINTER 0x7F00 /* Server Fast-Path Update PDU: action (2.2.9.1.2) */ #define FASTPATH_OUTPUT_ACTION_FASTPATH 0x0 #define FASTPATH_OUTPUT_ACTION_X224 0x3 /* Server Fast-Path Update PDU: flags (2.2.9.1.2) */ #define FASTPATH_OUTPUT_SECURE_CHECKSUM 0x1 #define FASTPATH_OUTPUT_ENCRYPTED 0x2 /* Fast-Path Update: updateCode (2.2.9.1.2.1) */ #define FASTPATH_UPDATETYPE_ORDERS 0x0 #define FASTPATH_UPDATETYPE_BITMAP 0x1 #define FASTPATH_UPDATETYPE_PALETTE 0x2 #define FASTPATH_UPDATETYPE_SYNCHRONIZE 0x3 #define FASTPATH_UPDATETYPE_SURFCMDS 0x4 #define FASTPATH_UPDATETYPE_PTR_NULL 0x5 #define FASTPATH_UPDATETYPE_PTR_DEFAULT 0x6 #define FASTPATH_UPDATETYPE_PTR_POSITION 0x8 #define FASTPATH_UPDATETYPE_COLOR 0x9 #define FASTPATH_UPDATETYPE_CACHED 0xA #define FASTPATH_UPDATETYPE_POINTER 0xB /* Fast-Path Update: fragmentation (2.2.9.1.2.1) */ #define FASTPATH_FRAGMENT_SINGLE 0x0 #define FASTPATH_FRAGMENT_LAST 0x1 #define FASTPATH_FRAGMENT_FIRST 0x2 #define FASTPATH_FRAGMENT_NEXT 0x3 #define FASTPATH_OUTPUT_COMPRESSION_USED 0x2 /* Surface Command Type (2.2.9.1.2.1.10.1) */ #define CMDTYPE_SET_SURFACE_BITS 0x0001 #define CMDTYPE_FRAME_MARKER 0x0004 #define CMDTYPE_STREAM_SURFACE_BITS 0x0006 /* Compression Flags (3.1.8.2.1) */ /* TODO: to be renamed, not used anywhere */ #define RDP_MPPC_COMPRESSED 0x20 #define RDP_MPPC_RESET 0x40 #define RDP_MPPC_FLUSH 0x80 #define RDP_MPPC_DICT_SIZE 8192 /* RDP 4.0 | MS-RDPBCGR 3.1.8 */ /* largePointerSupprtFlags (2.2.7.2.7) */ #define LARGE_POINTER_FLAG_96x96 0x00000001 #define LARGE_POINTER_FLAG_384x384 0x00000002 #endif /* MS_RDPBCGR_H */ xrdp-0.10.1/common/file.h000644 001751 000000 00000002136 14652432047 015217 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * read a config file */ #if !defined(FILE_H) #define FILE_H #include "arch.h" int file_read_sections(int fd, struct list *names); int file_by_name_read_sections(const char *file_name, struct list *names); int file_read_section(int fd, const char *section, struct list *names, struct list *values); int file_by_name_read_section(const char *file_name, const char *section, struct list *names, struct list *values); #endif xrdp-0.10.1/common/trans.c000644 001751 000000 00000066022 14652432047 015426 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * generic transport */ #if defined(HAVE_CONFIG_H) #include #endif #include "os_calls.h" #include "string_calls.h" #include "trans.h" #include "arch.h" #include "parse.h" #include "ssl_calls.h" #include "log.h" #define MAX_SBYTES 0 /** Time between polls of is_term when connecting */ #define CONNECT_TERM_POLL_MS 3000 /** Time we wait before another connect() attempt if one fails immediately */ #define CONNECT_DELAY_ON_FAIL_MS 2000 /*****************************************************************************/ int trans_tls_recv(struct trans *self, char *ptr, int len) { if (self->tls == NULL) { return 1; } return ssl_tls_read(self->tls, ptr, len); } /*****************************************************************************/ int trans_tls_send(struct trans *self, const char *data, int len) { if (self->tls == NULL) { return 1; } return ssl_tls_write(self->tls, data, len); } /*****************************************************************************/ int trans_tls_can_recv(struct trans *self, int sck, int millis) { if (self->tls == NULL) { return 1; } return ssl_tls_can_recv(self->tls, sck, millis); } /*****************************************************************************/ int trans_tcp_recv(struct trans *self, char *ptr, int len) { return g_tcp_recv(self->sck, ptr, len, 0); } /*****************************************************************************/ int trans_tcp_send(struct trans *self, const char *data, int len) { return g_tcp_send(self->sck, data, len, 0); } /*****************************************************************************/ int trans_tcp_can_recv(struct trans *self, int sck, int millis) { return g_sck_can_recv(sck, millis); } /*****************************************************************************/ struct trans * trans_create(int mode, int in_size, int out_size) { struct trans *self = (struct trans *) NULL; self = (struct trans *) g_malloc(sizeof(struct trans), 1); if (self != NULL) { self->sck = -1; make_stream(self->in_s); init_stream(self->in_s, in_size); make_stream(self->out_s); init_stream(self->out_s, out_size); self->mode = mode; self->tls = 0; /* assign tcp calls by default */ self->trans_recv = trans_tcp_recv; self->trans_send = trans_tcp_send; self->trans_can_recv = trans_tcp_can_recv; } return self; } /*****************************************************************************/ void trans_delete(struct trans *self) { if (self == 0) { return; } /* Call the user-specified destructor if one exists */ if (self->extra_destructor != NULL) { self->extra_destructor(self); } free_stream(self->in_s); free_stream(self->out_s); if (self->sck >= 0) { g_tcp_close(self->sck); } self->sck = -1; if (self->listen_filename != 0) { g_file_delete(self->listen_filename); g_free(self->listen_filename); } if (self->tls != 0) { ssl_tls_delete(self->tls); } g_free(self); } /*****************************************************************************/ void trans_delete_from_child(struct trans *self) { if (self == 0) { return; } if (self->listen_filename != 0) { g_free(self->listen_filename); self->listen_filename = 0; } trans_delete(self); } /*****************************************************************************/ int trans_get_wait_objs(struct trans *self, tbus *objs, int *count) { if (self == 0) { return 1; } if (self->status != TRANS_STATUS_UP) { return 1; } objs[*count] = self->sck; (*count)++; if (self->tls != NULL && (objs[*count] = ssl_get_rwo(self->tls)) != 0) { (*count)++; } return 0; } /*****************************************************************************/ int trans_get_wait_objs_rw(struct trans *self, tbus *robjs, int *rcount, tbus *wobjs, int *wcount, int *timeout) { if (self == 0) { return 1; } if (self->status != TRANS_STATUS_UP) { return 1; } if ((self->si != 0) && (self->si->source[self->my_source] > MAX_SBYTES)) { } else { if (trans_get_wait_objs(self, robjs, rcount) != 0) { return 1; } } if (self->wait_s != 0) { wobjs[*wcount] = self->sck; (*wcount)++; } return 0; } /*****************************************************************************/ int trans_send_waiting(struct trans *self, int block) { struct stream *temp_s; int bytes; int sent; int timeout; int cont; timeout = block ? 100 : 0; cont = 1; while (cont) { if (self->wait_s != 0) { temp_s = self->wait_s; if (g_tcp_can_send(self->sck, timeout)) { bytes = (int) (temp_s->end - temp_s->p); sent = self->trans_send(self, temp_s->p, bytes); if (sent > 0) { temp_s->p += sent; if (temp_s->source != 0) { temp_s->source[0] -= sent; } if (temp_s->p >= temp_s->end) { self->wait_s = temp_s->next; free_stream(temp_s); } } else if (sent == 0) { return 1; } else { if (!g_tcp_last_error_would_block(self->sck)) { return 1; } } } else if (block) { /* check for term here */ if (self->is_term != 0) { if (self->is_term()) { /* term */ return 1; } } } } else { break; } cont = block; } return 0; } /*****************************************************************************/ int trans_check_wait_objs(struct trans *self) { tbus in_sck = (tbus) 0; struct trans *in_trans = (struct trans *) NULL; int read_bytes = 0; unsigned int to_read = 0; unsigned int read_so_far = 0; int rv = 0; enum xrdp_source cur_source; if (self == 0) { return 1; } if (self->status != TRANS_STATUS_UP) { return 1; } rv = 0; if (self->type1 == TRANS_TYPE_LISTENER) /* listening */ { if (g_sck_can_recv(self->sck, 0)) { in_sck = g_sck_accept(self->sck); if (in_sck == -1) { if (g_tcp_last_error_would_block(self->sck)) { /* ok, but shouldn't happen */ } else { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } } if (in_sck != -1) { if (self->trans_conn_in != 0) /* is function assigned */ { in_trans = trans_create(self->mode, self->in_s->size, self->out_s->size); in_trans->sck = in_sck; in_trans->type1 = TRANS_TYPE_SERVER; in_trans->status = TRANS_STATUS_UP; in_trans->is_term = self->is_term; g_file_set_cloexec(in_sck, 1); g_sck_set_non_blocking(in_sck); if (self->trans_conn_in(self, in_trans) != 0) { trans_delete(in_trans); } } else { g_tcp_close(in_sck); } } } } else /* connected server or client (2 or 3) */ { if (self->si != 0 && self->si->source[self->my_source] > MAX_SBYTES) { } else if (self->trans_can_recv(self, self->sck, 0)) { /* CVE-2022-23479 - check a malicious caller hasn't managed * to set the header_size to an unreasonable value */ if (self->header_size > (unsigned int)self->in_s->size) { LOG(LOG_LEVEL_ERROR, "trans_check_wait_objs: Reading %u bytes beyond buffer", self->header_size - (unsigned int)self->in_s->size); self->status = TRANS_STATUS_DOWN; return 1; } cur_source = XRDP_SOURCE_NONE; if (self->si != 0) { cur_source = self->si->cur_source; self->si->cur_source = self->my_source; } read_so_far = self->in_s->end - self->in_s->data; to_read = self->header_size - read_so_far; if (to_read > 0) { read_bytes = self->trans_recv(self, self->in_s->end, to_read); if (read_bytes == -1) { if (g_tcp_last_error_would_block(self->sck)) { /* ok, but shouldn't happen */ } else { /* error */ self->status = TRANS_STATUS_DOWN; if (self->si != 0) { self->si->cur_source = cur_source; } return 1; } } else if (read_bytes == 0) { /* error */ self->status = TRANS_STATUS_DOWN; if (self->si != 0) { self->si->cur_source = cur_source; } return 1; } else { self->in_s->end += read_bytes; } } read_so_far = self->in_s->end - self->in_s->data; if (read_so_far == self->header_size) { if (self->trans_data_in != 0) { rv = self->trans_data_in(self); if (self->no_stream_init_on_data_in == 0) { init_stream(self->in_s, 0); } } } if (self->si != 0) { self->si->cur_source = cur_source; } } if (trans_send_waiting(self, 0) != 0) { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } } return rv; } /*****************************************************************************/ int trans_force_read_s(struct trans *self, struct stream *in_s, int size) { int rcvd; if (self->status != TRANS_STATUS_UP || size < 0 || !s_check_rem_out(in_s, size)) { return 1; } while (size > 0) { rcvd = self->trans_recv(self, in_s->end, size); if (rcvd == -1) { if (g_tcp_last_error_would_block(self->sck)) { if (!self->trans_can_recv(self, self->sck, 100)) { /* check for term here */ if (self->is_term != 0) { if (self->is_term()) { /* term */ self->status = TRANS_STATUS_DOWN; return 1; } } } } else { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } } else if (rcvd == 0) { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } else { in_s->end += rcvd; size -= rcvd; } } return 0; } /*****************************************************************************/ int trans_force_read(struct trans *self, int size) { return trans_force_read_s(self, self->in_s, size); } /*****************************************************************************/ int trans_force_write_s(struct trans *self, struct stream *out_s) { int size; int total; int sent; if (self->status != TRANS_STATUS_UP) { return 1; } size = (int) (out_s->end - out_s->data); total = 0; if (trans_send_waiting(self, 1) != 0) { self->status = TRANS_STATUS_DOWN; return 1; } while (total < size) { sent = self->trans_send(self, out_s->data + total, size - total); if (sent == -1) { if (g_tcp_last_error_would_block(self->sck)) { if (!g_tcp_can_send(self->sck, 100)) { /* check for term here */ if (self->is_term != 0) { if (self->is_term()) { /* term */ self->status = TRANS_STATUS_DOWN; return 1; } } } } else { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } } else if (sent == 0) { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } else { total = total + sent; } } return 0; } /*****************************************************************************/ int trans_force_write(struct trans *self) { return trans_force_write_s(self, self->out_s); } /*****************************************************************************/ int trans_write_copy_s(struct trans *self, struct stream *out_s) { int size; int sent; struct stream *wait_s; struct stream *temp_s; char *out_data; if (self->status != TRANS_STATUS_UP) { return 1; } /* try to send any left over */ if (trans_send_waiting(self, 0) != 0) { /* error */ self->status = TRANS_STATUS_DOWN; return 1; } out_data = out_s->data; sent = 0; size = (int) (out_s->end - out_s->data); if (self->wait_s == 0) { /* if no left over, try to send this new data */ if (g_tcp_can_send(self->sck, 0)) { sent = self->trans_send(self, out_s->data, size); if (sent > 0) { out_data += sent; size -= sent; } else if (sent == 0) { return 1; } else { if (!g_tcp_last_error_would_block(self->sck)) { return 1; } } } } if (size < 1) { return 0; } /* did not send right away, have to copy */ make_stream(wait_s); init_stream(wait_s, size); if (self->si != 0) { if ((self->si->cur_source != XRDP_SOURCE_NONE) && (self->si->cur_source != self->my_source)) { self->si->source[self->si->cur_source] += size; wait_s->source = self->si->source + self->si->cur_source; } } out_uint8a(wait_s, out_data, size); s_mark_end(wait_s); wait_s->p = wait_s->data; if (self->wait_s == 0) { self->wait_s = wait_s; } else { temp_s = self->wait_s; while (temp_s->next != 0) { temp_s = temp_s->next; } temp_s->next = wait_s; } return 0; } /*****************************************************************************/ int trans_write_copy(struct trans *self) { return trans_write_copy_s(self, self->out_s); } /*****************************************************************************/ /* Shim to apply the function signature of g_tcp_connect() * to g_tcp_local_connect() */ static int local_connect_shim(int fd, const char *server, const char *port) { return g_tcp_local_connect(fd, port); } /**************************************************************************//** * Waits for an asynchronous connect to complete. * @param self - Transport object * @param start_time Start time of connect (from g_time3()) * @param timeout Total wait timeout * @return 0 - connect succeeded, 1 - Connect failed * * If the transport is set up for checking a termination object, this * on a regular basis. */ static int poll_for_async_connect(struct trans *self, int start_time, int timeout) { int rv = 1; int ms_remaining = timeout - (g_time3() - start_time); while (ms_remaining > 0) { int poll_time = ms_remaining; /* Lower bound for waiting for a result */ if (poll_time < 100) { poll_time = 100; } /* Limit the wait time if we need to poll for termination */ if (self->is_term != NULL && poll_time > CONNECT_TERM_POLL_MS) { poll_time = CONNECT_TERM_POLL_MS; } if (g_tcp_can_send(self->sck, poll_time)) { /* Connect has finished - return the socket status */ rv = g_sck_socket_ok(self->sck) ? 0 : 1; break; } /* Check for program termination */ if (self->is_term != NULL && self->is_term()) { break; } ms_remaining = timeout - (g_time3() - start_time); } return rv; } /*****************************************************************************/ int trans_connect(struct trans *self, const char *server, const char *port, int timeout) { int start_time = g_time3(); int error; int ms_before_next_connect; /* * Function pointers which we use in the main loop to avoid * having to switch on the socket mode */ int (*f_alloc_socket)(void); int (*f_connect)(int fd, const char *server, const char *port); switch (self->mode) { case TRANS_MODE_TCP: f_alloc_socket = g_tcp_socket; f_connect = g_tcp_connect; break; case TRANS_MODE_UNIX: f_alloc_socket = g_tcp_local_socket; f_connect = local_connect_shim; break; default: LOG(LOG_LEVEL_ERROR, "Bad socket mode %d", self->mode); return 1; } while (1) { /* Check the program isn't terminating */ if (self->is_term != NULL && self->is_term()) { error = 1; break; } /* Allocate a new socket */ if (self->sck >= 0) { g_tcp_close(self->sck); } self->sck = f_alloc_socket(); if (self->sck < 0) { error = 1; break; } /* Try to connect asynchronously */ g_file_set_cloexec(self->sck, 1); g_tcp_set_non_blocking(self->sck); error = f_connect(self->sck, server, port); if (error == 0) { /* Connect was immediately successful */ break; } if (g_tcp_last_error_would_block(self->sck)) { /* Async connect is in progress */ if (poll_for_async_connect(self, start_time, timeout) == 0) { /* Async connect was successful */ error = 0; break; } /* No need to wait any more before the next connect attempt */ ms_before_next_connect = 0; } else { /* Connect failed immediately. Wait a bit before the next * attempt */ ms_before_next_connect = CONNECT_DELAY_ON_FAIL_MS; } /* Have we reached the total timeout yet? */ int ms_left = timeout - (g_time3() - start_time); if (ms_left <= 0) { error = 1; break; } /* Sleep a bit before trying again */ if (ms_before_next_connect > 0) { if (ms_before_next_connect > ms_left) { ms_before_next_connect = ms_left; } g_sleep(ms_before_next_connect); } } if (error != 0) { if (self->sck >= 0) { g_tcp_close(self->sck); self->sck = -1; } self->status = TRANS_STATUS_DOWN; } else { self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_CLIENT; /* client */ } return error; } /*****************************************************************************/ /** * @return 0 on success, 1 on failure */ int trans_listen_address(struct trans *self, const char *port, const char *address) { if (self->sck >= 0) { g_tcp_close(self->sck); } if (self->mode == TRANS_MODE_TCP) /* tcp */ { self->sck = g_tcp_socket(); if (self->sck < 0) { return 1; } g_file_set_cloexec(self->sck, 1); g_tcp_set_non_blocking(self->sck); if (g_tcp_bind_address(self->sck, port, address) == 0) { if (g_tcp_listen(self->sck) == 0) { self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_LISTENER; /* listener */ return 0; } } } else if (self->mode == TRANS_MODE_UNIX) /* unix socket */ { g_free(self->listen_filename); self->listen_filename = 0; g_file_delete(port); self->sck = g_tcp_local_socket(); if (self->sck < 0) { return 1; } g_file_set_cloexec(self->sck, 1); g_tcp_set_non_blocking(self->sck); if (g_tcp_local_bind(self->sck, port) == 0) { self->listen_filename = g_strdup(port); if (g_tcp_listen(self->sck) == 0) { g_chmod_hex(port, 0x0660); self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_LISTENER; /* listener */ return 0; } } } else if (self->mode == TRANS_MODE_VSOCK) /* vsock socket */ { self->sck = g_sck_vsock_socket(); if (self->sck < 0) { return 1; } g_file_set_cloexec(self->sck, 1); g_tcp_set_non_blocking(self->sck); if (g_sck_vsock_bind_address(self->sck, port, address) == 0) { if (g_tcp_listen(self->sck) == 0) { self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_LISTENER; /* listener */ return 0; } } } else if (self->mode == TRANS_MODE_TCP4) /* tcp4 */ { self->sck = g_tcp4_socket(); if (self->sck < 0) { return 1; } g_file_set_cloexec(self->sck, 1); g_tcp_set_non_blocking(self->sck); if (g_tcp4_bind_address(self->sck, port, address) == 0) { if (g_tcp_listen(self->sck) == 0) { self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_LISTENER; /* listener */ return 0; } } } else if (self->mode == TRANS_MODE_TCP6) /* tcp6 */ { self->sck = g_tcp6_socket(); if (self->sck < 0) { return 1; } g_file_set_cloexec(self->sck, 1); g_tcp_set_non_blocking(self->sck); if (g_tcp6_bind_address(self->sck, port, address) == 0) { if (g_tcp_listen(self->sck) == 0) { self->status = TRANS_STATUS_UP; /* ok */ self->type1 = TRANS_TYPE_LISTENER; /* listener */ return 0; } } } return 1; } /*****************************************************************************/ int trans_listen(struct trans *self, const char *port) { return trans_listen_address(self, port, "0.0.0.0"); } /*****************************************************************************/ struct stream * trans_get_in_s(struct trans *self) { struct stream *rv = (struct stream *) NULL; if (self == NULL) { rv = (struct stream *) NULL; } else { rv = self->in_s; } return rv; } /*****************************************************************************/ struct stream * trans_get_out_s(struct trans *self, int size) { struct stream *rv = (struct stream *) NULL; if (self == NULL) { rv = (struct stream *) NULL; } else { init_stream(self->out_s, size); rv = self->out_s; } return rv; } /*****************************************************************************/ /* returns error */ int trans_set_tls_mode(struct trans *self, const char *key, const char *cert, long ssl_protocols, const char *tls_ciphers) { self->tls = ssl_tls_create(self, key, cert); if (self->tls == NULL) { LOG(LOG_LEVEL_ERROR, "trans_set_tls_mode: ssl_tls_create malloc error"); return 1; } if (ssl_tls_accept(self->tls, ssl_protocols, tls_ciphers) != 0) { LOG(LOG_LEVEL_ERROR, "trans_set_tls_mode: ssl_tls_accept failed"); return 1; } /* assign tls functions */ self->trans_recv = trans_tls_recv; self->trans_send = trans_tls_send; self->trans_can_recv = trans_tls_can_recv; self->ssl_protocol = ssl_get_version(self->tls); self->cipher_name = ssl_get_cipher_name(self->tls); return 0; } /*****************************************************************************/ /* returns error */ int trans_shutdown_tls_mode(struct trans *self) { if (self->tls != NULL) { return ssl_tls_disconnect(self->tls); } /* assign callback back to tcp cal */ self->trans_recv = trans_tcp_recv; self->trans_send = trans_tcp_send; self->trans_can_recv = trans_tcp_can_recv; return 0; } xrdp-0.10.1/common/ms-rdpefs.h000644 001751 000000 00000011205 14652432047 016175 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPEFS : Definitions from [MS-RDPEFS] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPEFS are currently correct for v20180912 of that * document */ #if !defined(MS_RDPEFS_H) #define MS_RDPEFS_H /* * RDPDR_HEADER definitions (2.2.1.1) */ /* device redirector core component; most of the packets in this protocol */ /* are sent under this component ID */ #define RDPDR_CTYP_CORE 0x4472 /* printing component. the packets that use this ID are typically about */ /* printer cache management and identifying XPS printers */ #define RDPDR_CTYP_PRN 0x5052 /* Server Announce Request, as specified in section 2.2.2.2 */ #define PAKID_CORE_SERVER_ANNOUNCE 0x496E /* Client Announce Reply and Server Client ID Confirm, as specified in */ /* sections 2.2.2.3 and 2.2.2.6. */ #define PAKID_CORE_CLIENTID_CONFIRM 0x4343 /* Client Name Request, as specified in section 2.2.2.4 */ #define PAKID_CORE_CLIENT_NAME 0x434E /* Client Device List Announce Request, as specified in section 2.2.2.9 */ #define PAKID_CORE_DEVICELIST_ANNOUNCE 0x4441 /* Server Device Announce Response, as specified in section 2.2.2.1 */ #define PAKID_CORE_DEVICE_REPLY 0x6472 /* Device I/O Request, as specified in section 2.2.1.4 */ #define PAKID_CORE_DEVICE_IOREQUEST 0x4952 /* Device I/O Response, as specified in section 2.2.1.5 */ #define PAKID_CORE_DEVICE_IOCOMPLETION 0x4943 /* Server Core Capability Request, as specified in section 2.2.2.7 */ #define PAKID_CORE_SERVER_CAPABILITY 0x5350 /* Client Core Capability Response, as specified in section 2.2.2.8 */ #define PAKID_CORE_CLIENT_CAPABILITY 0x4350 /* Client Drive Device List Remove, as specified in section 2.2.3.2 */ #define PAKID_CORE_DEVICELIST_REMOVE 0x444D /* Add Printer Cachedata, as specified in [MS-RDPEPC] section 2.2.2.3 */ #define PAKID_PRN_CACHE_DATA 0x5043 /* Server User Logged On, as specified in section 2.2.2.5 */ #define PAKID_CORE_USER_LOGGEDON 0x554C /* Server Printer Set XPS Mode, as specified in [MS-RDPEPC] section 2.2.2.2 */ #define PAKID_PRN_USING_XPS 0x5543 /* * Capability header definitions (2.2.1.2) */ #define CAP_GENERAL_TYPE 0x0001 /* General cap set - GENERAL_CAPS_SET */ #define CAP_PRINTER_TYPE 0x0002 /* Print cap set - PRINTER_CAPS_SET */ #define CAP_PORT_TYPE 0x0003 /* Port cap set - PORT_CAPS_SET */ #define CAP_DRIVE_TYPE 0x0004 /* Drive cap set - DRIVE_CAPS_SET */ #define CAP_SMARTCARD_TYPE 0x0005 /* Smart card cap set - SMARTCARD_CAPS_SET */ /* * Device announce header (2.2.1.3) */ #define RDPDR_DTYP_SERIAL 0x0001 #define RDPDR_DTYP_PARALLEL 0x0002 #define RDPDR_DTYP_PRINT 0x0004 #define RDPDR_DTYP_FILESYSTEM 0x0008 #define RDPDR_DTYP_SMARTCARD 0x0020 /* Device I/O Request definitions (2.2.1.4) */ /* MajorFunction */ enum IRP_MJ { IRP_MJ_CREATE = 0x00000000, IRP_MJ_CLOSE = 0x00000002, IRP_MJ_READ = 0x00000003, IRP_MJ_WRITE = 0x00000004, IRP_MJ_DEVICE_CONTROL = 0x0000000E, IRP_MJ_QUERY_VOLUME_INFORMATION = 0x0000000A, IRP_MJ_SET_VOLUME_INFORMATION = 0x0000000B, IRP_MJ_QUERY_INFORMATION = 0x00000005, IRP_MJ_SET_INFORMATION = 0x00000006, IRP_MJ_DIRECTORY_CONTROL = 0x0000000C, IRP_MJ_LOCK_CONTROL = 0x00000011 }; /* MinorFunction */ /* Set to zero unless MajorFunction code == IRP_MJ_DIRECTORY_CONTROL */ enum IRP_MN { IRP_MN_NONE = 0x00000000, /* Name not in MS docs */ IRP_MN_QUERY_DIRECTORY = 0x00000001, IRP_MN_NOTIFY_CHANGE_DIRECTORY = 0x00000002 }; /* * General Capability Set (2.2.2.7.1) */ /* extendedPDU fields */ #define RDPDR_USER_LOGGEDON_PDU 0x00000004 #endif /* MS_RDPEFS_H */ xrdp-0.10.1/common/string_calls.c000644 001751 000000 00000106004 14652432047 016756 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2020 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * generic string handling calls */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include #include #include #include "log.h" #include "os_calls.h" #include "string_calls.h" #include "defines.h" #include "unicode_defines.h" unsigned int g_format_info_string(char *dest, unsigned int len, const char *format, const struct info_string_tag map[]) { unsigned int result = 0; const char *copy_from; /* Data to add to output */ unsigned int copy_len; /* Length of above */ unsigned int skip; /* Date to skip over in format string */ const char *p; const struct info_string_tag *m; for ( ; *format != '\0'; format += skip) { if (*format == '%') { char ch = *(format + 1); if (ch == '%') { /* '%%' in format - replace with single '%' */ copy_from = format; copy_len = 1; skip = 2; } else if (ch == '\0') { /* Percent at end of string - ignore */ copy_from = NULL; copy_len = 0; skip = 1; } else { /* Look up the character in the map, assuming failure */ copy_from = NULL; copy_len = 0; skip = 2; for (m = map ; m->ch != '\0' ; ++m) { if (ch == m->ch) { copy_from = m->val; copy_len = strlen(copy_from); break; } } } } else if ((p = strchr(format, '%')) != NULL) { /* Copy up to the next '%' */ copy_from = format; copy_len = p - format; skip = copy_len; } else { /* Copy the rest of the format string */ copy_from = format; copy_len = strlen(format); skip = copy_len; } /* Update the result before any truncation */ result += copy_len; /* Do we have room in the output buffer for any more data? We * must always write a terminator if possible */ if (len > 1) { if (copy_len > (len - 1)) { copy_len = len - 1; } memcpy(dest, copy_from, copy_len); dest += copy_len; len -= copy_len; } } /* Room for a terminator? */ if (len > 0) { *dest = '\0'; } return result; } /******************************************************************************/ const char * g_bool2text(int value) { return value ? "true" : "false"; } /*****************************************************************************/ int g_text2bool(const char *s) { if ( (g_atoi(s) != 0) || (0 == g_strcasecmp(s, "true")) || (0 == g_strcasecmp(s, "on")) || (0 == g_strcasecmp(s, "yes"))) { return 1; } return 0; } /*****************************************************************************/ int g_get_display_num_from_display(const char *display_text) { int rv = -1; const char *p; /* Skip over the hostname part of the DISPLAY */ if (display_text != NULL && (p = strchr(display_text, ':')) != NULL) { ++p; /* Skip the ':' */ /* Cater for the (still supported) double-colon. See * https://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html */ if (*p == ':') { ++p; } /* Check it starts with a digit, to avoid oddities like DISPLAY=":zz.0" * being parsed successfully */ if (isdigit(*p)) { rv = g_atoi(p); } } return rv; } /*****************************************************************************/ /* returns length of text */ int g_strlen(const char *text) { if (text == NULL) { return 0; } return strlen(text); } /*****************************************************************************/ /* locates char in text */ char * g_strchr(const char *text, int c) { if (text == NULL) { return 0; } /* Cast needed to compile with C++ */ return (char *)strchr(text, c); } /*****************************************************************************/ /* locates char in text */ char * g_strrchr(const char *text, int c) { if (text == NULL) { return 0; } /* Cast needed to compile with C++ */ return (char *)strrchr(text, c); } /*****************************************************************************/ /* locates char in text with length */ char * g_strnchr(const char *text, int c, int len) { if (text == NULL || len <= 0) { return NULL; } return (char *)memchr(text, c, len); } /*****************************************************************************/ /* returns dest */ char * g_strcpy(char *dest, const char *src) { if (src == 0 && dest != 0) { dest[0] = 0; return dest; } if (dest == 0 || src == 0) { return 0; } return strcpy(dest, src); } /*****************************************************************************/ /* returns dest */ char * g_strncpy(char *dest, const char *src, int len) { char *rv; if (src == 0 && dest != 0) { dest[0] = 0; return dest; } if (dest == 0 || src == 0) { return 0; } rv = strncpy(dest, src, len); dest[len] = 0; return rv; } /*****************************************************************************/ /* returns dest */ char * g_strcat(char *dest, const char *src) { if (dest == 0 || src == 0) { return dest; } return strcat(dest, src); } /*****************************************************************************/ /* returns dest */ char * g_strncat(char *dest, const char *src, int len) { if (dest == 0 || src == 0) { return dest; } return strncat(dest, src, len); } /*****************************************************************************/ /* if in = 0, return 0 else return newly alloced copy of in */ char * g_strdup(const char *in) { int len; char *p; if (in == 0) { return 0; } len = g_strlen(in); p = (char *)g_malloc(len + 1, 0); if (p != NULL) { g_strcpy(p, in); } return p; } /*****************************************************************************/ /* if in = 0, return 0 else return newly alloced copy of input string * if the input string is larger than maxlen the returned string will be * truncated. All strings returned will include null termination*/ char * g_strndup(const char *in, const unsigned int maxlen) { unsigned int len; char *p; if (in == 0) { return 0; } len = g_strlen(in); if (len > maxlen) { len = maxlen - 1; } p = (char *)g_malloc(len + 2, 0); if (p != NULL) { g_strncpy(p, in, len + 1); } return p; } /*****************************************************************************/ int g_strcmp(const char *c1, const char *c2) { return strcmp(c1, c2); } /*****************************************************************************/ int g_strncmp(const char *c1, const char *c2, int len) { return strncmp(c1, c2, len); } /*****************************************************************************/ /* compare up to delim */ int g_strncmp_d(const char *s1, const char *s2, const char delim, int n) { char c1; char c2; c1 = 0; c2 = 0; while (n > 0) { c1 = *(s1++); c2 = *(s2++); if ((c1 == 0) || (c1 != c2) || (c1 == delim) || (c2 == delim)) { return c1 - c2; } n--; } return c1 - c2; } /*****************************************************************************/ int g_strcasecmp(const char *c1, const char *c2) { #if defined(_WIN32) return stricmp(c1, c2); #else return strcasecmp(c1, c2); #endif } /*****************************************************************************/ int g_strncasecmp(const char *c1, const char *c2, int len) { #if defined(_WIN32) return strnicmp(c1, c2, len); #else return strncasecmp(c1, c2, len); #endif } /*****************************************************************************/ int g_atoi(const char *str) { if (str == 0) { return 0; } return atoi(str); } /*****************************************************************************/ /* As g_atoi() but allows for hexadecimal too */ int g_atoix(const char *str) { int base = 10; if (str == NULL) { str = "0"; } while (isspace(*str)) { ++str; } if (*str == '0' && tolower(*(str + 1)) == 'x') { str += 2; base = 16; } return strtol(str, NULL, base); } /*****************************************************************************/ int g_htoi(char *str) { int len; int index; int rv; int val; int shift; rv = 0; len = strlen(str); index = len - 1; shift = 0; while (index >= 0) { val = 0; switch (str[index]) { case '1': val = 1; break; case '2': val = 2; break; case '3': val = 3; break; case '4': val = 4; break; case '5': val = 5; break; case '6': val = 6; break; case '7': val = 7; break; case '8': val = 8; break; case '9': val = 9; break; case 'a': case 'A': val = 10; break; case 'b': case 'B': val = 11; break; case 'c': case 'C': val = 12; break; case 'd': case 'D': val = 13; break; case 'e': case 'E': val = 14; break; case 'f': case 'F': val = 15; break; } rv = rv | (val << shift); index--; shift += 4; } return rv; } /*****************************************************************************/ /* returns number of bytes copied into out_str */ int g_bytes_to_hexstr(const void *bytes, int num_bytes, char *out_str, int bytes_out_str) { int rv; int index; char *lout_str; const tui8 *lbytes; rv = 0; lbytes = (const tui8 *) bytes; lout_str = out_str; for (index = 0; index < num_bytes; index++) { if (bytes_out_str < 3) { break; } g_snprintf(lout_str, bytes_out_str, "%2.2x", lbytes[index]); lout_str += 2; bytes_out_str -= 2; rv += 2; } return rv; } /*****************************************************************************/ /* convert a byte array into a hex dump */ char * g_bytes_to_hexdump(const char *src, int len) { unsigned char *line; int i; int dump_number_lines; int dump_line_length; int dump_length; int dump_offset; int thisline; int offset; char *dump_buffer; #define HEX_DUMP_SOURCE_BYTES_PER_LINE (16) #ifdef _WIN32 #define HEX_DUMP_NEWLINE_SIZE (2) #else #ifdef _MACOS #define HEX_DUMP_NEWLINE_SIZE (1) #else #define HEX_DUMP_NEWLINE_SIZE (1) #endif #endif dump_line_length = (4 + 3 /* = 4 offset + 3 space */ + ((2 + 1) * HEX_DUMP_SOURCE_BYTES_PER_LINE) /* + (2 hex char + 1 space) per source byte */ + 2 /* + 2 space */ + HEX_DUMP_SOURCE_BYTES_PER_LINE + HEX_DUMP_NEWLINE_SIZE); dump_number_lines = (len / HEX_DUMP_SOURCE_BYTES_PER_LINE) + 1; /* +1 to round up */ dump_length = (dump_number_lines * dump_line_length /* hex dump lines */ + 1); /* terminating NULL */ dump_buffer = (char *)g_malloc(dump_length, 1); if (dump_buffer == NULL) { LOG_DEVEL(LOG_LEVEL_WARNING, "Failed to allocate buffer for hex dump of size %d", dump_length); return NULL; } line = (unsigned char *)src; offset = 0; dump_offset = 0; while (offset < len) { g_sprintf(dump_buffer + dump_offset, "%04x ", offset); dump_offset += 7; thisline = len - offset; if (thisline > HEX_DUMP_SOURCE_BYTES_PER_LINE) { thisline = HEX_DUMP_SOURCE_BYTES_PER_LINE; } for (i = 0; i < thisline; i++) { g_sprintf(dump_buffer + dump_offset, "%02x ", line[i]); dump_offset += 3; } for (; i < HEX_DUMP_SOURCE_BYTES_PER_LINE; i++) { dump_buffer[dump_offset++] = ' '; dump_buffer[dump_offset++] = ' '; dump_buffer[dump_offset++] = ' '; } dump_buffer[dump_offset++] = ' '; dump_buffer[dump_offset++] = ' '; for (i = 0; i < thisline; i++) { dump_buffer[dump_offset++] = (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'; } for (; i < HEX_DUMP_SOURCE_BYTES_PER_LINE; i++) { dump_buffer[dump_offset++] = ' '; } #ifdef _WIN32 dump_buffer[dump_offset++] = '\r'; dump_buffer[dump_offset++] = '\n'; #else #ifdef _MACOS dump_buffer[dump_offset++] = '\r'; #else dump_buffer[dump_offset++] = '\n'; #endif #endif offset += thisline; line += thisline; if (dump_offset % dump_line_length != 0) { LOG_DEVEL(LOG_LEVEL_WARNING, "BUG: dump_offset (%d) at the end of a line is not a " "multiple of the line length (%d)", dump_offset, dump_line_length); } } if (dump_offset > dump_length) { LOG_DEVEL(LOG_LEVEL_WARNING, "BUG: dump_offset (%d) is larger than the dump_buffer length (%d)", dump_offset, dump_length); dump_buffer[0] = '\0'; return dump_buffer; } /* replace the last new line with the end of the string since log_message will add a new line */ dump_buffer[dump_offset - HEX_DUMP_NEWLINE_SIZE] = '\0'; return dump_buffer; } /*****************************************************************************/ int g_pos(const char *str, const char *to_find) { const char *pp; pp = strstr(str, to_find); if (pp == 0) { return -1; } return (pp - str); } /*****************************************************************************/ char * g_strstr(const char *haystack, const char *needle) { if (haystack == NULL || needle == NULL) { return NULL; } /* Cast needed to compile with C++ */ return (char *)strstr(haystack, needle); } /*****************************************************************************/ /* returns error */ int g_strtrim(char *str, int trim_flags) { #define TRIMMABLE_CHAR(c) ((unsigned char)(c) <= ' ') int rv = 0; int index; int j; switch (trim_flags) { case 4: /* trim through */ j = 0; for (index = 0; str[index] != '\0'; index++) { if (!TRIMMABLE_CHAR(str[index])) { str[j++] = str[index]; } } str[j] = '\0'; break; case 3: /* trim both */ rv = g_strtrim(str, 1) || g_strtrim(str, 2); break; case 2: /* trim right */ index = strlen(str); while (index > 0 && TRIMMABLE_CHAR(str[index - 1])) { --index; } str[index] = '\0'; break; case 1: /* trim left */ index = 0; while (str[index] != '\0' && TRIMMABLE_CHAR(str[index])) { ++index; } if (index > 0) { memmove(str, str + index, strlen(str) + 1 - index); } break; default: rv = 1; } return rv; #undef TRIMMABLE_CHAR } /*****************************************************************************/ char * g_strnjoin(char *dest, int dest_len, const char *joiner, const char *src[], int src_len) { int len = 0; int joiner_len; int i = 0; int dest_remaining; char *dest_pos = dest; char *dest_end; if (dest == NULL || dest_len < 1) { return dest; } if (src == NULL || src_len < 1) { dest[0] = '\0'; return dest; } dest[0] = '\0'; dest_end = dest + dest_len - 1; joiner_len = g_strlen(joiner); for (i = 0; i < src_len - 1 && dest_pos < dest_end; i++) { len = g_strlen(src[i]); dest_remaining = dest_end - dest_pos; g_strncat(dest_pos, src[i], dest_remaining); dest_pos += MIN(len, dest_remaining); if (dest_pos < dest_end) { dest_remaining = dest_end - dest_pos; g_strncat(dest_pos, joiner, dest_remaining); dest_pos += MIN(joiner_len, dest_remaining); } } if (i == src_len - 1 && dest_pos < dest_end) { g_strncat(dest_pos, src[i], dest_end - dest_pos); } return dest; } /*****************************************************************************/ int g_bitmask_to_str(int bitmask, const struct bitmask_string bitdefs[], char delim, char *buff, int bufflen) { int rlen = 0; /* Returned length */ if (bufflen <= 0) /* Caller error */ { rlen = -1; } else { char *p = buff; /* Find the last writeable character in the buffer */ const char *last = buff + (bufflen - 1); const struct bitmask_string *b; for (b = &bitdefs[0] ; b->mask != 0; ++b) { if ((bitmask & b->mask) != 0) { if (p > buff) { /* Not first item - append separator */ if (p < last) { *p++ = delim; } ++rlen; } int slen = g_strlen(b->str); int copylen = MIN(slen, last - p); g_memcpy(p, b->str, copylen); p += copylen; rlen += slen; /* Remove the bit so we can check for undefined bits later*/ bitmask &= ~b->mask; } } if (bitmask != 0) { /* Bits left which aren't named by the user */ if (p > buff) { if (p < last) { *p++ = delim; } ++rlen; } /* This call will terminate the return buffer */ rlen += g_snprintf(p, last - p + 1, "0x%x", bitmask); } else { *p = '\0'; } } return rlen; } /*****************************************************************************/ int g_str_to_bitmask(const char *str, const struct bitmask_string bitdefs[], const char *delim, char *unrecognised, int unrecognised_len) { char *properties = NULL; char *p = NULL; int mask = 0; if (unrecognised_len < 1) { /* No space left to tell unrecognised tokens */ return 0; } if (!unrecognised) { return 0; } /* ensure not to return with uninitialized buffer */ unrecognised[0] = '\0'; if (!str || !bitdefs || !delim) { return 0; } properties = g_strdup(str); if (!properties) { return 0; } p = strtok(properties, delim); while (p != NULL) { g_strtrim(p, 3); const struct bitmask_string *b; int found = 0; for (b = &bitdefs[0] ; b->str != NULL; ++b) { if (0 == g_strcasecmp(p, b->str)) { mask |= b->mask; found = 1; break; } } if (found == 0) { int length = g_strlen(unrecognised); if (length > 0) { /* adding ",property" */ if (length + g_strlen(p) + 1 < unrecognised_len) { unrecognised[length] = delim[0]; length += 1; g_strcpy(unrecognised + length, p); } } else if (g_strlen(p) < unrecognised_len) { g_strcpy(unrecognised, p); } } p = strtok(NULL, delim); } g_free(properties); return mask; } /*****************************************************************************/ int g_bitmask_to_charstr(int bitmask, const struct bitmask_char bitdefs[], char *buff, int bufflen, int *rest) { int rlen = 0; /* Returned length */ if (bufflen <= 0) /* Caller error */ { rlen = -1; } else { char *p = buff; /* Find the last writeable character in the buffer */ const char *last = buff + (bufflen - 1); const struct bitmask_char *b; for (b = &bitdefs[0] ; b->c != '\0'; ++b) { if ((bitmask & b->mask) != 0) { if (p < last) { *p++ = b->c; } ++rlen; /* Remove the bit so we don't report it back */ bitmask &= ~b->mask; } } *p = '\0'; if (rest != NULL) { *rest = bitmask; } } return rlen; } /*****************************************************************************/ int g_charstr_to_bitmask(const char *str, const struct bitmask_char bitdefs[], char *unrecognised, int unrecognised_len) { int bitmask = 0; const char *cp; int j = 0; if (str != NULL && bitdefs != NULL) { for (cp = str ; *cp != '\0' ; ++cp) { const struct bitmask_char *b; char c = toupper(*cp); for (b = &bitdefs[0] ; b->c != '\0'; ++b) { if (toupper(b->c) == c) { bitmask |= b->mask; break; } } if (b->c == '\0') { if (unrecognised != NULL && j < (unrecognised_len - 1)) { unrecognised[j++] = *cp; } } } } if (unrecognised != NULL && j < unrecognised_len) { unrecognised[j] = '\0'; } return bitmask; } /*****************************************************************************/ /* * Looks for a simple mapping of signal number to name */ static const char * find_sig_name(int signum) { typedef struct { int num; const char *name; } sig_to_name_type; // Map a string 'zzz' to { SIGzzz, "zzz"} for making // typo-free sig_to_name_type objects # define DEFSIG(sig) { SIG ## sig, # sig } // Entries in this array are taken from // The Single UNIX ® Specification, Version 2 (1997) // plus additions from specific operating systems. // // The SUS requires these to be positive integer constants with a // macro definition. Note that SIGRTMIN and SIGRTMAX on Linux are // NOT constants, so have to be handled separately. static const sig_to_name_type sigmap[] = { // Names from SUS v2, in the order they are listed in that document // that *should* be defined everywhere // // Commented out definitions below are NOT used everywhere DEFSIG(ABRT), DEFSIG(ALRM), DEFSIG(FPE), DEFSIG(HUP), DEFSIG(ILL), DEFSIG(INT), DEFSIG(KILL), DEFSIG(PIPE), DEFSIG(QUIT), DEFSIG(SEGV), DEFSIG(TERM), DEFSIG(USR1), DEFSIG(USR2), DEFSIG(CHLD), DEFSIG(CONT), DEFSIG(STOP), DEFSIG(TSTP), DEFSIG(TTIN), DEFSIG(TTOU), DEFSIG(BUS), /* DEFSIG(POLL), */ /* DEFSIG(PROF), */ DEFSIG(SYS), DEFSIG(TRAP), DEFSIG(URG), DEFSIG(VTALRM), DEFSIG(XCPU), DEFSIG(XFSZ), // SIGPOLL and SIGPROF are marked as obselescent in 1003.1-2017, // Also SIGPOLL isn't in *BSD operating systems which use SIGIO #ifdef SIGPOLL DEFSIG(POLL), #endif #ifdef SIGPROF DEFSIG(PROF), #endif // BSD signals (from FreeBSD/OpenBSD sys/signal.h and // Darwin/Illumos signal.h) #ifdef SIGEMT DEFSIG(EMT), #endif #ifdef SIGIO DEFSIG(IO), #endif #ifdef SIGWINCH DEFSIG(WINCH), #endif #ifdef SIGINFO DEFSIG(INFO), #endif #ifdef SIGTHR DEFSIG(THR), #endif #ifdef SIGLIBRT DEFSIG(LIBRT), #endif #ifdef SIGPWR DEFSIG(PWR), #endif #ifdef SIGWAITING DEFSIG(WAITING), #endif #ifdef SIGLWP DEFSIG(LWP), #endif // Linux additions to *BSD (signal(7)) #ifdef SIGLOST DEFSIG(LOST), #endif #ifdef SIGSTKFLT DEFSIG(STKFLT), #endif // Terminator {0, NULL} #undef DEFSIG }; const sig_to_name_type *p; for (p = &sigmap[0] ; p->name != NULL ; ++p) { if (p->num == signum) { return p->name; } } // These aren't constants on Linux #ifdef SIGRTMIN if (signum == SIGRTMIN) { return "RTMIN"; } #endif #ifdef SIGRTMAX if (signum == SIGRTMAX) { return "RTMAX"; } #endif return NULL; } /*****************************************************************************/ char * g_sig2text(int signum, char sigstr[]) { if (signum >= 0) { const char *name = find_sig_name(signum); if (name != NULL) { g_snprintf(sigstr, MAXSTRSIGLEN, "SIG%s", name); return sigstr; } #if defined(SIGRTMIN) && defined(SIGRTMAX) if (signum > SIGRTMIN && signum < SIGRTMAX) { g_snprintf(sigstr, MAXSTRSIGLEN, "SIGRTMIN+%d", signum - SIGRTMIN); return sigstr; } #endif } // If all else fails... g_snprintf(sigstr, MAXSTRSIGLEN, "SIG#%d", signum); return sigstr; } /*****************************************************************************/ char32_t utf8_get_next_char(const char **utf8str_ref, unsigned int *len_ref) { /* * Macro used to parse a continuation character * @param cp Character Pointer (incremented on success) * @param end One character past end of input string * @param value The value we're constructing * @param finish_label Where to go in the event of an error */ #define PARSE_CONTINUATION_CHARACTER(cp, end, value, finish_label) \ { \ /* Error if we're out of data, or this char isn't a continuation */ \ if (cp == end || !IS_VALID_CONTINUATION_CHAR(*cp)) \ { \ value = UCS_REPLACEMENT_CHARACTER; \ goto finish_label; \ } \ value = (value) << 6 | (*cp & 0x3f); \ ++cp; \ } char32_t rv; /* Easier to work with unsigned chars and no indirection */ const unsigned char *cp = (const unsigned char *)*utf8str_ref; const unsigned char *end = (len_ref != NULL) ? cp + *len_ref : cp + 6; if (cp == end) { return 0; // Pathological case } unsigned int c0 = *cp++; if (c0 < 0x80) { rv = c0; } else if (c0 < 0xc0) { /* Unexpected continuation character */ rv = UCS_REPLACEMENT_CHARACTER; } else if (c0 < 0xe0) { /* Valid start character for sequence of length 2 * U-00000080 – U-000007FF */ rv = (c0 & 0x1f); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); if (rv < 0x80 || INVALID_UNICODE_80_TO_7FF(rv)) { rv = UCS_REPLACEMENT_CHARACTER; } } else if (c0 < 0xf0) { /* Valid start character for sequence of length 3 * U-00000800 – U-0000FFFF */ rv = (c0 & 0xf); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); if (rv < 0x800 || INVALID_UNICODE_800_TO_FFFF(rv)) { rv = UCS_REPLACEMENT_CHARACTER; } } else if (c0 < 0xf8) { /* Valid start character for sequence of length 4 * U-00010000 – U-0001FFFFF */ rv = (c0 & 0x7); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); if (rv < 0x10000 || INVALID_UNICODE_10000_TO_1FFFFF(rv)) { rv = UCS_REPLACEMENT_CHARACTER; } } else if (c0 < 0xfc) { /* Valid start character for sequence of length 5 * U-00200000 – U-03FFFFFF */ rv = (c0 & 0x3); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); // These values are currently unsupported rv = UCS_REPLACEMENT_CHARACTER; } else if (c0 < 0xfe) { /* Valid start character for sequence of length 6 * U-04000000 – U-7FFFFFFF */ rv = (c0 & 0x1); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); PARSE_CONTINUATION_CHARACTER(cp, end, rv, finish); // These values are currently unsupported rv = UCS_REPLACEMENT_CHARACTER; } else { // Invalid characters rv = UCS_REPLACEMENT_CHARACTER; } finish: if (len_ref) { *len_ref -= ((const char *)cp - *utf8str_ref); } *utf8str_ref = (const char *)cp; return rv; #undef PARSE_CONTINUATION_CHARACTER } /*****************************************************************************/ unsigned int utf_char32_to_utf8(char32_t c32, char *u8str) { unsigned int rv; if (INVALID_UNICODE(c32)) { c32 = UCS_REPLACEMENT_CHARACTER; } if (c32 < 0x80) { rv = 1; if (u8str != NULL) { u8str[0] = (char)c32; } } else if (c32 < 0x800) { rv = 2; // 11 bits. Five in first byte, six in second if (u8str != NULL) { u8str[1] = (c32 & 0x3f) | 0x80; c32 >>= 6; u8str[0] = (c32 & 0x1f) | 0xc0; } } else if (c32 < 0xffff) { rv = 3; // 16 bits. Four in first byte, six in second and third if (u8str != NULL) { u8str[2] = (c32 & 0x3f) | 0x80; c32 >>= 6; u8str[1] = (c32 & 0x3f) | 0x80; c32 >>= 6; u8str[0] = (c32 & 0xf) | 0xe0; } } else { rv = 4; // 21 bits. Three in first byte, six in second, third and fourth if (u8str != NULL) { u8str[3] = (c32 & 0x3f) | 0x80; c32 >>= 6; u8str[2] = (c32 & 0x3f) | 0x80; c32 >>= 6; u8str[1] = (c32 & 0x3f) | 0x80; c32 >>= 6; u8str[0] = (c32 & 0x7) | 0xf0; } } return rv; } /*****************************************************************************/ unsigned int utf8_char_count(const char *utf8str) { unsigned int rv = 0; char32_t c; if (utf8str != NULL) { while ((c = utf8_get_next_char(&utf8str, NULL)) != 0) { ++rv; } } return rv; } /*****************************************************************************/ unsigned int utf8_as_utf16_word_count(const char *utf8str, unsigned int len) { unsigned int rv = 0; while (len > 0) { char32_t c = utf8_get_next_char(&utf8str, &len); // Characters not in the BMP (i.e. over 0xffff) need a high/low // surrogate pair rv += (c >= 0x10000) ? 2 : 1; } return rv; } /*****************************************************************************/ int utf8_add_char_at(char *utf8str, unsigned int len, char32_t c32, unsigned int index) { int rv = 0; char c8[MAXLEN_UTF8_CHAR]; unsigned int c8len = utf_char32_to_utf8(c32, c8); // Find out where to insert the character char *insert_pos = utf8str; while (index > 0 && *insert_pos != '\0') { utf8_get_next_char((const char **)&insert_pos, NULL); --index; } // Did we get to where we need to be? if (index == 0) { unsigned int bytes_to_move = strlen(insert_pos) + 1; // Include terminator // Is there room to insert the character? // // <----------- len ----------> // <--> (bytes_to_move) // +----------------------------+ // |ABCDEFGHIJLMN\0 | // +----------------------------+ // ^ ^ // +-utf8str +-insert_pos // if ((insert_pos - utf8str) + bytes_to_move + c8len <= len) { memmove(insert_pos + c8len, insert_pos, bytes_to_move); memcpy(insert_pos, c8, c8len); rv = 1; } } return rv; } /*****************************************************************************/ char32_t utf8_remove_char_at(char *utf8str, unsigned int index) { int rv = 0; // Find out where to remove the character char *remove_pos = utf8str; while (index > 0) { // Any characters left in string? if (*remove_pos == '\0') { break; } utf8_get_next_char((const char **)&remove_pos, NULL); --index; } // Did we get to where we need to be? if (index == 0) { // Find the position after the character char *after_pos = remove_pos; rv = utf8_get_next_char((const char **)&after_pos, NULL); // Move everything up memmove(remove_pos, after_pos, strlen(after_pos) + 1); } return rv; } xrdp-0.10.1/common/guid.h000644 001751 000000 00000004351 14652432047 015231 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2021 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * @file common/guid.h * @brief GUID manipulation declarations */ #ifndef GUID_H #define GUID_H #include "arch.h" #define GUID_SIZE 16 /* bytes */ #define GUID_STR_SIZE (GUID_SIZE * 2 + 4 + 1) /* w/ 4 hyphens + null terminator */ /** * Use a struct for the guid so we can easily copy by assignment. * We use an array of char so that * we can compare GUIDs with a straight memcmp() * * Some fields of the GUID are in little-endian-order as specified by * [MS-DTYP]. This is at odds with RFC4122 which specifies big-endian * order for all fields. * * Octets RFC4122 field * ------ ------------- * 0-3 time_low (little-endian) * 4-5 time_mid (little-endian) * 6-7 time_hi_and_version (little-endian) * 8 clock_seq_hi_and_reserved * 9 clock_seq_low (in order) * 10-15 node */ struct guid { char g[GUID_SIZE]; }; /** * Get an initialised GUID * * The GUID is compatible with RFC4122 section 4.4. * * @return new GUID */ struct guid guid_new(void); /** * Clears an initialised GUID, so guid_is_set() returns true * * @param guid GUID to clear */ void guid_clear(struct guid *guid); /** * Checks if a GUID is initialised * * @param guid GUID to check (can be NULL) * @return non-zero if GUID is set */ int guid_is_set(const struct guid *guid); /** * Converts a GUID to a string representation * * @param guid GUID to represent * @param dest destionation pointer to at least GUID_STR_SIZE * bytes to store the representation * @return dest is returned for convenience */ const char *guid_to_str(const struct guid *guid, char *dest); #endif xrdp-0.10.1/common/rail.h000644 001751 000000 00000011114 14652432047 015223 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(_RAIL_H) #define _RAIL_H /* ORDER_TYPE_WINDOW WINDOW_ORDER_TYPE_WINDOW WINDOW_ORDER_ICON WINDOW_ORDER_CACHED_ICON WINDOW_ORDER_STATE_DELETED WINDOW_ORDER_STATE_NEW on WINDOW_ORDER_STATE_NEW off WINDOW_ORDER_TYPE_NOTIFY WINDOW_ORDER_STATE_DELETED WINDOW_ORDER_STATE_NEW on WINDOW_ORDER_STATE_NEW off WINDOW_ORDER_TYPE_DESKTOP WINDOW_ORDER_FIELD_DESKTOP_NONE on WINDOW_ORDER_FIELD_DESKTOP_NONE off */ /* Window Order Header Flags */ #define WINDOW_ORDER_TYPE_WINDOW 0x01000000 #define WINDOW_ORDER_TYPE_NOTIFY 0x02000000 #define WINDOW_ORDER_TYPE_DESKTOP 0x04000000 #define WINDOW_ORDER_STATE_NEW 0x10000000 #define WINDOW_ORDER_STATE_DELETED 0x20000000 #define WINDOW_ORDER_FIELD_OWNER 0x00000002 #define WINDOW_ORDER_FIELD_STYLE 0x00000008 #define WINDOW_ORDER_FIELD_SHOW 0x00000010 #define WINDOW_ORDER_FIELD_TITLE 0x00000004 #define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000 #define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000 #define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000 #define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000 #define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800 #define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000 #define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400 #define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100 #define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000 #define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200 #define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000 #define WINDOW_ORDER_ICON 0x40000000 #define WINDOW_ORDER_CACHED_ICON 0x80000000 #define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008 #define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001 #define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002 #define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004 #define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001 #define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002 #define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004 #define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008 #define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010 #define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020 struct rail_icon_info { int bpp; int width; int height; int cmap_bytes; int mask_bytes; int data_bytes; char *mask; char *cmap; char *data; }; struct rail_window_rect { short left; short top; short right; short bottom; }; struct rail_notify_icon_infotip { int timeout; int flags; char *text; char *title; }; struct rail_window_state_order { int owner_window_id; int style; int extended_style; int show_state; char *title_info; int client_offset_x; int client_offset_y; int client_area_width; int client_area_height; int rp_content; int root_parent_handle; int window_offset_x; int window_offset_y; int window_client_delta_x; int window_client_delta_y; int window_width; int window_height; int num_window_rects; struct rail_window_rect *window_rects; int visible_offset_x; int visible_offset_y; int num_visibility_rects; struct rail_window_rect *visibility_rects; }; struct rail_notify_state_order { int version; char *tool_tip; struct rail_notify_icon_infotip infotip; int state; int icon_cache_entry; int icon_cache_id; struct rail_icon_info icon_info; }; struct rail_monitored_desktop_order { int active_window_id; int num_window_ids; int *window_ids; }; #endif xrdp-0.10.1/common/ms-rdpeclip.h000644 001751 000000 00000006525 14652432047 016525 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPECLIP : Definitions from [MS-RDPECLIP] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPECLIP are currently correct for v220210407 of that * document */ #if !defined(MS_RDPECLIP_H) #define MS_RDPECLIP_H /* Clipboard PDU header message codes 2.2.1 */ #define CB_MONITOR_READY 1 #define CB_FORMAT_LIST 2 #define CB_FORMAT_LIST_RESPONSE 3 #define CB_FORMAT_DATA_REQUEST 4 #define CB_FORMAT_DATA_RESPONSE 5 #define CB_TEMP_DIRECTORY 6 #define CB_CLIP_CAPS 7 #define CB_FILECONTENTS_REQUEST 8 #define CB_FILECONTENTS_RESPONSE 9 #define CB_LOCK_CLIPDATA 10 #define CB_UNLOCK_CLIPDATA 11 #define CB_PDUTYPE_TO_STR(pdu_type) \ ((pdu_type) == CB_MONITOR_READY ? "CB_MONITOR_READY" : \ (pdu_type) == CB_FORMAT_LIST ? "CB_FORMAT_LIST" : \ (pdu_type) == CB_FORMAT_LIST_RESPONSE ? "CB_FORMAT_LIST_RESPONSE" : \ (pdu_type) == CB_FORMAT_DATA_REQUEST ? "CB_FORMAT_DATA_REQUEST" : \ (pdu_type) == CB_FORMAT_DATA_RESPONSE ? "CB_FORMAT_DATA_RESPONSE" : \ (pdu_type) == CB_TEMP_DIRECTORY ? "CB_TEMP_DIRECTORY" : \ (pdu_type) == CB_CLIP_CAPS ? "CB_CLIP_CAPS" : \ (pdu_type) == CB_FILECONTENTS_REQUEST ? "CB_FILECONTENTS_REQUEST" : \ (pdu_type) == CB_FILECONTENTS_RESPONSE ? "CB_FILECONTENTS_RESPONSE" : \ (pdu_type) == CB_LOCK_CLIPDATA ? "CB_LOCK_CLIPDATA" : \ (pdu_type) == CB_UNLOCK_CLIPDATA ? "CB_UNLOCK_CLIPDATA" : \ "unknown" \ ) /* Clipboard PDU header message flags 2.2.1 */ #define CB_RESPONSE_OK 0x0001 #define CB_RESPONSE_FAIL 0x0002 #define CB_ASCII_NAMES 0x0004 /* Capability set codes 2.2.2.1.1 */ #define CB_CAPSTYPE_GENERAL 1 #define CB_CAPS_VERSION_1 1 #define CB_CAPS_VERSION_2 2 /* General capability set general flags 2.2.2.1.1.1 */ #define CB_USE_LONG_FORMAT_NAMES 0x00000002 #define CB_STREAM_FILECLIP_ENABLED 0x00000004 #define CB_FILECLIP_NO_FILE_PATHS 0x00000008 #define CB_CAN_LOCK_CLIPDATA 0x00000010 /* File contents request PDU 2.2.5.3 */ /* Note that in the document these do not have a CB_ prefix */ #define CB_FILECONTENTS_SIZE 0x00000001 #define CB_FILECONTENTS_RANGE 0x00000002 /* File descriptor structure flags 2.2.5.2.3.1 */ /* Note that in the document these do not have a CB_ prefix */ #define CB_FD_ATTRIBUTES 0x00000004 #define CB_FD_FILESIZE 0x00000040 #define CB_FD_WRITESTIME 0x00000020 #define CB_FD_PROGRESSUI 0x00004000 /* File descriptor structure file attributes 2.2.5.2.3.1 */ /* Note that in the document these do not have a CB_ prefix */ #define CB_FILE_ATTRIBUTE_READONLY 0x00000001 #define CB_FILE_ATTRIBUTE_HIDDEN 0x00000002 #define CB_FILE_ATTRIBUTE_SYSTEM 0x00000004 #define CB_FILE_ATTRIBUTE_DIRECTORY 0x00000010 #define CB_FILE_ATTRIBUTE_ARCHIVE 0x00000020 #define CB_FILE_ATTRIBUTE_NORMAL 0x00000080 #endif /* MS_RDPECLIP_H */ xrdp-0.10.1/common/parse.h000644 001751 000000 00000053545 14652432047 015424 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Parsing structs and macros * * based on parse.h from rdesktop * this is a super fast stream method, you bet * needed functions g_malloc, g_free, g_memset, g_memcpy */ #if !defined(PARSE_H) #define PARSE_H #include "arch.h" #include "log.h" /* Check the config_ac.h file is included so we know whether to enable the * development macros */ #ifndef CONFIG_AC_H # error config_ac.h not visible in parse.h #endif #if defined(L_ENDIAN) #elif defined(B_ENDIAN) #else #error Unknown endianness. #endif /* parser state */ struct stream { char *p; char *end; char *data; int size; int pad0; /* offsets of various headers */ char *iso_hdr; char *mcs_hdr; char *sec_hdr; char *rdp_hdr; char *channel_hdr; /* other */ char *next_packet; struct stream *next; int *source; }; /** Check arguments to stream primitives * * This adds a function call overhead to every stream primitive and is * intended for development only * * @param s stream * @param n Bytes being requested for input/output * @param is_out (0=input, !0=output) * @param file __file__for caller * @param line __line__ for caller * * On any kind of violation a message is output and the program is * aborted. */ void parser_stream_overflow_check(const struct stream *s, int n, int is_out, const char *file, int line); #ifdef USE_DEVEL_STREAMCHECK # define S_CHECK_REM(s,n) \ parser_stream_overflow_check((s), (n), 0, __FILE__, __LINE__) # define S_CHECK_REM_OUT(s,n) \ parser_stream_overflow_check((s), (n), 1, __FILE__, __LINE__) #else # define S_CHECK_REM(s,n) # define S_CHECK_REM_OUT(s,n) #endif /******************************************************************************/ /** * Copies a UTF-8 string to a stream as little-endian UTF-16 * * @param s Stream * @param v UTF-8 string * @param vn Length of UTF-8 string. * @param file Caller location (from __FILE__) * @param line Caller location (from __LINE__) * * Caller is expected to check there is room for the result in s */ void out_utf8_as_utf16_le_proc(struct stream *s, const char *v, unsigned int vn, const char *file, int line); #define out_utf8_as_utf16_le(s,v,vn) \ out_utf8_as_utf16_le_proc((s), (v), (vn), __FILE__, __LINE__) /******************************************************************************/ /** * Copies a fixed-size little-endian UTF-16 string from a stream as UTF-8 * * @param s Stream * @param n Number of 16-bit words to copy * @param v Pointer to result buffer * @param vn Max size of result buffer * * @return number of characters which would be written to v, INCLUDING * an additional terminator. This can be used to check for a buffer * overflow. A terminator is added whether or not the input * includes one. * * Output is unconditionally NULL-terminated. * Input is not checked for NULLs - these are copied verbatim */ unsigned int in_utf16_le_fixed_as_utf8_proc(struct stream *s, unsigned int n, char *v, unsigned int vn, const char *file, int line); #define in_utf16_le_fixed_as_utf8(s,n,v,vn) \ in_utf16_le_fixed_as_utf8_proc((s), (n), (v), (vn), __FILE__, __LINE__) /******************************************************************************/ /** * Returns the size of the buffer needed to store a fixed-size * little-endian UTF-16 string in a stream as a UTF-8 string * * @param s Stream * @param n Number of 16-bit words to consider * @return number of characters needed to store the UTF-8 string. This * includes a terminator, which is written whether the parsed * string includes one or not. * @post Stream position is not moved between start and end of this call */ unsigned int in_utf16_le_fixed_as_utf8_length(struct stream *s, unsigned int n); /******************************************************************************/ /** * Copies a terminated little-endian UTF-16 string from a stream as UTF-8 * * @param s Stream * @param v Pointer to result buffer * @param vn Max size of result buffer * * @return number of characters which would be written to v, INCLUDING * the terminator. This can be used to check for a buffer overflow. * * Output is unconditionally NULL-terminated. * Input processing stops when a NULL is encountered, or the end of the buffer * is reached. */ unsigned int in_utf16_le_terminated_as_utf8(struct stream *s, char *v, unsigned int vn); /******************************************************************************/ /** * Returns the size of the buffer needed to store a terminated * little-endian UTF-16 string in a stream as a terminated UTF-8 string * * @param s Stream * @return number of characters needed to store the UTF-8 string, * including the terminator * @post Stream position is not moved between start and end of this call * * Input processing stops when a NULL is encountered, or the end of the buffer * is reached. */ unsigned int in_utf16_le_terminated_as_utf8_length(struct stream *s); /******************************************************************************/ #define s_check_rem(s, n) ((s)->p + (n) <= (s)->end) /******************************************************************************/ /** * @returns true if there are at least n bytes remaining in the stream, * else false and logs an error message */ #define s_check_rem_and_log(s, n, msg_prefix) \ ( s_check_rem((s), (n)) ? \ 1 : \ LOG(LOG_LEVEL_ERROR, \ "%s Not enough bytes in the stream: expected %d, remaining %d", \ (msg_prefix), (n), s_rem(s)) \ && 0 ) /******************************************************************************/ #define s_check_rem_out(s, n) ((s)->p + (n) <= (s)->data + (s)->size) /******************************************************************************/ /** * @returns true if there are at least n bytes remaining in the stream, * else false and logs an error message */ #define s_check_rem_out_and_log(s, n, msg_prefix) \ ( s_check_rem_out((s), (n)) ? \ 1 : \ LOG(LOG_LEVEL_ERROR, \ "%s Not enough bytes in the stream: expected %d, remaining %d", \ (msg_prefix), (n), s_rem_out(s)) \ && 0 ) /******************************************************************************/ #define s_check_end(s) ((s)->p == (s)->end) /******************************************************************************/ /** * @returns true if there are exactly 0 bytes remaining in the stream, * else false and logs an error message */ #define s_check_end_and_log(s, msg_prefix) \ ( s_check_end((s)) ? \ 1 : \ LOG(LOG_LEVEL_ERROR, \ "%s Expected to be at the end of the stream, " \ "but there are %d bytes remaining", \ (msg_prefix), s_rem(s)) \ && 0 ) /******************************************************************************/ #define s_rem(s) ((int) ((s)->end - (s)->p)) /******************************************************************************/ #define s_rem_out(s) ((int) ((s)->data + (s)->size - (s)->p)) /******************************************************************************/ #define make_stream(s) \ (s) = (struct stream*)g_malloc(sizeof(struct stream), 1) /******************************************************************************/ #define init_stream(s, v) do \ { \ if ((v) > (s)->size) \ { \ g_free((s)->data); \ (s)->data = (char*)g_malloc((v), 0); \ (s)->size = (v); \ } \ (s)->p = (s)->data; \ (s)->end = (s)->data; \ (s)->next_packet = 0; \ } while (0) /******************************************************************************/ #define free_stream(s) do \ { \ if ((s) != 0) \ { \ g_free((s)->data); \ } \ g_free((s)); \ } while (0) /******************************************************************************/ #define s_push_layer(s, h, n) do \ { \ (s)->h = (s)->p; \ (s)->p += (n); \ } while (0) /******************************************************************************/ #define s_pop_layer(s, h) \ (s)->p = (s)->h /******************************************************************************/ #define s_mark_end(s) \ (s)->end = (s)->p #define in_sint8(s, v) do \ { \ S_CHECK_REM((s), 1); \ (v) = *((signed char*)((s)->p)); \ (s)->p++; \ } while (0) /******************************************************************************/ #define in_uint8(s, v) do \ { \ S_CHECK_REM((s), 1); \ (v) = *((unsigned char*)((s)->p)); \ (s)->p++; \ } while (0) /******************************************************************************/ #define in_uint8_peek(s, v) do \ { \ S_CHECK_REM((s), 1); \ v = *s->p; \ } while (0) /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define in_sint16_le(s, v) do \ { \ S_CHECK_REM((s), 2); \ (v) = (signed short) \ ( \ (*((unsigned char*)((s)->p + 0)) << 0) | \ (*((unsigned char*)((s)->p + 1)) << 8) \ ); \ (s)->p += 2; \ } while (0) #else #define in_sint16_le(s, v) do \ { \ S_CHECK_REM((s), 2); \ (v) = *((signed short*)((s)->p)); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define in_uint16_le(s, v) do \ { \ S_CHECK_REM((s), 2); \ (v) = (unsigned short) \ ( \ (*((unsigned char*)((s)->p + 0)) << 0) | \ (*((unsigned char*)((s)->p + 1)) << 8) \ ); \ (s)->p += 2; \ } while (0) #else #define in_uint16_le(s, v) do \ { \ S_CHECK_REM((s), 2); \ (v) = *((unsigned short*)((s)->p)); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ #define in_uint16_be(s, v) do \ { \ S_CHECK_REM((s), 2); \ (v) = *((unsigned char*)((s)->p)); \ (s)->p++; \ (v) <<= 8; \ (v) |= *((unsigned char*)((s)->p)); \ (s)->p++; \ } while (0) /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define in_uint32_le(s, v) do \ { \ S_CHECK_REM((s), 4); \ (v) = (unsigned int) \ ( \ (*((unsigned char*)((s)->p + 0)) << 0) | \ (*((unsigned char*)((s)->p + 1)) << 8) | \ (*((unsigned char*)((s)->p + 2)) << 16) | \ (*((unsigned char*)((s)->p + 3)) << 24) \ ); \ (s)->p += 4; \ } while (0) #else #define in_uint32_le(s, v) do \ { \ S_CHECK_REM((s), 4); \ (v) = *((unsigned int*)((s)->p)); \ (s)->p += 4; \ } while (0) #endif /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define in_uint64_le(s, v) do \ { \ S_CHECK_REM((s), 8); \ (v) = (tui64) \ ( \ (((tui64)(*((unsigned char*)((s)->p + 0)))) << 0) | \ (((tui64)(*((unsigned char*)((s)->p + 1)))) << 8) | \ (((tui64)(*((unsigned char*)((s)->p + 2)))) << 16) | \ (((tui64)(*((unsigned char*)((s)->p + 3)))) << 24) | \ (((tui64)(*((unsigned char*)((s)->p + 4)))) << 32) | \ (((tui64)(*((unsigned char*)((s)->p + 5)))) << 40) | \ (((tui64)(*((unsigned char*)((s)->p + 6)))) << 48) | \ (((tui64)(*((unsigned char*)((s)->p + 7)))) << 56) \ ); \ (s)->p += 8; \ } while (0) #else #define in_uint64_le(s, v) do \ { \ S_CHECK_REM((s), 8); \ (v) = *((tui64*)((s)->p)); \ (s)->p += 8; \ } while (0) #endif /******************************************************************************/ #define in_uint32_be(s, v) do \ { \ S_CHECK_REM((s), 4); \ (v) = *((unsigned char*)((s)->p)); \ (s)->p++; \ (v) <<= 8; \ (v) |= *((unsigned char*)((s)->p)); \ (s)->p++; \ (v) <<= 8; \ (v) |= *((unsigned char*)((s)->p)); \ (s)->p++; \ (v) <<= 8; \ (v) |= *((unsigned char*)((s)->p)); \ (s)->p++; \ } while (0) /******************************************************************************/ #define out_uint8(s, v) do \ { \ S_CHECK_REM_OUT((s), 1); \ *((s)->p) = (unsigned char)(v); \ (s)->p++; \ } while (0) /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define out_uint16_le(s, v) do \ { \ S_CHECK_REM_OUT((s), 2); \ *((s)->p) = (unsigned char)((v) >> 0); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 8); \ (s)->p++; \ } while (0) #else #define out_uint16_le(s, v) do \ { \ S_CHECK_REM_OUT((s), 2); \ *((unsigned short*)((s)->p)) = (unsigned short)(v); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ #define out_uint16_be(s, v) do \ { \ S_CHECK_REM_OUT((s), 2); \ *((s)->p) = (unsigned char)((v) >> 8); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 0); \ (s)->p++; \ } while (0) /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define out_uint32_le(s, v) do \ { \ S_CHECK_REM_OUT((s), 4); \ *((s)->p) = (unsigned char)((v) >> 0); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 8); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 16); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 24); \ (s)->p++; \ } while (0) #else #define out_uint32_le(s, v) do \ { \ S_CHECK_REM_OUT((s), 4); \ *((unsigned int*)((s)->p)) = (v); \ (s)->p += 4; \ } while (0) #endif /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define out_uint64_le(s, v) do \ { \ S_CHECK_REM_OUT((s), 8); \ *((s)->p) = (unsigned char)((v) >> 0); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 8); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 16); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 24); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 32); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 40); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 48); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 56); \ (s)->p++; \ } while (0) #else #define out_uint64_le(s, v) do \ { \ S_CHECK_REM_OUT((s), 8); \ *((tui64*)((s)->p)) = (v); \ (s)->p += 8; \ } while (0) #endif /******************************************************************************/ #define out_uint32_be(s, v) do \ { \ S_CHECK_REM_OUT((s), 4); \ *((s)->p) = (unsigned char)((v) >> 24); \ s->p++; \ *((s)->p) = (unsigned char)((v) >> 16); \ s->p++; \ *((s)->p) = (unsigned char)((v) >> 8); \ s->p++; \ *((s)->p) = (unsigned char)(v); \ (s)->p++; \ } while (0) /******************************************************************************/ #define in_uint8p(s, v, n) do \ { \ S_CHECK_REM((s), (n)); \ (v) = (s)->p; \ (s)->p += (n); \ } while (0) /******************************************************************************/ #define in_uint8a(s, v, n) do \ { \ S_CHECK_REM((s), (n)); \ g_memcpy((v), (s)->p, (n)); \ (s)->p += (n); \ } while (0) /******************************************************************************/ #define in_uint8s(s, n) do \ { \ S_CHECK_REM((s), (n)); \ (s)->p += (n); \ } while (0); /******************************************************************************/ #define out_uint8p(s, v, n) do \ { \ S_CHECK_REM_OUT((s), (n)); \ g_memcpy((s)->p, (v), (n)); \ (s)->p += (n); \ } while (0) /******************************************************************************/ #define out_uint8a(s, v, n) \ out_uint8p((s), (v), (n)) /******************************************************************************/ #define out_uint8s(s, n) do \ { \ S_CHECK_REM_OUT((s), (n)); \ g_memset((s)->p, 0, (n)); \ (s)->p += (n); \ } while (0) /* * @brief allocate a new stream * * @param _s opaque handle to the new stream * @param _l length of new stream ******************************************************************************/ #define xstream_new(_s, _l) \ do \ { \ make_stream((_s)); \ init_stream((_s), (_l)); \ } while (0) /** * @brief release a previously allocated stream * * @param _s opaque handle returned by stream_new() *****************************************************************************/ #define xstream_free(_s) free_stream(_s) #define xstream_skip_u8(_s, _n) in_uint8s(_s, _n) #define xstream_rd_u8(_s, _var) in_uint8(_s, _var) #define xstream_rd_u16_le(_s, _var) in_uint16_le(_s, _var) #define xstream_rd_u32_le(_s, _var) in_uint32_le(_s, _var) #define xstream_rd_s8_le(_s, _var) in_sint8(_s, _var) #define xstream_rd_s16_le(_s, _var) in_sint16_le(_s, _var) #define xstream_rd_s32_le(_s, _var) TODO #define xstream_wr_u8(_s, _var) out_uint8(_s, _var) #define xstream_wr_u16_le(_s, _var) out_uint16_le(_s, _var) #define xstream_wr_u32_le(_s, _var) out_uint32_le(_s, _var) #define xstream_wr_s8(_s, _var) TODO #define xstream_wr_s16_le(_s, _var) TODO #define xstream_wr_s32_le(_s, _var) TODO #define xstream_rd_u64_le(_s, _v) \ do \ { \ _v = \ (tui64)(*((unsigned char *)_s->p)) | \ (((tui64) (*(((unsigned char *)_s->p) + 1))) << 8) | \ (((tui64) (*(((unsigned char *)_s->p) + 2))) << 16) | \ (((tui64) (*(((unsigned char *)_s->p) + 3))) << 24) | \ (((tui64) (*(((unsigned char *)_s->p) + 4))) << 32) | \ (((tui64) (*(((unsigned char *)_s->p) + 5))) << 40) | \ (((tui64) (*(((unsigned char *)_s->p) + 6))) << 48) | \ (((tui64) (*(((unsigned char *)_s->p) + 7))) << 56); \ _s->p += 8; \ } while (0) #define xstream_wr_u64_le(_s, _v) \ do \ { \ *(((unsigned char *) _s->p) + 0) = (unsigned char) ((_v >> 0) & 0xff); \ *(((unsigned char *) _s->p) + 1) = (unsigned char) ((_v >> 8) & 0xff); \ *(((unsigned char *) _s->p) + 2) = (unsigned char) ((_v >> 16) & 0xff); \ *(((unsigned char *) _s->p) + 3) = (unsigned char) ((_v >> 24) & 0xff); \ *(((unsigned char *) _s->p) + 4) = (unsigned char) ((_v >> 32) & 0xff); \ *(((unsigned char *) _s->p) + 5) = (unsigned char) ((_v >> 40) & 0xff); \ *(((unsigned char *) _s->p) + 6) = (unsigned char) ((_v >> 48) & 0xff); \ *(((unsigned char *) _s->p) + 7) = (unsigned char) ((_v >> 56) & 0xff); \ _s->p += 8; \ } while (0) /* copy data into stream */ #define xstream_copyin(_s, _dest, _len) \ do \ { \ g_memcpy((_s)->p, (_dest), (_len)); \ (_s)->p += (_len); \ } while (0) /* copy data out of stream */ #define xstream_copyout(_dest, _s, _len) \ do \ { \ g_memcpy((_dest), (_s)->p, (_len)); \ (_s)->p += (_len); \ } while (0) #define xstream_rd_string(_dest, _s, _len) \ do \ { \ g_memcpy((_dest), (_s)->p, (_len)); \ (_s)->p += (_len); \ } while (0) #define xstream_wr_string(_s, _src, _len) \ do \ { \ g_memcpy((_s)->p, (_src), (_len)); \ (_s)->p += (_len); \ } while (0) #define xstream_len(_s) (int) ((_s)->p - (_s)->data) #define xstream_seek(_s, _len) (_s)->p += (_len) #endif xrdp-0.10.1/common/xrdp_constants.h000644 001751 000000 00000026015 14652432047 017353 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * Miscellaneous protocol constants * * Copyright (C) Matthew Chapman 1999-2008 * Copyright (C) Jay Sorg 2004-2014 * Copyright (C) Kevin Zhou 2012 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(XRDP_CONSTANTS_H) #define XRDP_CONSTANTS_H /* TCP port for Remote Desktop Protocol */ #define TCP_PORT_RDP 3389 /****************************************************************************** * * xrdp constants * * Constants defined in publicly available Microsoft documents are not * stored here, but are stored in the include files ms-*.h, where the name * of the file is the name of the document defining the constant. * * So for example, NTSTATUS values found in [MS-ERREF] are found in * ms-erref.h ******************************************************************************/ /** * Size of buffer including terminator for an IP address as returned * by g_sck_get_peer_ip_address(). See POSIX INET6_ADDRSTRLEN */ #define MAX_PEER_ADDRSTRLEN 46 /** * Size of buffer including terminator for a socket description, as * returned by g_sck_get_peer_description() * Currently the largest is an IPv6 address (INET6_ADDRSTRLEN), plus * []: characters */ #define MAX_PEER_DESCSTRLEN (46 + 2 + 1 + 5) #define INFO_CLIENT_NAME_BYTES 32 /** * Maximum length of a string including the mandatory null terminator * [MS-RDPBCGR] TS_INFO_PACKET(2.2.1.11.1.1) */ #define INFO_CLIENT_MAX_CB_LEN 512 #define XRDP_MAX_BITMAP_CACHE_ID 3 #define XRDP_MAX_BITMAP_CACHE_IDX 2000 #define XRDP_BITMAP_CACHE_ENTRIES 2048 #define XR_MIN_KEY_CODE 8 #define XR_MAX_KEY_CODE 256 /* * Constants come from ITU-T Recommendations */ #define ISO_PDU_CR 0xE0 /* X.224 Connection Request */ #define ISO_PDU_CC 0xD0 /* X.224 Connection Confirm */ #define ISO_PDU_DR 0x80 /* Disconnect Request */ #define ISO_PDU_DT 0xF0 /* Data */ #define ISO_PDU_ER 0x70 /* Error */ /* MCS PDU codes (T.125) */ #define MCS_EDRQ 1 /* Erect Domain Request */ #define MCS_DPUM 8 /* Disconnect Provider Ultimatum */ #define MCS_AURQ 10 /* Attach User Request */ #define MCS_AUCF 11 /* Attach User Confirm */ #define MCS_CJRQ 14 /* Channel Join Request */ #define MCS_CJCF 15 /* Channel Join Confirm */ #define MCS_SDRQ 25 /* Send Data Request */ #define MCS_SDIN 26 /* Send Data Indication */ /****************************************************************************** * * Constants come from other Microsoft products * *****************************************************************************/ /* Sound format constants - see also RFC 2361 and MS-RDPAI */ #define WAVE_FORMAT_PCM 0x0001 #define WAVE_FORMAT_ADPCM 0x0002 #define WAVE_FORMAT_ALAW 0x0006 #define WAVE_FORMAT_MULAW 0x0007 #define WAVE_FORMAT_MPEGLAYER3 0x0055 #define WAVE_FORMAT_OPUS 0x0069 #define WAVE_FORMAT_AAC 0xA106 /* https://technet.microsoft.com/ja-jp/library/aa387685.aspx */ #define SEC_RSA_MAGIC 0x31415352 /* RSA1 */ /* NTSTATUS Values (MS-ERREF 2.3.1) */ /* used for RDPDR */ /* * not yet sorted out */ #define MCS_CONNECT_INITIAL 0x7f65 /* MCS BER: big endian, class=application (0x4000), constructed (0x2000), tag number > 30 (0x1f00), tag number=101 (0x0065) */ #define MCS_CONNECT_RESPONSE 0x7f66 /* MCS BER: application 102 */ #define BER_TAG_BOOLEAN 1 #define BER_TAG_INTEGER 2 #define BER_TAG_OCTET_STRING 4 #define BER_TAG_RESULT 10 #define MCS_TAG_DOMAIN_PARAMS 0x30 #define MCS_GLOBAL_CHANNEL 1003 #define MCS_USERCHANNEL_BASE 1001 /* RDP secure transport constants */ /* not used anywhere */ #define SEC_RANDOM_SIZE 32 #define SEC_MODULUS_SIZE 64 #define SEC_PADDING_SIZE 8 #define SEC_EXPONENT_SIZE 4 /* RDP licensing constants */ #define LICENCE_TOKEN_SIZE 10 #define LICENCE_HWID_SIZE 20 #define LICENCE_SIGNATURE_SIZE 16 /* See T.128 */ /* not used anywhere */ #define RDP_KEYPRESS 0 #define RDP_KEYRELEASE (KBD_FLAG_DOWN | KBD_FLAG_UP) /* Raster operation masks */ #define ROP2_S(rop3) (rop3 & 0xf) #define ROP2_P(rop3) ((rop3 & 0x3) | ((rop3 & 0x30) >> 2)) #define ROP2_COPY 0xc #define ROP2_XOR 0x6 #define ROP2_AND 0x8 #define ROP2_NXOR 0x9 #define ROP2_OR 0xe #define MIX_TRANSPARENT 0 #define MIX_OPAQUE 1 #define TEXT2_VERTICAL 0x04 #define TEXT2_IMPLICIT_X 0x20 /* RDP bitmap cache (version 2) constants */ #define BMPCACHE2_C0_CELLS 0x78 #define BMPCACHE2_C1_CELLS 0x78 #define BMPCACHE2_C2_CELLS 0x150 #define BMPCACHE2_NUM_PSTCELLS 0x9f6 #define PDU_FLAG_FIRST 0x01 #define PDU_FLAG_LAST 0x02 #define RDP_SOURCE "MSTSC" /* Keymap flags */ #define MapRightShiftMask (1 << 0) #define MapLeftShiftMask (1 << 1) #define MapShiftMask (MapRightShiftMask | MapLeftShiftMask) #define MapRightAltMask (1 << 2) #define MapLeftAltMask (1 << 3) #define MapAltGrMask MapRightAltMask #define MapRightCtrlMask (1 << 4) #define MapLeftCtrlMask (1 << 5) #define MapCtrlMask (MapRightCtrlMask | MapLeftCtrlMask) #define MapRightWinMask (1 << 6) #define MapLeftWinMask (1 << 7) #define MapWinMask (MapRightWinMask | MapLeftWinMask) #define MapNumLockMask (1 << 8) #define MapCapsLockMask (1 << 9) #define MapLocalStateMask (1 << 10) #define MapInhibitMask (1 << 11) #define MASK_ADD_BITS(var, mask) (var |= mask) #define MASK_REMOVE_BITS(var, mask) (var &= ~mask) #define MASK_HAS_BITS(var, mask) ((var & mask)>0) #define MASK_CHANGE_BIT(var, mask, active) \ (var = ((var & ~mask) | (active ? mask : 0))) /* Clipboard constants, "borrowed" from GCC system headers in the w32 cross compiler */ #define CF_TEXT 1 #define CF_BITMAP 2 #define CF_METAFILEPICT 3 #define CF_SYLK 4 #define CF_DIF 5 #define CF_TIFF 6 #define CF_OEMTEXT 7 #define CF_DIB 8 #define CF_PALETTE 9 #define CF_PENDATA 10 #define CF_RIFF 11 #define CF_WAVE 12 #define CF_UNICODETEXT 13 #define CF_ENHMETAFILE 14 #define CF_HDROP 15 #define CF_LOCALE 16 #define CF_MAX 17 #define CF_OWNERDISPLAY 128 #define CF_DSPTEXT 129 #define CF_DSPBITMAP 130 #define CF_DSPMETAFILEPICT 131 #define CF_DSPENHMETAFILE 142 #define CF_PRIVATEFIRST 512 #define CF_PRIVATELAST 767 #define CF_GDIOBJFIRST 768 #define CF_GDIOBJLAST 1023 /* RDPDR constants */ #define RDPDR_MAX_DEVICES 0x10 /* drawable types */ #define WND_TYPE_BITMAP 0 #define WND_TYPE_WND 1 #define WND_TYPE_SCREEN 2 #define WND_TYPE_BUTTON 3 #define WND_TYPE_IMAGE 4 #define WND_TYPE_EDIT 5 #define WND_TYPE_LABEL 6 #define WND_TYPE_COMBO 7 #define WND_TYPE_SPECIAL 8 #define WND_TYPE_LISTBOX 9 #define WND_TYPE_OFFSCREEN 10 /* button states */ #define BUTTON_STATE_UP 0 #define BUTTON_STATE_DOWN 1 /* touch gestures */ #define TOUCH_TWO_FINGERS_DOWN 0 #define TOUCH_TWO_FINGERS_UP 1 #define TOUCH_TWO_FINGERS_LEFT 2 #define TOUCH_TWO_FINGERS_RIGHT 3 /* messages */ #define WM_PAINT 3 #define WM_KEYDOWN 15 #define WM_KEYUP 16 #define WM_KEYBRD_SYNC 17 #define WM_MOUSEMOVE 100 #define WM_LBUTTONUP 101 #define WM_LBUTTONDOWN 102 #define WM_RBUTTONUP 103 #define WM_RBUTTONDOWN 104 #define WM_BUTTON3UP 105 #define WM_BUTTON3DOWN 106 #define WM_BUTTON4UP 107 #define WM_BUTTON4DOWN 108 #define WM_BUTTON5UP 109 #define WM_BUTTON5DOWN 110 #define WM_BUTTON6UP 111 #define WM_BUTTON6DOWN 112 #define WM_BUTTON7UP 113 #define WM_BUTTON7DOWN 114 #define WM_BUTTON8UP 115 #define WM_BUTTON8DOWN 116 #define WM_BUTTON9UP 117 #define WM_BUTTON9DOWN 118 #define WM_TOUCH_VSCROLL 140 #define WM_TOUCH_HSCROLL 141 #define WM_INVALIDATE 200 #define WM_CHANNEL_DATA 201 #define CB_ITEMCHANGE 300 #define FASTPATH_MAX_PACKET_SIZE 0x3fff #define XR_RDP_SCAN_LSHIFT 42 #define XR_RDP_SCAN_ALT 56 // Since we're not guaranteed to have pixman, copy these directives. #define XRDP_PIXMAN_TYPE_ARGB 2 #define XRDP_PIXMAN_TYPE_ABGR 3 #define XRDP_PIXMAN_FORMAT(bpp,type,a,r,g,b) (((bpp) << 24) | \ ((type) << 16) | \ ((a) << 12) | \ ((r) << 8) | \ ((g) << 4) | \ ((b))) #define XRDP_a8b8g8r8 \ XRDP_PIXMAN_FORMAT(32, XRDP_PIXMAN_TYPE_ABGR, 8, 8, 8, 8) #define XRDP_a8r8g8b8 \ XRDP_PIXMAN_FORMAT(32, XRDP_PIXMAN_TYPE_ARGB, 8, 8, 8, 8) #define XRDP_r5g6b5 \ XRDP_PIXMAN_FORMAT(16, XRDP_PIXMAN_TYPE_ARGB, 0, 5, 6, 5) #define XRDP_a1r5g5b5 \ XRDP_PIXMAN_FORMAT(16, XRDP_PIXMAN_TYPE_ARGB, 1, 5, 5, 5) #define XRDP_r3g3b2 \ XRDP_PIXMAN_FORMAT(8, XRDP_PIXMAN_TYPE_ARGB, 0, 3, 3, 2) // The last used constant in pixman is 63, so use 64+ #define XRDP_nv12 \ XRDP_PIXMAN_FORMAT(12, 64, 0, 0, 0, 0) #define XRDP_i420 \ XRDP_PIXMAN_FORMAT(12, 65, 0, 0, 0, 0) #define XRDP_nv12_709fr \ XRDP_PIXMAN_FORMAT(12, 66, 0, 0, 0, 0) #define XRDP_yuv444_709fr \ XRDP_PIXMAN_FORMAT(32, 67, 0, 0, 0, 0) // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegfx/8131c1bc-1af8-4907-a05a-f72f4581160f #define XRDP_yuv444_v1_stream_709fr \ XRDP_PIXMAN_FORMAT(32, 68, 0, 0, 0, 0) // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpegfx/781406c3-5e24-4f2b-b6ff-42b76bf64f6d #define XRDP_yuv444_v2_stream_709fr \ XRDP_PIXMAN_FORMAT(32, 69, 0, 0, 0, 0) #endif xrdp-0.10.1/common/defines.h000644 001751 000000 00000007237 14652432047 015724 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * main define/macro file */ #ifndef DEFINES_H #define DEFINES_H /* other macros */ #undef MIN #define MIN(x1, x2) ((x1) < (x2) ? (x1) : (x2)) #undef MAX #define MAX(x1, x2) ((x1) > (x2) ? (x1) : (x2)) #undef HIWORD #define HIWORD(in) (((in) & 0xffff0000) >> 16) #undef LOWORD #define LOWORD(in) ((in) & 0x0000ffff) #undef MAKELONG #define MAKELONG(lo, hi) ((((hi) & 0xffff) << 16) | ((lo) & 0xffff)) #define UNUSED_VAR(x) ((void) (x)) /* graphics macros */ #define MAKERECT(r, x, y, cx, cy) \ { (r).left = x; (r).top = y; (r).right = (x) + (cx); (r).bottom = (y) + (cy); } #define ISRECTEMPTY(r) (((r).right <= (r).left) || ((r).bottom <= (r).top)) #define RECTOFFSET(r, dx, dy) \ { (r).left += dx; (r).top += dy; (r).right += dx; (r).bottom += dy; } #define GETPIXEL8(d, x, y, w) (*(((unsigned char*)d) + ((y) * (w) + (x)))) #define GETPIXEL16(d, x, y, w) (*(((unsigned short*)d) + ((y) * (w) + (x)))) #define GETPIXEL32(d, x, y, w) (*(((unsigned int*)d) + ((y) * (w) + (x)))) #define SETPIXEL8(d, x, y, w, v) \ (*(((unsigned char*)d) + ((y) * (w) + (x))) = (v)) #define SETPIXEL16(d, x, y, w, v) \ (*(((unsigned short*)d) + ((y) * (w) + (x))) = (v)) #define SETPIXEL32(d, x, y, w, v) \ (*(((unsigned int*)d) + ((y) * (w) + (x))) = (v)) #define COLOR8(r, g, b) \ ( \ (((r) >> 5) << 0) | \ (((g) >> 5) << 3) | \ (((b) >> 6) << 6) \ ) #define COLOR15(r, g, b) ((((r) >> 3) << 10) | (((g) >> 3) << 5) | ((b) >> 3)) #define COLOR16(r, g, b) ((((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3)) #define COLOR24RGB(r, g, b) (((r) << 16) | ((g) << 8) | (b)) #define COLOR24BGR(r, g, b) (((b) << 16) | ((g) << 8) | (r)) #define HRED(c) ((c & 0xff0000) >> 16) #define HGREEN(c) ((c & 0x00ff00) >> 8) #define HBLUE(c) ((c & 0x0000ff)) #define HCOLOR(bpp,c) \ ( \ (bpp==8?COLOR8(HRED(c),HGREEN(c),HBLUE(c)): \ (bpp==15?COLOR15(HRED(c),HGREEN(c),HBLUE(c)): \ (bpp==16?COLOR16(HRED(c),HGREEN(c),HBLUE(c)): \ (bpp>=24?COLOR24BGR(HRED(c),HGREEN(c),HBLUE(c)):c) \ ) \ ) \ ) \ ) #define SPLITCOLOR15(r, g, b, c) \ { \ r = (((c) >> 7) & 0xf8) | (((c) >> 12) & 0x7); \ g = (((c) >> 2) & 0xf8) | (((c) >> 8) & 0x7); \ b = (((c) << 3) & 0xf8) | (((c) >> 2) & 0x7); \ } #define SPLITCOLOR16(r, g, b, c) \ { \ r = (((c) >> 8) & 0xf8) | (((c) >> 13) & 0x7); \ g = (((c) >> 3) & 0xfc) | (((c) >> 9) & 0x3); \ b = (((c) << 3) & 0xf8) | (((c) >> 2) & 0x7); \ } #define SPLITCOLOR32(r, g, b, c) \ { \ r = ((c) >> 16) & 0xff; \ g = ((c) >> 8) & 0xff; \ b = (c) & 0xff; \ } /* font macros */ #define FONT_DATASIZE_FROM_GEOMETRY(width,height) \ ((((height) * (((width) + 7) / 8)) + 3) & ~3) #define FONT_DATASIZE(f) FONT_DATASIZE_FROM_GEOMETRY((f->width), (f->height)) /* use crc for bitmap cache lookups */ #define USE_CRC #define XR_RGB2BGR(a_ulColor) \ (a_ulColor & 0xFF000000) | \ ((a_ulColor & 0x00FF0000) >> 16) | \ (a_ulColor & 0x0000FF00) | \ ((a_ulColor & 0x000000FF) << 16) #endif xrdp-0.10.1/common/list16.h000644 001751 000000 00000002457 14652432047 015430 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * simple list */ #if !defined(LIST16_H) #define LIST16_H #include "arch.h" /* list */ struct list16 { tui16 *items; int count; int max_count; tui16 mitems[4]; }; struct list16 * list16_create(void); void list16_delete(struct list16 *self); void list16_init(struct list16 *self); void list16_deinit(struct list16 *self); void list16_add_item(struct list16 *self, tui16 item); tui16 list16_get_item(struct list16 *self, int index); void list16_clear(struct list16 *self); int list16_index_of(struct list16 *self, tui16 item); void list16_remove_item(struct list16 *self, int index); void list16_insert_item(struct list16 *self, int index, tui16 item); #endif xrdp-0.10.1/common/thread_calls.h000644 001751 000000 00000002170 14652432047 016723 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * thread calls */ #if !defined(THREAD_CALLS_H) #define THREAD_CALLS_H #include "arch.h" int tc_thread_create(THREAD_RV (THREAD_CC *start_routine)(void *), void *arg); tbus tc_get_threadid(void); int tc_threadid_equal(tbus tid1, tbus tid2); tbus tc_mutex_create(void); void tc_mutex_delete(tbus mutex); int tc_mutex_lock(tbus mutex); int tc_mutex_unlock(tbus mutex); tbus tc_sem_create(int init_count); void tc_sem_delete(tbus sem); int tc_sem_dec(tbus sem); int tc_sem_inc(tbus sem); #endif xrdp-0.10.1/common/ms-rdperp.h000644 001751 000000 00000002005 14652432047 016204 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPERP : Definitions from [MS-RDPERP] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPERP are currently correct for v20190923 of that * document */ #if !defined(MS_RDPERP_H) #define MS_RDPERP_H /* Window List Capability Set: WndSupportLevel (2.2.1.1.2) */ #define TS_WINDOW_LEVEL_NOT_SUPPORTED 0x00000000 #define TS_WINDOW_LEVEL_SUPPORTED 0x00000001 #define TS_WINDOW_LEVEL_SUPPORTED_EX 0x00000002 #endif /* MS_RDPERP_H */ xrdp-0.10.1/common/base64.c000644 001751 000000 00000016041 14652432047 015357 0ustar00metawheel000000 000000 /** * Copyright (C) 2022 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * @file common/base64.c * @brief Base64 encoder / decoder */ #if defined(HAVE_CONFIG_H) #include #endif #include "string_calls.h" #include "base64.h" /* * Values for invalid and padding characters, used in the charmap * for converting base64 to binary * * These values are specially chosen to make it easy to detect padding or * invalid characters by or-ing together the values looked up in * a base64 quantum */ #define E_INVALID 0x40 #define E_PAD 0x80 /* Determine the character set on this platform */ #if ('a' == 0x61 && 'z' == 0x7a ) && \ ('A' == 0x41 && 'Z' == 0x5a ) && \ ('0' == 0x30 && '9' == 0x39 ) # define PLATFORM_IS_ASCII 1 #else # error "Unrecognised character set on this platform" #endif /* character set check */ /* * Define a table to map the base64 character values to bit values. */ #ifdef PLATFORM_IS_ASCII #define CHARMAP_BASE 0x28 #define E_IV E_INVALID /* For table alignment */ const unsigned char charmap[] = { /* 0x28 */ E_IV, E_IV, E_IV, 0x3e, E_IV, E_IV, E_IV, 0x3f, /* 0x30 */ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, /* 0x38 */ 0x3c, 0x3d, E_IV, E_IV, E_IV, E_PAD, E_IV, E_IV, /* 0x40 */ E_IV, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, /* 0x48 */ 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, /* 0x50 */ 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, /* 0x58 */ 0x17, 0x18, 0x19, E_IV, E_IV, E_IV, E_IV, E_IV, /* 0x60 */ E_IV, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, /* 0x68 */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, /* 0x70 */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, /* 0x78 */ 0x31, 0x32, 0x33 }; #undef E_IV #endif /* PLATFORM_IS_ASCII */ /** * Lookup a value in the charmap * * @param x - byte to lookup. Only referenced once so can safely have * side effects. * @param dest - destination to assign result to. */ #define CM_LOOKUP(x,dest) \ { \ unsigned int t = (unsigned int)(x) - CHARMAP_BASE;\ dest = (t < sizeof(charmap)) ? charmap[t] : E_INVALID; \ } /*****************************************************************************/ int base64_decode(const char *src, char *dst, size_t dst_len, size_t *actual_len) { *actual_len = 0; size_t src_len; size_t src_i = 0; size_t dst_i = 0; unsigned int a; /* Four characters of base64 quantum */ unsigned int b; unsigned int c; unsigned int d; unsigned int v; #define OUTPUT_CHAR(x) \ { \ if (dst_i < dst_len) \ { \ dst[dst_i] = (x);\ } \ ++dst_i; \ } src_len = g_strlen(src); while (src_i < src_len) { if ((src_len - src_i) >= 4) { /* Usual case - full quantum */ CM_LOOKUP(src[src_i++], a); CM_LOOKUP(src[src_i++], b); CM_LOOKUP(src[src_i++], c); CM_LOOKUP(src[src_i++], d); } else { /* Add padding on the end to make up the full quantum */ CM_LOOKUP(src[src_i++], a); b = E_PAD; c = E_PAD; d = E_PAD; if ((src_len - src_i) > 0) { CM_LOOKUP(src[src_i++], b); } if ((src_len - src_i) > 0) { CM_LOOKUP(src[src_i++], c); } } /* * Bitwise-or the translated quantum values together, so that * any invalid or padding characters can be detected with a * single test */ v = a | b | c | d; if ((v & E_INVALID) != 0) { return -1; /* At least one invalid character */ } if ((v & E_PAD) == 0) { /* No padding - a full quantum */ v = (a << 18) | (b << 12) | (c << 6) | d; OUTPUT_CHAR(v >> 16); OUTPUT_CHAR((v >> 8) & 0xff); OUTPUT_CHAR(v & 0xff); } else if (((a | b | c) & E_PAD) == 0) { /* No padding in the first 3 chars, so the padding must * be at the end */ v = (a << 10) | (b << 4) | (c >> 2); OUTPUT_CHAR(v >> 8); OUTPUT_CHAR(v & 0xff); } else if (((a | b) & E_PAD) == 0 && c == d) { /* No padding in first two chars, so if the last two chars are * equal, they must both be padding */ v = (a << 2) | (b >> 4); OUTPUT_CHAR(v); } else { /* Illegal padding */ return -1; } } *actual_len = dst_i; return 0; #undef OUTPUT_CHAR } /*****************************************************************************/ size_t base64_encode(const char *src, size_t src_len, char *dst, size_t dst_len) { char *p = dst; size_t src_i = 0; size_t max_src_len; unsigned int v; static const char *b64chr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/="; /* Each three octets of the source results in four bytes at the output, * plus we need a terminator. So we can work out the maximum number of * source octets we can process */ if (dst_len == 0) { max_src_len = 0; } else { max_src_len = (dst_len - 1) / 4 * 3; } if (src_len > max_src_len) { src_len = max_src_len; } while (src_i < src_len) { switch (src_len - src_i) { case 1: v = (unsigned int)(unsigned char)src[src_i++] << 4; *p++ = b64chr[v >> 6]; *p++ = b64chr[v & 0x3f]; *p++ = b64chr[64]; *p++ = b64chr[64]; break; case 2: v = (unsigned int)(unsigned char)src[src_i++] << 10; v |= (unsigned int)(unsigned char)src[src_i++] << 2; *p++ = b64chr[v >> 12]; *p++ = b64chr[(v >> 6) & 0x3f]; *p++ = b64chr[v & 0x3f]; *p++ = b64chr[64]; break; default: v = (unsigned int)(unsigned char)src[src_i++] << 16; v |= (unsigned int)(unsigned char)src[src_i++] << 8; v |= (unsigned int)(unsigned char)src[src_i++]; *p++ = b64chr[v >> 18]; *p++ = b64chr[(v >> 12) & 0x3f]; *p++ = b64chr[(v >> 6) & 0x3f]; *p++ = b64chr[v & 0x3f]; break; } } *p = '\0'; return src_len; } xrdp-0.10.1/common/ssl_calls.h000644 001751 000000 00000006162 14652432047 016262 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * Copyright (C) Idan Freiberg 2013-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(SSL_CALLS_H) #define SSL_CALLS_H #include "arch.h" /* Incomplete types */ struct ssl_tls; struct trans; int ssl_init(void); int ssl_finish(void); void * ssl_rc4_info_create(void); void ssl_rc4_info_delete(void *rc4_info); void ssl_rc4_set_key(void *rc4_info, const char *key, int len); void ssl_rc4_crypt(void *rc4_info, char *data, int len); void * ssl_sha1_info_create(void); void ssl_sha1_info_delete(void *sha1_info); void ssl_sha1_clear(void *sha1_info); void ssl_sha1_transform(void *sha1_info, const char *data, int len); void ssl_sha1_complete(void *sha1_info, char *data); void * ssl_md5_info_create(void); void ssl_md5_info_delete(void *md5_info); void ssl_md5_clear(void *md5_info); void ssl_md5_transform(void *md5_info, const char *data, int len); void ssl_md5_complete(void *md5_info, char *data); void * ssl_des3_encrypt_info_create(const char *key, const char *ivec); void * ssl_des3_decrypt_info_create(const char *key, const char *ivec); void ssl_des3_info_delete(void *des3); int ssl_des3_encrypt(void *des3, int length, const char *in_data, char *out_data); int ssl_des3_decrypt(void *des3, int length, const char *in_data, char *out_data); void * ssl_hmac_info_create(void); void ssl_hmac_info_delete(void *hmac); void ssl_hmac_sha1_init(void *hmac, const char *data, int len); void ssl_hmac_transform(void *hmac, const char *data, int len); void ssl_hmac_complete(void *hmac, char *data, int len); int ssl_mod_exp(char *out, int out_len, const char *in, int in_len, const char *mod, int mod_len, const char *exp, int exp_len); int ssl_gen_key_xrdp1(int key_size_in_bits, const char *exp, int exp_len, char *mod, int mod_len, char *pri, int pri_len); /* xrdp_tls.c */ struct ssl_tls * ssl_tls_create(struct trans *trans, const char *key, const char *cert); int ssl_tls_accept(struct ssl_tls *self, long ssl_protocols, const char *tls_ciphers); int ssl_tls_disconnect(struct ssl_tls *self); void ssl_tls_delete(struct ssl_tls *self); int ssl_tls_read(struct ssl_tls *tls, char *data, int length); int ssl_tls_write(struct ssl_tls *tls, const char *data, int length); int ssl_tls_can_recv(struct ssl_tls *tls, int sck, int millis); const char * ssl_get_version(const struct ssl_tls *ssl); const char * ssl_get_cipher_name(const struct ssl_tls *ssl); int ssl_get_protocols_from_string(const char *str, long *ssl_protocols); const char * get_openssl_version(); tintptr ssl_get_rwo(const struct ssl_tls *ssl); #endif xrdp-0.10.1/common/list.c000644 001751 000000 00000021150 14652432047 015243 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * simple list */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include "arch.h" #include "os_calls.h" #include "string_calls.h" #include "list.h" #include "log.h" enum { DEFAULT_LIST_SIZE = 10, DEFAULT_GROW_BY_SIZE = 10 }; /******************************************************************************/ struct list * list_create_sized(unsigned int size) { struct list *self; if (size < DEFAULT_LIST_SIZE) { size = DEFAULT_LIST_SIZE; } self = (struct list *)calloc(sizeof(struct list), 1); if (self != NULL) { self->items = (tbus *)malloc(sizeof(tbus) * size); if (self->items == NULL) { free(self); self = NULL; } else { self->grow_by = DEFAULT_GROW_BY_SIZE; self->alloc_size = size; } } return self; } /******************************************************************************/ struct list * list_create(void) { return list_create_sized(DEFAULT_LIST_SIZE); } /******************************************************************************/ void list_delete(struct list *self) { int i; if (self == 0) { return; } if (self->auto_free) { for (i = 0; i < self->count; i++) { free((void *)self->items[i]); self->items[i] = 0; } } free(self->items); free(self); } /******************************************************************************/ static int grow_list(struct list *self) { int rv = 1; unsigned int new_alloc_size = self->alloc_size + self->grow_by; tbus *p = (tbus *)realloc(self->items, sizeof(tbus) * new_alloc_size); if (p == NULL) { rv = 0; } else { self->alloc_size = new_alloc_size; self->items = p; } return rv; } /*****************************************************************************/ int list_add_item(struct list *self, tbus item) { if (self->count == self->alloc_size && !grow_list(self)) { return 0; } self->items[self->count] = item; self->count++; return 1; } /******************************************************************************/ tbus list_get_item(const struct list *self, int index) { if (index < 0 || index >= self->count) { return 0; } return self->items[index]; } /******************************************************************************/ void list_clear(struct list *self) { int i; if (self->auto_free) { for (i = 0; i < self->count; i++) { free((void *)self->items[i]); self->items[i] = 0; } } self->count = 0; self->grow_by = DEFAULT_GROW_BY_SIZE; self->alloc_size = DEFAULT_LIST_SIZE; self->items = (tbus *)realloc(self->items, sizeof(tbus) * self->alloc_size); } /******************************************************************************/ int list_index_of(struct list *self, tbus item) { int i; for (i = 0; i < self->count; i++) { if (self->items[i] == item) { return i; } } return -1; } /******************************************************************************/ void list_remove_item(struct list *self, int index) { int i; if (index >= 0 && index < self->count) { if (self->auto_free) { free((void *)self->items[index]); self->items[index] = 0; } for (i = index; i < (self->count - 1); i++) { self->items[i] = self->items[i + 1]; } self->count--; } } int list_insert_item(struct list *self, int index, tbus item) { int i; if (index > self->count) { index = self->count; } else if (index < 0) { index = 0; } if (self->count == self->alloc_size && !grow_list(self)) { return 0; } // Move all the items above this location up one for (i = self->count ; i > index ; --i) { self->items[i] = self->items[i - 1]; } self->count++; self->items[index] = item; return 1; } /******************************************************************************/ int list_add_strdup(struct list *self, const char *str) { int rv; char *dup; if (str == NULL) { rv = list_add_item(self, (tintptr)str); } else if ((dup = g_strdup(str)) == NULL) { rv = 0; } else { rv = list_add_item(self, (tintptr)dup); if (!rv) { g_free(dup); } } return rv; } /******************************************************************************/ int list_add_strdup_multi(struct list *self, ...) { va_list ap; int entry_count = self->count; const char *s; int rv = 1; va_start(ap, self); while ((s = va_arg(ap, const char *)) != NULL) { if (!list_add_strdup(self, s)) { rv = 0; break; } } va_end(ap); if (rv == 0) { // Remove the additional items we added while (self->count > entry_count) { list_remove_item(self, self->count - 1); } } return rv; } /******************************************************************************/ /* append one list to another using strdup for each item in the list */ /* begins copy at start_index, a zero based index on the source list */ int list_append_list_strdup(struct list *self, struct list *dest, int start_index) { int index; int rv = 1; int entry_dest_count = dest->count; for (index = start_index; index < self->count; index++) { const char *item = (const char *)list_get_item(self, index); if (!list_add_strdup(dest, item)) { rv = 0; break; } } if (rv == 0) { // Remove the additional items we added while (dest->count > entry_dest_count) { list_remove_item(dest, dest->count - 1); } } return rv; } /******************************************************************************/ void list_dump_items(struct list *self) { int index; if (self->count == 0) { LOG_DEVEL(LOG_LEVEL_TRACE, "List is empty"); } for (index = 0; index < self->count; index++) { LOG_DEVEL(LOG_LEVEL_TRACE, "%d: %p", index, (void *) list_get_item(self, index)); } } /******************************************************************************/ /** * Appends a string fragment to a list * @param[in,out] start Pointer to start of fragment (by reference) * @param end Pointer to one past end of fragment * @param list List to append to * @result 1 for success * * In the event of a memory failure, 0 is returned and the list is deleted. */ int split_string_append_fragment(const char **start, const char *end, struct list *list) { const unsigned int len = end - *start; char *copy = (char *)malloc(len + 1); if (copy == NULL) { list_delete(list); return 0; } g_memcpy(copy, *start, len); copy[len] = '\0'; if (!list_add_item(list, (tintptr)copy)) { g_free(copy); list_delete(list); return 0; } *start = end + 1; return 1; } /******************************************************************************/ struct list * split_string_into_list(const char *str, char character) { struct list *result = list_create(); if (result == NULL) { return result; } result->auto_free = 1; if (str == NULL) { return result; } const char *p; while ((p = g_strchr(str, character)) != NULL) { if (!split_string_append_fragment(&str, p, result)) { return NULL; } } if (*str != '\0') { if (!split_string_append_fragment(&str, str + g_strlen(str), result)) { return NULL; } } return result; } xrdp-0.10.1/common/os_calls.h000644 001751 000000 00000036671 14652432047 016112 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * generic operating system calls */ #if !defined(OS_CALLS_H) #define OS_CALLS_H #include "arch.h" enum exit_reason { E_XR_STATUS_CODE = 0, ///< 'val' contains exit status E_XR_SIGNAL, ///< 'val' contains a signal number E_XR_UNEXPECTED }; struct exit_status { enum exit_reason reason; int val; }; struct list; #define g_tcp_can_recv g_sck_can_recv #define g_tcp_can_send g_sck_can_send #define g_tcp_recv g_sck_recv #define g_tcp_send g_sck_send #define g_tcp_close g_sck_close #define g_tcp_last_error_would_block g_sck_last_error_would_block #define g_tcp_set_non_blocking g_sck_set_non_blocking #define g_tcp_local_socket g_sck_local_socket #define g_tcp_local_connect g_sck_local_connect #define g_tcp_listen g_sck_listen #define g_tcp_local_bind g_sck_local_bind #define g_tcp_select g_sck_select #define g_close_wait_obj g_delete_wait_obj int g_rm_temp_dir(void); void g_init(const char *app_name); void g_deinit(void); void g_printf(const char *format, ...) printflike(1, 2); void g_sprintf(char *dest, const char *format, ...) \ printflike(2, 3); int g_snprintf(char *dest, int len, const char *format, ...) \ printflike(3, 4); void g_writeln(const char *format, ...) printflike(1, 2); void g_write(const char *format, ...) printflike(1, 2); void g_hexdump(const char *p, int len); int g_getchar(void); int g_tcp_set_no_delay(int sck); int g_tcp_set_keepalive(int sck); int g_tcp_socket(void); int g_sck_set_send_buffer_bytes(int sck, int bytes); int g_sck_get_send_buffer_bytes(int sck, int *bytes); int g_sck_set_recv_buffer_bytes(int sck, int bytes); int g_sck_get_recv_buffer_bytes(int sck, int *bytes); int g_sck_local_socket(void); int g_sck_local_socketpair(int sck[2]); int g_sck_vsock_socket(void); int g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid); void g_sck_close(int sck); int g_tcp_connect(int sck, const char *address, const char *port); int g_sck_local_connect(int sck, const char *port); int g_sck_set_non_blocking(int sck); int g_tcp_bind(int sck, const char *port); int g_sck_local_bind(int sck, const char *port); int g_sck_vsock_bind(int sck, const char *port); int g_sck_vsock_bind_address(int sck, const char *port, const char *address); int g_tcp_bind_address(int sck, const char *port, const char *address); int g_sck_listen(int sck); int g_sck_accept(int sck); int g_sck_recv(int sck, void *ptr, unsigned int len, int flags); int g_sck_send(int sck, const void *ptr, unsigned int len, int flags); /** * Receives data and file descriptors on a unix domain socket * * @param sck - Socket to receive data + file descriptors from * @param ptr - Pointer to buffer for incoming data * @param len - Length of data. Must be > 0 * @param[out] fds - Array of file descriptors * @param [in] maxfd - Max number of elements in fds * @param[out] fdcount - Actual number of file descriptors received * @return Bytes received, or < 0 for error. * * If the result is > 0 but less than len, the file descriptors have * been received. Get the rest of the data with normal g_sck_recv() calls. * * fdcount may be more that maxfd. This indicates that more file descriptors * were received than there was space for. The excess file descriptors * are closed and discarded. */ int g_sck_recv_fd_set(int sck, void *ptr, unsigned int len, int fds[], unsigned int maxfd, unsigned int *fdcount); /** * Sends data and file descriptors on a unix domain socket * * @param sck - Socket to send data + file descriptors on * @param ptr - Data to send * @param len - Length of data. Must be > 0 * @param fds - Array of file descriptors * @param fdcount - Number of file descriptors * @return Bytes sent, or < 0 for error. * * If the result is > 0 but less than len, the file descriptors have * been sent. Send the rest of the data with normal g_sck_send() calls. */ int g_sck_send_fd_set(int sck, const void *ptr, unsigned int len, int fds[], unsigned int fdcount); int g_sck_last_error_would_block(int sck); int g_sck_socket_ok(int sck); /** * Checks socket writeability with an optional wait * * @param sck - Socket to check * @param millis - Maximum milliseconds to wait for writeability to be true * * @note The wait time may not be reached in the event of an incoming signal * so do not use this call to impose a hard timeout */ int g_sck_can_send(int sck, int millis); /** * Checks socket readability with an optional wait * * @param sck - Socket to check * @param millis - Maximum milliseconds to wait for readability to be true * * @note The wait time may not be reached in the event of an incoming signal * so do not use this call to impose a hard timeout */ int g_sck_can_recv(int sck, int millis); int g_sck_select(int sck1, int sck2); /** * Gets the IP address of a connected peer, if it has one * @param sck File descriptor for peer * @param ip buffer to write IP address to * @param bytes Size of ip buffer. Should be at least MAX_IP_ADDRSTRLEN * @param[out] portptr Optional variable to receive the port number * @return Pointer to IP for convenience * * If the peer has no IP address (for example, it is a Unix Domain Socket), * or the specified buffer is too small, the returned string is "" */ const char * g_sck_get_peer_ip_address(int sck, char *ip, unsigned int bytes, unsigned short *port); /** * Gets a description for a connected peer * @param sck File descriptor for peer * @param desc buffer to write description to * @param bytes Size of description buffer. Should be at least * MAX_PEER_DESCSTRLEN * @return Pointer to desc for convenience * * Unlike g_sck_get_peer_ip_address(), this will return a * description of some sort for any socket type. */ const char * g_sck_get_peer_description(int sck, char *desc, unsigned int bytes); /** * Sleep for the specified number of milli-seconds * @param msecs Milli-seconds * * If a signal is processed, it is possible that this call will * sleep for less than the specified number of milli-seconds. This * is platform-specific */ void g_sleep(int msecs); int g_pipe(int fd[2]); tintptr g_create_wait_obj(const char *name); tintptr g_create_wait_obj_from_socket(tintptr socket, int write); void g_delete_wait_obj_from_socket(tintptr wait_obj); int g_set_wait_obj(tintptr obj); int g_reset_wait_obj(tintptr obj); int g_is_wait_obj_set(tintptr obj); int g_delete_wait_obj(tintptr obj); /** * Wait for the specified readable and writeable objs * * The wait finishes when at least one of the objects becomes * readable or writeable * * @param read_objs Array of read objects * @param rcount Number of elements in read_objs * @param write_objs Array of write objects * @param rcount Number of elements in write_objs * @param mstimeout Timeout in milliseconds. < 0 means an infinite timeout. * * @return 0 for success. The objects will need to be polled to * find out what is readable or writeable. * * An mstimeout of zero will return immediately, although * error conditions may be checked for. */ int g_obj_wait(tintptr *read_objs, int rcount, tintptr *write_objs, int wcount, int mstimeout); void g_random(char *data, int len); int g_abs(int i); int g_memcmp(const void *s1, const void *s2, int len); int g_file_open_rw(const char *file_name); int g_file_open_ex(const char *file_name, int aread, int awrite, int acreate, int atrunc); int g_file_open_ro(const char *file_name); int g_file_close(int fd); /** * Returns 1 if a file is open (i.e. the file descriptor is valid) * @param fd File descriptor * @return 1 for file open, 0 for not open */ int g_file_is_open(int fd); int g_file_read(int fd, char *ptr, int len); int g_file_write(int fd, const char *ptr, int len); int g_file_seek(int fd, int offset); int g_file_lock(int fd, int start, int len); int g_file_map(int fd, int aread, int awrite, size_t length, void **addr); int g_munmap(void *addr, size_t length); int g_file_duplicate_on(int fd, int target_fd); int g_file_get_cloexec(int fd); int g_file_set_cloexec(int fd, int status); /** * Get a list of open file descriptors * * @param min Min FD to consider * @param max Max FD to consider (+1), or -1 for no limit * @result Array of file descriptors, in ascending order. * * Call delete_list() on the result when you've finished with it. */ struct list *g_get_open_fds(int min, int max); int g_chmod_hex(const char *filename, int flags); int g_umask_hex(int flags); int g_chown(const char *name, int uid, int gid); int g_mkdir(const char *dirname); char *g_get_current_dir(char *dirname, int maxlen); int g_set_current_dir(const char *dirname); int g_file_exist(const char *filename); int g_file_readable(const char *filename); int g_directory_exist(const char *dirname); int g_executable_exist(const char *dirname); int g_create_dir(const char *dirname); int g_create_path(const char *path); int g_remove_dir(const char *dirname); int g_file_delete(const char *filename); int g_file_get_size(const char *filename); int g_file_get_device_number(const char *filename); int g_file_get_inode_num(const char *filename); long g_load_library(char *in); int g_free_library(long lib); void *g_get_proc_address(long lib, const char *name); int g_system(const char *aexec); char *g_get_strerror(void); int g_get_errno(void); int g_execvp(const char *p1, char *args[]); /** * Issues an execvp() call * * @param file Executable * @param argv Argument list for executable. * * argv does not need to be NULL terminated - the call takes care * of this. * * @return Only if an error has occurred - use g_get_errno() or equivalent */ int g_execvp_list(const char *file, struct list *argv); int g_execlp3(const char *a1, const char *a2, const char *a3); /** * Set an alarm using SIGALRM * @param func Signal handler, or NULL to cancel an alarm * @param secs Number of seconds until an alarm is raised * @return Number of seconds remaining before a previously requested * alarm is raised */ unsigned int g_set_alarm(void (*func)(int), unsigned int secs); /** * Set a handler up for SIGCHLD * @param func signal handler, or NULL to restore the default handler * The handler remains in place until explicitly replaced. */ void g_signal_child_stop(void (*func)(int)); /** * Set a handler up for SIGSEGV * @param func signal handler, or NULL to restore the default handler * The handler can only be called once, at which point the * default handler is restored. This is to avoid infinite loops */ void g_signal_segfault(void (*func)(int)); /** * Set a handler up for SIGHUP * @param func signal handler, or NULL to restore the default handler * The handler remains in place until explicitly replaced. */ void g_signal_hang_up(void (*func)(int)); /** * Set a handler up for SIGINT * @param func signal handler, or NULL to restore the default handler * The handler remains in place until explicitly replaced. */ void g_signal_user_interrupt(void (*func)(int)); /** * Set a handler up for SIGTERM * @param func signal handler, or NULL to restore the default handler * The handler remains in place until explicitly replaced. */ void g_signal_terminate(void (*func)(int)); /** * Set a handler up for SIGPIPE * @param func signal handler, or NULL to restore the default handler * The handler remains in place until explicitly replaced. */ void g_signal_pipe(void (*func)(int)); /** * Set a handler up for SIGUSR1 * @param func signal handler, or NULL to restore the default handler * The handler remains in place until explicitly replaced. */ void g_signal_usr1(void (*func)(int)); int g_fork(void); int g_setgid(int pid); int g_initgroups(const char *user); int g_getuid(void); int g_getgid(void); int g_setuid(int pid); int g_setsid(void); int g_getlogin(char *name, unsigned int len); int g_setlogin(const char *name); #ifdef HAVE_SETUSERCONTEXT /** Sets the login user context (BSD systems only) * @param uid UID of suer * @return 0 for success */ int g_set_allusercontext(int uid); #endif int g_waitchild(struct exit_status *e); int g_waitpid(int pid); struct exit_status g_waitpid_status(int pid); /* * Sets the process group ID of the indicated process to the specified value. * (POSIX.1) * * Errors are logged. * * May do nothing if process groups are not supported */ int g_setpgid(int pid, int pgid); void g_clearenv(void); int g_setenv(const char *name, const char *value, int rewrite); char *g_getenv(const char *name); int g_exit(int exit_code); int g_getpid(void); int g_sigterm(int pid); int g_sighup(int pid); int g_getuser_info_by_name(const char *username, int *uid, int *gid, char **shell, char **dir, char **gecos); int g_getuser_info_by_uid(int uid, char **username, int *gid, char **shell, char **dir, char **gecos); int g_getgroup_info(const char *groupname, int *gid); /** * Checks whether a user is in the specified group * @param username Name of user * @param gid GID of group * @param[out] ok Whether user is in group * @return Non-zero if a system error occurred. In this instance OK is not set * * Primary group of username is also checked */ int g_check_user_in_group(const char *username, int gid, int *ok); int g_time1(void); int g_time2(void); int g_time3(void); int g_save_to_bmp(const char *filename, char *data, int stride_bytes, int width, int height, int depth, int bits_per_pixel); void *g_shmat(int shmid); int g_shmdt(const void *shmaddr); int g_gethostname(char *name, int len); int g_mirror_memcpy(void *dst, const void *src, int len); int g_tcp4_socket(void); int g_tcp4_bind_address(int sck, const char *port, const char *address); int g_tcp6_socket(void); int g_tcp6_bind_address(int sck, const char *port, const char *address); int g_no_new_privs(void); void g_qsort(void *base, size_t nitems, size_t size, int (*compar)(const void *, const void *)); /* glib-style wrappers */ #define g_new(struct_type, n_structs) \ (struct_type *) malloc(sizeof(struct_type) * (n_structs)) #define g_new0(struct_type, n_structs) \ (struct_type *) calloc((n_structs), sizeof(struct_type)) /* remove these when no longer used */ #define g_malloc(_size, _zero) (_zero ? calloc(1, _size) : malloc(_size)) #define g_free free #define g_memset memset #define g_memcpy memcpy #define g_memmove memmove #endif xrdp-0.10.1/common/log.c000644 001751 000000 00000076210 14652432047 015060 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include #include #include #include #include "list.h" #include "file.h" #include "os_calls.h" #include "thread_calls.h" #include "string_calls.h" /* Add a define here so that the log.h will hold more information * when compiled from this C file. * When compiled normally the log.h file only contain the public parts * of the operators in this file. */ #define LOGINTERNALSTUFF #include "log.h" /* Here we store the current state and configuration of the log */ static struct log_config *g_staticLogConfig = NULL; /* This file first start with all private functions. In the end of the file the public functions is defined */ /** * * @brief Opens log file * @param fname log file name * @return see open(2) return values * */ int internal_log_file_open(const char *fname) { int ret = -1; if (fname != NULL) { if (g_strcmp(fname, "") != 0) { ret = open(fname, O_WRONLY | O_CREAT | O_APPEND | O_SYNC, S_IRUSR | S_IWUSR); } else { ret = dup(1); } } if (ret != -1) { g_file_set_cloexec(ret, 1); } return ret; } /** * * @brief Converts xrdp log level to syslog logging level * @param xrdp logging level * @return syslog equivalent logging level * */ int internal_log_xrdp2syslog(const enum logLevels lvl) { switch (lvl) { case LOG_LEVEL_ALWAYS: return LOG_CRIT; case LOG_LEVEL_ERROR: return LOG_ERR; case LOG_LEVEL_WARNING: return LOG_WARNING; case LOG_LEVEL_INFO: return LOG_INFO; case LOG_LEVEL_DEBUG: case LOG_LEVEL_TRACE: return LOG_DEBUG; default: g_writeln("Undefined log level - programming error"); return LOG_DEBUG; } } /** * @brief Converts xrdp log levels to textual logging levels * @param lvl logging level * @param str pointer to a string, must be allocated before * @return The log string in str pointer. * */ void internal_log_lvl2str(const enum logLevels lvl, char *str) { switch (lvl) { case LOG_LEVEL_ALWAYS: snprintf(str, 9, "%s", "[CORE ] "); break; case LOG_LEVEL_ERROR: snprintf(str, 9, "%s", "[ERROR] "); break; case LOG_LEVEL_WARNING: snprintf(str, 9, "%s", "[WARN ] "); break; case LOG_LEVEL_INFO: snprintf(str, 9, "%s", "[INFO ] "); break; case LOG_LEVEL_DEBUG: snprintf(str, 9, "%s", "[DEBUG] "); break; case LOG_LEVEL_TRACE: snprintf(str, 9, "%s", "[TRACE] "); break; default: snprintf(str, 9, "%s", "PRG ERR!"); g_writeln("Programming error - undefined log level!!!"); } } /******************************************************************************/ enum logReturns internal_log_start(struct log_config *l_cfg) { enum logReturns ret = LOG_GENERAL_ERROR; if (0 == l_cfg) { ret = LOG_ERROR_MALLOC; return ret; } /* if progname is NULL, we return error */ if (0 == l_cfg->program_name) { g_writeln("program_name not properly assigned"); return ret; } if (l_cfg->dump_on_start) { internal_log_config_dump(l_cfg); } /* open file */ if (l_cfg->log_file != NULL) { l_cfg->fd = internal_log_file_open(l_cfg->log_file); if (-1 == l_cfg->fd) { return LOG_ERROR_FILE_OPEN; } } /* if syslog is enabled, open it */ if (l_cfg->enable_syslog) { openlog(l_cfg->program_name, LOG_CONS | LOG_PID, LOG_DAEMON); } #ifdef LOG_ENABLE_THREAD pthread_mutexattr_init(&(l_cfg->log_lock_attr)); pthread_mutex_init(&(l_cfg->log_lock), &(l_cfg->log_lock_attr)); #endif return LOG_STARTUP_OK; } /******************************************************************************/ enum logReturns internal_log_end(struct log_config *l_cfg) { enum logReturns ret = LOG_GENERAL_ERROR; /* if log is closed, quit silently */ if (0 == l_cfg) { return ret; } if (-1 != l_cfg->fd) { /* closing logfile... */ g_file_close(l_cfg->fd); } /* if syslog is enabled, close it */ if (l_cfg->enable_syslog) { closelog(); } /* freeing allocated memory */ if (0 != l_cfg->log_file) { g_free(l_cfg->log_file); l_cfg->log_file = 0; } ret = LOG_STARTUP_OK; return ret; } /** * Converts a string representing the log level to a value * @param buf * @return */ enum logLevels internal_log_text2level(const char *buf) { if (0 == g_strcasecmp(buf, "0") || 0 == g_strcasecmp(buf, "core")) { return LOG_LEVEL_ALWAYS; } else if (0 == g_strcasecmp(buf, "1") || 0 == g_strcasecmp(buf, "error")) { return LOG_LEVEL_ERROR; } else if (0 == g_strcasecmp(buf, "2") || 0 == g_strcasecmp(buf, "warn") || 0 == g_strcasecmp(buf, "warning")) { return LOG_LEVEL_WARNING; } else if (0 == g_strcasecmp(buf, "3") || 0 == g_strcasecmp(buf, "info")) { return LOG_LEVEL_INFO; } else if (0 == g_strcasecmp(buf, "4") || 0 == g_strcasecmp(buf, "debug")) { return LOG_LEVEL_DEBUG; } else if (0 == g_strcasecmp(buf, "5") || 0 == g_strcasecmp(buf, "trace")) { return LOG_LEVEL_TRACE; } g_writeln("Your configured log level is corrupt - we use debug log level"); return LOG_LEVEL_DEBUG; } /******************************************************************************/ struct log_config * internal_config_read_logging(int file, const char *applicationName, const char *section_prefix) { int i; char *buf; char *temp_buf; char section_name[512]; struct log_config *lc; struct list *param_n; struct list *param_v; lc = internalInitAndAllocStruct(); if (lc == NULL) { return NULL; } param_n = list_create(); param_n->auto_free = 1; param_v = list_create(); param_v->auto_free = 1; list_clear(param_v); list_clear(param_n); /* setting defaults */ lc->program_name = applicationName; lc->log_file = 0; lc->fd = -1; lc->log_level = LOG_LEVEL_INFO; lc->enable_console = 0; lc->console_level = LOG_LEVEL_INFO; lc->enable_syslog = 0; lc->syslog_level = LOG_LEVEL_INFO; lc->dump_on_start = 0; lc->enable_pid = 0; g_snprintf(section_name, 511, "%s%s", section_prefix, SESMAN_CFG_LOGGING); file_read_section(file, section_name, param_n, param_v); for (i = 0; i < param_n->count; i++) { buf = (char *)list_get_item(param_n, i); if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_FILE)) { lc->log_file = g_strdup((char *)list_get_item(param_v, i)); if (lc->log_file != NULL) { if (lc->log_file[0] != '/' && g_strcmp(lc->log_file, "") != 0) { temp_buf = (char *)g_malloc(512, 0); g_snprintf(temp_buf, 511, "%s/%s", XRDP_LOG_PATH, lc->log_file); g_free(lc->log_file); lc->log_file = temp_buf; } } } if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_LEVEL)) { lc->log_level = internal_log_text2level((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_ENABLE_SYSLOG)) { lc->enable_syslog = g_text2bool((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_SYSLOG_LEVEL)) { lc->syslog_level = internal_log_text2level((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_ENABLE_CONSOLE)) { lc->enable_console = g_text2bool((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_CONSOLE_LEVEL)) { lc->console_level = internal_log_text2level((char *)list_get_item(param_v, i)); } if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_ENABLE_PID)) { lc->enable_pid = g_text2bool((char *)list_get_item(param_v, i)); } } if (0 == lc->log_file) { lc->log_file = g_strdup("./sesman.log"); } /* try to create path if not exist */ g_create_path(lc->log_file); #ifdef LOG_PER_LOGGER_LEVEL int len; struct log_logger_level *logger; list_clear(param_v); list_clear(param_n); g_snprintf(section_name, 511, "%s%s", section_prefix, SESMAN_CFG_LOGGING_LOGGER); file_read_section(file, section_name, param_n, param_v); for (i = 0; i < param_n->count; i++) { logger = (struct log_logger_level *)g_malloc(sizeof(struct log_logger_level), 1); list_add_item(lc->per_logger_level, (tbus) logger); logger->log_level = internal_log_text2level((char *)list_get_item(param_v, i)); g_strncpy(logger->logger_name, (char *)list_get_item(param_n, i), LOGGER_NAME_SIZE); logger->logger_name[LOGGER_NAME_SIZE] = '\0'; len = g_strlen(logger->logger_name); if (len >= 2 && logger->logger_name[len - 2] == '(' && logger->logger_name[len - 1] == ')' ) { logger->logger_type = LOG_TYPE_FUNCTION; logger->logger_name[len - 2] = '\0'; } else { logger->logger_type = LOG_TYPE_FILE; } } #endif list_delete(param_v); list_delete(param_n); return lc; } void internal_log_config_dump(struct log_config *config) { char str_level[20]; #ifdef LOG_PER_LOGGER_LEVEL struct log_logger_level *logger; int i; #endif g_printf("logging configuration:\r\n"); if (config->log_file) { internal_log_lvl2str(config->log_level, str_level); g_printf("\tLogFile: %s\r\n", config->log_file); g_printf("\tLogLevel: %s\r\n", str_level); } else { g_printf("\tLogFile: %s\r\n", ""); } if (config->enable_console) { internal_log_lvl2str(config->console_level, str_level); } else { g_strcpy(str_level, ""); } g_printf("\tConsoleLevel: %s\r\n", str_level); if (config->enable_syslog) { internal_log_lvl2str(config->syslog_level, str_level); } else { g_strcpy(str_level, ""); } g_printf("\tSyslogLevel: %s\r\n", str_level); #ifdef LOG_PER_LOGGER_LEVEL g_printf("per logger configuration:\r\n"); for (i = 0; i < config->per_logger_level->count; i++) { logger = (struct log_logger_level *)list_get_item(config->per_logger_level, i); internal_log_lvl2str(logger->log_level, str_level); g_printf("\t%-*s: %s\r\n", LOGGER_NAME_SIZE, logger->logger_name, str_level); } if (config->per_logger_level->count == 0) { g_printf("\tNone\r\n"); } #endif } struct log_config * internalInitAndAllocStruct(void) { struct log_config *ret = g_new0(struct log_config, 1); if (ret != NULL) { ret->fd = -1; ret->enable_syslog = 0; #ifdef LOG_PER_LOGGER_LEVEL ret->per_logger_level = list_create(); if (ret->per_logger_level != NULL) { ret->per_logger_level->auto_free = 1; } else { g_writeln("could not allocate memory for log struct"); g_free(ret); ret = NULL; } #endif } else { g_writeln("could not allocate memory for log struct"); } return ret; } /** * Copies logging levels only from one log_config structure to another **/ static void internal_log_config_copy_levels(struct log_config *dest, const struct log_config *src) { dest->log_level = src->log_level; dest->enable_syslog = src->enable_syslog; dest->syslog_level = src->syslog_level; dest->enable_console = src->enable_console; dest->console_level = src->console_level; #ifdef LOG_PER_LOGGER_LEVEL if (dest->per_logger_level == NULL) { dest->per_logger_level = list_create(); if (dest->per_logger_level == NULL) { return; } dest->per_logger_level->auto_free = 1; } else { list_clear(dest->per_logger_level); } if (src->per_logger_level == NULL) { return; } int i; for (i = 0; i < src->per_logger_level->count; ++i) { struct log_logger_level *dst_logger = (struct log_logger_level *)g_malloc(sizeof(struct log_logger_level), 1); *dst_logger = *(struct log_logger_level *) list_get_item(src->per_logger_level, i), list_add_item(dest->per_logger_level, (tbus) dst_logger); } #endif } void internal_log_config_copy(struct log_config *dest, const struct log_config *src) { if (src != NULL && dest != NULL) { dest->fd = src->fd; g_free(dest->log_file); dest->log_file = g_strdup(src->log_file); #ifdef LOG_ENABLE_THREAD dest->log_lock = src->log_lock; dest->log_lock_attr = src->log_lock_attr; #endif dest->program_name = src->program_name; dest->enable_pid = src->enable_pid; dest->dump_on_start = src->dump_on_start; internal_log_config_copy_levels(dest, src); } } bool_t internal_log_is_enabled_for_level(const enum logLevels log_level, const bool_t override_destination_level, const enum logLevels override_log_level) { /* Is log initialized? */ if (g_staticLogConfig == NULL) { return 0; } else if (g_staticLogConfig->fd < 0 && !g_staticLogConfig->enable_syslog && !g_staticLogConfig->enable_console) { /* all logging outputs are disabled */ return 0; } else if (override_destination_level) { /* Override is enabled - should the message should be logged? */ return log_level <= override_log_level; } /* Override is disabled - Is there at least one log destination * which will accept the message based on the log level? */ else if (g_staticLogConfig->fd >= 0 && log_level <= g_staticLogConfig->log_level) { return 1; } else if (g_staticLogConfig->enable_syslog && log_level <= g_staticLogConfig->syslog_level) { return 1; } else if (g_staticLogConfig->enable_console && log_level <= g_staticLogConfig->console_level) { return 1; } else { return 0; } } bool_t internal_log_location_overrides_level(const char *function_name, const char *file_name, enum logLevels *log_level_return) { #ifdef LOG_PER_LOGGER_LEVEL struct log_logger_level *logger = NULL; int i; if (g_staticLogConfig == NULL) { return 0; } for (i = 0; i < g_staticLogConfig->per_logger_level->count; i++) { logger = (struct log_logger_level *)list_get_item(g_staticLogConfig->per_logger_level, i); if ((logger->logger_type == LOG_TYPE_FILE && 0 == g_strncmp(logger->logger_name, file_name, LOGGER_NAME_SIZE)) || (logger->logger_type == LOG_TYPE_FUNCTION && 0 == g_strncmp(logger->logger_name, function_name, LOGGER_NAME_SIZE))) { *log_level_return = logger->log_level; return 1; } } #endif return 0; } /* * Here below the public functions */ struct log_config * log_config_init_for_console(enum logLevels lvl, const char *override_name) { struct log_config *config = internalInitAndAllocStruct(); if (config != NULL) { config->program_name = ""; config->enable_console = 1; if (override_name != NULL && override_name[0] != '\0') { config->console_level = internal_log_text2level(override_name); } else { config->console_level = lvl; } } return config; } struct log_config * log_config_init_from_config(const char *iniFilename, const char *applicationName, const char *section_prefix) { int fd; struct log_config *config; if (applicationName == NULL) { g_writeln("Programming error your application name cannot be null"); return NULL; } if (iniFilename == NULL) { g_writeln("The inifile is null to log_config_init_from_config!"); return NULL; } fd = g_file_open_ro(iniFilename); if (-1 == fd) { g_writeln("We could not open the configuration file to read log parameters"); return NULL; } /* read logging config */ config = internal_config_read_logging(fd, applicationName, section_prefix); /* cleanup */ g_file_close(fd); return config; } enum logReturns log_config_free(struct log_config *config) { if (config != NULL) { #ifdef LOG_PER_LOGGER_LEVEL if (config->per_logger_level != NULL) { list_delete(config->per_logger_level); config->per_logger_level = NULL; } #endif if (0 != config->log_file) { g_free(config->log_file); config->log_file = 0; } g_free(config); } return LOG_STARTUP_OK; } /** * Restarts the logging. * * The logging file is never changed, as it is common in xrdp to share a * log file between parents and children. The end result would be * confusing for the user. */ static enum logReturns log_restart_from_param(const struct log_config *lc) { enum logReturns rv = LOG_GENERAL_ERROR; if (g_staticLogConfig == NULL) { log_message(LOG_LEVEL_ALWAYS, "Log not already initialized"); } else if (lc == NULL) { g_writeln("lc to log_start_from_param is NULL"); } else { if (g_staticLogConfig->fd >= 0 && g_strcmp(g_staticLogConfig->log_file, lc->log_file) != 0) { log_message(LOG_LEVEL_WARNING, "Unable to change log file name from %s to %s", g_staticLogConfig->log_file, lc->log_file); } /* Reconfigure syslog logging, allowing for a program_name change */ if (g_staticLogConfig->enable_syslog) { closelog(); } if (lc->enable_syslog) { openlog(lc->program_name, LOG_CONS | LOG_PID, LOG_DAEMON); } /* Copy over simple values... */ #ifdef LOG_ENABLE_THREAD g_staticLogConfig->log_lock = lc->log_lock; g_staticLogConfig->log_lock_attr = lc->log_lock_attr; #endif g_staticLogConfig->program_name = lc->program_name; g_staticLogConfig->enable_pid = lc->enable_pid; g_staticLogConfig->dump_on_start = lc->dump_on_start; /* ... and the log levels */ internal_log_config_copy_levels(g_staticLogConfig, lc); rv = LOG_STARTUP_OK; } return rv; } enum logReturns log_start_from_param(const struct log_config *src_log_config) { enum logReturns ret = LOG_GENERAL_ERROR; if (g_staticLogConfig != NULL) { log_message(LOG_LEVEL_ALWAYS, "Log already initialized"); return ret; } if (src_log_config == NULL) { g_writeln("src_log_config to log_start_from_param is NULL"); return ret; } else { g_staticLogConfig = internalInitAndAllocStruct(); if (g_staticLogConfig == NULL) { g_writeln("internalInitAndAllocStruct failed"); return LOG_ERROR_MALLOC; } internal_log_config_copy(g_staticLogConfig, src_log_config); ret = internal_log_start(g_staticLogConfig); if (ret != LOG_STARTUP_OK) { g_writeln("Could not start log"); log_config_free(g_staticLogConfig); g_staticLogConfig = NULL; } } return ret; } /** * This function initialize the log facilities according to the configuration * file, that is described by the in parameter. * @param iniFile * @param applicationName, the name that is used in the log for the running application * @return 0 on success */ enum logReturns log_start(const char *iniFile, const char *applicationName, unsigned int flags) { enum logReturns ret = LOG_GENERAL_ERROR; struct log_config *config; config = log_config_init_from_config(iniFile, applicationName, ""); if (config != NULL) { config->dump_on_start = (flags & LOG_START_DUMP_CONFIG) ? 1 : 0; if (flags & LOG_START_RESTART) { ret = log_restart_from_param(config); if (ret != LOG_STARTUP_OK) { g_writeln("Could not restart log"); } } else { ret = log_start_from_param(config); if (ret != LOG_STARTUP_OK) { g_writeln("Could not start log"); } } log_config_free(config); } else { g_writeln("Error reading configuration for log based on config: %s", iniFile); } return ret; } /** * Function that terminates all logging * @return */ enum logReturns log_end(void) { enum logReturns ret = LOG_GENERAL_ERROR; ret = internal_log_end(g_staticLogConfig); log_config_free(g_staticLogConfig); g_staticLogConfig = NULL; return ret; } /*****************************************************************************/ /* log a hex dump */ enum logReturns log_hexdump(const enum logLevels log_level, const char *message, const char *src, int len) { return log_hexdump_with_location("", "", 0, log_level, message, src, len); } /*****************************************************************************/ /* log a hex dump */ enum logReturns log_hexdump_with_location(const char *function_name, const char *file_name, const int line_number, const enum logLevels log_level, const char *message, const char *src, int len) { char *dump_buffer; enum logReturns rv = LOG_STARTUP_OK; enum logLevels override_log_level = LOG_LEVEL_NEVER; bool_t override_destination_level = 0; override_destination_level = internal_log_location_overrides_level( function_name, file_name, &override_log_level); if (!internal_log_is_enabled_for_level(log_level, override_destination_level, override_log_level)) { return LOG_STARTUP_OK; } /* Start the dump on a new line so that the first line of the dump is aligned to the first column instead of to after the log message preamble (eg. time, log level, ...) */ #ifdef _WIN32 #define HEX_DUMP_HEADER ("Hex Dump:\r\n") #else #ifdef _MACOS #define HEX_DUMP_HEADER ("Hex Dump:\r") #else #define HEX_DUMP_HEADER ("Hex Dump:\n") #endif #endif dump_buffer = g_bytes_to_hexdump(src, len); if (dump_buffer != NULL) { if (g_strlen(file_name) > 0) { rv = log_message_with_location(function_name, file_name, line_number, log_level, "%s %s%s", message, HEX_DUMP_HEADER, dump_buffer); } else { rv = log_message(log_level, "%s %s%s", message, HEX_DUMP_HEADER, dump_buffer); } g_free(dump_buffer); } return rv; } enum logReturns log_message_with_location(const char *function_name, const char *file_name, const int line_number, const enum logLevels level, const char *msg, ...) { va_list ap; enum logReturns rv; char buff[LOG_BUFFER_SIZE]; enum logLevels override_log_level = LOG_LEVEL_NEVER; bool_t override_destination_level = 0; if (g_staticLogConfig == NULL) { g_writeln("The log reference is NULL - log not initialized properly " "when called from [%s(%s:%d)]", (function_name != NULL ? function_name : "unknown_function"), (file_name != NULL ? file_name : "unknown_file"), line_number); return LOG_ERROR_NO_CFG; } override_destination_level = internal_log_location_overrides_level( function_name, file_name, &override_log_level); if (!internal_log_is_enabled_for_level(level, override_destination_level, override_log_level)) { return LOG_STARTUP_OK; } g_snprintf(buff, LOG_BUFFER_SIZE, "[%s(%s:%d)] %s", function_name, file_name, line_number, msg); va_start(ap, msg); rv = internal_log_message(level, override_destination_level, override_log_level, buff, ap); va_end(ap); return rv; } enum logReturns log_message(const enum logLevels lvl, const char *msg, ...) { va_list ap; enum logReturns rv; va_start(ap, msg); rv = internal_log_message(lvl, 0, LOG_LEVEL_NEVER, msg, ap); va_end(ap); return rv; } enum logReturns internal_log_message(const enum logLevels lvl, const bool_t override_destination_level, const enum logLevels override_log_level, const char *msg, va_list ap) { char buff[LOG_BUFFER_SIZE + 43]; /* 31 ("[2022-10-07T19:58:33.065+0900] ") + 8 (log level) + 4 (space+cr+lf+\0) */ int len = 0; enum logReturns rv = LOG_STARTUP_OK; int writereply = 0; if (g_staticLogConfig == NULL) { g_writeln("The log reference is NULL - log not initialized properly"); return LOG_ERROR_NO_CFG; } if (0 > g_staticLogConfig->fd && g_staticLogConfig->enable_syslog == 0 && g_staticLogConfig->enable_console == 0) { return LOG_ERROR_FILE_NOT_OPEN; } if (!internal_log_is_enabled_for_level(lvl, override_destination_level, override_log_level)) { return LOG_STARTUP_OK; } getFormattedDateTime(buff, 32); internal_log_lvl2str(lvl, buff + 31); if (g_staticLogConfig->enable_pid) { /* 31 (datetime) + 8 (log level) = 39 */ g_snprintf(buff + 39, LOG_BUFFER_SIZE, "[pid:%d tid:%lld] ", g_getpid(), (long long) tc_get_threadid()); len = g_strlen(buff + 39); } len += vsnprintf(buff + 39 + len, LOG_BUFFER_SIZE - len, msg, ap); /* checking for truncated messages */ if (len > LOG_BUFFER_SIZE) { log_message(LOG_LEVEL_WARNING, "next message will be truncated"); len = LOG_BUFFER_SIZE; } /* forcing the end of message string */ /* 31 (datetime) + 8 (log level) = 39 */ #ifdef _WIN32 buff[len + 39] = '\r'; buff[len + 40] = '\n'; buff[len + 41] = '\0'; #else #ifdef _MACOS buff[len + 39] = '\r'; buff[len + 40] = '\0'; #else buff[len + 39] = '\n'; buff[len + 40] = '\0'; #endif #endif if (g_staticLogConfig->enable_syslog && ((override_destination_level && lvl <= override_log_level) || (!override_destination_level && lvl <= g_staticLogConfig->syslog_level))) { /* log to syslog*/ /* %s fix compiler warning 'not a string literal' */ syslog(internal_log_xrdp2syslog(lvl), "%s", buff + 31); } if (g_staticLogConfig->enable_console && ((override_destination_level && lvl <= override_log_level) || (!override_destination_level && lvl <= g_staticLogConfig->console_level))) { /* log to console */ g_printf("%s", buff); } if ((override_destination_level && lvl <= override_log_level) || (!override_destination_level && lvl <= g_staticLogConfig->log_level)) { /* log to application logfile */ if (g_staticLogConfig->fd >= 0) { #ifdef LOG_ENABLE_THREAD pthread_mutex_lock(&(g_staticLogConfig->log_lock)); #endif writereply = g_file_write(g_staticLogConfig->fd, buff, g_strlen(buff)); if (writereply <= 0) { rv = LOG_ERROR_NULL_FILE; } #ifdef LOG_ENABLE_THREAD pthread_mutex_unlock(&(g_staticLogConfig->log_lock)); #endif } } return rv; } /** * Return the configured log file name * @return */ char * getLogFile(char *replybuf, int bufsize) { if (g_staticLogConfig) { if (g_staticLogConfig->log_file) { g_strncpy(replybuf, g_staticLogConfig->log_file, bufsize); } else { g_sprintf(replybuf, "The log_file name is NULL"); } } else { g_snprintf(replybuf, bufsize, "The log is not properly started"); } return replybuf; } /** * Returns formatted datetime for log * @return */ char * getFormattedDateTime(char *replybuf, int bufsize) { char buf_datetime[21]; /* 2022-10-07T16:36:04 + . */ char buf_millisec[4]; /* 357 */ char buf_timezone[6]; /* +0900 */ struct tm *now; struct timeval tv; int millisec; gettimeofday(&tv, NULL); now = localtime(&tv.tv_sec); millisec = (tv.tv_usec + 500 / 1000); g_snprintf(buf_millisec, sizeof(buf_millisec), "%03d", millisec); strftime(buf_datetime, sizeof(buf_datetime), "%FT%T.", now); strftime(buf_timezone, sizeof(buf_timezone), "%z", now); g_snprintf(replybuf, bufsize, "[%s%s%s] ", buf_datetime, buf_millisec, buf_timezone); return replybuf; } /*****************************************************************************/ #ifdef USE_DEVEL_LOGGING void log_devel_leaking_fds(const char *exe, int min, int max) { struct list *fd_list = g_get_open_fds(min, max); if (fd_list != NULL) { int i; for (i = 0 ; i < fd_list->count ; ++i) { int fd = (int)fd_list->items[i]; if (g_file_get_cloexec(fd) == 0) { LOG_DEVEL(LOG_LEVEL_WARNING, "File descriptor %d is not CLOEXEC when running %s", fd, exe); } } } } #endif // USE_DEVEL_LOGGING xrdp-0.10.1/common/fifo.c000644 001751 000000 00000016130 14652432047 015215 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Matt Burt 2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file common/fifo.c * @brief Fifo for storing generic pointers * * Defines an unbounded FIFO-queue for void * pointers * * The stored pointers are called 'items' below. * * Items are stored in groups called 'chunks'. Chunks are linked together * in a chain:- * * +-------------+ +--------+ +--------+ +--------+ * | first_chunk |--->| next |--->| next |--->| NULL |<-+ * | last_chunk |-+ +--------+ +--------+ +--------+ | * | . . . | | | item.0 | | item.0 | | item.0 | | * +-------------+ | | ... | | ... | | ... | | * | | item.n | | item.n | | item.n | | * | +--------+ +--------+ +--------+ | * | | * +------------------------------------------+ * * This allows items to be added to the FIFO by allocating blocks * as each one fills up. * * The code to read from the FIFO de-allocates blocks as each one is * consumed. * * There is always at least one chunk in the FIFO. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "fifo.h" #define ITEMS_PER_CHUNK 31 struct chunk { struct chunk *next; void *items[ITEMS_PER_CHUNK]; }; struct fifo { struct chunk *first_chunk; struct chunk *last_chunk; /** Next address to write in 'last_chunk' */ unsigned short writer; /** Next address to read in 'first_chunk' */ unsigned short reader; /** Item destructor function, or NULL */ fifo_item_destructor item_destructor; }; /*****************************************************************************/ struct fifo * fifo_create(fifo_item_destructor item_destructor) { struct fifo *result = NULL; struct chunk *cptr = (struct chunk *)malloc(sizeof(struct chunk)); if (cptr != NULL) { /* 'next' pointer in last block is always NULL */ cptr->next = NULL; result = (struct fifo *)malloc(sizeof(struct fifo)); if (result == NULL) { free(cptr); } else { result->first_chunk = cptr; result->last_chunk = cptr; result->writer = 0; result->reader = 0; result->item_destructor = item_destructor; } } return result; } /*****************************************************************************/ /** * Internal function to call the destructor function on all items in the fifo * * @param self fifo. Can't be NULL * @param closure Additional argument to destructor function */ static void call_item_destructor(struct fifo *self, void *closure) { if (self->item_destructor != NULL) { struct chunk *cptr = self->first_chunk; unsigned int i = self->reader; // Process all the chunks up to the last one while (cptr != self->last_chunk) { (*self->item_destructor)(cptr->items[i++], closure); if (i == ITEMS_PER_CHUNK) { cptr = cptr->next; i = 0; } } // Process all the items in the last chunk while (i < self->writer) { (*self->item_destructor)(cptr->items[i++], closure); } } } /*****************************************************************************/ void fifo_delete(struct fifo *self, void *closure) { if (self != NULL) { call_item_destructor(self, closure); // Now free all the chunks struct chunk *cptr = self->first_chunk; while (cptr != NULL) { struct chunk *next = cptr->next; free(cptr); cptr = next; } free(self); } } /*****************************************************************************/ void fifo_clear(struct fifo *self, void *closure) { if (self != NULL) { call_item_destructor(self, closure); // Now free all the chunks except the last one struct chunk *cptr = self->first_chunk; while (cptr->next != NULL) { struct chunk *next = cptr->next; free(cptr); cptr = next; } // Re-initialise fifo fields self->first_chunk = cptr; self->last_chunk = cptr; self->reader = 0; self->writer = 0; } } /*****************************************************************************/ int fifo_add_item(struct fifo *self, void *item) { int rv = 0; if (self != NULL && item != NULL) { if (self->writer == ITEMS_PER_CHUNK) { // Add another chunk to the chain struct chunk *cptr; cptr = (struct chunk *)malloc(sizeof(struct chunk)); if (cptr == NULL) { return 0; } cptr->next = NULL; self->last_chunk->next = cptr; self->last_chunk = cptr; self->writer = 0; } self->last_chunk->items[self->writer++] = item; rv = 1; } return rv; } /*****************************************************************************/ void * fifo_remove_item(struct fifo *self) { void *item = NULL; if (self != NULL) { // More than one chunk in the fifo? if (self->first_chunk != self->last_chunk) { /* We're not reading the last chunk. There * must be something in the fifo */ item = self->first_chunk->items[self->reader++]; /* At the end of this chunk? */ if (self->reader == ITEMS_PER_CHUNK) { struct chunk *old_chunk = self->first_chunk; self->first_chunk = old_chunk->next; free(old_chunk); self->reader = 0; } } else if (self->reader < self->writer) { /* We're reading the last chunk */ item = self->first_chunk->items[self->reader++]; if (self->reader == self->writer) { // fifo is now empty. We can reset the pointers // to prevent unnecessary allocations in the future. self->reader = 0; self->writer = 0; } } } return item; } /*****************************************************************************/ int fifo_is_empty(struct fifo *self) { return (self == NULL || (self->first_chunk == self->last_chunk && self->reader == self->writer)); } xrdp-0.10.1/common/guid.c000644 001751 000000 00000004703 14652432047 015225 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) 2021 Matt Burt, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * @file common/guid.c * @brief GUID manipulation definitions */ #if defined(HAVE_CONFIG_H) #include #endif #include "guid.h" #include "os_calls.h" #include "string_calls.h" enum { /* Field offsets in the UUID */ E_CLOCK_SEQ_HI_AND_RESERVED = 8, E_TIME_HI_AND_VERSION_MSB = 7, /* UUID versions from RFC4122 section 4.1.3 */ E_UUID_VERSION_RANDOM = 4 }; struct guid guid_new(void) { struct guid guid = {0}; g_random(guid.g, sizeof(guid.g)); /* Show this UUID as conforming to RFC4122 (section 4.1.1) */ guid.g[E_CLOCK_SEQ_HI_AND_RESERVED] &= ~0x40; /* Clear bit 6 */ guid.g[E_CLOCK_SEQ_HI_AND_RESERVED] |= (char)0x80; /* Set bit 7 */ guid.g[E_TIME_HI_AND_VERSION_MSB] &= ~0xf0; guid.g[E_TIME_HI_AND_VERSION_MSB] |= (E_UUID_VERSION_RANDOM << 4); return guid; } void guid_clear(struct guid *guid) { g_memset(&guid->g, '\x00', GUID_SIZE); } int guid_is_set(const struct guid *guid) { unsigned int i; int rv = 0; if (guid != NULL) { for (i = 0 ; i < GUID_SIZE; ++i) { if (guid->g[i] != '\x00') { rv = 1; break; } } } return rv; } const char *guid_to_str(const struct guid *src, char *dest) { const unsigned char *guid = (const unsigned char *)src->g; /* * Flipping integers into little-endian * See also: https://devblogs.microsoft.com/oldnewthing/20220928-00/?p=107221 */ g_sprintf(dest, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6], guid[8], guid[9], guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]); return dest; } xrdp-0.10.1/common/Makefile.am000644 001751 000000 00000002570 14652432047 016165 0ustar00metawheel000000 000000 if XRDP_PIXMAN PIXMAN_SOURCES = else PIXMAN_SOURCES = pixman-region16.c pixman-region.h endif EXTRA_DIST = pixman-region.c include_HEADERS = \ ms-erref.h \ ms-fscc.h \ ms-rdpbcgr.h \ ms-rdpeclip.h \ ms-rdpefs.h \ ms-rdpegdi.h \ ms-rdpele.h \ ms-rdperp.h \ ms-rdpedisp.h \ ms-smb2.h \ xrdp_client_info.h \ xrdp_constants.h \ xrdp_rail.h \ xrdp_sockets.h AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_LOG_PATH=\"${localstatedir}/log\" # -no-suppress is an automake-specific flag which is needed # to prevent us missing compiler errors in some circumstances # (see https://github.com/neutrinolabs/xrdp/pull/1843 ) AM_CFLAGS = -no-suppress $(OPENSSL_CFLAGS) module_LTLIBRARIES = \ libcommon.la libcommon_la_SOURCES = \ arch.h \ base64.h \ base64.c \ defines.h \ fifo.c \ fifo.h \ file.c \ file.h \ guid.c \ guid.h \ list.c \ list.h \ list16.c \ list16.h \ log.c \ log.h \ os_calls.c \ os_calls.h \ parse.c \ parse.h \ rail.h \ ssl_calls.c \ ssl_calls.h \ string_calls.c \ string_calls.h \ thread_calls.c \ thread_calls.h \ trans.c \ trans.h \ unicode_defines.h \ $(PIXMAN_SOURCES) libcommon_la_LIBADD = \ -lpthread \ $(OPENSSL_LIBS) \ $(DLOPEN_LIBS) xrdp-0.10.1/common/parse.c000644 001751 000000 00000021343 14652432047 015406 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) 2021 Matt Burt * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Enforce stream primitive checking */ #if defined(HAVE_CONFIG_H) #include #endif #include #include "arch.h" #include "parse.h" #include "log.h" #include "string_calls.h" #include "unicode_defines.h" /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define out_uint16_le_unchecked(s, v) do \ { \ *((s)->p) = (unsigned char)((v) >> 0); \ (s)->p++; \ *((s)->p) = (unsigned char)((v) >> 8); \ (s)->p++; \ } while (0) #else #define out_uint16_le_unchecked(s, v) do \ { \ *((unsigned short*)((s)->p)) = (unsigned short)(v); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ #if defined(B_ENDIAN) || defined(NEED_ALIGN) #define in_uint16_le_unchecked(s, v) do \ { \ (v) = (unsigned short) \ ( \ (*((unsigned char*)((s)->p + 0)) << 0) | \ (*((unsigned char*)((s)->p + 1)) << 8) \ ); \ (s)->p += 2; \ } while (0) #else #define in_uint16_le_unchecked(s, v) do \ { \ (v) = *((unsigned short*)((s)->p)); \ (s)->p += 2; \ } while (0) #endif /******************************************************************************/ void parser_stream_overflow_check(const struct stream *s, int n, int is_out, const char *file, int line) { /* Sanity checks */ if (n < 0) { LOG(LOG_LEVEL_ALWAYS, "%s:%d " "stream primitive called with negative n=%d", file, line, n); abort(); } if (is_out) { /* Output overflow */ if (!s_check_rem_out(s, n)) { LOG(LOG_LEVEL_ALWAYS, "%s:%d Stream output buffer overflow. " "Size=%d, pos=%d, requested=%d", file, line, s->size, (int)(s->p - s->data), n); abort(); } } else { /* Input overflow */ if (!s_check_rem(s, n)) { LOG(LOG_LEVEL_ALWAYS, "%s:%d Stream input buffer overflow. " "Max=%d, pos=%d, requested=%d", file, line, (int)(s->end - s->data), (int)(s->p - s->data), n); abort(); } } } /******************************************************************************/ void out_utf8_as_utf16_le_proc(struct stream *s, const char *v, unsigned int vn, const char *file, int line) { // Expansion of S_CHECK_REM_OUT(s, ) using passed-in // file and line #ifdef USE_DEVEL_STREAMCHECK int octet_cnt = utf8_as_utf16_word_count(v, vn) * 2; parser_stream_overflow_check(s, octet_cnt, 1, file, line); #endif while (vn > 0) { char32_t c32 = utf8_get_next_char(&v, &vn); char16_t low; if (c32 < 0x10000) { low = (char16_t)c32; } else { /* Need a surrogate pair */ low = LOW_SURROGATE_FROM_C32(c32); char16_t high = HIGH_SURROGATE_FROM_C32(c32); out_uint16_le_unchecked(s, high); } out_uint16_le_unchecked(s, low); } } /******************************************************************************/ /** * Gets the next Unicode character from a code stream * @param s Stream * @return Unicode character * * Non-characters and illegally coded characters are mapped to * UCS_REPLACEMENT_CHARACTER * * @pre Two bytes are assumed to be available on the stram on entry */ static char32_t get_c32_from_stream(struct stream *s) { char32_t c32 = UCS_REPLACEMENT_CHARACTER; // Assume failure char16_t w; in_uint16_le_unchecked(s, w); if (IS_HIGH_SURROGATE(w)) { if (s_check_rem(s, 2)) { char16_t low; in_uint16_le_unchecked(s, low); if (IS_LOW_SURROGATE(low)) { /* Valid surrogate pair */ char32_t v = C32_FROM_SURROGATE_PAIR(low, w); /* Ignore some values which can be successfully encoded * in this way */ if (!IS_PLANE_END_NON_CHARACTER(c32)) { c32 = v; } } else { /* Invalid low surrogate - pop character back */ s->p -= 2; } } } else if (!IS_LOW_SURROGATE(w) && !IS_PLANE_END_NON_CHARACTER(w) && !IS_ARABIC_NON_CHARACTER(w)) { /* Character from the Basic Multilingual Plane */ c32 = (char32_t)w; } return c32; } /******************************************************************************/ unsigned int in_utf16_le_fixed_as_utf8_proc(struct stream *s, unsigned int n, char *v, unsigned int vn, const char *file, int line) { unsigned int rv = 0; char32_t c32; char u8str[MAXLEN_UTF8_CHAR]; unsigned int u8len; char *saved_s_end = s->end; // Expansion of S_CHECK_REM(s, n*2) using passed-in file and line #ifdef USE_DEVEL_STREAMCHECK parser_stream_overflow_check(s, n * 2, 0, file, line); #endif // Temporarily set the stream end pointer to allow us to use // s_check_rem() when reading in UTF-16 words if (s->end - s->p > (int)(n * 2)) { s->end = s->p + (int)(n * 2); } while (s_check_rem(s, 2)) { c32 = get_c32_from_stream(s); u8len = utf_char32_to_utf8(c32, u8str); if (u8len + 1 <= vn) { /* Room for this character and a terminator. Add the character */ unsigned int i; for (i = 0 ; i < u8len ; ++i) { v[i] = u8str[i]; } vn -= u8len; v += u8len; } else if (vn > 1) { /* We've skipped a character, but there's more than one byte * remaining in the output buffer. Mark the output buffer as * full so we don't get a smaller character being squeezed into * the remaining space */ vn = 1; } rv += u8len; } // Restore stream to full length s->end = saved_s_end; if (vn > 0) { *v = '\0'; } ++rv; return rv; } /******************************************************************************/ unsigned int in_utf16_le_fixed_as_utf8_length(struct stream *s, unsigned int n) { char *saved_s_p = s->p; unsigned int rv = in_utf16_le_fixed_as_utf8(s, n, NULL, 0); s->p = saved_s_p; return rv; } /******************************************************************************/ unsigned int in_utf16_le_terminated_as_utf8(struct stream *s, char *v, unsigned int vn) { unsigned int rv = 0; char32_t c32; char u8str[MAXLEN_UTF8_CHAR]; unsigned int u8len; while (s_check_rem(s, 2)) { c32 = get_c32_from_stream(s); if (c32 == 0) { break; // Terminator encountered } u8len = utf_char32_to_utf8(c32, u8str); if (u8len + 1 <= vn) { /* Room for this character and a terminator. Add the character */ unsigned int i; for (i = 0 ; i < u8len ; ++i) { v[i] = u8str[i]; } vn -= u8len; v += u8len; } else if (vn > 1) { /* We've skipped a character, but there's more than one byte * remaining in the output buffer. Mark the output buffer as * full so we don't get a smaller character being squeezed into * the remaining space */ vn = 1; } rv += u8len; } if (vn > 0) { *v = '\0'; } ++rv; return rv; } /******************************************************************************/ unsigned int in_utf16_le_terminated_as_utf8_length(struct stream *s) { char *saved_s_p = s->p; unsigned int rv = in_utf16_le_terminated_as_utf8(s, NULL, 0); s->p = saved_s_p; return rv; } xrdp-0.10.1/common/ms-rdpegdi.h000644 001751 000000 00000004176 14652432047 016341 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPEGDI : Definitions from [MS-RDPEGDI] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPEGDI are currently correct for v20180912 of that * document */ #if !defined(MS_RDPEGDI_H) #define MS_RDPEGDI_H /* Drawing Order: controlFlags (2.2.2.2.1, 2.2.2.2.1.1.2) */ #define TS_STANDARD 0x01 #define TS_SECONDARY 0x02 #define TS_BOUNDS 0x04 #define TS_TYPE_CHANGE 0x08 #define TS_DELTA_COORDINATES 0x10 #define TS_ZERO_BOUNDS_DELTAS 0x20 #define TS_ZERO_FIELD_BYTE_BIT0 0x40 #define TS_ZERO_FIELD_BYTE_BIT1 0x80 /* Drawing Order: orderType (2.2.2.2.1.1.2) */ /* Should be renamed */ #define RDP_ORDER_DESTBLT 0 /* TS_ENC_DSTBLT_ORDER */ #define RDP_ORDER_PATBLT 1 #define RDP_ORDER_SCREENBLT 2 #define RDP_ORDER_LINE 9 #define RDP_ORDER_RECT 10 #define RDP_ORDER_DESKSAVE 11 #define RDP_ORDER_MEMBLT 13 #define RDP_ORDER_TRIBLT 14 #define RDP_ORDER_POLYLINE 22 #define RDP_ORDER_TEXT2 27 #define RDP_ORDER_COMPOSITE 37 /* 0x25 - not defined in RDPEGDI */ /* Secondary Drawing Order Header: orderType (2.2.2.2.1.2.1.1) */ #define TS_CACHE_BITMAP_UNCOMPRESSED 0x00 #define TS_CACHE_COLOR_TABLE 0x01 #define TS_CACHE_BITMAP_COMPRESSED 0x02 #define TS_CACHE_GLYPH 0x03 #define TS_CACHE_BITMAP_UNCOMPRESSED_REV2 0x04 #define TS_CACHE_BITMAP_COMPRESSED_REV2 0x05 #define TS_CACHE_BRUSH 0x07 #define TS_CACHE_BITMAP_COMPRESSED_REV3 0x08 #endif /* MS_RDPEGDI_H */ xrdp-0.10.1/common/trans.h000644 001751 000000 00000013204 14652432047 015425 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * generic transport */ #if !defined(TRANS_H) #define TRANS_H #include "arch.h" #include "parse.h" #define TRANS_MODE_TCP 1 /* tcp6 if defined, else tcp4 */ #define TRANS_MODE_UNIX 2 #define TRANS_MODE_VSOCK 3 #define TRANS_MODE_TCP4 4 /* tcp4 only */ #define TRANS_MODE_TCP6 6 /* tcp6 only */ #define TRANS_TYPE_LISTENER 1 #define TRANS_TYPE_SERVER 2 #define TRANS_TYPE_CLIENT 3 #define TRANS_STATUS_DOWN 0 #define TRANS_STATUS_UP 1 struct trans; /* forward declaration */ struct xrdp_tls; typedef int (*ttrans_data_in)(struct trans *self); typedef int (*ttrans_conn_in)(struct trans *self, struct trans *new_self); typedef int (*tis_term)(void); typedef int (*trans_recv_proc) (struct trans *self, char *ptr, int len); typedef int (*trans_send_proc) (struct trans *self, const char *data, int len); typedef int (*trans_can_recv_proc) (struct trans *self, int sck, int millis); /* optional source info */ enum xrdp_source { XRDP_SOURCE_NONE = 0, XRDP_SOURCE_CLIENT, XRDP_SOURCE_SESMAN, XRDP_SOURCE_CHANSRV, XRDP_SOURCE_MOD, XRDP_SOURCE_MAX_COUNT }; /* * @brief Provide flow control mechanism for (primarily) xrdp * * There is one of these data structures per-program. * * While input is being read from a 'struct trans' and processed, the * cur_source member is set to the my_source member from the transport. * During this processing, trans_write_copy() may be called to send output * on another struct trans. If this happens, and the output needs to be * buffered, trans_write_copy() can add the number of bytes generated by * the input trans to the source field for the cur_source. This allows us to * see how much output has been buffered for each input source. * * When the program assembles 'struct trans' objects to scan for input * (normally in trans_get_wait_objs()), it is able to see how much buffered * output is registered for each input. Inputs which have too much buffered * output owing are skipped, and not considered for input. * * This provides a simple means of providing back-pressure on an input * where the data it is providing is being processed and then sent out on * a much slower link. */ struct source_info { enum xrdp_source cur_source; int source[XRDP_SOURCE_MAX_COUNT]; }; struct trans { tbus sck; /* socket handle */ int mode; /* 1 tcp, 2 unix socket, 3 vsock */ int status; int type1; /* 1 listener 2 server 3 client */ ttrans_data_in trans_data_in; ttrans_conn_in trans_conn_in; void *callback_data; unsigned int header_size; struct stream *in_s; struct stream *out_s; char *listen_filename; tis_term is_term; /* used to test for exit */ struct stream *wait_s; int no_stream_init_on_data_in; int extra_flags; /* user defined */ void *extra_data; /* user defined */ void (*extra_destructor)(struct trans *); /* user defined */ struct ssl_tls *tls; const char *ssl_protocol; /* e.g. TLSv1, TLSv1.1, TLSv1.2, unknown */ const char *cipher_name; /* e.g. AES256-GCM-SHA384 */ trans_recv_proc trans_recv; trans_send_proc trans_send; trans_can_recv_proc trans_can_recv; struct source_info *si; enum xrdp_source my_source; }; struct trans * trans_create(int mode, int in_size, int out_size); void trans_delete(struct trans *self); void trans_delete_from_child(struct trans *self); int trans_get_wait_objs(struct trans *self, tbus *objs, int *count); int trans_get_wait_objs_rw(struct trans *self, tbus *robjs, int *rcount, tbus *wobjs, int *wcount, int *timeout); int trans_check_wait_objs(struct trans *self); int trans_force_read_s(struct trans *self, struct stream *in_s, int size); int trans_force_write_s(struct trans *self, struct stream *out_s); int trans_force_read(struct trans *self, int size); int trans_force_write(struct trans *self); int trans_write_copy(struct trans *self); int trans_write_copy_s(struct trans *self, struct stream *out_s); /** * Connect the transport to the specified destination * * @param self Transport * @param server Destination server (TCP transports only) * @param port TCP port, or UNIX socket to connect to * @param timeout in milli-seconds for the operation * @return 0 for success * * Multiple connection attempts may be made within the timeout period. * * If the operation is successful, 0 is returned and self->status will * be TRANS_STATUS_UP */ int trans_connect(struct trans *self, const char *server, const char *port, int timeout); int trans_listen_address(struct trans *self, const char *port, const char *address); int trans_listen(struct trans *self, const char *port); struct stream * trans_get_in_s(struct trans *self); struct stream * trans_get_out_s(struct trans *self, int size); int trans_set_tls_mode(struct trans *self, const char *key, const char *cert, long ssl_protocols, const char *tls_ciphers); int trans_shutdown_tls_mode(struct trans *self); int trans_tcp_force_read_s(struct trans *self, struct stream *in_s, int size); #endif xrdp-0.10.1/common/string_calls.h000644 001751 000000 00000032127 14652432047 016767 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2020 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * generic string handling calls */ #if !defined(STRING_CALLS_H) #define STRING_CALLS_H #include "arch.h" /** * Map a character to a string value * * This structure is used by g_format_info_string() to specify the * string which could be output for %'ch', where ch is a character */ struct info_string_tag { char ch; const char *val; }; #define INFO_STRING_END_OF_LIST { '\0', NULL } /** * Map a bitmask to a string value * * * This structure is used by g_bitmask_to_str() to specify the * string for each bit in the bitmask */ struct bitmask_string { int mask; const char *str; }; #define BITMASK_STRING_END_OF_LIST { 0, NULL } /** * Map a bitmask to a char value * * * This structure is used by g_bitmask_to_charstr() to specify the * char for each bit in the bitmask */ struct bitmask_char { int mask; char c; }; #define BITMASK_CHAR_END_OF_LIST { 0, '\0' } enum { // See g_sig2text() // Must be able to hold "SIG#%d" for INT_MIN // // ((sizeof(int) * 5 + 1) / 2) provides a very slight overestimate of // the bytes requires to store a decimal expansion of 'int':- // sizeof INT_MAX display bytes ((sizeof(int) * 5 + 1) // (int) needed / 2) // ------ ------- ------------- --------------------------- // 1 127 3 3 // 2 32767 5 5 // 3 8388607 7 8 // 4 2147483637 10 10 // 8 9*(10**18) 19 20 // 16 2*(10**38) 39 40 // 32 6*(10**76) 77 80 MAXSTRSIGLEN = (3 + 1 + 1 + ((sizeof(int) * 5 + 1) / 2) + 1) }; /* * Significant Universal Character Set (Unicode) characters */ enum { UCS_WHITE_SQUARE = 0x25a1, UCS_REPLACEMENT_CHARACTER = 0xfffd }; /** * Processes a format string for general info * * @param[out] dest Destination buffer * @param[in] len Length of buffer, including space for a terminator * @param[in] format Format string to process * @param[in] map Array of struct info_string_tag. * * Where a '%' is encountered in the format string, the map is scanned * and the corresponding string is copied instead of '%'. * * '%%' is always replaced with a single '%' in the output. % strings * not present in the map are ignored. * * The map is terminated with INFO_STRING_END_OF_LIST * * Caller can check for buffer truncation by comparing the result with * the buffer length (as in snprintf()) */ unsigned int g_format_info_string(char *dest, unsigned int len, const char *format, const struct info_string_tag map[]); /** * Converts a boolean to a string for output * * @param[in] value Value to convert * @return String representation */ const char * g_bool2text(int value); /** * Converts a string to a boolean value * * @param[in] s String to convert * @return machine representation */ int g_text2bool(const char *s); /** * Joins an array of strings into a single string. * * Note: The joiner is placed between each source string. The joiner is not * placed after the last source string. If there is only one source string, * then the result string will be equal to the source string. * * Note: any content that is present in dest will be overwritten with the new * joined string. * * Note: If the destination array is not large enough to hold the entire * contents of the joined string, then the joined string will be truncated * to fit in the destination array. * * @param[out] dest The destination array to write the joined string into. * @param[in] dest_len The max number of characters to write to the destination * array including the terminating null. Must be > 0 * @param[in] joiner The string to concatenate between each source string. * The joiner string may be NULL which is processed as a zero length string. * @param[in] src An array of strings to join. The array must be non-null. * Array items may be NULL and are processed as zero length strings. * @param[in] src_len The number of strings to join in the src array. Must be > 0 * @return A pointer to the beginning of the joined string (ie. returns dest). */ char * g_strnjoin(char *dest, int dest_len, const char *joiner, const char *src[], int src_len); /** * Converts a binary array into a hux dump suitable for displaying to a user. * * The format of the hex dump is: * 0000 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 ................ * /\ /\ /\ * | | | * | | ascii representation of bytes * | hex representation of bytes * offset from beginning of the byte array in hex * * Note: the ascii representation uses '.' for all non-printable * characters (eg. below 32 or above 127). * * Note: the string contains embedded new lines, but is not new line terminated. * * @param[in] src Value to convert * @param[in] len The number of bytes in src to convert * @return string containing the hex dump that must be free'd by the caller */ char * g_bytes_to_hexdump(const char *src, int len); /** * Extracts the display number from an X11 display string * * @param Display string (i.e. g_getenv("DISPLAY")) * * @result <0 if the string could not be parsed, or >=0 for a display number */ int g_get_display_num_from_display(const char *display_text); /** * Converts a bitmask into a string for output purposes * * Similar to g_bitmask_to_charstr(), but tokens are strings, separated * by delimiters. * * @param bitmask Bitmask to convert * @param bitdefs Definitions for strings for bits * @param delim Delimiter to use between strings * @param buff Output buff * @param bufflen Length of buff, including terminator '`\0' * * @return Total length excluding terminator which would be written, as * in snprintf(). Can be used to check for overflow * * @note Any undefined bits in the bitmask are appended to the output as * a hexadecimal constant. */ int g_bitmask_to_str(int bitmask, const struct bitmask_string bitdefs[], char delim, char *buff, int bufflen); /*** * Converts a string containing a series of tokens to a bitmask. * * Similar to g_charstr_to_bitmask(), but tokens are strings, separated * by delimiters. * * @param str Input string * @param bitdefs Array mapping tokens to bitmask values * @param delim Delimiter for tokens in str * @param[out] unrecognised Buffer for any unrecognised tokens * @param unrecognised_len Length of unrecognised including '\0'; * @return bitmask value for recognised tokens */ int g_str_to_bitmask(const char *str, const struct bitmask_string bitdefs[], const char *delim, char *unrecognised, int unrecognised_len); /** * Converts a bitmask into a string for output purposes * * Similar to g_bitmask_to_str(), but tokens are individual characters, and * there are no delimiters. * * @param bitmask Bitmask to convert * @param bitdefs Definitions for strings for bits * @param buff Output buff * @param bufflen Length of buff, including terminator '`\0' * @param[out] rest Any unused bits which weren't covered by bitdefs. * May be NULL. * * @return Total length excluding terminator which would be written, as * in snprintf(). Can be used to check for overflow * * @note Any undefined bits in the bitmask are appended to the output as * a hexadecimal constant. */ int g_bitmask_to_charstr(int bitmask, const struct bitmask_char bitdefs[], char *buff, int bufflen, int *rest); /*** * Converts a string containing a series of characters to a bitmask. * * Similar to g_str_to_bitmask(), but tokens are individual characters, and * there are no delimiters. * * @param str Input string * @param bitdefs Array mapping tokens to bitmask values * @param delim Delimiter for tokens in str * @param[out] unrecognised Buffer for any unrecognised tokens * @param unrecognised_len Length of unrecognised including '\0'; * @return bitmask value for recognised tokens */ int g_charstr_to_bitmask(const char *str, const struct bitmask_char bitdefs[], char *unrecognised, int unrecognised_len); int g_strlen(const char *text); char *g_strchr(const char *text, int c); char *g_strrchr(const char *text, int c); char *g_strnchr(const char *text, int c, int len); char *g_strcpy(char *dest, const char *src); char *g_strncpy(char *dest, const char *src, int len); char *g_strcat(char *dest, const char *src); char *g_strncat(char *dest, const char *src, int len); char *g_strdup(const char *in); char *g_strndup(const char *in, const unsigned int maxlen); int g_strcmp(const char *c1, const char *c2); int g_strncmp(const char *c1, const char *c2, int len); int g_strncmp_d(const char *c1, const char *c2, const char delim, int len); int g_strcasecmp(const char *c1, const char *c2); int g_strncasecmp(const char *c1, const char *c2, int len); int g_atoi(const char *str); /** * Extends g_atoi(), Converts decimal and hexadecimal number String to integer * * Prefix hexadecimal numbers with '0x' * * @param str String to convert to an integer * @return int Integer expression of a string */ int g_atoix(const char *str); int g_htoi(char *str); int g_bytes_to_hexstr(const void *bytes, int num_bytes, char *out_str, int bytes_out_str); int g_pos(const char *str, const char *to_find); char *g_strstr(const char *haystack, const char *needle); /** trim spaces and tabs, anything <= space * * @param str (assumed to be UTF-8) * @param trim_flags 1 trim left, 2 trim right, 3 trim both, 4 trim through * @return != 0 - trim_flags not recognised * this will always shorten the string or not change it */ int g_strtrim(char *str, int trim_flags); /** * Maps a signal number to a string, i.e. SIGHUP -> "SIGHUP" * * @param signum Signal number * @param sigstr buffer for result * @return sigstr, for convenience * * Buffer is assumed to be at least MAXSTRSIGLEN * * The string "SIG#" is returned for unrecognised signums */ char *g_sig2text(int signum, char sigstr[]); /** * Get the next Unicode character from a UTF-8 string * * @param utf8str_ref UTF 8 string [by reference] * @param len_ref Length of string [by reference] or NULL * @return Unicode character * * On return, utf8str and len are updated to point past the decoded character. * Unrecognised characters are mapped to UCS_REPLACEMENT_CHARACTER * * len is not needed if your utf8str has a terminator, or is known to * be well-formed. */ char32_t utf8_get_next_char(const char **utf8str_ref, unsigned int *len_ref); /** * Convert a Unicode character to UTF-8 * @param c32 Unicode character * @param u8str buffer containing at least MAXLEN_UTF8_CHAR bytes for result * @return Number of bytes written to u8str. Can be NULL if only the * length is needed. * * The bytes written to u8str are unterminated */ #define MAXLEN_UTF8_CHAR 4 unsigned int utf_char32_to_utf8(char32_t c32, char *u8str); /** * Returns the number of Unicode characters in a UTF-8 string * @param utf8str UTF-8 string * @result Number of Unicode characters in the string (terminator not included) */ unsigned int utf8_char_count(const char *utf8str); /** * Returns the number of UTF-16 words required to store a UTF-8 string * @param utf8str UTF-8 string * @param len Length of UTF-8 string * @result number of words to store UTF-8 string as UTF-16. */ unsigned int utf8_as_utf16_word_count(const char *utf8str, unsigned int len); /** * Add a Unicode character into a UTF-8 string * @param utf8str Pointer to UTF-8 string * @param len Length of buffer for UTF-8 string (includes NULL) * @param c32 character to add * @param index Where to add the codepoint * @return 1 for success, 0 if no character was inserted * * This routine has to parse the string as it goes, so can be slow. */ int utf8_add_char_at(char *utf8str, unsigned int len, char32_t c32, unsigned int index); /** * Remove a Unicode character from a UTF-8 string * @param utf8str Pointer to UTF-8 string * @param index Where to remove the codepoint from (0-based) * @return Character removed, or 0 if no character was removed * * This routine has to parse the string as it goes, so can be slow. */ char32_t utf8_remove_char_at(char *utf8str, unsigned int index); #endif xrdp-0.10.1/common/arch.h000644 001751 000000 00000010330 14652432047 015210 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(ARCH_H) #define ARCH_H #include #include #if defined(HAVE_STDINT_H) #include #else typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; #if defined(_WIN64) typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; typedef signed __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else typedef signed long long int64_t; typedef unsigned long long uint64_t; typedef signed long intptr_t; typedef unsigned long uintptr_t; #endif #endif typedef int bool_t; // Define Unicode character types #if defined(HAVE_UCHAR_H) #include #elif defined(HAVE_STDINT_H) typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; #else typedef uint16_t char16_t; typedef uint32_t char32_t; #endif /* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN in the makefile to override */ /* check endianness */ #if !(defined(L_ENDIAN) || defined(B_ENDIAN)) #if !defined(__BYTE_ORDER) && defined(__linux__) #include #endif #if defined(BYTE_ORDER) #if BYTE_ORDER == BIG_ENDIAN #define B_ENDIAN #else #define L_ENDIAN #endif #endif #if !(defined(L_ENDIAN) || defined(B_ENDIAN)) #if defined(__sparc__) || \ defined(__s390__) || defined (__s390x__) || \ defined(__hppa__) || defined (__m68k__) || \ (defined(__PPC__) && defined(__BIG_ENDIAN__)) || \ (defined(__ppc__) && defined(__BIG_ENDIAN__)) #define B_ENDIAN #else #define L_ENDIAN #endif #endif #endif /* check if we need to align data */ #if !(defined(NEED_ALIGN) || defined(NO_NEED_ALIGN)) #if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \ defined(__AIX__) || defined(__m68k__) || defined(__mips__) || \ defined(__ia64__) || defined(__arm__) || defined(__sh__) || \ (defined(__PPC__) && defined(__BIG_ENDIAN__)) || \ (defined(__ppc__) && defined(__BIG_ENDIAN__)) || \ defined(__loongarch__) || defined(__e2k__) #define NEED_ALIGN #elif defined(__x86__) || defined(__x86_64__) || \ defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \ defined(__i386__) || defined(__aarch64__) || \ defined(__PPC__) || defined(__LITTLE_ENDIAN__) || \ defined(__s390__) || defined (__s390x__) || \ defined(__riscv) #define NO_NEED_ALIGN #else #warning unknown arch #endif #endif /* defines for thread creation factory functions */ #if defined(_WIN32) #define THREAD_RV unsigned long #define THREAD_CC __stdcall #else #define THREAD_RV void* #define THREAD_CC #endif #if defined(_WIN32) #if defined(__BORLANDC__) #define EXPORT_CC _export __cdecl #else #define EXPORT_CC #endif #else #define EXPORT_CC #endif #ifndef DEFINED_Ts #define DEFINED_Ts typedef int8_t ti8; typedef uint8_t tui8; typedef int8_t tsi8; typedef int16_t ti16; typedef uint16_t tui16; typedef int16_t tsi16; typedef int32_t ti32; typedef uint32_t tui32; typedef int32_t tsi32; typedef int64_t ti64; typedef uint64_t tui64; typedef int64_t tsi64; typedef bool_t tbool; typedef intptr_t tbus; typedef intptr_t tintptr; /* socket */ #if defined(_WIN32) typedef unsigned int tsock; #else typedef int tsock; #endif #endif /* DEFINED_Ts */ /* format string verification */ #if defined(HAVE_FUNC_ATTRIBUTE_FORMAT) #define printflike(arg_format, arg_first_check) \ __attribute__((__format__(__printf__, arg_format, arg_first_check))) #else #define printflike(arg_format, arg_first_check) #endif /* module interface */ #ifdef __cplusplus extern "C" { #endif tintptr mod_init(void); int mod_exit(tintptr); #ifdef __cplusplus } #endif #endif xrdp-0.10.1/common/ms-rdpedisp.h000644 001751 000000 00000003400 14652432047 016522 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPEDISP : Definitions from [MS-RDPEDISP] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPEDISP are currently correct for v20201030 of that * document */ #if !defined(MS_RDPEDISP_H) #define MS_RDPEDISP_H /* Display Control Messages: Display Virtual Channel Extension (2.2.2) */ #define DISPLAYCONTROL_PDU_TYPE_MONITOR_LAYOUT 0x00000002 #define DISPLAYCONTROL_PDU_TYPE_CAPS 0x00000005 /* Display Control Monitor Layout (2.2.2.2.1) */ #define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001 #define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_WIDTH 0xC8 #define CLIENT_MONITOR_DATA_MINIMUM_VIRTUAL_MONITOR_HEIGHT 0xC8 #define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_WIDTH 0x2000 #define CLIENT_MONITOR_DATA_MAXIMUM_VIRTUAL_MONITOR_HEIGHT 0x2000 #define ORIENTATION_LANDSCAPE 0 #define ORIENTATION_PORTRAIT 90 #define ORIENTATION_LANDSCAPE_FLIPPED 180 #define ORIENTATION_PORTRAIT_FLIPPED 270 /* Display Control Monitor Layout (2.2.2.2.1) */ #define DISPLAYCONTROL_MONITOR_PRIMARY 0x00000001 #endif /* MS_RDPEDISP_H */ xrdp-0.10.1/common/ms-rdpele.h000644 001751 000000 00000002571 14652432047 016173 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-RDPELE : Definitions from [MS-RDPELE] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-RDPELE are currently correct for v20180912 of that * document */ #if !defined(MS_RDPELE_H) #define MS_RDPELE_H /* LicensingMessage (MS-RDPELE 2.2.2) */ /* TODO: to be renamed */ #define LICENCE_TAG_DEMAND 0x01 /* LICENSE_REQUEST */ #define LICENCE_TAG_AUTHREQ 0x02 /* PLATFORM_CHALLENGE */ #define LICENCE_TAG_ISSUE 0x03 /* NEW_LICENSE */ #define LICENCE_TAG_REISSUE 0x04 /* UPGRADE_LICENSE */ #define LICENCE_TAG_PRESENT 0x12 /* LICENSE_INFO */ #define LICENCE_TAG_REQUEST 0x13 /* NEW_LICENSE_REQUEST */ #define LICENCE_TAG_AUTHRESP 0x15 /* PLATFORM_CHALLENGE_RESPONSE */ #define LICENCE_TAG_RESULT 0xff #endif /* MS_RDPELE_H */ xrdp-0.10.1/common/file.c000644 001751 000000 00000022627 14652432047 015221 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * read a config file */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include "string_calls.h" #include "list.h" #include "file.h" #include "parse.h" #define FILE_MAX_LINE_BYTES 2048 static int file_read_ini_line(struct stream *s, char *text, int text_bytes); /*****************************************************************************/ /* look up for a section name within str (i.e. pattern [section_name]) * if a section name is found, this function return 1 and copy the section * inplace of str. */ static int line_lookup_for_section_name(char *str, int str_bytes) { int name_index_start; int index; char c; name_index_start = -1; index = 0; while ((c = str[index]) != 0) { if (c == '[') { name_index_start = index + 1; } else if (c == ']' && name_index_start > 0) { if (name_index_start + index >= str_bytes) { return 0; } for (index = index - name_index_start; index > 0; index--) { str[0] = str[name_index_start]; str++; } str[0] = 0; return 1; } ++index; } return 0; } /*****************************************************************************/ /* returns error returns 0 if everything is ok returns 1 if problem reading file */ static int l_file_read_sections(int fd, int max_file_size, struct list *names) { struct stream *s; char text[FILE_MAX_LINE_BYTES]; int len; int rv; rv = 0; g_file_seek(fd, 0); g_memset(text, 0, FILE_MAX_LINE_BYTES); list_clear(names); make_stream(s); init_stream(s, max_file_size); len = g_file_read(fd, s->data, max_file_size); if (len > 0) { s->end = s->p + len; while (file_read_ini_line(s, text, FILE_MAX_LINE_BYTES) == 0) { if (line_lookup_for_section_name(text, FILE_MAX_LINE_BYTES) != 0) { list_add_strdup(names, text); } } } else if (len < 0) { rv = 1; } free_stream(s); return rv; } /*****************************************************************************/ /* Read a line in the stream 's', removing comments. * returns error * returns 0 if everything is ok * returns 1 if problem reading file */ static int file_read_ini_line(struct stream *s, char *text, int text_bytes) { int i; int skip_to_end; int at_end; char c; skip_to_end = 0; if (!s_check_rem(s, 1)) { return 1; } i = 0; in_uint8(s, c); while (c != 10 && c != 13) { /* these mean skip the rest of the line */ if (c == '#' || c == ';') { skip_to_end = 1; } if (!skip_to_end) { text[i] = c; i++; if (i >= text_bytes) { return 1; } } if (s_check_rem(s, 1)) { in_uint8(s, c); } else { c = 0; break; } } if (c == 10 || c == 13) { at_end = 0; while (c == 10 || c == 13) { if (s_check_rem(s, 1)) { in_uint8(s, c); } else { at_end = 1; break; } } if (!at_end) { s->p--; } } text[i] = 0; return 0; } /*****************************************************************************/ /* returns error */ static int file_split_name_value(char *text, char *name, char *value) { int len; int i; int value_index; int name_index; int on_to; value_index = 0; name_index = 0; on_to = 0; name[0] = 0; value[0] = 0; len = g_strlen(text); for (i = 0; i < len; i++) { if (text[i] == '=' && !on_to) { on_to = 1; } else if (on_to) { value[value_index] = text[i]; value_index++; value[value_index] = 0; } else { name[name_index] = text[i]; name_index++; name[name_index] = 0; } } g_strtrim(name, 3); /* trim both right and left */ g_strtrim(value, 3); /* trim both right and left */ return 0; } /*****************************************************************************/ /* return error */ static int l_file_read_section(int fd, int max_file_size, const char *section, struct list *names, struct list *values) { struct stream *s; char *data; char *text; char *name; char *value; char *lvalue; int len; int file_size; data = (char *) g_malloc(FILE_MAX_LINE_BYTES * 3, 0); text = data; name = text + FILE_MAX_LINE_BYTES; value = name + FILE_MAX_LINE_BYTES; file_size = 32 * 1024; /* 32 K file size limit */ g_file_seek(fd, 0); g_memset(text, 0, FILE_MAX_LINE_BYTES); list_clear(names); list_clear(values); make_stream(s); init_stream(s, file_size); len = g_file_read(fd, s->data, file_size); if (len > 0) { s->end = s->p + len; while (file_read_ini_line(s, text, FILE_MAX_LINE_BYTES) == 0) { if (line_lookup_for_section_name(text, FILE_MAX_LINE_BYTES) != 0) { if (g_strcasecmp(section, text) == 0) { while (file_read_ini_line(s, text, FILE_MAX_LINE_BYTES) == 0) { if (line_lookup_for_section_name(text, FILE_MAX_LINE_BYTES) != 0) { break; } if (g_strlen(text) > 0) { file_split_name_value(text, name, value); list_add_strdup(names, name); if (value[0] == '$') { lvalue = g_getenv(value + 1); if (lvalue != 0) { list_add_strdup(values, lvalue); } else { list_add_strdup(values, ""); } } else { list_add_strdup(values, value); } } } free_stream(s); g_free(data); return 0; } } } } free_stream(s); g_free(data); return 1; } /*****************************************************************************/ /* returns error returns 0 if everything is ok returns 1 if problem reading file */ /* 32 K file size limit */ int file_read_sections(int fd, struct list *names) { return l_file_read_sections(fd, 32 * 1024, names); } /*****************************************************************************/ /* return error */ /* this function should be preferred over file_read_sections because it can read any file size */ int file_by_name_read_sections(const char *file_name, struct list *names) { int fd; int file_size; int rv; file_size = g_file_get_size(file_name); if (file_size < 1) { return 1; } fd = g_file_open_ro(file_name); if (fd < 0) { return 1; } rv = l_file_read_sections(fd, file_size, names); g_file_close(fd); return rv; } /*****************************************************************************/ /* return error */ /* 32 K file size limit */ int file_read_section(int fd, const char *section, struct list *names, struct list *values) { return l_file_read_section(fd, 32 * 1024, section, names, values); } /*****************************************************************************/ /* return error */ /* this function should be preferred over file_read_section because it can read any file size */ int file_by_name_read_section(const char *file_name, const char *section, struct list *names, struct list *values) { int fd; int file_size; int rv; file_size = g_file_get_size(file_name); if (file_size < 1) { return 1; } fd = g_file_open_ro(file_name); if (fd < 0) { return 1; } rv = l_file_read_section(fd, file_size, section, names, values); g_file_close(fd); return rv; } xrdp-0.10.1/common/pixman-region16.c000644 001751 000000 00000004423 14652432047 017220 0ustar00metawheel000000 000000 /* * Copyright © 2008 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of * Red Hat, Inc. not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior * permission. Red Hat, Inc. makes no representations about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Soren Sandmann */ /* taken from pixman 0.34 altered to compile without all of pixman */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #include #include #include #if defined(HAVE_STDINT_H) #include #endif #include "pixman-region.h" #if !defined(UINT32_MAX) #define UINT32_MAX (4294967295U) #endif #if !defined(INT16_MIN) #define INT16_MIN (-32767-1) #endif #if !defined(INT16_MAX) #define INT16_MAX (32767) #endif #define PIXMAN_EXPORT #define FALSE 0 #define TRUE 1 #define MIN(x1, x2) ((x1) < (x2) ? (x1) : (x2)) #define MAX(x1, x2) ((x1) > (x2) ? (x1) : (x2)) typedef pixman_box16_t box_type_t; typedef pixman_region16_data_t region_data_type_t; typedef pixman_region16_t region_type_t; typedef signed int overflow_int_t; #define PREFIX(x) pixman_region##x #define PIXMAN_REGION_MAX INT16_MAX #define PIXMAN_REGION_MIN INT16_MIN #define FUNC "func" #define critical_if_fail(expr) int _pixman_log_error(const char *func, const char *format, ...) { return 0; } #include "pixman-region.c" xrdp-0.10.1/common/pixman-region.c000644 001751 000000 00000240167 14652432047 017060 0ustar00metawheel000000 000000 /* * Copyright 1987, 1988, 1989, 1998 The Open Group * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. * * 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 * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of The Open Group shall not be * used in advertising or otherwise to promote the sale, use or other dealings * in this Software without prior written authorization from The Open Group. * * Copyright 1987, 1988, 1989 by * Digital Equipment Corporation, Maynard, Massachusetts. * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital not be * used in advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifndef PIXMAN_REGION_MAX #error "This file should be #included from pixman-region16.c, not compiled directly" #endif #ifndef CONFIG_AC_H #error "config_ac.h not visible in pixman-region.c" #endif #define PIXREGION_NIL(reg) ((reg)->data && !(reg)->data->numRects) /* not a region */ #define PIXREGION_NAR(reg) ((reg)->data == pixman_broken_data) #define PIXREGION_NUMRECTS(reg) ((reg)->data ? (reg)->data->numRects : 1) #define PIXREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0) #define PIXREGION_RECTS(reg) \ ((reg)->data ? (box_type_t *)((reg)->data + 1) \ : &(reg)->extents) #define PIXREGION_BOXPTR(reg) ((box_type_t *)((reg)->data + 1)) #define PIXREGION_BOX(reg, i) (&PIXREGION_BOXPTR (reg)[i]) #define PIXREGION_TOP(reg) PIXREGION_BOX (reg, (reg)->data->numRects) #define PIXREGION_END(reg) PIXREGION_BOX (reg, (reg)->data->numRects - 1) #define GOOD_RECT(rect) ((rect)->x1 < (rect)->x2 && (rect)->y1 < (rect)->y2) #define BAD_RECT(rect) ((rect)->x1 > (rect)->x2 || (rect)->y1 > (rect)->y2) /* This file is included by pixman-region16.c which defines PREFIX(x). * This check allows cppcheck 2.x to scan this file separately */ #ifndef PREFIX #define PREFIX(x) pixman_region##x #endif #ifdef USE_DEVEL_LOGGING pixman_bool_t PREFIX(_selfcheck) (region_type_t *reg); #define GOOD(reg) \ do \ { \ if (!PREFIX (_selfcheck (reg))) \ _pixman_log_error (FUNC, "Malformed region " # reg); \ } while (0) #else #define GOOD(reg) #endif static const box_type_t PREFIX (_empty_box_) = { 0, 0, 0, 0 }; static const region_data_type_t PREFIX (_empty_data_) = { 0, 0 }; #if defined (__llvm__) && !defined (__clang__) static const volatile region_data_type_t PREFIX (_broken_data_) = { 0, 0 }; #else static const region_data_type_t PREFIX (_broken_data_) = { 0, 0 }; #endif static box_type_t *pixman_region_empty_box = (box_type_t *) &PREFIX (_empty_box_); static region_data_type_t *pixman_region_empty_data = (region_data_type_t *) &PREFIX (_empty_data_); static region_data_type_t *pixman_broken_data = (region_data_type_t *) &PREFIX (_broken_data_); static pixman_bool_t pixman_break (region_type_t *region); /* * The functions in this file implement the Region abstraction used extensively * throughout the X11 sample server. A Region is simply a set of disjoint * (non-overlapping) rectangles, plus an "extent" rectangle which is the * smallest single rectangle that contains all the non-overlapping rectangles. * * A Region is implemented as a "y-x-banded" array of rectangles. This array * imposes two degrees of order. First, all rectangles are sorted by top side * y coordinate first (y1), and then by left side x coordinate (x1). * * Furthermore, the rectangles are grouped into "bands". Each rectangle in a * band has the same top y coordinate (y1), and each has the same bottom y * coordinate (y2). Thus all rectangles in a band differ only in their left * and right side (x1 and x2). Bands are implicit in the array of rectangles: * there is no separate list of band start pointers. * * The y-x band representation does not minimize rectangles. In particular, * if a rectangle vertically crosses a band (the rectangle has scanlines in * the y1 to y2 area spanned by the band), then the rectangle may be broken * down into two or more smaller rectangles stacked one atop the other. * * ----------- ----------- * | | | | band 0 * | | -------- ----------- -------- * | | | | in y-x banded | | | | band 1 * | | | | form is | | | | * ----------- | | ----------- -------- * | | | | band 2 * -------- -------- * * An added constraint on the rectangles is that they must cover as much * horizontal area as possible: no two rectangles within a band are allowed * to touch. * * Whenever possible, bands will be merged together to cover a greater vertical * distance (and thus reduce the number of rectangles). Two bands can be merged * only if the bottom of one touches the top of the other and they have * rectangles in the same places (of the same width, of course). * * Adam de Boor wrote most of the original region code. Joel McCormack * substantially modified or rewrote most of the core arithmetic routines, and * added pixman_region_validate in order to support several speed improvements * to pixman_region_validate_tree. Bob Scheifler changed the representation * to be more compact when empty or a single rectangle, and did a bunch of * gratuitous reformatting. Carl Worth did further gratuitous reformatting * while re-merging the server and client region code into libpixregion. * Soren Sandmann did even more gratuitous reformatting. */ /* true iff two Boxes overlap */ #define EXTENTCHECK(r1, r2) \ (!( ((r1)->x2 <= (r2)->x1) || \ ((r1)->x1 >= (r2)->x2) || \ ((r1)->y2 <= (r2)->y1) || \ ((r1)->y1 >= (r2)->y2) ) ) /* true iff (x,y) is in Box */ #define INBOX(r, x, y) \ ( ((r)->x2 > x) && \ ((r)->x1 <= x) && \ ((r)->y2 > y) && \ ((r)->y1 <= y) ) /* true iff Box r1 contains Box r2 */ #define SUBSUMES(r1, r2) \ ( ((r1)->x1 <= (r2)->x1) && \ ((r1)->x2 >= (r2)->x2) && \ ((r1)->y1 <= (r2)->y1) && \ ((r1)->y2 >= (r2)->y2) ) static size_t PIXREGION_SZOF (size_t n) { size_t size = n * sizeof(box_type_t); if (n > UINT32_MAX / sizeof(box_type_t)) { return 0; } if (sizeof(region_data_type_t) > UINT32_MAX - size) { return 0; } return size + sizeof(region_data_type_t); } static region_data_type_t * alloc_data (size_t n) { size_t sz = PIXREGION_SZOF (n); if (!sz) { return NULL; } return (region_data_type_t *) malloc(sz); } #define FREE_DATA(reg) if ((reg)->data && (reg)->data->size) free ((reg)->data) #define RECTALLOC_BAIL(region, n, bail) \ do \ { \ if (!(region)->data || \ (((region)->data->numRects + (n)) > (region)->data->size)) \ { \ if (!pixman_rect_alloc (region, n)) \ goto bail; \ } \ } while (0) #define RECTALLOC(region, n) \ do \ { \ if (!(region)->data || \ (((region)->data->numRects + (n)) > (region)->data->size)) \ { \ if (!pixman_rect_alloc (region, n)) { \ return FALSE; \ } \ } \ } while (0) #define ADDRECT(next_rect, nx1, ny1, nx2, ny2) \ do \ { \ next_rect->x1 = nx1; \ next_rect->y1 = ny1; \ next_rect->x2 = nx2; \ next_rect->y2 = ny2; \ next_rect++; \ } \ while (0) #define NEWRECT(region, next_rect, nx1, ny1, nx2, ny2) \ do \ { \ if (!(region)->data || \ ((region)->data->numRects == (region)->data->size)) \ { \ if (!pixman_rect_alloc (region, 1)) \ return FALSE; \ next_rect = PIXREGION_TOP (region); \ } \ ADDRECT (next_rect, nx1, ny1, nx2, ny2); \ region->data->numRects++; \ critical_if_fail (region->data->numRects <= region->data->size); \ } while (0) #define DOWNSIZE(reg, numRects) \ do \ { \ if (((numRects) < ((reg)->data->size >> 1)) && \ ((reg)->data->size > 50)) \ { \ region_data_type_t * new_data; \ size_t data_size = PIXREGION_SZOF (numRects); \ \ if (!data_size) \ { \ new_data = NULL; \ } \ else \ { \ new_data = (region_data_type_t *) \ realloc ((reg)->data, data_size); \ } \ \ if (new_data) \ { \ new_data->size = (numRects); \ (reg)->data = new_data; \ } \ } \ } while (0) PIXMAN_EXPORT pixman_bool_t PREFIX (_equal) (region_type_t *reg1, region_type_t *reg2) { int i; box_type_t *rects1; box_type_t *rects2; if (reg1->extents.x1 != reg2->extents.x1) { return FALSE; } if (reg1->extents.x2 != reg2->extents.x2) { return FALSE; } if (reg1->extents.y1 != reg2->extents.y1) { return FALSE; } if (reg1->extents.y2 != reg2->extents.y2) { return FALSE; } if (PIXREGION_NUMRECTS (reg1) != PIXREGION_NUMRECTS (reg2)) { return FALSE; } rects1 = PIXREGION_RECTS (reg1); rects2 = PIXREGION_RECTS (reg2); for (i = 0; i != PIXREGION_NUMRECTS (reg1); i++) { if (rects1[i].x1 != rects2[i].x1) { return FALSE; } if (rects1[i].x2 != rects2[i].x2) { return FALSE; } if (rects1[i].y1 != rects2[i].y1) { return FALSE; } if (rects1[i].y2 != rects2[i].y2) { return FALSE; } } return TRUE; } int PREFIX (_print) (region_type_t *rgn) { int num, size; int i; box_type_t *rects; num = PIXREGION_NUMRECTS (rgn); size = PIXREGION_SIZE (rgn); rects = PIXREGION_RECTS (rgn); fprintf (stderr, "num: %d size: %d\n", num, size); fprintf (stderr, "extents: %d %d %d %d\n", rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2); for (i = 0; i < num; i++) { fprintf (stderr, "%d %d %d %d \n", rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2); } fprintf (stderr, "\n"); return (num); } PIXMAN_EXPORT void PREFIX (_init) (region_type_t *region) { region->extents = *pixman_region_empty_box; region->data = pixman_region_empty_data; } PIXMAN_EXPORT void PREFIX (_init_rect) (region_type_t *region, int x, int y, unsigned int width, unsigned int height) { region->extents.x1 = x; region->extents.y1 = y; region->extents.x2 = x + width; region->extents.y2 = y + height; if (!GOOD_RECT (®ion->extents)) { if (BAD_RECT (®ion->extents)) { _pixman_log_error (FUNC, "Invalid rectangle passed"); } PREFIX (_init) (region); return; } region->data = NULL; } PIXMAN_EXPORT void PREFIX (_init_with_extents) (region_type_t *region, box_type_t *extents) { if (!GOOD_RECT (extents)) { if (BAD_RECT (extents)) { _pixman_log_error (FUNC, "Invalid rectangle passed"); } PREFIX (_init) (region); return; } region->extents = *extents; region->data = NULL; } PIXMAN_EXPORT void PREFIX (_fini) (region_type_t *region) { GOOD (region); FREE_DATA (region); } PIXMAN_EXPORT int PREFIX (_n_rects) (region_type_t *region) { return PIXREGION_NUMRECTS (region); } PIXMAN_EXPORT box_type_t * PREFIX (_rectangles) (region_type_t *region, int *n_rects) { if (n_rects) { *n_rects = PIXREGION_NUMRECTS (region); } return PIXREGION_RECTS (region); } static pixman_bool_t pixman_break (region_type_t *region) { FREE_DATA (region); region->extents = *pixman_region_empty_box; region->data = pixman_broken_data; return FALSE; } static pixman_bool_t pixman_rect_alloc (region_type_t *region, int n) { region_data_type_t *data; if (!region->data) { n++; region->data = alloc_data (n); if (!region->data) { return pixman_break (region); } region->data->numRects = 1; *PIXREGION_BOXPTR (region) = region->extents; } else if (!region->data->size) { region->data = alloc_data (n); if (!region->data) { return pixman_break (region); } region->data->numRects = 0; } else { size_t data_size; if (n == 1) { n = region->data->numRects; if (n > 500) /* XXX pick numbers out of a hat */ { n = 250; } } n += region->data->numRects; data_size = PIXREGION_SZOF (n); if (!data_size) { data = NULL; } else { data = (region_data_type_t *) realloc (region->data, PIXREGION_SZOF (n)); } if (!data) { return pixman_break (region); } region->data = data; } region->data->size = n; return TRUE; } PIXMAN_EXPORT pixman_bool_t PREFIX (_copy) (region_type_t *dst, region_type_t *src) { GOOD (dst); GOOD (src); if (dst == src) { return TRUE; } dst->extents = src->extents; if (!src->data || !src->data->size) { FREE_DATA (dst); dst->data = src->data; return TRUE; } if (!dst->data || (dst->data->size < src->data->numRects)) { FREE_DATA (dst); dst->data = alloc_data (src->data->numRects); if (!dst->data) { return pixman_break (dst); } dst->data->size = src->data->numRects; } dst->data->numRects = src->data->numRects; memmove ((char *)PIXREGION_BOXPTR (dst), (char *)PIXREGION_BOXPTR (src), dst->data->numRects * sizeof(box_type_t)); return TRUE; } /*====================================================================== * Generic Region Operator *====================================================================*/ /*- *----------------------------------------------------------------------- * pixman_coalesce -- * Attempt to merge the boxes in the current band with those in the * previous one. We are guaranteed that the current band extends to * the end of the rects array. Used only by pixman_op. * * Results: * The new index for the previous band. * * Side Effects: * If coalescing takes place: * - rectangles in the previous band will have their y2 fields * altered. * - region->data->numRects will be decreased. * *----------------------------------------------------------------------- */ static inline int pixman_coalesce (region_type_t *region, /* Region to coalesce */ int prev_start, /* Index of start of previous band */ int cur_start) /* Index of start of current band */ { box_type_t *prev_box; /* Current box in previous band */ box_type_t *cur_box; /* Current box in current band */ int numRects; /* Number rectangles in both bands */ int y2; /* Bottom of current band */ /* * Figure out how many rectangles are in the band. */ numRects = cur_start - prev_start; critical_if_fail (numRects == region->data->numRects - cur_start); if (!numRects) { return cur_start; } /* * The bands may only be coalesced if the bottom of the previous * matches the top scanline of the current. */ prev_box = PIXREGION_BOX (region, prev_start); cur_box = PIXREGION_BOX (region, cur_start); if (prev_box->y2 != cur_box->y1) { return cur_start; } /* * Make sure the bands have boxes in the same places. This * assumes that boxes have been added in such a way that they * cover the most area possible. I.e. two boxes in a band must * have some horizontal space between them. */ y2 = cur_box->y2; do { if ((prev_box->x1 != cur_box->x1) || (prev_box->x2 != cur_box->x2)) { return (cur_start); } prev_box++; cur_box++; numRects--; } while (numRects); /* * The bands may be merged, so set the bottom y of each box * in the previous band to the bottom y of the current band. */ numRects = cur_start - prev_start; region->data->numRects -= numRects; do { prev_box--; prev_box->y2 = y2; numRects--; } while (numRects); return prev_start; } /* Quicky macro to avoid trivial reject procedure calls to pixman_coalesce */ #define COALESCE(new_reg, prev_band, cur_band) \ do \ { \ if (cur_band - prev_band == new_reg->data->numRects - cur_band) \ prev_band = pixman_coalesce (new_reg, prev_band, cur_band); \ else \ prev_band = cur_band; \ } while (0) /*- *----------------------------------------------------------------------- * pixman_region_append_non_o -- * Handle a non-overlapping band for the union and subtract operations. * Just adds the (top/bottom-clipped) rectangles into the region. * Doesn't have to check for subsumption or anything. * * Results: * None. * * Side Effects: * region->data->numRects is incremented and the rectangles overwritten * with the rectangles we're passed. * *----------------------------------------------------------------------- */ static inline pixman_bool_t pixman_region_append_non_o (region_type_t *region, box_type_t *r, box_type_t *r_end, int y1, int y2) { box_type_t *next_rect; int new_rects; new_rects = r_end - r; critical_if_fail (y1 < y2); critical_if_fail (new_rects != 0); /* Make sure we have enough space for all rectangles to be added */ RECTALLOC (region, new_rects); next_rect = PIXREGION_TOP (region); region->data->numRects += new_rects; do { critical_if_fail (r->x1 < r->x2); ADDRECT (next_rect, r->x1, y1, r->x2, y2); r++; } while (r != r_end); return TRUE; } #define FIND_BAND(r, r_band_end, r_end, ry1) \ do \ { \ ry1 = r->y1; \ r_band_end = r + 1; \ while ((r_band_end != r_end) && (r_band_end->y1 == ry1)) { \ r_band_end++; \ } \ } while (0) #define APPEND_REGIONS(new_reg, r, r_end) \ do \ { \ int new_rects; \ if ((new_rects = r_end - r)) { \ RECTALLOC_BAIL (new_reg, new_rects, bail); \ memmove ((char *)PIXREGION_TOP (new_reg), (char *)r, \ new_rects * sizeof(box_type_t)); \ new_reg->data->numRects += new_rects; \ } \ } while (0) /*- *----------------------------------------------------------------------- * pixman_op -- * Apply an operation to two regions. Called by pixman_region_union, pixman_region_inverse, * pixman_region_subtract, pixman_region_intersect.... Both regions MUST have at least one * rectangle, and cannot be the same object. * * Results: * TRUE if successful. * * Side Effects: * The new region is overwritten. * overlap set to TRUE if overlap_func ever returns TRUE. * * Notes: * The idea behind this function is to view the two regions as sets. * Together they cover a rectangle of area that this function divides * into horizontal bands where points are covered only by one region * or by both. For the first case, the non_overlap_func is called with * each the band and the band's upper and lower extents. For the * second, the overlap_func is called to process the entire band. It * is responsible for clipping the rectangles in the band, though * this function provides the boundaries. * At the end of each band, the new region is coalesced, if possible, * to reduce the number of rectangles in the region. * *----------------------------------------------------------------------- */ typedef pixman_bool_t (*overlap_proc_ptr) (region_type_t *region, box_type_t *r1, box_type_t *r1_end, box_type_t *r2, box_type_t *r2_end, int y1, int y2); static pixman_bool_t pixman_op (region_type_t *new_reg, /* Place to store result */ region_type_t *reg1, /* First region in operation */ region_type_t *reg2, /* 2d region in operation */ overlap_proc_ptr overlap_func, /* Function to call for over- * lapping bands */ int append_non1, /* Append non-overlapping bands * in region 1 ? */ int append_non2 /* Append non-overlapping bands * in region 2 ? */ ) { box_type_t *r1; /* Pointer into first region */ box_type_t *r2; /* Pointer into 2d region */ box_type_t *r1_end; /* End of 1st region */ box_type_t *r2_end; /* End of 2d region */ int ybot; /* Bottom of intersection */ int ytop; /* Top of intersection */ region_data_type_t *old_data; /* Old data for new_reg */ int prev_band; /* Index of start of * previous band in new_reg */ int cur_band; /* Index of start of current * band in new_reg */ box_type_t *r1_band_end; /* End of current band in r1 */ box_type_t *r2_band_end; /* End of current band in r2 */ int top; /* Top of non-overlapping band */ int bot; /* Bottom of non-overlapping band*/ int r1y1; /* Temps for r1->y1 and r2->y1 */ int r2y1; int new_size; int numRects; /* * Break any region computed from a broken region */ if (PIXREGION_NAR (reg1) || PIXREGION_NAR (reg2)) { return pixman_break (new_reg); } /* * Initialization: * set r1, r2, r1_end and r2_end appropriately, save the rectangles * of the destination region until the end in case it's one of * the two source regions, then mark the "new" region empty, allocating * another array of rectangles for it to use. */ r1 = PIXREGION_RECTS (reg1); new_size = PIXREGION_NUMRECTS (reg1); r1_end = r1 + new_size; numRects = PIXREGION_NUMRECTS (reg2); r2 = PIXREGION_RECTS (reg2); r2_end = r2 + numRects; critical_if_fail (r1 != r1_end); critical_if_fail (r2 != r2_end); old_data = (region_data_type_t *)NULL; if (((new_reg == reg1) && (new_size > 1)) || ((new_reg == reg2) && (numRects > 1))) { old_data = new_reg->data; new_reg->data = pixman_region_empty_data; } /* guess at new size */ if (numRects > new_size) { new_size = numRects; } new_size <<= 1; if (!new_reg->data) { new_reg->data = pixman_region_empty_data; } else if (new_reg->data->size) { new_reg->data->numRects = 0; } if (new_size > new_reg->data->size) { if (!pixman_rect_alloc (new_reg, new_size)) { free (old_data); return FALSE; } } /* * Initialize ybot. * In the upcoming loop, ybot and ytop serve different functions depending * on whether the band being handled is an overlapping or non-overlapping * band. * In the case of a non-overlapping band (only one of the regions * has points in the band), ybot is the bottom of the most recent * intersection and thus clips the top of the rectangles in that band. * ytop is the top of the next intersection between the two regions and * serves to clip the bottom of the rectangles in the current band. * For an overlapping band (where the two regions intersect), ytop clips * the top of the rectangles of both regions and ybot clips the bottoms. */ ybot = MIN (r1->y1, r2->y1); /* * prev_band serves to mark the start of the previous band so rectangles * can be coalesced into larger rectangles. qv. pixman_coalesce, above. * In the beginning, there is no previous band, so prev_band == cur_band * (cur_band is set later on, of course, but the first band will always * start at index 0). prev_band and cur_band must be indices because of * the possible expansion, and resultant moving, of the new region's * array of rectangles. */ prev_band = 0; do { /* * This algorithm proceeds one source-band (as opposed to a * destination band, which is determined by where the two regions * intersect) at a time. r1_band_end and r2_band_end serve to mark the * rectangle after the last one in the current band for their * respective regions. */ critical_if_fail (r1 != r1_end); critical_if_fail (r2 != r2_end); FIND_BAND (r1, r1_band_end, r1_end, r1y1); FIND_BAND (r2, r2_band_end, r2_end, r2y1); /* * First handle the band that doesn't intersect, if any. * * Note that attention is restricted to one band in the * non-intersecting region at once, so if a region has n * bands between the current position and the next place it overlaps * the other, this entire loop will be passed through n times. */ if (r1y1 < r2y1) { if (append_non1) { top = MAX (r1y1, ybot); bot = MIN (r1->y2, r2y1); if (top != bot) { cur_band = new_reg->data->numRects; if (!pixman_region_append_non_o (new_reg, r1, r1_band_end, top, bot)) { goto bail; } COALESCE (new_reg, prev_band, cur_band); } } ytop = r2y1; } else if (r2y1 < r1y1) { if (append_non2) { top = MAX (r2y1, ybot); bot = MIN (r2->y2, r1y1); if (top != bot) { cur_band = new_reg->data->numRects; if (!pixman_region_append_non_o (new_reg, r2, r2_band_end, top, bot)) { goto bail; } COALESCE (new_reg, prev_band, cur_band); } } ytop = r1y1; } else { ytop = r1y1; } /* * Now see if we've hit an intersecting band. The two bands only * intersect if ybot > ytop */ ybot = MIN (r1->y2, r2->y2); if (ybot > ytop) { cur_band = new_reg->data->numRects; if (!(*overlap_func)(new_reg, r1, r1_band_end, r2, r2_band_end, ytop, ybot)) { goto bail; } COALESCE (new_reg, prev_band, cur_band); } /* * If we've finished with a band (y2 == ybot) we skip forward * in the region to the next band. */ if (r1->y2 == ybot) { r1 = r1_band_end; } if (r2->y2 == ybot) { r2 = r2_band_end; } } while (r1 != r1_end && r2 != r2_end); /* * Deal with whichever region (if any) still has rectangles left. * * We only need to worry about banding and coalescing for the very first * band left. After that, we can just group all remaining boxes, * regardless of how many bands, into one final append to the list. */ if ((r1 != r1_end) && append_non1) { /* Do first non_overlap1Func call, which may be able to coalesce */ FIND_BAND (r1, r1_band_end, r1_end, r1y1); cur_band = new_reg->data->numRects; if (!pixman_region_append_non_o (new_reg, r1, r1_band_end, MAX (r1y1, ybot), r1->y2)) { goto bail; } COALESCE (new_reg, prev_band, cur_band); /* Just append the rest of the boxes */ APPEND_REGIONS (new_reg, r1_band_end, r1_end); } else if ((r2 != r2_end) && append_non2) { /* Do first non_overlap2Func call, which may be able to coalesce */ FIND_BAND (r2, r2_band_end, r2_end, r2y1); cur_band = new_reg->data->numRects; if (!pixman_region_append_non_o (new_reg, r2, r2_band_end, MAX (r2y1, ybot), r2->y2)) { goto bail; } COALESCE (new_reg, prev_band, cur_band); /* Append rest of boxes */ APPEND_REGIONS (new_reg, r2_band_end, r2_end); } free (old_data); if (!(numRects = new_reg->data->numRects)) { FREE_DATA (new_reg); new_reg->data = pixman_region_empty_data; } else if (numRects == 1) { new_reg->extents = *PIXREGION_BOXPTR (new_reg); FREE_DATA (new_reg); new_reg->data = (region_data_type_t *)NULL; } else { DOWNSIZE (new_reg, numRects); } return TRUE; bail: free (old_data); return pixman_break (new_reg); } /*- *----------------------------------------------------------------------- * pixman_set_extents -- * Reset the extents of a region to what they should be. Called by * pixman_region_subtract and pixman_region_intersect as they can't * figure it out along the way or do so easily, as pixman_region_union can. * * Results: * None. * * Side Effects: * The region's 'extents' structure is overwritten. * *----------------------------------------------------------------------- */ static void pixman_set_extents (region_type_t *region) { box_type_t *box, *box_end; if (!region->data) { return; } if (!region->data->size) { region->extents.x2 = region->extents.x1; region->extents.y2 = region->extents.y1; return; } box = PIXREGION_BOXPTR (region); box_end = PIXREGION_END (region); /* * Since box is the first rectangle in the region, it must have the * smallest y1 and since box_end is the last rectangle in the region, * it must have the largest y2, because of banding. Initialize x1 and * x2 from box and box_end, resp., as good things to initialize them * to... */ region->extents.x1 = box->x1; region->extents.y1 = box->y1; region->extents.x2 = box_end->x2; region->extents.y2 = box_end->y2; critical_if_fail (region->extents.y1 < region->extents.y2); while (box <= box_end) { if (box->x1 < region->extents.x1) { region->extents.x1 = box->x1; } if (box->x2 > region->extents.x2) { region->extents.x2 = box->x2; } box++; } critical_if_fail (region->extents.x1 < region->extents.x2); } /*====================================================================== * Region Intersection *====================================================================*/ /*- *----------------------------------------------------------------------- * pixman_region_intersect_o -- * Handle an overlapping band for pixman_region_intersect. * * Results: * TRUE if successful. * * Side Effects: * Rectangles may be added to the region. * *----------------------------------------------------------------------- */ /*ARGSUSED*/ static pixman_bool_t pixman_region_intersect_o (region_type_t *region, box_type_t *r1, box_type_t *r1_end, box_type_t *r2, box_type_t *r2_end, int y1, int y2) { int x1; int x2; box_type_t *next_rect; next_rect = PIXREGION_TOP (region); critical_if_fail (y1 < y2); critical_if_fail (r1 != r1_end && r2 != r2_end); do { x1 = MAX (r1->x1, r2->x1); x2 = MIN (r1->x2, r2->x2); /* * If there's any overlap between the two rectangles, add that * overlap to the new region. */ if (x1 < x2) { NEWRECT (region, next_rect, x1, y1, x2, y2); } /* * Advance the pointer(s) with the leftmost right side, since the next * rectangle on that list may still overlap the other region's * current rectangle. */ if (r1->x2 == x2) { r1++; } if (r2->x2 == x2) { r2++; } } while ((r1 != r1_end) && (r2 != r2_end)); return TRUE; } PIXMAN_EXPORT pixman_bool_t PREFIX (_intersect) (region_type_t *new_reg, region_type_t *reg1, region_type_t *reg2) { GOOD (reg1); GOOD (reg2); GOOD (new_reg); /* check for trivial reject */ if (PIXREGION_NIL (reg1) || PIXREGION_NIL (reg2) || !EXTENTCHECK (®1->extents, ®2->extents)) { /* Covers about 20% of all cases */ FREE_DATA (new_reg); new_reg->extents.x2 = new_reg->extents.x1; new_reg->extents.y2 = new_reg->extents.y1; if (PIXREGION_NAR (reg1) || PIXREGION_NAR (reg2)) { new_reg->data = pixman_broken_data; return FALSE; } else { new_reg->data = pixman_region_empty_data; } } else if (!reg1->data && !reg2->data) { /* Covers about 80% of cases that aren't trivially rejected */ new_reg->extents.x1 = MAX (reg1->extents.x1, reg2->extents.x1); new_reg->extents.y1 = MAX (reg1->extents.y1, reg2->extents.y1); new_reg->extents.x2 = MIN (reg1->extents.x2, reg2->extents.x2); new_reg->extents.y2 = MIN (reg1->extents.y2, reg2->extents.y2); FREE_DATA (new_reg); new_reg->data = (region_data_type_t *)NULL; } else if (!reg2->data && SUBSUMES (®2->extents, ®1->extents)) { return PREFIX (_copy) (new_reg, reg1); } else if (!reg1->data && SUBSUMES (®1->extents, ®2->extents)) { return PREFIX (_copy) (new_reg, reg2); } else if (reg1 == reg2) { return PREFIX (_copy) (new_reg, reg1); } else { /* General purpose intersection */ if (!pixman_op (new_reg, reg1, reg2, pixman_region_intersect_o, FALSE, FALSE)) { return FALSE; } pixman_set_extents (new_reg); } GOOD (new_reg); return (TRUE); } #define MERGERECT(r) \ do \ { \ if (r->x1 <= x2) \ { \ /* Merge with current rectangle */ \ if (x2 < r->x2) \ x2 = r->x2; \ } \ else \ { \ /* Add current rectangle, start new one */ \ NEWRECT (region, next_rect, x1, y1, x2, y2); \ x1 = r->x1; \ x2 = r->x2; \ } \ r++; \ } while (0) /*====================================================================== * Region Union *====================================================================*/ /*- *----------------------------------------------------------------------- * pixman_region_union_o -- * Handle an overlapping band for the union operation. Picks the * left-most rectangle each time and merges it into the region. * * Results: * TRUE if successful. * * Side Effects: * region is overwritten. * overlap is set to TRUE if any boxes overlap. * *----------------------------------------------------------------------- */ static pixman_bool_t pixman_region_union_o (region_type_t *region, box_type_t *r1, box_type_t *r1_end, box_type_t *r2, box_type_t *r2_end, int y1, int y2) { box_type_t *next_rect; int x1; /* left and right side of current union */ int x2; critical_if_fail (y1 < y2); critical_if_fail (r1 != r1_end && r2 != r2_end); next_rect = PIXREGION_TOP (region); /* Start off current rectangle */ if (r1->x1 < r2->x1) { x1 = r1->x1; x2 = r1->x2; r1++; } else { x1 = r2->x1; x2 = r2->x2; r2++; } while (r1 != r1_end && r2 != r2_end) { if (r1->x1 < r2->x1) { MERGERECT (r1); } else { MERGERECT (r2); } } /* Finish off whoever (if any) is left */ if (r1 != r1_end) { do { MERGERECT (r1); } while (r1 != r1_end); } else if (r2 != r2_end) { do { MERGERECT (r2); } while (r2 != r2_end); } /* Add current rectangle */ NEWRECT (region, next_rect, x1, y1, x2, y2); return TRUE; } PIXMAN_EXPORT pixman_bool_t PREFIX(_intersect_rect) (region_type_t *dest, region_type_t *source, int x, int y, unsigned int width, unsigned int height) { region_type_t region; region.data = NULL; region.extents.x1 = x; region.extents.y1 = y; region.extents.x2 = x + width; region.extents.y2 = y + height; return PREFIX(_intersect) (dest, source, ®ion); } PIXMAN_EXPORT pixman_bool_t PREFIX (_union) (region_type_t *new_reg, region_type_t *reg1, region_type_t *reg2) { /* Return TRUE if some overlap * between reg1, reg2 */ GOOD (reg1); GOOD (reg2); GOOD (new_reg); /* checks all the simple cases */ /* * Region 1 and 2 are the same */ if (reg1 == reg2) { return PREFIX (_copy) (new_reg, reg1); } /* * Region 1 is empty */ if (PIXREGION_NIL (reg1)) { if (PIXREGION_NAR (reg1)) { return pixman_break (new_reg); } if (new_reg != reg2) { return PREFIX (_copy) (new_reg, reg2); } return TRUE; } /* * Region 2 is empty */ if (PIXREGION_NIL (reg2)) { if (PIXREGION_NAR (reg2)) { return pixman_break (new_reg); } if (new_reg != reg1) { return PREFIX (_copy) (new_reg, reg1); } return TRUE; } /* * Region 1 completely subsumes region 2 */ if (!reg1->data && SUBSUMES (®1->extents, ®2->extents)) { if (new_reg != reg1) { return PREFIX (_copy) (new_reg, reg1); } return TRUE; } /* * Region 2 completely subsumes region 1 */ if (!reg2->data && SUBSUMES (®2->extents, ®1->extents)) { if (new_reg != reg2) { return PREFIX (_copy) (new_reg, reg2); } return TRUE; } if (!pixman_op (new_reg, reg1, reg2, pixman_region_union_o, TRUE, TRUE)) { return FALSE; } new_reg->extents.x1 = MIN (reg1->extents.x1, reg2->extents.x1); new_reg->extents.y1 = MIN (reg1->extents.y1, reg2->extents.y1); new_reg->extents.x2 = MAX (reg1->extents.x2, reg2->extents.x2); new_reg->extents.y2 = MAX (reg1->extents.y2, reg2->extents.y2); GOOD (new_reg); return TRUE; } /* Convenience function for performing union of region with a * single rectangle */ PIXMAN_EXPORT pixman_bool_t PREFIX (_union_rect) (region_type_t *dest, region_type_t *source, int x, int y, unsigned int width, unsigned int height) { region_type_t region; region.extents.x1 = x; region.extents.y1 = y; region.extents.x2 = x + width; region.extents.y2 = y + height; if (!GOOD_RECT (®ion.extents)) { if (BAD_RECT (®ion.extents)) { _pixman_log_error (FUNC, "Invalid rectangle passed"); } return PREFIX (_copy) (dest, source); } region.data = NULL; return PREFIX (_union) (dest, source, ®ion); } /*====================================================================== * Batch Rectangle Union *====================================================================*/ #define EXCHANGE_RECTS(a, b) \ { \ box_type_t t; \ t = rects[a]; \ rects[a] = rects[b]; \ rects[b] = t; \ } static void quick_sort_rects ( box_type_t rects[], int numRects) { int y1; int x1; int i, j; box_type_t *r; /* Always called with numRects > 1 */ do { if (numRects == 2) { if (rects[0].y1 > rects[1].y1 || (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1)) { EXCHANGE_RECTS (0, 1); } return; } /* Choose partition element, stick in location 0 */ EXCHANGE_RECTS (0, numRects >> 1); y1 = rects[0].y1; x1 = rects[0].x1; /* Partition array */ i = 0; j = numRects; do { r = &(rects[i]); do { r++; i++; } while (i != numRects && (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1))); r = &(rects[j]); do { r--; j--; } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1)); if (i < j) { EXCHANGE_RECTS (i, j); } } while (i < j); /* Move partition element back to middle */ EXCHANGE_RECTS (0, j); /* Recurse */ if (numRects - j - 1 > 1) { quick_sort_rects (&rects[j + 1], numRects - j - 1); } numRects = j; } while (numRects > 1); } /*- *----------------------------------------------------------------------- * pixman_region_validate -- * * Take a ``region'' which is a non-y-x-banded random collection of * rectangles, and compute a nice region which is the union of all the * rectangles. * * Results: * TRUE if successful. * * Side Effects: * The passed-in ``region'' may be modified. * overlap set to TRUE if any rectangles overlapped, * else FALSE; * * Strategy: * Step 1. Sort the rectangles into ascending order with primary key y1 * and secondary key x1. * * Step 2. Split the rectangles into the minimum number of proper y-x * banded regions. This may require horizontally merging * rectangles, and vertically coalescing bands. With any luck, * this step in an identity transformation (ala the Box widget), * or a coalescing into 1 box (ala Menus). * * Step 3. Merge the separate regions down to a single region by calling * pixman_region_union. Maximize the work each pixman_region_union call does by using * a binary merge. * *----------------------------------------------------------------------- */ static pixman_bool_t validate (region_type_t *badreg) { /* Descriptor for regions under construction in Step 2. */ typedef struct { region_type_t reg; int prev_band; int cur_band; } region_info_t; region_info_t stack_regions[64]; int numRects; /* Original numRects for badreg */ region_info_t *ri; /* Array of current regions */ int num_ri; /* Number of entries used in ri */ int size_ri; /* Number of entries available in ri */ int i; /* Index into rects */ int j; /* Index into ri */ region_info_t *rit; /* &ri[j] */ region_type_t *reg; /* ri[j].reg */ box_type_t *box; /* Current box in rects */ box_type_t *ri_box; /* Last box in ri[j].reg */ region_type_t *hreg; /* ri[j_half].reg */ pixman_bool_t ret = TRUE; if (!badreg->data) { GOOD (badreg); return TRUE; } numRects = badreg->data->numRects; if (!numRects) { if (PIXREGION_NAR (badreg)) { return FALSE; } GOOD (badreg); return TRUE; } if (badreg->extents.x1 < badreg->extents.x2) { if ((numRects) == 1) { FREE_DATA (badreg); badreg->data = (region_data_type_t *) NULL; } else { DOWNSIZE (badreg, numRects); } GOOD (badreg); return TRUE; } /* Step 1: Sort the rects array into ascending (y1, x1) order */ quick_sort_rects (PIXREGION_BOXPTR (badreg), numRects); /* Step 2: Scatter the sorted array into the minimum number of regions */ /* Set up the first region to be the first rectangle in badreg */ /* Note that step 2 code will never overflow the ri[0].reg rects array */ ri = stack_regions; size_ri = sizeof (stack_regions) / sizeof (stack_regions[0]); num_ri = 1; ri[0].prev_band = 0; ri[0].cur_band = 0; ri[0].reg = *badreg; box = PIXREGION_BOXPTR (&ri[0].reg); ri[0].reg.extents = *box; ri[0].reg.data->numRects = 1; badreg->extents = *pixman_region_empty_box; badreg->data = pixman_region_empty_data; /* Now scatter rectangles into the minimum set of valid regions. If the * next rectangle to be added to a region would force an existing rectangle * in the region to be split up in order to maintain y-x banding, just * forget it. Try the next region. If it doesn't fit cleanly into any * region, make a new one. */ for (i = numRects; --i > 0;) { box++; /* Look for a region to append box to */ for (j = num_ri, rit = ri; --j >= 0; rit++) { reg = &rit->reg; ri_box = PIXREGION_END (reg); if (box->y1 == ri_box->y1 && box->y2 == ri_box->y2) { /* box is in same band as ri_box. Merge or append it */ if (box->x1 <= ri_box->x2) { /* Merge it with ri_box */ if (box->x2 > ri_box->x2) { ri_box->x2 = box->x2; } } else { RECTALLOC_BAIL (reg, 1, bail); *PIXREGION_TOP (reg) = *box; reg->data->numRects++; } goto next_rect; /* So sue me */ } else if (box->y1 >= ri_box->y2) { /* Put box into new band */ if (reg->extents.x2 < ri_box->x2) { reg->extents.x2 = ri_box->x2; } if (reg->extents.x1 > box->x1) { reg->extents.x1 = box->x1; } COALESCE (reg, rit->prev_band, rit->cur_band); rit->cur_band = reg->data->numRects; RECTALLOC_BAIL (reg, 1, bail); *PIXREGION_TOP (reg) = *box; reg->data->numRects++; goto next_rect; } /* Well, this region was inappropriate. Try the next one. */ } /* for j */ /* Uh-oh. No regions were appropriate. Create a new one. */ if (size_ri == num_ri) { size_t data_size; /* Oops, allocate space for new region information */ size_ri <<= 1; data_size = size_ri * sizeof(region_info_t); if (data_size / size_ri != sizeof(region_info_t)) { goto bail; } if (ri == stack_regions) { rit = (region_info_t *) malloc(data_size); if (!rit) { goto bail; } memcpy (rit, ri, num_ri * sizeof (region_info_t)); } else { rit = (region_info_t *) realloc (ri, data_size); if (!rit) { goto bail; } } ri = rit; rit = &ri[num_ri]; } num_ri++; rit->prev_band = 0; rit->cur_band = 0; rit->reg.extents = *box; rit->reg.data = (region_data_type_t *)NULL; /* MUST force allocation */ if (!pixman_rect_alloc (&rit->reg, (i + num_ri) / num_ri)) { goto bail; } next_rect: ; } /* for i */ /* Make a final pass over each region in order to COALESCE and set * extents.x2 and extents.y2 */ for (j = num_ri, rit = ri; --j >= 0; rit++) { reg = &rit->reg; ri_box = PIXREGION_END (reg); reg->extents.y2 = ri_box->y2; if (reg->extents.x2 < ri_box->x2) { reg->extents.x2 = ri_box->x2; } COALESCE (reg, rit->prev_band, rit->cur_band); if (reg->data->numRects == 1) /* keep unions happy below */ { FREE_DATA (reg); reg->data = (region_data_type_t *)NULL; } } /* Step 3: Union all regions into a single region */ while (num_ri > 1) { int half = num_ri / 2; for (j = num_ri & 1; j < (half + (num_ri & 1)); j++) { reg = &ri[j].reg; hreg = &ri[j + half].reg; if (!pixman_op (reg, reg, hreg, pixman_region_union_o, TRUE, TRUE)) { ret = FALSE; } if (hreg->extents.x1 < reg->extents.x1) { reg->extents.x1 = hreg->extents.x1; } if (hreg->extents.y1 < reg->extents.y1) { reg->extents.y1 = hreg->extents.y1; } if (hreg->extents.x2 > reg->extents.x2) { reg->extents.x2 = hreg->extents.x2; } if (hreg->extents.y2 > reg->extents.y2) { reg->extents.y2 = hreg->extents.y2; } FREE_DATA (hreg); } num_ri -= half; if (!ret) { goto bail; } } *badreg = ri[0].reg; if (ri != stack_regions) { /* cppcheck-suppress autovarInvalidDeallocation */ free (ri); } GOOD (badreg); return ret; bail: for (i = 0; i < num_ri; i++) { FREE_DATA (&ri[i].reg); } if (ri != stack_regions) { /* cppcheck-suppress autovarInvalidDeallocation */ free (ri); } return pixman_break (badreg); } /*====================================================================== * Region Subtraction *====================================================================*/ /*- *----------------------------------------------------------------------- * pixman_region_subtract_o -- * Overlapping band subtraction. x1 is the left-most point not yet * checked. * * Results: * TRUE if successful. * * Side Effects: * region may have rectangles added to it. * *----------------------------------------------------------------------- */ /*ARGSUSED*/ static pixman_bool_t pixman_region_subtract_o (region_type_t *region, box_type_t *r1, box_type_t *r1_end, box_type_t *r2, box_type_t *r2_end, int y1, int y2) { box_type_t *next_rect; int x1; x1 = r1->x1; critical_if_fail (y1 < y2); critical_if_fail (r1 != r1_end && r2 != r2_end); next_rect = PIXREGION_TOP (region); do { if (r2->x2 <= x1) { /* * Subtrahend entirely to left of minuend: go to next subtrahend. */ r2++; } else if (r2->x1 <= x1) { /* * Subtrahend precedes minuend: nuke left edge of minuend. */ x1 = r2->x2; if (x1 >= r1->x2) { /* * Minuend completely covered: advance to next minuend and * reset left fence to edge of new minuend. */ r1++; if (r1 != r1_end) { x1 = r1->x1; } } else { /* * Subtrahend now used up since it doesn't extend beyond * minuend */ r2++; } } else if (r2->x1 < r1->x2) { /* * Left part of subtrahend covers part of minuend: add uncovered * part of minuend to region and skip to next subtrahend. */ critical_if_fail (x1 < r2->x1); NEWRECT (region, next_rect, x1, y1, r2->x1, y2); x1 = r2->x2; if (x1 >= r1->x2) { /* * Minuend used up: advance to new... */ r1++; if (r1 != r1_end) { x1 = r1->x1; } } else { /* * Subtrahend used up */ r2++; } } else { /* * Minuend used up: add any remaining piece before advancing. */ if (r1->x2 > x1) { NEWRECT (region, next_rect, x1, y1, r1->x2, y2); } r1++; if (r1 != r1_end) { x1 = r1->x1; } } } while ((r1 != r1_end) && (r2 != r2_end)); /* * Add remaining minuend rectangles to region. */ while (r1 != r1_end) { critical_if_fail (x1 < r1->x2); NEWRECT (region, next_rect, x1, y1, r1->x2, y2); r1++; if (r1 != r1_end) { x1 = r1->x1; } } return TRUE; } /*- *----------------------------------------------------------------------- * pixman_region_subtract -- * Subtract reg_s from reg_m and leave the result in reg_d. * S stands for subtrahend, M for minuend and D for difference. * * Results: * TRUE if successful. * * Side Effects: * reg_d is overwritten. * *----------------------------------------------------------------------- */ PIXMAN_EXPORT pixman_bool_t PREFIX (_subtract) (region_type_t *reg_d, region_type_t *reg_m, region_type_t *reg_s) { GOOD (reg_m); GOOD (reg_s); GOOD (reg_d); /* check for trivial rejects */ if (PIXREGION_NIL (reg_m) || PIXREGION_NIL (reg_s) || !EXTENTCHECK (®_m->extents, ®_s->extents)) { if (PIXREGION_NAR (reg_s)) { return pixman_break (reg_d); } return PREFIX (_copy) (reg_d, reg_m); } else if (reg_m == reg_s) { FREE_DATA (reg_d); reg_d->extents.x2 = reg_d->extents.x1; reg_d->extents.y2 = reg_d->extents.y1; reg_d->data = pixman_region_empty_data; return TRUE; } /* Add those rectangles in region 1 that aren't in region 2, do yucky subtraction for overlaps, and just throw away rectangles in region 2 that aren't in region 1 */ if (!pixman_op (reg_d, reg_m, reg_s, pixman_region_subtract_o, TRUE, FALSE)) { return FALSE; } /* * Can't alter reg_d's extents before we call pixman_op because * it might be one of the source regions and pixman_op depends * on the extents of those regions being unaltered. Besides, this * way there's no checking against rectangles that will be nuked * due to coalescing, so we have to examine fewer rectangles. */ pixman_set_extents (reg_d); GOOD (reg_d); return TRUE; } /*====================================================================== * Region Inversion *====================================================================*/ /*- *----------------------------------------------------------------------- * pixman_region_inverse -- * Take a region and a box and return a region that is everything * in the box but not in the region. The careful reader will note * that this is the same as subtracting the region from the box... * * Results: * TRUE. * * Side Effects: * new_reg is overwritten. * *----------------------------------------------------------------------- */ PIXMAN_EXPORT pixman_bool_t PREFIX (_inverse) (region_type_t *new_reg, /* Destination region */ region_type_t *reg1, /* Region to invert */ box_type_t *inv_rect) /* Bounding box for inversion */ { region_type_t inv_reg; /* Quick and dirty region made from the * bounding box */ GOOD (reg1); GOOD (new_reg); /* check for trivial rejects */ if (PIXREGION_NIL (reg1) || !EXTENTCHECK (inv_rect, ®1->extents)) { if (PIXREGION_NAR (reg1)) { return pixman_break (new_reg); } new_reg->extents = *inv_rect; FREE_DATA (new_reg); new_reg->data = (region_data_type_t *)NULL; return TRUE; } /* Add those rectangles in region 1 that aren't in region 2, * do yucky subtraction for overlaps, and * just throw away rectangles in region 2 that aren't in region 1 */ inv_reg.extents = *inv_rect; inv_reg.data = (region_data_type_t *)NULL; if (!pixman_op (new_reg, &inv_reg, reg1, pixman_region_subtract_o, TRUE, FALSE)) { return FALSE; } /* * Can't alter new_reg's extents before we call pixman_op because * it might be one of the source regions and pixman_op depends * on the extents of those regions being unaltered. Besides, this * way there's no checking against rectangles that will be nuked * due to coalescing, so we have to examine fewer rectangles. */ pixman_set_extents (new_reg); GOOD (new_reg); return TRUE; } /* In time O(log n), locate the first box whose y2 is greater than y. * Return @end if no such box exists. */ static box_type_t * find_box_for_y (box_type_t *begin, box_type_t *end, int y) { box_type_t *mid; if (end == begin) { return end; } if (end - begin == 1) { if (begin->y2 > y) { return begin; } else { return end; } } mid = begin + (end - begin) / 2; if (mid->y2 > y) { /* If no box is found in [begin, mid], the function * will return @mid, which is then known to be the * correct answer. */ return find_box_for_y (begin, mid, y); } else { return find_box_for_y (mid, end, y); } } /* * rect_in(region, rect) * This routine takes a pointer to a region and a pointer to a box * and determines if the box is outside/inside/partly inside the region. * * The idea is to travel through the list of rectangles trying to cover the * passed box with them. Anytime a piece of the rectangle isn't covered * by a band of rectangles, part_out is set TRUE. Any time a rectangle in * the region covers part of the box, part_in is set TRUE. The process ends * when either the box has been completely covered (we reached a band that * doesn't overlap the box, part_in is TRUE and part_out is false), the * box has been partially covered (part_in == part_out == TRUE -- because of * the banding, the first time this is true we know the box is only * partially in the region) or is outside the region (we reached a band * that doesn't overlap the box at all and part_in is false) */ PIXMAN_EXPORT pixman_region_overlap_t PREFIX (_contains_rectangle) (region_type_t *region, box_type_t *prect) { box_type_t *pbox; box_type_t *pbox_end; int part_in, part_out; int numRects; int x, y; GOOD (region); numRects = PIXREGION_NUMRECTS (region); /* useful optimization */ if (!numRects || !EXTENTCHECK (®ion->extents, prect)) { return (PIXMAN_REGION_OUT); } if (numRects == 1) { /* We know that it must be PIXMAN_REGION_IN or PIXMAN_REGION_PART */ if (SUBSUMES (®ion->extents, prect)) { return (PIXMAN_REGION_IN); } else { return (PIXMAN_REGION_PART); } } part_out = FALSE; part_in = FALSE; /* (x,y) starts at upper left of rect, moving to the right and down */ x = prect->x1; y = prect->y1; /* can stop when both part_out and part_in are TRUE, or we reach prect->y2 */ for (pbox = PIXREGION_BOXPTR (region), pbox_end = pbox + numRects; pbox != pbox_end; pbox++) { /* getting up to speed or skipping remainder of band */ if (pbox->y2 <= y) { if ((pbox = find_box_for_y (pbox, pbox_end, y)) == pbox_end) { break; } } if (pbox->y1 > y) { part_out = TRUE; /* missed part of rectangle above */ if (part_in || (pbox->y1 >= prect->y2)) { break; } y = pbox->y1; /* x guaranteed to be == prect->x1 */ } if (pbox->x2 <= x) { continue; /* not far enough over yet */ } if (pbox->x1 > x) { part_out = TRUE; /* missed part of rectangle to left */ if (part_in) { break; } } if (pbox->x1 < prect->x2) { part_in = TRUE; /* definitely overlap */ if (part_out) { break; } } if (pbox->x2 >= prect->x2) { y = pbox->y2; /* finished with this band */ if (y >= prect->y2) { break; } x = prect->x1; /* reset x out to left again */ } else { /* * Because boxes in a band are maximal width, if the first box * to overlap the rectangle doesn't completely cover it in that * band, the rectangle must be partially out, since some of it * will be uncovered in that band. part_in will have been set true * by now... */ part_out = TRUE; break; } } if (part_in) { if (y < prect->y2) { return PIXMAN_REGION_PART; } else { return PIXMAN_REGION_IN; } } else { return PIXMAN_REGION_OUT; } } /* PREFIX(_translate) (region, x, y) * translates in place */ PIXMAN_EXPORT void PREFIX (_translate) (region_type_t *region, int x, int y) { overflow_int_t x1, x2, y1, y2; int nbox; box_type_t *pbox; GOOD (region); region->extents.x1 = x1 = region->extents.x1 + x; region->extents.y1 = y1 = region->extents.y1 + y; region->extents.x2 = x2 = region->extents.x2 + x; region->extents.y2 = y2 = region->extents.y2 + y; if (((x1 - PIXMAN_REGION_MIN) | (y1 - PIXMAN_REGION_MIN) | (PIXMAN_REGION_MAX - x2) | (PIXMAN_REGION_MAX - y2)) >= 0) { if (region->data && (nbox = region->data->numRects)) { for (pbox = PIXREGION_BOXPTR (region); nbox--; pbox++) { pbox->x1 += x; pbox->y1 += y; pbox->x2 += x; pbox->y2 += y; } } return; } if (((x2 - PIXMAN_REGION_MIN) | (y2 - PIXMAN_REGION_MIN) | (PIXMAN_REGION_MAX - x1) | (PIXMAN_REGION_MAX - y1)) <= 0) { region->extents.x2 = region->extents.x1; region->extents.y2 = region->extents.y1; FREE_DATA (region); region->data = pixman_region_empty_data; return; } if (x1 < PIXMAN_REGION_MIN) { region->extents.x1 = PIXMAN_REGION_MIN; } else if (x2 > PIXMAN_REGION_MAX) { region->extents.x2 = PIXMAN_REGION_MAX; } if (y1 < PIXMAN_REGION_MIN) { region->extents.y1 = PIXMAN_REGION_MIN; } else if (y2 > PIXMAN_REGION_MAX) { region->extents.y2 = PIXMAN_REGION_MAX; } if (region->data && (nbox = region->data->numRects)) { box_type_t *pbox_out; for (pbox_out = pbox = PIXREGION_BOXPTR (region); nbox--; pbox++) { pbox_out->x1 = x1 = pbox->x1 + x; pbox_out->y1 = y1 = pbox->y1 + y; pbox_out->x2 = x2 = pbox->x2 + x; pbox_out->y2 = y2 = pbox->y2 + y; if (((x2 - PIXMAN_REGION_MIN) | (y2 - PIXMAN_REGION_MIN) | (PIXMAN_REGION_MAX - x1) | (PIXMAN_REGION_MAX - y1)) <= 0) { region->data->numRects--; continue; } if (x1 < PIXMAN_REGION_MIN) { pbox_out->x1 = PIXMAN_REGION_MIN; } else if (x2 > PIXMAN_REGION_MAX) { pbox_out->x2 = PIXMAN_REGION_MAX; } if (y1 < PIXMAN_REGION_MIN) { pbox_out->y1 = PIXMAN_REGION_MIN; } else if (y2 > PIXMAN_REGION_MAX) { pbox_out->y2 = PIXMAN_REGION_MAX; } pbox_out++; } if (pbox_out != pbox) { if (region->data->numRects == 1) { region->extents = *PIXREGION_BOXPTR (region); FREE_DATA (region); region->data = (region_data_type_t *)NULL; } else { pixman_set_extents (region); } } } GOOD (region); } PIXMAN_EXPORT void PREFIX (_reset) (region_type_t *region, box_type_t *box) { GOOD (region); critical_if_fail (GOOD_RECT (box)); region->extents = *box; FREE_DATA (region); region->data = NULL; } PIXMAN_EXPORT void PREFIX (_clear) (region_type_t *region) { GOOD (region); FREE_DATA (region); region->extents = *pixman_region_empty_box; region->data = pixman_region_empty_data; } /* box is "return" value */ PIXMAN_EXPORT int PREFIX (_contains_point) (region_type_t *region, int x, int y, box_type_t *box) { box_type_t *pbox, *pbox_end; int numRects; GOOD (region); numRects = PIXREGION_NUMRECTS (region); if (!numRects || !INBOX (®ion->extents, x, y)) { return (FALSE); } if (numRects == 1) { if (box) { *box = region->extents; } return (TRUE); } pbox = PIXREGION_BOXPTR (region); pbox_end = pbox + numRects; pbox = find_box_for_y (pbox, pbox_end, y); for (; pbox != pbox_end; pbox++) { if ((y < pbox->y1) || (x < pbox->x1)) { break; /* missed it */ } if (x >= pbox->x2) { continue; /* not there yet */ } if (box) { *box = *pbox; } return (TRUE); } return (FALSE); } PIXMAN_EXPORT int PREFIX (_not_empty) (region_type_t *region) { GOOD (region); return (!PIXREGION_NIL (region)); } PIXMAN_EXPORT box_type_t * PREFIX (_extents) (region_type_t *region) { GOOD (region); return (®ion->extents); } /* * Clip a list of scanlines to a region. The caller has allocated the * space. FSorted is non-zero if the scanline origins are in ascending order. * * returns the number of new, clipped scanlines. */ PIXMAN_EXPORT pixman_bool_t PREFIX (_selfcheck) (region_type_t *reg) { int i, numRects; if ((reg->extents.x1 > reg->extents.x2) || (reg->extents.y1 > reg->extents.y2)) { return FALSE; } numRects = PIXREGION_NUMRECTS (reg); if (!numRects) { return ((reg->extents.x1 == reg->extents.x2) && (reg->extents.y1 == reg->extents.y2) && (reg->data->size || (reg->data == pixman_region_empty_data))); } else if (numRects == 1) { return (!reg->data); } else { box_type_t *pbox_p, *pbox_n; box_type_t box; pbox_p = PIXREGION_RECTS (reg); box = *pbox_p; box.y2 = pbox_p[numRects - 1].y2; pbox_n = pbox_p + 1; for (i = numRects; --i > 0; pbox_p++, pbox_n++) { if ((pbox_n->x1 >= pbox_n->x2) || (pbox_n->y1 >= pbox_n->y2)) { return FALSE; } if (pbox_n->x1 < box.x1) { box.x1 = pbox_n->x1; } if (pbox_n->x2 > box.x2) { box.x2 = pbox_n->x2; } if ((pbox_n->y1 < pbox_p->y1) || ((pbox_n->y1 == pbox_p->y1) && ((pbox_n->x1 < pbox_p->x2) || (pbox_n->y2 != pbox_p->y2)))) { return FALSE; } } return ((box.x1 == reg->extents.x1) && (box.x2 == reg->extents.x2) && (box.y1 == reg->extents.y1) && (box.y2 == reg->extents.y2)); } } PIXMAN_EXPORT pixman_bool_t PREFIX (_init_rects) (region_type_t *region, const box_type_t *boxes, int count) { box_type_t *rects; int displacement; int i; /* if it's 1, then we just want to set the extents, so call * the existing method. */ if (count == 1) { PREFIX (_init_rect) (region, boxes[0].x1, boxes[0].y1, boxes[0].x2 - boxes[0].x1, boxes[0].y2 - boxes[0].y1); return TRUE; } PREFIX (_init) (region); /* if it's 0, don't call pixman_rect_alloc -- 0 rectangles is * a special case, and causing pixman_rect_alloc would cause * us to leak memory (because the 0-rect case should be the * static pixman_region_empty_data data). */ if (count == 0) { return TRUE; } if (!pixman_rect_alloc (region, count)) { return FALSE; } rects = PIXREGION_RECTS (region); /* Copy in the rects */ memcpy (rects, boxes, sizeof(box_type_t) * count); region->data->numRects = count; /* Eliminate empty and malformed rectangles */ displacement = 0; for (i = 0; i < count; ++i) { box_type_t *box = &rects[i]; if (box->x1 >= box->x2 || box->y1 >= box->y2) { displacement++; } else if (displacement) { rects[i - displacement] = rects[i]; } } region->data->numRects -= displacement; /* If eliminating empty rectangles caused there * to be only 0 or 1 rectangles, deal with that. */ if (region->data->numRects == 0) { FREE_DATA (region); PREFIX (_init) (region); return TRUE; } if (region->data->numRects == 1) { region->extents = rects[0]; FREE_DATA (region); region->data = NULL; GOOD (region); return TRUE; } /* Validate */ region->extents.x1 = region->extents.x2 = 0; return validate (region); } xrdp-0.10.1/common/os_calls.c000644 001751 000000 00000276066 14652432047 016111 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * generic operating system calls * * put all the os / arch define in here you want */ /* To test for Windows (64 bit or 32 bit) use _WIN32 and _WIN64 in addition for 64 bit windows. _WIN32 is defined for both. To test for Linux use __linux__. To test for BSD use BSD */ #if defined(HAVE_CONFIG_H) #include "config_ac.h" #endif #if defined(_WIN32) #include #include #else /* fix for solaris 10 with gcc 3.3.2 problem */ #if defined(sun) || defined(__sun) #define ctid_t id_t #endif #include #include #include #include #include #if defined(XRDP_ENABLE_VSOCK) #if defined(__linux__) #include #elif defined(__FreeBSD__) // sockaddr_hvs is not available outside the kernel for whatever reason struct sockaddr_hvs { unsigned char sa_len; sa_family_t sa_family; unsigned int hvs_port; unsigned char hvs_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - sizeof(unsigned char) - sizeof(unsigned int)]; }; #endif #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_SYS_PRCTL_H) #include #endif #include #include #include #include #include #include #include #include #include #endif #ifdef HAVE_SETUSERCONTEXT #include #endif #include #include #include #include #include /* this is so we can use #ifdef BSD later */ /* This is the recommended way of detecting BSD in the FreeBSD Porter's Handbook. */ #if (defined(__unix__) || defined(unix)) && !defined(USG) #include #endif #include "os_calls.h" #include "limits.h" #include "string_calls.h" #include "log.h" #include "xrdp_constants.h" #if defined(__linux__) #include #endif /* sys/ucred.h needs to be included to use struct xucred * in FreeBSD and OS X. No need for other BSDs except GNU/kFreeBSD */ #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__) #include #endif /* for solaris */ #if !defined(PF_LOCAL) #define PF_LOCAL AF_UNIX #endif #if !defined(INADDR_NONE) #define INADDR_NONE ((unsigned long)-1) #endif /** * Type big enough to hold socket address information for any connecting type */ union sock_info { struct sockaddr sa; struct sockaddr_in sa_in; #if defined(XRDP_ENABLE_IPV6) struct sockaddr_in6 sa_in6; #endif struct sockaddr_un sa_un; #if defined(XRDP_ENABLE_VSOCK) #if defined(__linux__) struct sockaddr_vm sa_vm; #elif defined(__FreeBSD__) struct sockaddr_hvs sa_hvs; #endif #endif }; /*****************************************************************************/ int g_rm_temp_dir(void) { return 0; } /*****************************************************************************/ void g_init(const char *app_name) { #if defined(_WIN32) WSADATA wsadata; WSAStartup(2, &wsadata); #endif } /*****************************************************************************/ void g_deinit(void) { #if defined(_WIN32) WSACleanup(); #endif fflush(stdout); fflush(stderr); g_rm_temp_dir(); } /*****************************************************************************/ /* output text to stdout, try to use g_write / g_writeln instead to avoid linux / windows EOL problems */ void g_printf(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); } /*****************************************************************************/ void g_sprintf(char *dest, const char *format, ...) { va_list ap; va_start(ap, format); vsprintf(dest, format, ap); va_end(ap); } /*****************************************************************************/ int g_snprintf(char *dest, int len, const char *format, ...) { int err; va_list ap; va_start(ap, format); err = vsnprintf(dest, len, format, ap); va_end(ap); return err; } /*****************************************************************************/ void g_writeln(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); #if defined(_WIN32) g_printf("\r\n"); #else g_printf("\n"); #endif } /*****************************************************************************/ void g_write(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stdout, format, ap); va_end(ap); } /*****************************************************************************/ /* print a hex dump to stdout*/ void g_hexdump(const char *p, int len) { unsigned char *line; int i; int thisline; int offset; line = (unsigned char *)p; offset = 0; while (offset < len) { g_printf("%04x ", offset); thisline = len - offset; if (thisline > 16) { thisline = 16; } for (i = 0; i < thisline; i++) { g_printf("%02x ", line[i]); } for (; i < 16; i++) { g_printf(" "); } for (i = 0; i < thisline; i++) { g_printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); } g_writeln("%s", ""); offset += thisline; line += thisline; } } /*****************************************************************************/ int g_getchar(void) { return getchar(); } /*****************************************************************************/ /*Returns 0 on success*/ int g_tcp_set_no_delay(int sck) { int ret = 1; /* error */ int option_value; socklen_t option_len; option_len = sizeof(option_value); /* SOL_TCP IPPROTO_TCP */ if (getsockopt(sck, IPPROTO_TCP, TCP_NODELAY, (char *)&option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); if (setsockopt(sck, IPPROTO_TCP, TCP_NODELAY, (char *)&option_value, option_len) == 0) { ret = 0; /* success */ } else { LOG(LOG_LEVEL_ERROR, "Error setting tcp_nodelay"); } } } else { LOG(LOG_LEVEL_ERROR, "Error getting tcp_nodelay"); } return ret; } /*****************************************************************************/ /*Returns 0 on success*/ int g_tcp_set_keepalive(int sck) { int ret = 1; /* error */ int option_value; socklen_t option_len; option_len = sizeof(option_value); /* SOL_TCP IPPROTO_TCP */ if (getsockopt(sck, SOL_SOCKET, SO_KEEPALIVE, (char *)&option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); if (setsockopt(sck, SOL_SOCKET, SO_KEEPALIVE, (char *)&option_value, option_len) == 0) { ret = 0; /* success */ } else { LOG(LOG_LEVEL_ERROR, "Error setting tcp_keepalive"); } } } else { LOG(LOG_LEVEL_ERROR, "Error getting tcp_keepalive"); } return ret; } /*****************************************************************************/ /* returns a newly created socket or -1 on error */ /* in win32 a socket is an unsigned int, in linux, it's an int */ int g_tcp_socket(void) { int rv; int option_value; socklen_t option_len; #if defined(XRDP_ENABLE_IPV6) rv = (int)socket(AF_INET6, SOCK_STREAM, 0); if (rv < 0) { switch (errno) { case EPROTONOSUPPORT: /* if IPv6 is supported, but don't have an IPv6 address */ case EAFNOSUPPORT: /* if IPv6 not supported, retry IPv4 */ LOG(LOG_LEVEL_INFO, "IPv6 not supported, falling back to IPv4"); rv = (int)socket(AF_INET, SOCK_STREAM, 0); break; default: LOG(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror()); return -1; } } #else rv = (int)socket(AF_INET, SOCK_STREAM, 0); #endif if (rv < 0) { LOG(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror()); return -1; } #if defined(XRDP_ENABLE_IPV6) option_len = sizeof(option_value); if (getsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&option_value, &option_len) == 0) { if (option_value != 0) { #if defined(XRDP_ENABLE_IPV6ONLY) option_value = 1; #else option_value = 0; #endif option_len = sizeof(option_value); if (setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&option_value, option_len) < 0) { LOG(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed"); } } } #endif option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); if (setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value, option_len) < 0) { LOG(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed"); } } } return rv; } /*****************************************************************************/ /* returns error */ int g_sck_set_send_buffer_bytes(int sck, int bytes) { int option_value; socklen_t option_len; option_value = bytes; option_len = sizeof(option_value); if (setsockopt(sck, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, option_len) != 0) { return 1; } return 0; } /*****************************************************************************/ /* returns error */ int g_sck_get_send_buffer_bytes(int sck, int *bytes) { int option_value; socklen_t option_len; option_value = 0; option_len = sizeof(option_value); if (getsockopt(sck, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, &option_len) != 0) { return 1; } *bytes = option_value; return 0; } /*****************************************************************************/ /* returns error */ int g_sck_set_recv_buffer_bytes(int sck, int bytes) { int option_value; socklen_t option_len; option_value = bytes; option_len = sizeof(option_value); if (setsockopt(sck, SOL_SOCKET, SO_RCVBUF, (char *)&option_value, option_len) != 0) { return 1; } return 0; } /*****************************************************************************/ /* returns error */ int g_sck_get_recv_buffer_bytes(int sck, int *bytes) { int option_value; socklen_t option_len; option_value = 0; option_len = sizeof(option_value); if (getsockopt(sck, SOL_SOCKET, SO_RCVBUF, (char *)&option_value, &option_len) != 0) { return 1; } *bytes = option_value; return 0; } /*****************************************************************************/ int g_sck_local_socket(void) { #if defined(_WIN32) return -1; #else return socket(PF_LOCAL, SOCK_STREAM, 0); #endif } /*****************************************************************************/ int g_sck_local_socketpair(int sck[2]) { #if defined(_WIN32) return -1; #else return socketpair(PF_LOCAL, SOCK_STREAM, 0, sck); #endif } /*****************************************************************************/ int g_sck_vsock_socket(void) { #if defined(XRDP_ENABLE_VSOCK) #if defined(__linux__) LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: returning Linux vsock socket"); return socket(PF_VSOCK, SOCK_STREAM, 0); #elif defined(__FreeBSD__) LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: returning FreeBSD Hyper-V socket"); return socket(AF_HYPERV, SOCK_STREAM, 0); // docs say to use AF_HYPERV here - PF_HYPERV does not exist #else LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: vsock enabled at compile time, but platform is unsupported"); return -1; #endif #else LOG(LOG_LEVEL_DEBUG, "g_sck_vsock_socket: vsock disabled at compile time"); return -1; #endif } /*****************************************************************************/ /* returns error */ int g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid) { #if defined(SO_PEERCRED) socklen_t ucred_length; struct myucred { pid_t pid; uid_t uid; gid_t gid; } credentials; ucred_length = sizeof(credentials); if (getsockopt(sck, SOL_SOCKET, SO_PEERCRED, &credentials, &ucred_length)) { return 1; } if (pid != 0) { *pid = credentials.pid; } if (uid != 0) { *uid = credentials.uid; } if (gid != 0) { *gid = credentials.gid; } return 0; #elif defined(LOCAL_PEERCRED) /* FreeBSD, OS X reach here*/ struct xucred xucred; unsigned int xucred_length; xucred_length = sizeof(xucred); if (getsockopt(sck, SOL_LOCAL, LOCAL_PEERCRED, &xucred, &xucred_length)) { return 1; } if (pid != 0) { *pid = 0; /* can't get pid in FreeBSD, OS X */ } if (uid != 0) { *uid = xucred.cr_uid; } if (gid != 0) { *gid = xucred.cr_gid; } return 0; #else return 1; #endif } /*****************************************************************************/ static const char * get_peer_description(const union sock_info *sock_info, char *desc, unsigned int bytes) { if (bytes > 0) { int family = sock_info->sa.sa_family; switch (family) { case AF_INET: { char ip[INET_ADDRSTRLEN]; const struct sockaddr_in *sa_in = &sock_info->sa_in; if (inet_ntop(family, &sa_in->sin_addr, ip, sizeof(ip)) != NULL) { g_snprintf(desc, bytes, "%s:%d", ip, ntohs(sa_in->sin_port)); } else { g_snprintf(desc, bytes, ":%d", ntohs(sa_in->sin_port)); } break; } #if defined(XRDP_ENABLE_IPV6) case AF_INET6: { char ip[INET6_ADDRSTRLEN]; const struct sockaddr_in6 *sa_in6 = &sock_info->sa_in6; if (inet_ntop(family, &sa_in6->sin6_addr, ip, sizeof(ip)) != NULL) { g_snprintf(desc, bytes, "[%s]:%d", ip, ntohs(sa_in6->sin6_port)); } else { g_snprintf(desc, bytes, "[]:%d", ntohs(sa_in6->sin6_port)); } break; } #endif case AF_UNIX: { g_snprintf(desc, bytes, "AF_UNIX"); break; } #if defined(XRDP_ENABLE_VSOCK) #if defined(__linux__) case AF_VSOCK: { const struct sockaddr_vm *sa_vm = &sock_info->sa_vm; g_snprintf(desc, bytes, "AF_VSOCK:cid=%u/port=%u", sa_vm->svm_cid, sa_vm->svm_port); break; } #elif defined(__FreeBSD__) case AF_HYPERV: { const struct sockaddr_hvs *sa_hvs = &sock_info->sa_hvs; g_snprintf(desc, bytes, "AF_HYPERV:port=%u", sa_hvs->hvs_port); break; } #endif #endif default: g_snprintf(desc, bytes, "Unknown address family %d", family); break; } } return desc; } /*****************************************************************************/ void g_sck_close(int sck) { #if defined(_WIN32) closesocket(sck); #else char sockname[MAX_PEER_DESCSTRLEN]; union sock_info sock_info; socklen_t sock_len = sizeof(sock_info); memset(&sock_info, 0, sizeof(sock_info)); if (getsockname(sck, &sock_info.sa, &sock_len) == 0) { get_peer_description(&sock_info, sockname, sizeof(sockname)); } else { LOG(LOG_LEVEL_WARNING, "getsockname() failed on socket %d: %s", sck, g_get_strerror()); if (errno == EBADF || errno == ENOTSOCK) { return; } g_snprintf(sockname, sizeof(sockname), "unknown"); } if (close(sck) == 0) { LOG(LOG_LEVEL_DEBUG, "Closed socket %d (%s)", sck, sockname); } else { LOG(LOG_LEVEL_WARNING, "Cannot close socket %d (%s): %s", sck, sockname, g_get_strerror()); } #endif } #if defined(XRDP_ENABLE_IPV6) /*****************************************************************************/ /* Helper function for g_tcp_connect. */ static int connect_loopback(int sck, const char *port) { struct sockaddr_in6 sa; struct sockaddr_in s; int res; // First IPv6 g_memset(&sa, 0, sizeof(sa)); sa.sin6_family = AF_INET6; sa.sin6_addr = in6addr_loopback; // IPv6 ::1 sa.sin6_port = htons((tui16)atoi(port)); res = connect(sck, (struct sockaddr *)&sa, sizeof(sa)); if (res == -1 && errno == EINPROGRESS) { return -1; } if (res == 0 || (res == -1 && errno == EISCONN)) { return 0; } // else IPv4 g_memset(&s, 0, sizeof(s)); s.sin_family = AF_INET; s.sin_addr.s_addr = htonl(INADDR_LOOPBACK); // IPv4 127.0.0.1 s.sin_port = htons((tui16)atoi(port)); res = connect(sck, (struct sockaddr *)&s, sizeof(s)); if (res == -1 && errno == EINPROGRESS) { return -1; } if (res == 0 || (res == -1 && errno == EISCONN)) { return 0; } // else IPv6 with IPv4 address g_memset(&sa, 0, sizeof(sa)); sa.sin6_family = AF_INET6; inet_pton(AF_INET6, "::FFFF:127.0.0.1", &sa.sin6_addr); sa.sin6_port = htons((tui16)atoi(port)); res = connect(sck, (struct sockaddr *)&sa, sizeof(sa)); if (res == -1 && errno == EINPROGRESS) { return -1; } if (res == 0 || (res == -1 && errno == EISCONN)) { return 0; } return -1; } #endif /*****************************************************************************/ /* returns error, zero is good */ /* The connection might get to be in progress, if so -1 is returned. */ /* The caller needs to call again to check if succeed. */ #if defined(XRDP_ENABLE_IPV6) int g_tcp_connect(int sck, const char *address, const char *port) { int res = 0; struct addrinfo p; struct addrinfo *h = (struct addrinfo *)NULL; struct addrinfo *rp = (struct addrinfo *)NULL; g_memset(&p, 0, sizeof(struct addrinfo)); p.ai_socktype = SOCK_STREAM; p.ai_protocol = IPPROTO_TCP; p.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED; p.ai_family = AF_INET6; if (g_strcmp(address, "127.0.0.1") == 0) { return connect_loopback(sck, port); } else { res = getaddrinfo(address, port, &p, &h); } if (res != 0) { LOG(LOG_LEVEL_ERROR, "g_tcp_connect(%d, %s, %s): getaddrinfo() failed: %s", sck, address, port, gai_strerror(res)); } if (res > -1) { if (h != NULL) { for (rp = h; rp != NULL; rp = rp->ai_next) { res = connect(sck, (struct sockaddr *)(rp->ai_addr), rp->ai_addrlen); if (res == -1 && errno == EINPROGRESS) { break; /* Return -1 */ } if (res == 0 || (res == -1 && errno == EISCONN)) { res = 0; break; /* Success */ } } freeaddrinfo(h); } } return res; } #else int g_tcp_connect(int sck, const char *address, const char *port) { struct sockaddr_in s; struct hostent *h; int res; g_memset(&s, 0, sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = htons((tui16)atoi(port)); s.sin_addr.s_addr = inet_addr(address); if (s.sin_addr.s_addr == INADDR_NONE) { h = gethostbyname(address); if (h != 0) { if (h->h_name != 0) { if (h->h_addr_list != 0) { if ((*(h->h_addr_list)) != 0) { s.sin_addr.s_addr = *((int *)(*(h->h_addr_list))); } } } } } res = connect(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_in)); /* Mac OSX connect() returns -1 for already established connections */ if (res == -1 && errno == EISCONN) { res = 0; } return res; } #endif /*****************************************************************************/ /* returns error, zero is good */ int g_sck_local_connect(int sck, const char *port) { #if defined(_WIN32) return -1; #else struct sockaddr_un s; memset(&s, 0, sizeof(struct sockaddr_un)); s.sun_family = AF_UNIX; strncpy(s.sun_path, port, sizeof(s.sun_path)); s.sun_path[sizeof(s.sun_path) - 1] = 0; return connect(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_un)); #endif } /*****************************************************************************/ int g_sck_set_non_blocking(int sck) { unsigned long i; #if defined(_WIN32) i = 1; ioctlsocket(sck, FIONBIO, &i); #else i = fcntl(sck, F_GETFL); i = i | O_NONBLOCK; if (fcntl(sck, F_SETFL, i) < 0) { LOG(LOG_LEVEL_ERROR, "g_sck_set_non_blocking: fcntl() failed"); } #endif return 0; } #if defined(XRDP_ENABLE_IPV6) /*****************************************************************************/ /* returns error, zero is good */ int g_tcp_bind(int sck, const char *port) { struct sockaddr_in6 sa; struct sockaddr_in s; int errno6; // First IPv6 g_memset(&sa, 0, sizeof(sa)); sa.sin6_family = AF_INET6; sa.sin6_addr = in6addr_any; // IPv6 :: sa.sin6_port = htons((tui16)atoi(port)); if (bind(sck, (struct sockaddr *)&sa, sizeof(sa)) == 0) { return 0; } errno6 = errno; // else IPv4 g_memset(&s, 0, sizeof(s)); s.sin_family = AF_INET; s.sin_addr.s_addr = htonl(INADDR_ANY); // IPv4 0.0.0.0 s.sin_port = htons((tui16)atoi(port)); if (bind(sck, (struct sockaddr *)&s, sizeof(s)) == 0) { return 0; } LOG(LOG_LEVEL_ERROR, "g_tcp_bind(%d, %s) failed " "bind IPv6 (errno=%d) and IPv4 (errno=%d).", sck, port, errno6, errno); return -1; } #else int g_tcp_bind(int sck, const char *port) { struct sockaddr_in s; memset(&s, 0, sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = htons((tui16)atoi(port)); s.sin_addr.s_addr = INADDR_ANY; return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_in)); } #endif /*****************************************************************************/ int g_sck_local_bind(int sck, const char *port) { #if defined(_WIN32) return -1; #else struct sockaddr_un s; memset(&s, 0, sizeof(struct sockaddr_un)); s.sun_family = AF_UNIX; strncpy(s.sun_path, port, sizeof(s.sun_path)); s.sun_path[sizeof(s.sun_path) - 1] = 0; return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_un)); #endif } /*****************************************************************************/ int g_sck_vsock_bind(int sck, const char *port) { #if defined(XRDP_ENABLE_VSOCK) #if defined(__linux__) struct sockaddr_vm s; g_memset(&s, 0, sizeof(struct sockaddr_vm)); s.svm_family = AF_VSOCK; s.svm_port = atoi(port); s.svm_cid = VMADDR_CID_ANY; return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_vm)); #elif defined(__FreeBSD__) struct sockaddr_hvs s; g_memset(&s, 0, sizeof(struct sockaddr_hvs)); s.sa_family = AF_HYPERV; s.hvs_port = atoi(port); return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_hvs)); #else return -1; #endif #else return -1; #endif } /*****************************************************************************/ int g_sck_vsock_bind_address(int sck, const char *port, const char *address) { #if defined(XRDP_ENABLE_VSOCK) #if defined(__linux__) struct sockaddr_vm s; g_memset(&s, 0, sizeof(struct sockaddr_vm)); s.svm_family = AF_VSOCK; s.svm_port = atoi(port); s.svm_cid = atoi(address); return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_vm)); #elif defined(__FreeBSD__) struct sockaddr_hvs s; g_memset(&s, 0, sizeof(struct sockaddr_hvs)); s.sa_family = AF_HYPERV; s.hvs_port = atoi(port); // channel/address currently unsupported in FreeBSD 13. return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_hvs)); #else return -1; #endif #else return -1; #endif } #if defined(XRDP_ENABLE_IPV6) /*****************************************************************************/ /* Helper function for g_tcp_bind_address. */ static int bind_loopback(int sck, const char *port) { struct sockaddr_in6 sa; struct sockaddr_in s; int errno6; int errno4; // First IPv6 g_memset(&sa, 0, sizeof(sa)); sa.sin6_family = AF_INET6; sa.sin6_addr = in6addr_loopback; // IPv6 ::1 sa.sin6_port = htons((tui16)atoi(port)); if (bind(sck, (struct sockaddr *)&sa, sizeof(sa)) == 0) { return 0; } errno6 = errno; // else IPv4 g_memset(&s, 0, sizeof(s)); s.sin_family = AF_INET; s.sin_addr.s_addr = htonl(INADDR_LOOPBACK); // IPv4 127.0.0.1 s.sin_port = htons((tui16)atoi(port)); if (bind(sck, (struct sockaddr *)&s, sizeof(s)) == 0) { return 0; } errno4 = errno; // else IPv6 with IPv4 address g_memset(&sa, 0, sizeof(sa)); sa.sin6_family = AF_INET6; inet_pton(AF_INET6, "::FFFF:127.0.0.1", &sa.sin6_addr); sa.sin6_port = htons((tui16)atoi(port)); if (bind(sck, (struct sockaddr *)&sa, sizeof(sa)) == 0) { return 0; } LOG(LOG_LEVEL_ERROR, "bind_loopback(%d, %s) failed; " "IPv6 ::1 (errno=%d), IPv4 127.0.0.1 (errno=%d) and IPv6 ::FFFF:127.0.0.1 (errno=%d).", sck, port, errno6, errno4, errno); return -1; } /*****************************************************************************/ /* Helper function for g_tcp_bind_address. */ /* Returns error, zero is good. */ static int getaddrinfo_bind(int sck, const char *port, const char *address) { int res; int error; struct addrinfo hints; struct addrinfo *list; struct addrinfo *i; res = -1; g_memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_flags = 0; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; error = getaddrinfo(address, port, &hints, &list); if (error == 0) { i = list; while ((i != 0) && (res < 0)) { res = bind(sck, i->ai_addr, i->ai_addrlen); i = i->ai_next; } freeaddrinfo(list); } else { LOG(LOG_LEVEL_ERROR, "getaddrinfo error: %s", gai_strerror(error)); return -1; } return res; } /*****************************************************************************/ /* Binds a socket to a port. If no specified address the port will be bind */ /* to 'any', i.e. available on all network. */ /* For bind to local host, see valid address strings below. */ /* Returns error, zero is good. */ int g_tcp_bind_address(int sck, const char *port, const char *address) { int res; if ((address == 0) || (address[0] == 0) || (g_strcmp(address, "0.0.0.0") == 0) || (g_strcmp(address, "::") == 0)) { return g_tcp_bind(sck, port); } if ((g_strcmp(address, "127.0.0.1") == 0) || (g_strcmp(address, "::1") == 0) || (g_strcmp(address, "localhost") == 0)) { return bind_loopback(sck, port); } // Let getaddrinfo translate the address string... // IPv4: ddd.ddd.ddd.ddd // IPv6: x:x:x:x:x:x:x:x%, or x::x:x:x:x% res = getaddrinfo_bind(sck, port, address); if (res != 0) { // If fail and it is an IPv4 address, try with the mapped address struct in_addr a; if ((inet_aton(address, &a) == 1) && (strlen(address) <= 15)) { char sz[7 + 15 + 1]; sprintf(sz, "::FFFF:%s", address); res = getaddrinfo_bind(sck, port, sz); if (res == 0) { return 0; } } LOG(LOG_LEVEL_ERROR, "g_tcp_bind_address(%d, %s, %s) Failed!", sck, port, address); return -1; } return 0; } #else int g_tcp_bind_address(int sck, const char *port, const char *address) { struct sockaddr_in s; memset(&s, 0, sizeof(struct sockaddr_in)); s.sin_family = AF_INET; s.sin_port = htons((tui16)atoi(port)); s.sin_addr.s_addr = INADDR_ANY; if (inet_aton(address, &s.sin_addr) < 0) { return -1; /* bad address */ } return bind(sck, (struct sockaddr *)&s, sizeof(struct sockaddr_in)); } #endif /*****************************************************************************/ /* returns error, zero is good */ int g_sck_listen(int sck) { return listen(sck, 2); } /*****************************************************************************/ int g_sck_accept(int sck) { int ret; union sock_info sock_info; socklen_t sock_len = sizeof(sock_info); memset(&sock_info, 0, sock_len); ret = accept(sck, (struct sockaddr *)&sock_info, &sock_len); if (ret > 0) { char description[MAX_PEER_DESCSTRLEN]; get_peer_description(&sock_info, description, sizeof(description)); LOG(LOG_LEVEL_INFO, "Socket %d: connection accepted from %s", ret, description); } return ret; } /*****************************************************************************/ const char * g_sck_get_peer_ip_address(int sck, char *ip, unsigned int bytes, unsigned short *port) { if (bytes > 0) { int ok = 0; union sock_info sock_info; socklen_t sock_len = sizeof(sock_info); memset(&sock_info, 0, sock_len); if (getpeername(sck, (struct sockaddr *)&sock_info, &sock_len) == 0) { int family = sock_info.sa.sa_family; switch (family) { case AF_INET: { struct sockaddr_in *sa_in = &sock_info.sa_in; if (inet_ntop(family, &sa_in->sin_addr, ip, bytes) != NULL) { ok = 1; if (port != NULL) { *port = ntohs(sa_in->sin_port); } } break; } #if defined(XRDP_ENABLE_IPV6) case AF_INET6: { struct sockaddr_in6 *sa_in6 = &sock_info.sa_in6; if (inet_ntop(family, &sa_in6->sin6_addr, ip, bytes) != NULL) { ok = 1; if (port != NULL) { *port = ntohs(sa_in6->sin6_port); } } break; } #endif default: break; } } if (!ok) { ip[0] = '\0'; } } return ip; } /*****************************************************************************/ const char * g_sck_get_peer_description(int sck, char *desc, unsigned int bytes) { union sock_info sock_info; socklen_t sock_len = sizeof(sock_info); memset(&sock_info, 0, sock_len); if (getpeername(sck, (struct sockaddr *)&sock_info, &sock_len) == 0) { get_peer_description(&sock_info, desc, bytes); } return desc; } /*****************************************************************************/ void g_sleep(int msecs) { #if defined(_WIN32) Sleep(msecs); #else usleep(msecs * 1000); #endif } /*****************************************************************************/ int g_pipe(int fd[2]) { return pipe(fd); } /*****************************************************************************/ int g_sck_last_error_would_block(int sck) { #if defined(_WIN32) return WSAGetLastError() == WSAEWOULDBLOCK; #else return (errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == EINPROGRESS); #endif } /*****************************************************************************/ int g_sck_recv(int sck, void *ptr, unsigned int len, int flags) { #if defined(_WIN32) return recv(sck, (char *)ptr, len, flags); #else return recv(sck, ptr, len, flags); #endif } /*****************************************************************************/ int g_sck_send(int sck, const void *ptr, unsigned int len, int flags) { #if defined(_WIN32) return send(sck, (const char *)ptr, len, flags); #else return send(sck, ptr, len, flags); #endif } /*****************************************************************************/ int g_sck_recv_fd_set(int sck, void *ptr, unsigned int len, int fds[], unsigned int maxfd, unsigned int *fdcount) { int rv = -1; #if !defined(_WIN32) // The POSIX API gives us no way to see how much ancillary data is // present for recvmsg() - just use a big buffer. // // Use a union, so control_un.control is properly aligned. union { struct cmsghdr cm; unsigned char control[8192]; } control_un; struct msghdr msg = {0}; *fdcount = 0; /* Set up descriptor for vanilla data */ struct iovec iov[1] = { {ptr, len} }; msg.msg_iov = &iov[0]; msg.msg_iovlen = 1; /* Add in the ancillary data buffer */ msg.msg_control = control_un.control; msg.msg_controllen = sizeof(control_un.control); if ((rv = recvmsg(sck, &msg, 0)) > 0) { struct cmsghdr *cmsg; if ((msg.msg_flags & MSG_CTRUNC) != 0) { LOG(LOG_LEVEL_WARNING, "Ancillary data on recvmsg() was truncated"); } // Iterate over the cmsghdr structures in the ancillary data for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { const unsigned char *data = CMSG_DATA(cmsg); unsigned int data_len = cmsg->cmsg_len - CMSG_LEN(0); // Check the data length doesn't point past the end of // control_un.control (see below). This shouldn't happen, // but is conceivable if the ancillary data is truncated // and the OS doesn't handle that properly. // // <-- (sizeof(control_un.control) --> // +------------------------------------+ // | | // +------------------------------------+ // ^ ^ // | | <- data_len -> // | | // control_un.control data unsigned int max_data_len = sizeof(control_un.control) - (data - control_un.control); if (len > max_data_len) { len = max_data_len; } // Process all the file descriptors in the structure while (data_len >= sizeof(int)) { int fd; memcpy(&fd, data, sizeof(int)); data += sizeof(int); data_len -= sizeof(int); if (*fdcount < maxfd) { fds[(*fdcount)++] = fd; } else { // No room in the user's buffer for this fd close(fd); } } } } } #endif /* !WIN32 */ return rv; } /*****************************************************************************/ int g_sck_send_fd_set(int sck, const void *ptr, unsigned int len, int fds[], unsigned int fdcount) { int rv = -1; #if !defined(_WIN32) struct msghdr msg = {0}; /* Set up descriptor for vanilla data */ struct iovec iov[1] = { {(void *)ptr, len} }; msg.msg_iov = &iov[0]; msg.msg_iovlen = 1; if (fdcount > 0) { unsigned int fdsize = sizeof(fds[0]) * fdcount; /* Payload size */ /* Allocate ancillary data structure */ msg.msg_controllen = CMSG_SPACE(fdsize); msg.msg_control = (struct cmsghdr *)g_malloc(msg.msg_controllen, 1); if (msg.msg_control == NULL) { /* Memory allocation failure */ LOG(LOG_LEVEL_ERROR, "Error allocating buffer for %u fds", fdcount); return -1; } /* Fill in the ancillary data structure */ struct cmsghdr *cmptr = CMSG_FIRSTHDR(&msg); cmptr->cmsg_len = CMSG_LEN(fdsize); cmptr->cmsg_level = SOL_SOCKET; cmptr->cmsg_type = SCM_RIGHTS; memcpy(CMSG_DATA(cmptr), fds, fdsize); } rv = sendmsg(sck, &msg, 0); g_free(msg.msg_control); #endif /* !WIN32 */ return rv; } /*****************************************************************************/ /* returns boolean */ int g_sck_socket_ok(int sck) { int opt; socklen_t opt_len; opt_len = sizeof(opt); if (getsockopt(sck, SOL_SOCKET, SO_ERROR, (char *)(&opt), &opt_len) == 0) { if (opt == 0) { return 1; } } return 0; } /*****************************************************************************/ /* wait 'millis' milliseconds for the socket to be able to write */ /* returns boolean */ int g_sck_can_send(int sck, int millis) { int rv = 0; if (sck > 0) { struct pollfd pollfd; pollfd.fd = sck; pollfd.events = POLLOUT; pollfd.revents = 0; if (poll(&pollfd, 1, millis) > 0) { if ((pollfd.revents & POLLOUT) != 0) { rv = 1; } } } return rv; } /*****************************************************************************/ /* wait 'millis' milliseconds for the socket to be able to receive */ /* returns boolean */ int g_sck_can_recv(int sck, int millis) { int rv = 0; if (sck > 0) { struct pollfd pollfd; pollfd.fd = sck; pollfd.events = POLLIN; pollfd.revents = 0; if (poll(&pollfd, 1, millis) > 0) { if ((pollfd.revents & (POLLIN | POLLHUP)) != 0) { rv = 1; } } } return rv; } /*****************************************************************************/ int g_sck_select(int sck1, int sck2) { struct pollfd pollfd[2] = {0}; int rvmask[2] = {0}; /* Output masks corresponding to fds in pollfd */ unsigned int i = 0; int rv = 0; if (sck1 > 0) { pollfd[i].fd = sck1; pollfd[i].events = POLLIN; rvmask[i] = 1; ++i; } if (sck2 > 0) { pollfd[i].fd = sck2; pollfd[i].events = POLLIN; rvmask[i] = 2; ++i; } if (poll(pollfd, i, 0) > 0) { if ((pollfd[0].revents & (POLLIN | POLLHUP)) != 0) { rv |= rvmask[0]; } if ((pollfd[1].revents & (POLLIN | POLLHUP)) != 0) { rv |= rvmask[1]; } } return rv; } /*****************************************************************************/ /* returns boolean */ static int g_fd_can_read(int fd) { int rv = 0; if (fd > 0) { struct pollfd pollfd; pollfd.fd = fd; pollfd.events = POLLIN; pollfd.revents = 0; if (poll(&pollfd, 1, 0) > 0) { if ((pollfd.revents & (POLLIN | POLLHUP)) != 0) { rv = 1; } } } return rv; } /*****************************************************************************/ /* returns error */ /* O_NONBLOCK = 0x00000800 */ static int g_set_nonblock(int fd) { int error; int flags; error = fcntl(fd, F_GETFL); if (error < 0) { return 1; } flags = error; if ((flags & O_NONBLOCK) != O_NONBLOCK) { flags |= O_NONBLOCK; error = fcntl(fd, F_SETFL, flags); if (error < 0) { return 1; } } return 0; } /*****************************************************************************/ /* returns 0 on error */ tintptr g_create_wait_obj(const char *name) { #ifdef _WIN32 tintptr obj; obj = (tintptr)CreateEvent(0, 1, 0, name); return obj; #else int fds[2]; int error; error = pipe(fds); if (error != 0) { return 0; } if (g_set_nonblock(fds[0]) != 0) { close(fds[0]); close(fds[1]); return 0; } if (g_set_nonblock(fds[1]) != 0) { close(fds[0]); close(fds[1]); return 0; } g_file_set_cloexec(fds[0], 1); g_file_set_cloexec(fds[1], 1); return (fds[1] << 16) | fds[0]; #endif } /*****************************************************************************/ /* returns 0 on error */ tintptr g_create_wait_obj_from_socket(tintptr socket, int write) { #ifdef _WIN32 /* Create and return corresponding event handle for WaitForMultipleObjects */ WSAEVENT event; long lnetevent = 0; g_memset(&event, 0, sizeof(WSAEVENT)); event = WSACreateEvent(); lnetevent = (write ? FD_WRITE : FD_READ) | FD_CLOSE; if (WSAEventSelect(socket, event, lnetevent) == 0) { return (tbus)event; } else { return 0; } #else return socket; #endif } /*****************************************************************************/ void g_delete_wait_obj_from_socket(tintptr wait_obj) { #ifdef _WIN32 if (wait_obj == 0) { return; } WSACloseEvent((HANDLE)wait_obj); #else #endif } /*****************************************************************************/ /* returns error */ int g_set_wait_obj(tintptr obj) { #ifdef _WIN32 #error "Win32 is no longer supported." #else int error; int fd; int written; int to_write; char buf[4] = "sig"; if (obj == 0) { return 0; } fd = obj & USHRT_MAX; if (g_fd_can_read(fd)) { /* already signalled */ return 0; } fd = obj >> 16; to_write = 4; written = 0; while (written < to_write) { error = write(fd, buf + written, to_write - written); if (error == -1) { error = errno; if ((error == EAGAIN) || (error == EWOULDBLOCK) || (error == EINPROGRESS) || (error == EINTR)) { /* ok */ } else { return 1; } } else if (error > 0) { written += error; } else { return 1; } } return 0; #endif } /*****************************************************************************/ /* returns error */ int g_reset_wait_obj(tintptr obj) { #ifdef _WIN32 if (obj == 0) { return 0; } ResetEvent((HANDLE)obj); return 0; #else char buf[4]; int error; int fd; if (obj == 0) { return 0; } fd = obj & 0xffff; while (g_fd_can_read(fd)) { error = read(fd, buf, 4); if (error == -1) { error = errno; if ((error == EAGAIN) || (error == EWOULDBLOCK) || (error == EINPROGRESS) || (error == EINTR)) { /* ok */ } else { return 1; } } else if (error == 0) { return 1; } } return 0; #endif } /*****************************************************************************/ /* returns boolean */ int g_is_wait_obj_set(tintptr obj) { #ifdef _WIN32 if (obj == 0) { return 0; } if (WaitForSingleObject((HANDLE)obj, 0) == WAIT_OBJECT_0) { return 1; } return 0; #else if (obj == 0) { return 0; } return g_fd_can_read(obj & 0xffff); #endif } /*****************************************************************************/ /* returns error */ int g_delete_wait_obj(tintptr obj) { #ifdef _WIN32 if (obj == 0) { return 0; } /* Close event handle */ CloseHandle((HANDLE)obj); return 0; #else if (obj == 0) { return 0; } close(obj & 0xffff); close(obj >> 16); return 0; #endif } /*****************************************************************************/ /* returns error */ int g_obj_wait(tintptr *read_objs, int rcount, tintptr *write_objs, int wcount, int mstimeout) { #define MAX_HANDLES 256 #ifdef _WIN32 HANDLE handles[MAX_HANDLES]; DWORD count; DWORD error; int j; int i; j = 0; count = rcount + wcount; for (i = 0; i < rcount; i++) { handles[j++] = (HANDLE)(read_objs[i]); } for (i = 0; i < wcount; i++) { handles[j++] = (HANDLE)(write_objs[i]); } if (mstimeout < 0) { mstimeout = INFINITE; } error = WaitForMultipleObjects(count, handles, FALSE, mstimeout); if (error == WAIT_FAILED) { return 1; } return 0; #else struct pollfd pollfd[MAX_HANDLES]; int sck; int i = 0; unsigned int j = 0; int rv = 1; if (read_objs == NULL && rcount != 0) { LOG(LOG_LEVEL_ERROR, "Programming error read_objs is null"); } else if (write_objs == NULL && wcount != 0) { LOG(LOG_LEVEL_ERROR, "Programming error write_objs is null"); } /* Check carefully for int overflow in passed-in counts */ else if ((unsigned int)rcount > MAX_HANDLES || (unsigned int)wcount > MAX_HANDLES || ((unsigned int)rcount + (unsigned int)wcount) > MAX_HANDLES) { LOG(LOG_LEVEL_ERROR, "Programming error too many handles"); } else { if (mstimeout < 0) { mstimeout = -1; } for (i = 0; i < rcount ; ++i) { sck = read_objs[i] & 0xffff; if (sck > 0) { pollfd[j].fd = sck; pollfd[j].events = POLLIN; ++j; } } for (i = 0; i < wcount; ++i) { sck = write_objs[i]; if (sck > 0) { pollfd[j].fd = sck; pollfd[j].events = POLLOUT; ++j; } } rv = (poll(pollfd, j, mstimeout) < 0); if (rv != 0) { /* these are not really errors */ if ((errno == EAGAIN) || (errno == EWOULDBLOCK) || (errno == EINPROGRESS) || (errno == EINTR)) /* signal occurred */ { rv = 0; } } } return rv; #endif #undef MAX_HANDLES } /*****************************************************************************/ void g_random(char *data, int len) { #if defined(_WIN32) int index; srand(g_time1()); for (index = 0; index < len; index++) { data[index] = (char)rand(); /* rand returns a number between 0 and RAND_MAX */ } #else int fd; memset(data, 0x44, len); fd = open("/dev/urandom", O_RDONLY); if (fd == -1) { fd = open("/dev/random", O_RDONLY); } if (fd != -1) { if (read(fd, data, len) != len) { } close(fd); } #endif } /*****************************************************************************/ int g_abs(int i) { return abs(i); } /*****************************************************************************/ int g_memcmp(const void *s1, const void *s2, int len) { return memcmp(s1, s2, len); } /*****************************************************************************/ /* returns -1 on error, else return handle or file descriptor */ int g_file_open_rw(const char *file_name) { #if defined(_WIN32) return (int)CreateFileA(file_name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); #else return open(file_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); #endif } /*****************************************************************************/ /* returns -1 on error, else return handle or file descriptor */ int g_file_open_ex(const char *file_name, int aread, int awrite, int acreate, int atrunc) { #if defined(_WIN32) return -1; #else int rv; int flags; flags = 0; if (aread && awrite) { flags |= O_RDWR; } else if (aread) { flags |= O_RDONLY; } else if (awrite) { flags |= O_WRONLY; } if (acreate) { flags |= O_CREAT; } if (atrunc) { flags |= O_TRUNC; } rv = open(file_name, flags, S_IRUSR | S_IWUSR); return rv; #endif } /*****************************************************************************/ /* returns -1 on error, else return handle or file descriptor */ int g_file_open_ro(const char *file_name) { return g_file_open_ex(file_name, 1, 0, 0, 0); } /*****************************************************************************/ /* returns error, always 0 */ int g_file_close(int fd) { #if defined(_WIN32) CloseHandle((HANDLE)fd); #else close(fd); #endif return 0; } /*****************************************************************************/ int g_file_is_open(int fd) { return (fcntl(fd, F_GETFD) >= 0); } /*****************************************************************************/ /* read from file, returns the number of bytes read or -1 on error */ int g_file_read(int fd, char *ptr, int len) { #if defined(_WIN32) if (ReadFile((HANDLE)fd, (LPVOID)ptr, (DWORD)len, (LPDWORD)&len, 0)) { return len; } else { return -1; } #else return read(fd, ptr, len); #endif } /*****************************************************************************/ /* write to file, returns the number of bytes written or -1 on error */ int g_file_write(int fd, const char *ptr, int len) { #if defined(_WIN32) if (WriteFile((HANDLE)fd, (LPVOID)ptr, (DWORD)len, (LPDWORD)&len, 0)) { return len; } else { return -1; } #else return write(fd, ptr, len); #endif } /*****************************************************************************/ /* move file pointer, returns offset on success, -1 on failure */ int g_file_seek(int fd, int offset) { #if defined(_WIN32) int rv; rv = (int)SetFilePointer((HANDLE)fd, offset, 0, FILE_BEGIN); if (rv == (int)INVALID_SET_FILE_POINTER) { return -1; } else { return rv; } #else return (int)lseek(fd, offset, SEEK_SET); #endif } /*****************************************************************************/ /* do a write lock on a file */ /* return boolean */ int g_file_lock(int fd, int start, int len) { #if defined(_WIN32) return LockFile((HANDLE)fd, start, 0, len, 0); #else struct flock lock; lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = start; lock.l_len = len; if (fcntl(fd, F_SETLK, &lock) == -1) { return 0; } return 1; #endif } /*****************************************************************************/ /* Gets the close-on-exec flag for a file descriptor */ int g_file_get_cloexec(int fd) { int rv = 0; int flags = fcntl(fd, F_GETFD); if (flags >= 0 && (flags & FD_CLOEXEC) != 0) { rv = 1; } return rv; } /*****************************************************************************/ /* Sets/clears the close-on-exec flag for a file descriptor */ /* return boolean */ int g_file_set_cloexec(int fd, int status) { int rv = 0; int current_flags = fcntl(fd, F_GETFD); if (current_flags >= 0) { int new_flags; if (status) { new_flags = current_flags | FD_CLOEXEC; } else { new_flags = current_flags & ~FD_CLOEXEC; } if (new_flags != current_flags) { rv = (fcntl(fd, F_SETFD, new_flags) >= 0); } } return rv; } /*****************************************************************************/ struct list * g_get_open_fds(int min, int max) { struct list *result = list_create(); if (result != NULL) { if (max < 0) { max = sysconf(_SC_OPEN_MAX); } if (max > min) { struct pollfd *fds = g_new0(struct pollfd, max - min); int i; if (fds == NULL) { goto nomem; } for (i = min ; i < max ; ++i) { fds[i - min].fd = i; } if (poll(fds, max - min, 0) >= 0) { for (i = min ; i < max ; ++i) { if (fds[i - min].revents != POLLNVAL) { // Descriptor is open if (!list_add_item(result, i)) { goto nomem; } } } } g_free(fds); } } return result; nomem: list_delete(result); return NULL; } /*****************************************************************************/ int g_file_map(int fd, int aread, int awrite, size_t length, void **addr) { int prot = 0; void *laddr; if (aread) { prot |= PROT_READ; } if (awrite) { prot |= PROT_WRITE; } laddr = mmap(NULL, length, prot, MAP_SHARED, fd, 0); if (laddr == MAP_FAILED) { return 1; } *addr = laddr; return 0; } /*****************************************************************************/ int g_munmap(void *addr, size_t length) { return munmap(addr, length); } /*****************************************************************************/ /* Converts a hex mask to a mode_t value */ #if !defined(_WIN32) static mode_t hex_to_mode_t(int hex) { mode_t mode = 0; mode |= (hex & 0x4000) ? S_ISUID : 0; mode |= (hex & 0x2000) ? S_ISGID : 0; mode |= (hex & 0x1000) ? S_ISVTX : 0; mode |= (hex & 0x0400) ? S_IRUSR : 0; mode |= (hex & 0x0200) ? S_IWUSR : 0; mode |= (hex & 0x0100) ? S_IXUSR : 0; mode |= (hex & 0x0040) ? S_IRGRP : 0; mode |= (hex & 0x0020) ? S_IWGRP : 0; mode |= (hex & 0x0010) ? S_IXGRP : 0; mode |= (hex & 0x0004) ? S_IROTH : 0; mode |= (hex & 0x0002) ? S_IWOTH : 0; mode |= (hex & 0x0001) ? S_IXOTH : 0; return mode; } #endif /*****************************************************************************/ /* Converts a mode_t value to a hex mask */ #if !defined(_WIN32) static int mode_t_to_hex(mode_t mode) { int hex = 0; hex |= (mode & S_ISUID) ? 0x4000 : 0; hex |= (mode & S_ISGID) ? 0x2000 : 0; hex |= (mode & S_ISVTX) ? 0x1000 : 0; hex |= (mode & S_IRUSR) ? 0x0400 : 0; hex |= (mode & S_IWUSR) ? 0x0200 : 0; hex |= (mode & S_IXUSR) ? 0x0100 : 0; hex |= (mode & S_IRGRP) ? 0x0040 : 0; hex |= (mode & S_IWGRP) ? 0x0020 : 0; hex |= (mode & S_IXGRP) ? 0x0010 : 0; hex |= (mode & S_IROTH) ? 0x0004 : 0; hex |= (mode & S_IWOTH) ? 0x0002 : 0; hex |= (mode & S_IXOTH) ? 0x0001 : 0; return hex; } #endif /*****************************************************************************/ /* Duplicates a file descriptor onto another one using the semantics * of dup2() */ /* return boolean */ int g_file_duplicate_on(int fd, int target_fd) { int rv = (dup2(fd, target_fd) >= 0); if (rv < 0) { LOG(LOG_LEVEL_ERROR, "Can't clone file %d as file %d [%s]", fd, target_fd, g_get_strerror()); } return rv; } /*****************************************************************************/ /* returns error */ int g_chmod_hex(const char *filename, int flags) { #if defined(_WIN32) return 0; #else mode_t m = hex_to_mode_t(flags); return chmod(filename, m); #endif } /*****************************************************************************/ /* returns error */ int g_umask_hex(int flags) { #if defined(_WIN32) return flags; #else mode_t m = hex_to_mode_t(flags); m = umask(m); return mode_t_to_hex(m); #endif } /*****************************************************************************/ /* returns error, zero is ok */ int g_chown(const char *name, int uid, int gid) { return chown(name, uid, gid); } /*****************************************************************************/ /* returns error, always zero */ int g_mkdir(const char *dirname) { #if defined(_WIN32) return 0; #else return mkdir(dirname, S_IRWXU); #endif } /*****************************************************************************/ /* gets the current working directory and puts up to maxlen chars in dirname always returns 0 */ char * g_get_current_dir(char *dirname, int maxlen) { #if defined(_WIN32) GetCurrentDirectoryA(maxlen, dirname); return 0; #else if (getcwd(dirname, maxlen) == 0) { } return 0; #endif } /*****************************************************************************/ /* returns error, zero on success and -1 on failure */ int g_set_current_dir(const char *dirname) { #if defined(_WIN32) if (SetCurrentDirectoryA(dirname)) { return 0; } else { return -1; } #else return chdir(dirname); #endif } /*****************************************************************************/ /* returns boolean, non zero if the file exists */ int g_file_exist(const char *filename) { #if defined(_WIN32) return 0; // use FileAge(filename) <> -1 #else return access(filename, F_OK) == 0; #endif } /*****************************************************************************/ /* returns boolean, non zero if the file is readable */ int g_file_readable(const char *filename) { #if defined(_WIN32) return _waccess(filename, 04) == 0; #else return access(filename, R_OK) == 0; #endif } /*****************************************************************************/ /* returns boolean, non zero if the directory exists */ int g_directory_exist(const char *dirname) { #if defined(_WIN32) return 0; // use GetFileAttributes and check return value // is not -1 and FILE_ATTRIBUTE_DIRECTORY bit is set #else struct stat st; if (stat(dirname, &st) == 0) { return S_ISDIR(st.st_mode); } else { return 0; } #endif } /*****************************************************************************/ /* returns boolean, non zero if the file exists and is a readable executable */ int g_executable_exist(const char *exename) { return access(exename, R_OK | X_OK) == 0; } /*****************************************************************************/ /* returns boolean */ int g_create_dir(const char *dirname) { #if defined(_WIN32) return CreateDirectoryA(dirname, 0); // test this #else return mkdir(dirname, 0777) == 0; #endif } /*****************************************************************************/ /* will try to create directories up to last / in name example /tmp/a/b/c/readme.txt will try to create /tmp/a/b/c returns boolean */ int g_create_path(const char *path) { char *pp; char *sp; char *copypath; int status; status = 1; copypath = g_strdup(path); pp = copypath; sp = strchr(pp, '/'); while (sp != 0) { if (sp != pp) { *sp = 0; if (!g_directory_exist(copypath)) { if (!g_create_dir(copypath)) { status = 0; break; } } *sp = '/'; } pp = sp + 1; sp = strchr(pp, '/'); } g_free(copypath); return status; } /*****************************************************************************/ /* returns boolean */ int g_remove_dir(const char *dirname) { #if defined(_WIN32) return RemoveDirectoryA(dirname); // test this #else return rmdir(dirname) == 0; #endif } /*****************************************************************************/ /* returns non zero if the file was deleted */ int g_file_delete(const char *filename) { #if defined(_WIN32) return DeleteFileA(filename); #else return unlink(filename) != -1; #endif } /*****************************************************************************/ /* returns file size, -1 on error */ int g_file_get_size(const char *filename) { #if defined(_WIN32) return -1; #else struct stat st; if (stat(filename, &st) == 0) { return (int)(st.st_size); } else { return -1; } #endif } /*****************************************************************************/ /* returns device number, -1 on error */ int g_file_get_device_number(const char *filename) { #if defined(_WIN32) return -1; #else struct stat st; if (stat(filename, &st) == 0) { return (int)(st.st_dev); } else { return -1; } #endif } /*****************************************************************************/ /* returns inode number, -1 on error */ int g_file_get_inode_num(const char *filename) { #if defined(_WIN32) return -1; #else struct stat st; if (stat(filename, &st) == 0) { return (int)(st.st_ino); } else { return -1; } #endif } /*****************************************************************************/ long g_load_library(char *in) { #if defined(_WIN32) return (long)LoadLibraryA(in); #else return (long)dlopen(in, RTLD_LOCAL | RTLD_LAZY); #endif } /*****************************************************************************/ int g_free_library(long lib) { if (lib == 0) { return 0; } #if defined(_WIN32) return FreeLibrary((HMODULE)lib); #else return dlclose((void *)lib); #endif } /*****************************************************************************/ /* returns NULL if not found */ void * g_get_proc_address(long lib, const char *name) { if (lib == 0) { return 0; } #if defined(_WIN32) return GetProcAddress((HMODULE)lib, name); #else return dlsym((void *)lib, name); #endif } /*****************************************************************************/ /* does not work in win32 */ int g_system(const char *aexec) { #if defined(_WIN32) return 0; #else return system(aexec); #endif } /*****************************************************************************/ /* does not work in win32 */ char * g_get_strerror(void) { #if defined(_WIN32) return 0; #else return strerror(errno); #endif } /*****************************************************************************/ int g_get_errno(void) { #if defined(_WIN32) return GetLastError(); #else return errno; #endif } /*****************************************************************************/ /* does not work in win32 */ #define ARGS_STR_LEN 1024 int g_execvp(const char *p1, char *args[]) { #if defined(_WIN32) return 0; #else int rv; char args_str[ARGS_STR_LEN]; int args_len; args_len = 0; while (args[args_len] != NULL) { args_len++; } g_strnjoin(args_str, ARGS_STR_LEN, " ", (const char **) args, args_len); LOG(LOG_LEVEL_DEBUG, "Calling exec (excutable: %s, arguments: %s)", p1, args_str); rv = execvp(p1, args); /* should not get here */ int saved_errno = errno; LOG(LOG_LEVEL_ERROR, "Error calling exec (excutable: %s, arguments: %s) " "returned errno: %d, description: %s", p1, args_str, g_get_errno(), g_get_strerror()); errno = saved_errno; return rv; #endif } /*****************************************************************************/ int g_execvp_list(const char *file, struct list *argv) { int rv = -1; /* Push a terminating NULL onto the list for the system call */ if (!list_add_item(argv, (tintptr)NULL)) { LOG(LOG_LEVEL_ERROR, "No memory for exec to terminate list"); errno = ENOMEM; } else { /* Read the argv argument straight from the list */ rv = g_execvp(file, (char **)argv->items); /* should not get here */ list_remove_item(argv, argv->count - 1); // Lose terminating NULL } return rv; } /*****************************************************************************/ /* does not work in win32 */ int g_execlp3(const char *a1, const char *a2, const char *a3) { #if defined(_WIN32) return 0; #else int rv; const char *args[] = {a2, a3, NULL}; char args_str[ARGS_STR_LEN]; g_strnjoin(args_str, ARGS_STR_LEN, " ", args, 2); LOG(LOG_LEVEL_DEBUG, "Calling exec (executable: %s, arguments: %s)", a1, args_str); g_rm_temp_dir(); rv = execlp(a1, a2, a3, (void *)0); /* should not get here */ LOG(LOG_LEVEL_ERROR, "Error calling exec (executable: %s, arguments: %s) " "returned errno: %d, description: %s", a1, args_str, g_get_errno(), g_get_strerror()); return rv; #endif } /*****************************************************************************/ /* does not work in win32 */ unsigned int g_set_alarm(void (*func)(int), unsigned int secs) { #if defined(_WIN32) return 0; #else struct sigaction action; /* Cancel any previous alarm to prevent a race */ unsigned int rv = alarm(0); if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESTART; } sigemptyset (&action.sa_mask); sigaction(SIGALRM, &action, NULL); if (func != NULL && secs > 0) { (void)alarm(secs); } return rv; #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_child_stop(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; // Don't need to know when children are stopped or started action.sa_flags = (SA_RESTART | SA_NOCLDSTOP); } sigemptyset (&action.sa_mask); sigaction(SIGCHLD, &action, NULL); #endif } /*****************************************************************************/ void g_signal_segfault(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESETHAND; // This is a one-shot } sigemptyset (&action.sa_mask); sigaction(SIGSEGV, &action, NULL); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_hang_up(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESTART; } sigemptyset (&action.sa_mask); sigaction(SIGHUP, &action, NULL); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_user_interrupt(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESTART; } sigemptyset (&action.sa_mask); sigaction(SIGINT, &action, NULL); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_terminate(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESTART; } sigemptyset (&action.sa_mask); sigaction(SIGTERM, &action, NULL); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_pipe(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESTART; } sigemptyset (&action.sa_mask); sigaction(SIGPIPE, &action, NULL); #endif } /*****************************************************************************/ /* does not work in win32 */ void g_signal_usr1(void (*func)(int)) { #if defined(_WIN32) #else struct sigaction action; if (func == NULL) { action.sa_handler = SIG_DFL; action.sa_flags = 0; } else { action.sa_handler = func; action.sa_flags = SA_RESTART; } sigemptyset (&action.sa_mask); sigaction(SIGUSR1, &action, NULL); #endif } /*****************************************************************************/ /* does not work in win32 */ int g_fork(void) { #if defined(_WIN32) return 0; #else int rv; rv = fork(); if (rv == -1) /* error */ { LOG(LOG_LEVEL_ERROR, "Process fork failed with errno: %d, description: %s", g_get_errno(), g_get_strerror()); } return rv; #endif } /*****************************************************************************/ /* does not work in win32 */ int g_setgid(int pid) { #if defined(_WIN32) return 0; #else return setgid(pid); #endif } /*****************************************************************************/ /* returns error, zero is success, non zero is error */ /* does not work in win32 */ int g_initgroups(const char *username) { #if defined(_WIN32) return 0; #else int gid; int error = g_getuser_info_by_name(username, NULL, &gid, NULL, NULL, NULL); if (error == 0) { error = initgroups(username, gid); } return error; #endif } /*****************************************************************************/ /* does not work in win32 */ /* returns user id */ int g_getuid(void) { #if defined(_WIN32) return 0; #else return getuid(); #endif } /*****************************************************************************/ /* does not work in win32 */ /* returns user id */ int g_getgid(void) { #if defined(_WIN32) return 0; #else return getgid(); #endif } /*****************************************************************************/ /* does not work in win32 */ /* On success, zero is returned. On error, -1 is returned */ int g_setuid(int pid) { #if defined(_WIN32) return 0; #else return setuid(pid); #endif } /*****************************************************************************/ int g_setsid(void) { #if defined(_WIN32) return -1; #else return setsid(); #endif } /*****************************************************************************/ int g_getlogin(char *name, unsigned int len) { #if defined(_WIN32) return -1; #else return getlogin_r(name, len); #endif } /*****************************************************************************/ int g_setlogin(const char *name) { #ifdef BSD return setlogin(name); #else return -1; #endif } /*****************************************************************************/ #ifdef HAVE_SETUSERCONTEXT int g_set_allusercontext(int uid) { int rv; struct passwd *pwd = getpwuid(uid); if (pwd == NULL) { LOG(LOG_LEVEL_ERROR, "No password entry for UID %d", uid); rv = 1; } else { rv = setusercontext(NULL, pwd, uid, LOGIN_SETALL); if (rv != 0) { LOG(LOG_LEVEL_ERROR, "setusercontext(%d) failed [%s]", uid, g_get_strerror()); } } return (rv != 0); /* Return 0 or 1 */ } #endif /*****************************************************************************/ /* does not work in win32 returns pid of process that exits or zero if signal occurred an exit_status struct can optionally be passed in to get the exit status of the child */ int g_waitchild(struct exit_status *e) { #if defined(_WIN32) return 0; #else int wstat; int rv; struct exit_status dummy; if (e == NULL) { e = &dummy; // Set this, then throw it away } e->reason = E_XR_UNEXPECTED; e->val = 0; rv = waitpid(-1, &wstat, WNOHANG); if (rv == -1) { if (errno == EINTR) { /* This shouldn't happen as signal handlers use SA_RESTART */ rv = 0; } } else if (WIFEXITED(wstat)) { e->reason = E_XR_STATUS_CODE; e->val = WEXITSTATUS(wstat); } else if (WIFSIGNALED(wstat)) { e->reason = E_XR_SIGNAL; e->val = WTERMSIG(wstat); } return rv; #endif } /*****************************************************************************/ /* does not work in win32 returns pid of process that exits or <= 0 if no process was found Note that signal handlers are established with BSD-style semantics, so this call is NOT interrupted by a signal */ int g_waitpid(int pid) { #if defined(_WIN32) return 0; #else int rv = 0; if (pid < 0) { rv = -1; } else { rv = waitpid(pid, 0, 0); } return rv; #endif } /*****************************************************************************/ /* does not work in win32 returns exit status code of child process with pid Note that signal handlers are established with BSD-style semantics, so this call is NOT interrupted by a signal */ struct exit_status g_waitpid_status(int pid) { struct exit_status exit_status = {.reason = E_XR_UNEXPECTED, .val = 0}; #if !defined(_WIN32) if (pid > 0) { int rv; int status; LOG(LOG_LEVEL_DEBUG, "waiting for pid %d to exit", pid); rv = waitpid(pid, &status, 0); if (rv != -1) { if (WIFEXITED(status)) { exit_status.reason = E_XR_STATUS_CODE; exit_status.val = WEXITSTATUS(status); } if (WIFSIGNALED(status)) { exit_status.reason = E_XR_SIGNAL; exit_status.val = WTERMSIG(status); } } else { LOG(LOG_LEVEL_WARNING, "wait for pid %d returned unknown result", pid); } } #endif return exit_status; } /*****************************************************************************/ int g_setpgid(int pid, int pgid) { int rv = setpgid(pid, pgid); if (rv < 0) { if (pid == 0) { pid = getpid(); } LOG(LOG_LEVEL_ERROR, "Can't set process group ID of %d to %d [%s]", pid, pgid, g_get_strerror()); } return rv; } /*****************************************************************************/ /* does not work in win32 */ void g_clearenv(void) { #if defined(HAVE_CLEARENV) clearenv(); #elif defined(_WIN32) #elif defined(BSD) extern char **environ; environ[0] = 0; #else extern char **environ; environ = 0; #endif } /*****************************************************************************/ /* does not work in win32 */ int g_setenv(const char *name, const char *value, int rewrite) { #if defined(_WIN32) return 0; #else return setenv(name, value, rewrite); #endif } /*****************************************************************************/ /* does not work in win32 */ char * g_getenv(const char *name) { #if defined(_WIN32) return 0; #else return getenv(name); #endif } /*****************************************************************************/ int g_exit(int exit_code) { exit(exit_code); return 0; } /*****************************************************************************/ int g_getpid(void) { #if defined(_WIN32) return (int)GetCurrentProcessId(); #else return (int)getpid(); #endif } /*****************************************************************************/ /* does not work in win32 */ int g_sigterm(int pid) { #if defined(_WIN32) return 0; #else return kill(pid, SIGTERM); #endif } /*****************************************************************************/ /* does not work in win32 */ int g_sighup(int pid) { #if defined(_WIN32) return 0; #else return kill(pid, SIGHUP); #endif } /*****************************************************************************/ /* returns 0 if ok */ /* the caller is responsible to free the buffs */ /* does not work in win32 */ int g_getuser_info_by_name(const char *username, int *uid, int *gid, char **shell, char **dir, char **gecos) { int rv = 1; #if !defined(_WIN32) if (username == NULL) { LOG(LOG_LEVEL_ERROR, "g_getuser_info_by_name() called for NULL user"); } else { struct passwd *pwd_1 = getpwnam(username); if (pwd_1 != 0) { rv = 0; if (uid != 0) { *uid = pwd_1->pw_uid; } if (gid != 0) { *gid = pwd_1->pw_gid; } if (shell != 0) { *shell = g_strdup(pwd_1->pw_shell); } if (dir != 0) { *dir = g_strdup(pwd_1->pw_dir); } if (gecos != 0) { *gecos = g_strdup(pwd_1->pw_gecos); } } } #endif return rv; } /*****************************************************************************/ /* returns 0 if ok */ /* the caller is responsible to free the buffs */ /* does not work in win32 */ int g_getuser_info_by_uid(int uid, char **username, int *gid, char **shell, char **dir, char **gecos) { #if defined(_WIN32) return 1; #else struct passwd *pwd_1; pwd_1 = getpwuid(uid); if (pwd_1 != 0) { if (username != NULL) { *username = g_strdup(pwd_1->pw_name); } if (gid != 0) { *gid = pwd_1->pw_gid; } if (shell != 0) { *shell = g_strdup(pwd_1->pw_shell); } if (dir != 0) { *dir = g_strdup(pwd_1->pw_dir); } if (gecos != 0) { *gecos = g_strdup(pwd_1->pw_gecos); } return 0; } return 1; #endif } /*****************************************************************************/ /* returns 0 if ok */ /* does not work in win32 */ int g_getgroup_info(const char *groupname, int *gid) { #if defined(_WIN32) return 1; #else struct group *g; g = getgrnam(groupname); if (g != 0) { if (gid != 0) { *gid = g->gr_gid; } return 0; } return 1; #endif } /*****************************************************************************/ #ifdef HAVE_GETGROUPLIST int g_check_user_in_group(const char *username, int gid, int *ok) { int rv = 1; struct passwd *pwd_1 = getpwnam(username); if (pwd_1 != NULL) { // Get number of groups for user // // Some implementations of getgrouplist() (i.e. muslc) don't // allow ngroups to be <1 on entry int ngroups = 1; GETGROUPS_T dummy; getgrouplist(username, pwd_1->pw_gid, &dummy, &ngroups); if (ngroups > 0) // Should always be true { GETGROUPS_T *grouplist; grouplist = (GETGROUPS_T *)malloc(ngroups * sizeof(grouplist[0])); if (grouplist != NULL) { // Now get the actual groups. The number of groups returned // by this call is not necessarily the same as the number // returned by the first call. int allocgroups = ngroups; getgrouplist(username, pwd_1->pw_gid, grouplist, &ngroups); ngroups = MIN(ngroups, allocgroups); rv = 0; *ok = 0; int i; for (i = 0 ; i < ngroups; ++i) { if (grouplist[i] == (GETGROUPS_T)gid) { *ok = 1; break; } } free(grouplist); } } } return rv; } /*****************************************************************************/ #else // HAVE_GETGROUPLIST int g_check_user_in_group(const char *username, int gid, int *ok) { #if defined(_WIN32) return 1; #else int i; struct passwd *pwd_1 = getpwnam(username); struct group *groups = getgrgid(gid); if (pwd_1 == NULL || groups == NULL) { return 1; } if (pwd_1->pw_gid == gid) { *ok = 1; } else { *ok = 0; i = 0; while (0 != groups->gr_mem[i]) { if (0 == g_strcmp(groups->gr_mem[i], username)) { *ok = 1; break; } i++; } } return 0; #endif } #endif // HAVE_GETGROUPLIST /*****************************************************************************/ /* returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds. for windows, returns the number of seconds since the machine was started. */ int g_time1(void) { #if defined(_WIN32) return GetTickCount() / 1000; #else return time(0); #endif } /*****************************************************************************/ /* returns the number of milliseconds since the machine was started. */ int g_time2(void) { #if defined(_WIN32) return (int)GetTickCount(); #else struct tms tm; clock_t num_ticks = 0; g_memset(&tm, 0, sizeof(struct tms)); num_ticks = times(&tm); return (int)(num_ticks * 10); #endif } /*****************************************************************************/ /* returns time in milliseconds, uses gettimeofday does not work in win32 */ int g_time3(void) { #if defined(_WIN32) return 0; #else struct timeval tp; gettimeofday(&tp, 0); return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); #endif } /******************************************************************************/ /******************************************************************************/ struct bmp_magic { char magic[2]; }; struct bmp_hdr { unsigned int size; /* file size in bytes */ unsigned short reserved1; unsigned short reserved2; unsigned int offset; /* offset to image data, in bytes */ }; struct dib_hdr { unsigned int hdr_size; int width; int height; unsigned short nplanes; unsigned short bpp; unsigned int compress_type; unsigned int image_size; int hres; int vres; unsigned int ncolors; unsigned int nimpcolors; }; /******************************************************************************/ int g_save_to_bmp(const char *filename, char *data, int stride_bytes, int width, int height, int depth, int bits_per_pixel) { struct bmp_magic bm; struct bmp_hdr bh; struct dib_hdr dh; int bytes; int fd; int index; int i1; int pixel; int extra; int file_stride_bytes; char *line; char *line_ptr; if ((depth == 24) && (bits_per_pixel == 32)) { } else if ((depth == 32) && (bits_per_pixel == 32)) { } else { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: unimplemented for: depth %d, bits_per_pixel %d", depth, bits_per_pixel); return 1; } bm.magic[0] = 'B'; bm.magic[1] = 'M'; /* scan lines are 32 bit aligned, bottom 2 bits must be zero */ file_stride_bytes = width * ((depth + 7) / 8); extra = file_stride_bytes; extra = extra & 3; extra = (4 - extra) & 3; file_stride_bytes += extra; bh.size = sizeof(bm) + sizeof(bh) + sizeof(dh) + height * file_stride_bytes; bh.reserved1 = 0; bh.reserved2 = 0; bh.offset = sizeof(bm) + sizeof(bh) + sizeof(dh); dh.hdr_size = sizeof(dh); dh.width = width; dh.height = height; dh.nplanes = 1; dh.bpp = depth; dh.compress_type = 0; dh.image_size = height * file_stride_bytes; dh.hres = 0xb13; dh.vres = 0xb13; dh.ncolors = 0; dh.nimpcolors = 0; fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (fd == -1) { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: open error"); return 1; } bytes = write(fd, &bm, sizeof(bm)); if (bytes != sizeof(bm)) { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: write error"); } bytes = write(fd, &bh, sizeof(bh)); if (bytes != sizeof(bh)) { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: write error"); } bytes = write(fd, &dh, sizeof(dh)); if (bytes != sizeof(dh)) { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: write error"); } data += stride_bytes * height; data -= stride_bytes; if ((depth == 24) && (bits_per_pixel == 32)) { line = (char *) malloc(file_stride_bytes); memset(line, 0, file_stride_bytes); for (index = 0; index < height; index++) { line_ptr = line; for (i1 = 0; i1 < width; i1++) { pixel = ((int *)data)[i1]; *(line_ptr++) = (pixel >> 0) & 0xff; *(line_ptr++) = (pixel >> 8) & 0xff; *(line_ptr++) = (pixel >> 16) & 0xff; } bytes = write(fd, line, file_stride_bytes); if (bytes != file_stride_bytes) { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: write error"); } data -= stride_bytes; } free(line); } else if (depth == bits_per_pixel) { for (index = 0; index < height; index++) { bytes = write(fd, data, width * (bits_per_pixel / 8)); if (bytes != width * (bits_per_pixel / 8)) { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: write error"); } data -= stride_bytes; } } else { LOG(LOG_LEVEL_ERROR, "g_save_to_bpp: unimplemented for: depth %d, bits_per_pixel %d", depth, bits_per_pixel); } close(fd); return 0; } /*****************************************************************************/ /* returns pointer or nil on error */ void * g_shmat(int shmid) { #if defined(_WIN32) return 0; #else return shmat(shmid, 0, 0); #endif } /*****************************************************************************/ /* returns -1 on error 0 on success */ int g_shmdt(const void *shmaddr) { #if defined(_WIN32) return -1; #else return shmdt(shmaddr); #endif } /*****************************************************************************/ /* returns -1 on error 0 on success */ int g_gethostname(char *name, int len) { return gethostname(name, len); } static unsigned char g_reverse_byte[0x100] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff }; /*****************************************************************************/ /* mirror each byte while copying */ int g_mirror_memcpy(void *dst, const void *src, int len) { tui8 *dst8; const tui8 *src8; dst8 = (tui8 *) dst; src8 = (const tui8 *) src; while (len > 0) { *dst8 = g_reverse_byte[*src8]; dst8++; src8++; len--; } return 0; } /*****************************************************************************/ int g_tcp4_socket(void) { #if defined(XRDP_ENABLE_IPV6ONLY) return -1; #else int rv; int option_value; socklen_t option_len; rv = socket(AF_INET, SOCK_STREAM, 0); if (rv < 0) { return -1; } option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); if (setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, option_len) < 0) { } } } return rv; #endif } /*****************************************************************************/ int g_tcp4_bind_address(int sck, const char *port, const char *address) { #if defined(XRDP_ENABLE_IPV6ONLY) return -1; #else struct sockaddr_in s; memset(&s, 0, sizeof(s)); s.sin_family = AF_INET; s.sin_addr.s_addr = htonl(INADDR_ANY); s.sin_port = htons((uint16_t) atoi(port)); if (inet_aton(address, &s.sin_addr) < 0) { return -1; /* bad address */ } if (bind(sck, (struct sockaddr *) &s, sizeof(s)) < 0) { return -1; } return 0; #endif } /*****************************************************************************/ int g_tcp6_socket(void) { #if defined(XRDP_ENABLE_IPV6) int rv; int option_value; socklen_t option_len; rv = socket(AF_INET6, SOCK_STREAM, 0); if (rv < 0) { return -1; } option_len = sizeof(option_value); if (getsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &option_value, &option_len) == 0) { #if defined(XRDP_ENABLE_IPV6ONLY) if (option_value == 0) { option_value = 1; #else if (option_value != 0) { option_value = 0; #endif option_len = sizeof(option_value); if (setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &option_value, option_len) < 0) { } } } option_len = sizeof(option_value); if (getsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, &option_len) == 0) { if (option_value == 0) { option_value = 1; option_len = sizeof(option_value); if (setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *) &option_value, option_len) < 0) { } } } return rv; #else return -1; #endif } /*****************************************************************************/ int g_tcp6_bind_address(int sck, const char *port, const char *address) { #if defined(XRDP_ENABLE_IPV6) int rv; int error; struct addrinfo hints; struct addrinfo *list; struct addrinfo *i; rv = -1; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_flags = 0; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; error = getaddrinfo(address, port, &hints, &list); if (error == 0) { i = list; while ((i != NULL) && (rv < 0)) { rv = bind(sck, i->ai_addr, i->ai_addrlen); i = i->ai_next; } freeaddrinfo(list); } else { return -1; } return rv; #else return -1; #endif } /*****************************************************************************/ /* returns error, zero is success, non zero is error */ /* only works in linux */ int g_no_new_privs(void) { #if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_NO_NEW_PRIVS) /* * PR_SET_NO_NEW_PRIVS requires Linux kernel 3.5 and newer. */ return prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); #else return 0; #endif } /*****************************************************************************/ void g_qsort(void *base, size_t nitems, size_t size, int (*compar)(const void *, const void *)) { qsort(base, nitems, size, compar); } xrdp-0.10.1/common/Makefile.in000644 001751 000000 00000065254 14652432075 016207 0ustar00metawheel000000 000000 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = : build_triplet = @build@ host_triplet = @host@ subdir = common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/ax_type_socklen_t.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config_ac.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(module_LTLIBRARIES) am__DEPENDENCIES_1 = libcommon_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__libcommon_la_SOURCES_DIST = arch.h base64.h base64.c defines.h \ fifo.c fifo.h file.c file.h guid.c guid.h list.c list.h \ list16.c list16.h log.c log.h os_calls.c os_calls.h parse.c \ parse.h rail.h ssl_calls.c ssl_calls.h string_calls.c \ string_calls.h thread_calls.c thread_calls.h trans.c trans.h \ unicode_defines.h pixman-region16.c pixman-region.h @XRDP_PIXMAN_FALSE@am__objects_1 = pixman-region16.lo am_libcommon_la_OBJECTS = base64.lo fifo.lo file.lo guid.lo list.lo \ list16.lo log.lo os_calls.lo parse.lo ssl_calls.lo \ string_calls.lo thread_calls.lo trans.lo $(am__objects_1) libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/base64.Plo ./$(DEPDIR)/fifo.Plo \ ./$(DEPDIR)/file.Plo ./$(DEPDIR)/guid.Plo ./$(DEPDIR)/list.Plo \ ./$(DEPDIR)/list16.Plo ./$(DEPDIR)/log.Plo \ ./$(DEPDIR)/os_calls.Plo ./$(DEPDIR)/parse.Plo \ ./$(DEPDIR)/pixman-region16.Plo ./$(DEPDIR)/ssl_calls.Plo \ ./$(DEPDIR)/string_calls.Plo ./$(DEPDIR)/thread_calls.Plo \ ./$(DEPDIR)/trans.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libcommon_la_SOURCES) DIST_SOURCES = $(am__libcommon_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(include_HEADERS) 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__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTHMOD_LIB = @AUTHMOD_LIB@ AUTHMOD_OBJ = @AUTHMOD_OBJ@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHECK_CFLAGS = @CHECK_CFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CMOCKA_CFLAGS = @CMOCKA_CFLAGS@ CMOCKA_LIBS = @CMOCKA_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FDKAAC_CFLAGS = @FDKAAC_CFLAGS@ FDKAAC_LIBS = @FDKAAC_LIBS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FREERDP_CFLAGS = @FREERDP_CFLAGS@ FREERDP_LIBS = @FREERDP_LIBS@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ FUSE_CFLAGS = @FUSE_CFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GREP = @GREP@ IMLIB2_CFLAGS = @IMLIB2_CFLAGS@ IMLIB2_LIBS = @IMLIB2_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PAM_RULES = @PAM_RULES@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TurboJpegIncDir = @TurboJpegIncDir@ TurboJpegLibDir = @TurboJpegLibDir@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pamconfdir = @pamconfdir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ socketdir = @socketdir@ srcdir = @srcdir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @XRDP_PIXMAN_FALSE@PIXMAN_SOURCES = pixman-region16.c pixman-region.h @XRDP_PIXMAN_TRUE@PIXMAN_SOURCES = EXTRA_DIST = pixman-region.c include_HEADERS = \ ms-erref.h \ ms-fscc.h \ ms-rdpbcgr.h \ ms-rdpeclip.h \ ms-rdpefs.h \ ms-rdpegdi.h \ ms-rdpele.h \ ms-rdperp.h \ ms-rdpedisp.h \ ms-smb2.h \ xrdp_client_info.h \ xrdp_constants.h \ xrdp_rail.h \ xrdp_sockets.h AM_CPPFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_LOG_PATH=\"${localstatedir}/log\" # -no-suppress is an automake-specific flag which is needed # to prevent us missing compiler errors in some circumstances # (see https://github.com/neutrinolabs/xrdp/pull/1843 ) AM_CFLAGS = -no-suppress $(OPENSSL_CFLAGS) module_LTLIBRARIES = \ libcommon.la libcommon_la_SOURCES = \ arch.h \ base64.h \ base64.c \ defines.h \ fifo.c \ fifo.h \ file.c \ file.h \ guid.c \ guid.h \ list.c \ list.h \ list16.c \ list16.h \ log.c \ log.h \ os_calls.c \ os_calls.h \ parse.c \ parse.h \ rail.h \ ssl_calls.c \ ssl_calls.h \ string_calls.c \ string_calls.h \ thread_calls.c \ thread_calls.h \ trans.c \ trans.h \ unicode_defines.h \ $(PIXMAN_SOURCES) libcommon_la_LIBADD = \ -lpthread \ $(OPENSSL_LIBS) \ $(DLOPEN_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -$(am__rm_f) $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) -rpath $(moduledir) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guid.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list16.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os_calls.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-region16.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssl_calls.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_calls.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_calls.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trans.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) 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" 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(includedir)"; 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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/base64.Plo -rm -f ./$(DEPDIR)/fifo.Plo -rm -f ./$(DEPDIR)/file.Plo -rm -f ./$(DEPDIR)/guid.Plo -rm -f ./$(DEPDIR)/list.Plo -rm -f ./$(DEPDIR)/list16.Plo -rm -f ./$(DEPDIR)/log.Plo -rm -f ./$(DEPDIR)/os_calls.Plo -rm -f ./$(DEPDIR)/parse.Plo -rm -f ./$(DEPDIR)/pixman-region16.Plo -rm -f ./$(DEPDIR)/ssl_calls.Plo -rm -f ./$(DEPDIR)/string_calls.Plo -rm -f ./$(DEPDIR)/thread_calls.Plo -rm -f ./$(DEPDIR)/trans.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-moduleLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: 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 ./$(DEPDIR)/base64.Plo -rm -f ./$(DEPDIR)/fifo.Plo -rm -f ./$(DEPDIR)/file.Plo -rm -f ./$(DEPDIR)/guid.Plo -rm -f ./$(DEPDIR)/list.Plo -rm -f ./$(DEPDIR)/list16.Plo -rm -f ./$(DEPDIR)/log.Plo -rm -f ./$(DEPDIR)/os_calls.Plo -rm -f ./$(DEPDIR)/parse.Plo -rm -f ./$(DEPDIR)/pixman-region16.Plo -rm -f ./$(DEPDIR)/ssl_calls.Plo -rm -f ./$(DEPDIR)/string_calls.Plo -rm -f ./$(DEPDIR)/thread_calls.Plo -rm -f ./$(DEPDIR)/trans.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-moduleLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-moduleLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-moduleLTLIBRARIES 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 mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ uninstall-moduleLTLIBRARIES .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% xrdp-0.10.1/common/log.h000644 001751 000000 00000033543 14652432047 015067 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef LOG_H #define LOG_H #include #include "arch.h" #include "defines.h" #include "list.h" /* Check the config_ac.h file is included so we know whether to enable the * development macros */ #ifndef CONFIG_AC_H # error config_ac.h not visible in log.h #endif /* logging buffer size */ #define LOG_BUFFER_SIZE 8192 #define LOGGER_NAME_SIZE 50 /* logging levels */ enum logLevels { LOG_LEVEL_ALWAYS = 0, LOG_LEVEL_ERROR, /* for describing non-recoverable error states in a request or method */ LOG_LEVEL_WARNING, /* for describing recoverable error states in a request or method */ LOG_LEVEL_INFO, /* for low verbosity and high level descriptions of normal operations */ LOG_LEVEL_DEBUG, /* for medium verbosity and low level descriptions of normal operations */ LOG_LEVEL_TRACE, /* for high verbosity and low level descriptions of normal operations (eg. method or wire tracing) */ LOG_LEVEL_NEVER, }; /* startup return values */ enum logReturns { LOG_STARTUP_OK = 0, LOG_ERROR_MALLOC, LOG_ERROR_NULL_FILE, LOG_ERROR_FILE_OPEN, LOG_ERROR_NO_CFG, LOG_ERROR_FILE_NOT_OPEN, LOG_GENERAL_ERROR }; #define SESMAN_CFG_LOGGING "Logging" #define SESMAN_CFG_LOGGING_LOGGER "LoggingPerLogger" #define SESMAN_CFG_LOG_FILE "LogFile" #define SESMAN_CFG_LOG_LEVEL "LogLevel" #define SESMAN_CFG_LOG_ENABLE_CONSOLE "EnableConsole" #define SESMAN_CFG_LOG_CONSOLE_LEVEL "ConsoleLevel" #define SESMAN_CFG_LOG_ENABLE_SYSLOG "EnableSyslog" #define SESMAN_CFG_LOG_SYSLOG_LEVEL "SyslogLevel" #define SESMAN_CFG_LOG_ENABLE_PID "EnableProcessId" /* enable threading */ /*#define LOG_ENABLE_THREAD*/ #ifdef USE_DEVEL_LOGGING #define LOG_PER_LOGGER_LEVEL /** * @brief Logging macro for messages that are for an XRDP developer to * understand and debug XRDP code. * * Note: all log levels are relevant to help a developer understand XRDP at * different levels of granularity. * * Note: the logging function calls are removed when USE_DEVEL_LOGGING is * NOT defined. * * Note: when the build is configured with --enable-devel-logging, then * the log level can be configured per the source file name or method name * (with the suffix "()") in the [LoggingPerLogger] * section of the configuration file. * * For example: * ``` * [LoggingPerLogger] * xrdp.c=DEBUG * main()=WARNING * ``` * * @param lvl, the log level * @param msg, the log text as a printf format c-string * @param ... the arguments for the printf format c-string */ #define LOG_DEVEL(log_level, args...) \ log_message_with_location(__func__, __FILE__, __LINE__, log_level, args) /** * @brief Logging macro for messages that are for a system administrator to * configure and run XRDP on their machine. * * Note: the logging function calls contain additional code location info when * USE_DEVEL_LOGGING is defined. * * @param lvl, the log level * @param msg, the log text as a printf format c-string * @param ... the arguments for the printf format c-string */ #define LOG(log_level, args...) \ log_message_with_location(__func__, __FILE__, __LINE__, log_level, args) /** * @brief Logging macro for logging the contents of a byte array using a hex * dump format. * * Note: the logging function calls are removed when USE_DEVEL_LOGGING is * NOT defined. * * @param log_level, the log level * @param message, a message prefix for the hex dump. Note: no printf like * formatting is done to this message. * @param buffer, a pointer to the byte array to log as a hex dump * @param length, the length of the byte array to log */ #define LOG_DEVEL_HEXDUMP(log_level, message, buffer, length) \ log_hexdump_with_location(__func__, __FILE__, __LINE__, log_level, message, buffer, length) /** * @brief Logging macro for logging the contents of a byte array using a hex * dump format. * * @param log_level, the log level * @param message, a message prefix for the hex dump. Note: no printf like * formatting is done to this message. * @param buffer, a pointer to the byte array to log as a hex dump * @param length, the length of the byte array to log */ #define LOG_HEXDUMP(log_level, message, buffer, length) \ log_hexdump_with_location(__func__, __FILE__, __LINE__, log_level, message, buffer, length) #define LOG_DEVEL_LEAKING_FDS(exe,min,max) log_devel_leaking_fds(exe,min,max) #else #define LOG(log_level, args...) log_message(log_level, args) #define LOG_HEXDUMP(log_level, message, buffer, length) \ log_hexdump(log_level, message, buffer, length) /* Since log_message() returns a value ensure that the elided versions of * LOG_DEVEL and LOG_DEVEL_HEXDUMP also "fake" returning the success value */ #define LOG_DEVEL(log_level, args...) UNUSED_VAR(LOG_STARTUP_OK) #define LOG_DEVEL_HEXDUMP(log_level, message, buffer, length) UNUSED_VAR(LOG_STARTUP_OK) #define LOG_DEVEL_LEAKING_FDS(exe,min,max) #endif /* Flags values for log_start() */ /** * Dump the log config on startup */ #define LOG_START_DUMP_CONFIG (1<<0) /** * Restart the logging system. * * On a restart, existing files are not closed. This is because the * files may be shared by sub-processes, and the result will not be what the * user expects */ #define LOG_START_RESTART (1<<1) #ifdef LOG_PER_LOGGER_LEVEL enum log_logger_type { LOG_TYPE_FILE = 0, LOG_TYPE_FUNCTION, }; struct log_logger_level { enum logLevels log_level; enum log_logger_type logger_type; char logger_name[LOGGER_NAME_SIZE + 1]; }; #endif struct log_config { const char *program_name; /* Pointer to static storage */ char *log_file; /* Dynamically allocated */ int fd; enum logLevels log_level; int enable_console; enum logLevels console_level; int enable_syslog; enum logLevels syslog_level; #ifdef LOG_PER_LOGGER_LEVEL struct list *per_logger_level; #endif int dump_on_start; int enable_pid; #ifdef LOG_ENABLE_THREAD pthread_mutex_t log_lock; pthread_mutexattr_t log_lock_attr; #endif }; /* internal functions, only used in log.c if this ifdef is defined.*/ #ifdef LOGINTERNALSTUFF /** * * @brief Starts the logging subsystem * @param l_cfg logging system configuration * @return * */ enum logReturns internal_log_start(struct log_config *l_cfg); /** * * @brief Shuts down the logging subsystem * @param l_cfg pointer to the logging subsystem to stop * */ enum logReturns internal_log_end(struct log_config *l_cfg); /** * Converts a log level to a string * @param lvl, the loglevel * @param str pointer where the string will be stored. */ void internal_log_lvl2str(const enum logLevels lvl, char *str); /** * * @brief Converts a string to a log level * @param s The string to convert * @return The corresponding level or LOG_LEVEL_DEBUG if error * */ enum logLevels internal_log_text2level(const char *buf); /** * A function that init our struct that holds all state and * also init its content. * @return LOG_STARTUP_OK or LOG_ERROR_MALLOC */ struct log_config * internalInitAndAllocStruct(void); /** * Print the contents of the logging config to stdout. */ void internal_log_config_dump(struct log_config *config); /** * the log function that all files use to log an event. * @param lvl, the loglevel * @param override_destination_level, if true then the destination log level is not used * @param override_log_level, the loglevel instead of the destination log level if override_destination_level is true * @param msg, the logtext. * @param ap, the values for the message format arguments * @return */ enum logReturns internal_log_message(const enum logLevels lvl, const bool_t override_destination_level, const enum logLevels override_log_level, const char *msg, va_list ap); /** * @param log_level, the log level * @param override_destination_level, if true then the destination log level is ignored. * @param override_log_level, the log level to use instead of the destination log level * if override_destination_level is true * @return true if at least one log destination will accept a message logged at the given level. */ bool_t internal_log_is_enabled_for_level(const enum logLevels log_level, const bool_t override_destination_level, const enum logLevels override_log_level); /** * @param function_name, the function name (typically the __func__ macro) * @param file_name, the file name (typically the __FILE__ macro) * @param[out] log_level_return, the log level to use instead of the destination log level * @return true if the logger location overrides the destination log levels */ bool_t internal_log_location_overrides_level(const char *function_name, const char *file_name, enum logLevels *log_level_return); /*End of internal functions*/ #endif /** * This function initialize the log facilities according to the configuration * file, that is described by the in parameter. * @param iniFile * @param applicationName the name that is used in the log for the running * application * @param flags Flags to affect the operation of the call * @return LOG_STARTUP_OK on success */ enum logReturns log_start(const char *iniFile, const char *applicationName, unsigned int flags); /** * An alternative log_start where the caller gives the params directly. * @param config * @return * * @post to avoid memory leaks, the config argument must be free'ed using * `log_config_free()` */ enum logReturns log_start_from_param(const struct log_config *src_log_config); /** * Sets up a suitable log config for writing to the console only * (i.e. for a utility) * * The config can be customised by the caller before calling * log_start_from_param() * * @param Default log level * @param Log level name, or NULL. This can be used to provide an * override to the default log level, by environment variable or * argument. * * @return pointer to struct log_config. */ struct log_config * log_config_init_for_console(enum logLevels lvl, const char *override_name); /** * Read configuration from a file and store the values in the returned * log_config. * @param file * @param applicationName, the application name used in the log events. * @param section_prefix, prefix for the logging sections to parse * @return */ struct log_config * log_config_init_from_config(const char *iniFilename, const char *applicationName, const char *section_prefix); /** * Free the memory for the log_config struct. */ enum logReturns log_config_free(struct log_config *config); /** * Function that terminates all logging * @return */ enum logReturns log_end(void); /** * the log function that all files use to log an event. * * Please prefer to use the LOG and LOG_DEVEL macros instead of this function directly. * * @param lvl, the loglevel * @param msg, the logtext. * @param ... * @return */ enum logReturns log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3); enum logReturns log_hexdump(const enum logLevels log_level, const char *msg, const char *p, int len); /** * the log function that all files use to log an event, * with the function name and file line. * * Please prefer to use the LOG and LOG_DEVEL macros instead of this function directly. * * @param function_name, the function name (typically the __func__ macro) * @param file_name, the file name (typically the __FILE__ macro) * @param line_number, the line number in the file (typically the __LINE__ macro) * @param lvl, the loglevel * @param msg, the logtext. * @param ... * @return */ enum logReturns log_message_with_location(const char *function_name, const char *file_name, const int line_number, const enum logLevels lvl, const char *msg, ...) printflike(5, 6); enum logReturns log_hexdump_with_location(const char *function_name, const char *file_name, const int line_number, const enum logLevels log_level, const char *msg, const char *p, int len); /** * This function returns the configured file name for the logfile * @param replybuf the buffer where the reply is stored * @param bufsize how big is the reply buffer. * @return */ char *getLogFile(char *replybuf, int bufsize); /** * Returns formatted datetime for log * @return */ char *getFormattedDateTime(char *replybuf, int bufsize); #ifdef USE_DEVEL_LOGGING /** * Log open file descriptors not cloexec before execing another program * * Used to ensure file descriptors aren't leaking when running * non-privileged executables * * Use the LOG_DEVEL_LEAKING_FDS() macro to invoke this function * * @param exe Executable we're about to launch * @param min Minimum FD to consider * @param max Maximum FD to consider + 1, or -1 for no upper FD */ void log_devel_leaking_fds(const char *exe, int min, int max); #endif #endif xrdp-0.10.1/common/fifo.h000644 001751 000000 00000004714 14652432047 015227 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Laxmikant Rashinkar 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file common/fifo.h * @brief Fifo for storing generic pointers * * Declares an unbounded FIFO-queue for void * pointers */ #ifndef _FIFO_H #define _FIFO_H struct fifo; /** * Function used by fifo_clear()/fifo_delete() to destroy items * * @param item Item being deleted * @param closure Additional argument to function * * Use this function to free any allocated storage (e.g. if the items * are dynamically allocated) */ typedef void (*fifo_item_destructor)(void *item, void *closure); /** * Create new fifo * * @param item_destructor Destructor for fifo items, or NULL for none * @return fifo, or NULL if no memory */ struct fifo * fifo_create(fifo_item_destructor item_destructor); /** * Delete an existing fifo * * Any existing entries on the fifo are passed in order to the * item destructor specified when the fifo was created. * * @param self fifo to delete (may be NULL) * @param closure Additional parameter for fifo item destructor */ void fifo_delete(struct fifo *self, void *closure); /** * Clear(empty) an existing fifo * * Any existing entries on the fifo are passed in order to the * item destructor specified when the fifo was created. * * @param self fifo to clear (may be NULL) * @param closure Additional parameter for fifo item destructor */ void fifo_clear(struct fifo *self, void *closure); /** Add an item to a fifo * @param self fifo * @param item Item to add * @return 1 if successful, 0 for no memory, or tried to add NULL */ int fifo_add_item(struct fifo *self, void *item); /** Remove an item from a fifo * @param self fifo * @return item if successful, NULL for no items in FIFO */ void * fifo_remove_item(struct fifo *self); /** Is fifo empty? * * @param self fifo * @return 1 if fifo is empty, 0 if not */ int fifo_is_empty(struct fifo *self); #endif xrdp-0.10.1/common/unicode_defines.h000644 001751 000000 00000006003 14652432047 017420 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2023 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file common/unicode_defines.h * * Defines used internally by the implementations of the Unicode routines */ #if !defined(UNICODE_DEFINES_H) #define UNICODE_DEFINES_H /** * Is this byte a valid UTF-8 continuation character? */ #define IS_VALID_CONTINUATION_CHAR(c) ((c) >= 0x80 && (c) < 0xc0) /** * Is this character one of the end-of-plane non-characters? * * These are U+xFFFE and U+xFFFF for x in (0..10} */ #define IS_PLANE_END_NON_CHARACTER(c32) (((c32) & 0xfffe) == 0xfffe) /** * Is this character one of the additional non-characters? * * 32 additional non-charactersare defined in the * "Arabic Presentation Forms-A" Unicode block */ #define IS_ARABIC_NON_CHARACTER(c32) ((c32) >= 0xfdd0 && (c32) <= 0xfdef) // Invalid characters, based on UTF-8 decoding range // // By 'invalid' we mean characters that should not be encoded or // decoded when switching between UTF-8 and UTF-32 // // See "UTF-8 decoder capability and stress test" Markus Kuhn 2015-08-28 #define INVALID_UNICODE_0_TO_7F(c) (0) // No invalid characters #define INVALID_UNICODE_80_TO_7FF(c) (0) // No invalid characters #define INVALID_UNICODE_800_TO_FFFF(c) \ (((c) >= 0xd800 && (c) <= 0xdfff) || /* Surrogate pairs */ \ IS_ARABIC_NON_CHARACTER(c) || \ IS_PLANE_END_NON_CHARACTER(c)) #define INVALID_UNICODE_10000_TO_1FFFFF(c) \ (IS_PLANE_END_NON_CHARACTER(c) || (c) > 0x10ffff) // Returns true for all 'invalid' Unicode chars #define INVALID_UNICODE(c) \ ( \ INVALID_UNICODE_0_TO_7F(c) || \ INVALID_UNICODE_80_TO_7FF(c) || \ INVALID_UNICODE_800_TO_FFFF(c) || \ INVALID_UNICODE_10000_TO_1FFFFF(c) \ ) /** * Is this character a UTF-16 high surrogate? */ #define IS_HIGH_SURROGATE(u16) (((u16) & 0xfc00) == 0xd800) /** * Is this character a UTF-16 low surrogate? */ #define IS_LOW_SURROGATE(u16) (((u16) & 0xfc00) == 0xdc00) /** * Extract the UTF-16 high surrogate from a character */ #define HIGH_SURROGATE_FROM_C32(c32) \ (((((c32) - 0x10000) >> 10) & 0x3ff) | 0xd800) /** * Extract the UTF-16 low surrogate from a character */ #define LOW_SURROGATE_FROM_C32(c32) (((c32) & 0x3ff) | 0xdc00) /** * Reconstruct a character from a UTF-16 surrogate pair * * This macro cannot return values higher than 0x10ffff */ #define C32_FROM_SURROGATE_PAIR(low,high) \ ((char32_t)(((high) & 0x3ff) << 10) + ((low) & 0x3ff) + 0x10000) #endif // UNICODE_DEFINES_H xrdp-0.10.1/common/thread_calls.c000644 001751 000000 00000011732 14652432047 016722 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * thread calls */ #if defined(HAVE_CONFIG_H) #include #endif #if defined(_WIN32) #include #elif defined(__APPLE__) #include #include #include #else #include #include #endif #include "arch.h" #include "thread_calls.h" #include "os_calls.h" /*****************************************************************************/ /* returns error */ #if defined(_WIN32) int tc_thread_create(unsigned long (__stdcall *start_routine)(void *), void *arg) { int rv = 0; DWORD thread_id = 0; HANDLE thread = (HANDLE)0; /* CreateThread returns handle or zero on error */ thread = CreateThread(0, 0, start_routine, arg, 0, &thread_id); rv = !thread; CloseHandle(thread); return rv; } #else int tc_thread_create(void *(* start_routine)(void *), void *arg) { int rv = 0; pthread_t thread = (pthread_t)0; g_memset(&thread, 0x00, sizeof(pthread_t)); /* pthread_create returns error */ rv = pthread_create(&thread, 0, start_routine, arg); if (!rv) { rv = pthread_detach(thread); } return rv; } #endif /*****************************************************************************/ tbus tc_get_threadid(void) { #if defined(_WIN32) return (tbus)GetCurrentThreadId(); #else return (tbus)pthread_self(); #endif } /*****************************************************************************/ /* returns boolean */ int tc_threadid_equal(tbus tid1, tbus tid2) { #if defined(_WIN32) return tid1 == tid2; #else return pthread_equal((pthread_t)tid1, (pthread_t)tid2); #endif } /*****************************************************************************/ tbus tc_mutex_create(void) { #if defined(_WIN32) return (tbus)CreateMutex(0, 0, 0); #else pthread_mutex_t *lmutex; lmutex = (pthread_mutex_t *)g_malloc(sizeof(pthread_mutex_t), 0); pthread_mutex_init(lmutex, 0); return (tbus)lmutex; #endif } /*****************************************************************************/ void tc_mutex_delete(tbus mutex) { #if defined(_WIN32) CloseHandle((HANDLE)mutex); #else pthread_mutex_t *lmutex; lmutex = (pthread_mutex_t *)mutex; pthread_mutex_destroy(lmutex); g_free(lmutex); #endif } /*****************************************************************************/ int tc_mutex_lock(tbus mutex) { #if defined(_WIN32) WaitForSingleObject((HANDLE)mutex, INFINITE); return 0; #else pthread_mutex_lock((pthread_mutex_t *)mutex); return 0; #endif } /*****************************************************************************/ int tc_mutex_unlock(tbus mutex) { int rv = 0; #if defined(_WIN32) ReleaseMutex((HANDLE)mutex); #else if (mutex != 0) { rv = pthread_mutex_unlock((pthread_mutex_t *)mutex); } #endif return rv; } /*****************************************************************************/ tbus tc_sem_create(int init_count) { #if defined(_WIN32) HANDLE sem; sem = CreateSemaphore(0, init_count, init_count + 10, 0); return (tbus)sem; #elif defined(__APPLE__) dispatch_semaphore_t sem = dispatch_semaphore_create(init_count); return (tbus)sem; #else sem_t *sem = (sem_t *)NULL; sem = (sem_t *)g_malloc(sizeof(sem_t), 0); sem_init(sem, 0, init_count); return (tbus)sem; #endif } /*****************************************************************************/ void tc_sem_delete(tbus sem) { #if defined(_WIN32) CloseHandle((HANDLE)sem); #elif defined(__APPLE__) dispatch_release((dispatch_semaphore_t)sem); #else sem_t *lsem; lsem = (sem_t *)sem; sem_destroy(lsem); g_free(lsem); #endif } /*****************************************************************************/ int tc_sem_dec(tbus sem) { #if defined(_WIN32) WaitForSingleObject((HANDLE)sem, INFINITE); return 0; #elif defined(__APPLE__) dispatch_semaphore_wait((dispatch_semaphore_t)sem, DISPATCH_TIME_FOREVER); return 0; #else sem_wait((sem_t *)sem); return 0; #endif } /*****************************************************************************/ int tc_sem_inc(tbus sem) { #if defined(_WIN32) ReleaseSemaphore((HANDLE)sem, 1, 0); return 0; #elif defined(__APPLE__) dispatch_semaphore_signal((dispatch_semaphore_t)sem); return 0; #else sem_post((sem_t *)sem); return 0; #endif } xrdp-0.10.1/common/base64.h000644 001751 000000 00000005723 14652432047 015371 0ustar00metawheel000000 000000 /** * Copyright (C) 2021 Koichiro Iwao, all xrdp contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file common/base64.h * @brief Base64 encoder / decoder * * Base-64 is described in RFC4648. The following notes apply to this * implementation:- * - The only supported characters are [A-Za-z0-9+/=]. At present, * embedded linefeeds and URL encodings are not supported. * */ #if !defined(BASE64_CALLS_H) #define BASE64_CALLS_H #include "arch.h" /* * Decodes a base64 string * * @param src Pointer to null-terminated source * @param dst Pointer to output buffer * @param dst_len Length of above. No more than this is written to the * output buffer * @param actual_len Pointer to value to receive actual length of decoded data * @return 0 for success, 1 for an invalid input string * * The following notes apply to this implementation:- * - Embedded padding is supported, provided it only occurs at the end * of a quantum as described in RFC4648(4). This allows concatenated * encodings to be fed into the decoder. * - Padding of the last quantum is assumed if not provided. * - Excess padding of the last quantum is ignored. * * Only dst_len bytes at most are written to the output. The length * returned in actual_len however represents how much buffer is needed for * a correct result. This may be more than dst_len, and enables the caller * to detect a potential buffer overflow */ int base64_decode(const char *src, char *dst, size_t dst_len, size_t *actual_len); /* * Encodes a buffer as base64 * * @param src Pointer to source * @param src_len Length of above. * @param dst Pointer to output buffer for null-terminated string * @param dst_len Length of above. No more than this is written to the * output buffer * @return Number of source characters processed * * The following notes apply to this implementation:- * - Padding of the last quantum is always written if the number of * source bytes is not divisible by 3. * * The number of source characters processed is always returned. If * the destination buffer is too small for all the output plus a * terminator, the returned value from this procedure will be less than * src_len. In this case no padding characters will have been written, * and the remaining characters can be converted with more calls to * this procedure. */ size_t base64_encode(const char *src, size_t src_len, char *dst, size_t dst_len); #endif /* BASE64_CALLS_H */ xrdp-0.10.1/common/ms-smb2.h000644 001751 000000 00000005423 14652432047 015562 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-SMB2 : Definitions from [MS-SMB2] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-SMB2 are currently correct for v20190923 of that * document */ #if !defined(MS_SMB2_H) #define MS_SMB2_H /* SMB2 CREATE request values (section 2.2.13) */ /* * ShareAccess Mask. Currently, this is referred * to in MS-RDPEFS 2.2.1.4.1 as 'SharedAccess' rather than 'ShareAccess'. */ #define SA_FILE_SHARE_READ 0x00000001 #define SA_FILE_SHARE_WRITE 0x00000002 #define SA_FILE_SHARE_DELETE 0x00000004 /* CreateDisposition Mask */ #define CD_FILE_SUPERSEDE 0x00000000 #define CD_FILE_OPEN 0x00000001 #define CD_FILE_CREATE 0x00000002 #define CD_FILE_OPEN_IF 0x00000003 #define CD_FILE_OVERWRITE 0x00000004 #define CD_FILE_OVERWRITE_IF 0x00000005 /* CreateOptions Mask */ enum CREATE_OPTIONS { CO_FILE_DIRECTORY_FILE = 0x00000001, CO_FILE_WRITE_THROUGH = 0x00000002, CO_FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020, CO_FILE_DELETE_ON_CLOSE = 0x00001000 }; /* * DesiredAccess Mask (section 2.2.13.1.1) */ #define DA_FILE_READ_DATA 0x00000001 #define DA_FILE_WRITE_DATA 0x00000002 #define DA_FILE_APPEND_DATA 0x00000004 #define DA_FILE_READ_EA 0x00000008 /* rd extended attributes */ #define DA_FILE_WRITE_EA 0x00000010 /* wr extended attributes */ #define DA_FILE_EXECUTE 0x00000020 #define DA_FILE_READ_ATTRIBUTES 0x00000080 #define DA_FILE_WRITE_ATTRIBUTES 0x00000100 #define DA_DELETE 0x00010000 #define DA_READ_CONTROL 0x00020000 /* rd security descriptor */ #define DA_WRITE_DAC 0x00040000 #define DA_WRITE_OWNER 0x00080000 #define DA_SYNCHRONIZE 0x00100000 #define DA_ACCESS_SYSTEM_SECURITY 0x01000000 #define DA_MAXIMUM_ALLOWED 0x02000000 #define DA_GENERIC_ALL 0x10000000 #define DA_GENERIC_EXECUTE 0x20000000 #define DA_GENERIC_WRITE 0x40000000 #define DA_GENERIC_READ 0x80000000 #endif /* MS_SMB2_H */ xrdp-0.10.1/common/ms-fscc.h000644 001751 000000 00000003640 14652432047 015634 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-FSCC : Definitions from [MS-FSCC] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-FSCC are currently correct for v20190923 of that * document */ #if !defined(MS_FSCC_H) #define MS_FSCC_H /* * File system ioctl codes (section 2.3) */ #define FSCTL_DELETE_OBJECT_ID 0x900a0 /* * File information classes (section 2.4) */ enum FS_INFORMATION_CLASS { FileAllocationInformation = 19, /* Set */ FileBasicInformation = 4, /* Query, Set */ FileBothDirectoryInformation = 3, /* Query */ FileDirectoryInformation = 1, /* Query */ FileDispositionInformation = 13, /* Set */ FileEndOfFileInformation = 20, /* Set */ FileFullDirectoryInformation = 2, /* Query */ FileNamesInformation = 12, /* Query */ FileRenameInformation = 10, /* Set */ FileStandardInformation = 5 /* Query */ }; /* * Size of structs above without trailing RESERVED fields (MS-RDPEFS * 2.2.3.3.8) */ #define FILE_BASIC_INFORMATION_SIZE 36 #define FILE_STD_INFORMATION_SIZE 22 #define FILE_END_OF_FILE_INFORMATION_SIZE 8 /* Windows file attributes (section 2.6) */ #define W_FILE_ATTRIBUTE_DIRECTORY 0x00000010 #define W_FILE_ATTRIBUTE_READONLY 0x00000001 #define W_FILE_ATTRIBUTE_SYSTEM 0x00000004 #define W_FILE_ATTRIBUTE_NORMAL 0x00000080 #endif /* MS_FSCC_H */ xrdp-0.10.1/common/ssl_calls.c000644 001751 000000 00000115763 14652432047 016265 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * Copyright (C) Idan Freiberg 2013-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ssl calls */ #if defined(HAVE_CONFIG_H) #include #endif #include /* needed for openssl headers */ #include #include #include #include #include #include #include #include #include #include #include "os_calls.h" #include "string_calls.h" #include "arch.h" #include "ssl_calls.h" #include "trans.h" #include "log.h" #define SSL_WANT_READ_WRITE_TIMEOUT 100 /* * Globals used by openssl 3 and later */ #if OPENSSL_VERSION_NUMBER >= 0x30000000L static EVP_MD *g_md_md5; /* MD5 message digest */ static EVP_MD *g_md_sha1; /* SHA1 message digest */ static EVP_CIPHER *g_cipher_des_ede3_cbc; /* DES3 CBC cipher */ static EVP_MAC *g_mac_hmac; /* HMAC MAC */ #endif /* definition of ssl_tls */ struct ssl_tls { SSL *ssl; /* SSL * */ SSL_CTX *ctx; /* SSL_CTX * */ char *cert; char *key; struct trans *trans; tintptr rwo; /* wait obj */ int error_logged; /* Error has already been logged */ }; #if OPENSSL_VERSION_NUMBER < 0x10100000L static inline HMAC_CTX * HMAC_CTX_new(void) { HMAC_CTX *hmac_ctx = g_new(HMAC_CTX, 1); HMAC_CTX_init(hmac_ctx); return hmac_ctx; } static inline void HMAC_CTX_free(HMAC_CTX *hmac_ctx) { HMAC_CTX_cleanup(hmac_ctx); g_free(hmac_ctx); } static inline void RSA_get0_key(const RSA *key, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { *n = key->n; *d = key->d; } static inline int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { /* If the fields p and g in d are NULL, the corresponding input * parameters MUST be non-NULL. q may remain NULL. */ if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL)) { return 0; } if (p != NULL) { BN_free(dh->p); dh->p = p; } if (q != NULL) { BN_free(dh->q); dh->q = q; } if (g != NULL) { BN_free(dh->g); dh->g = g; } if (q != NULL) { dh->length = BN_num_bits(q); } return 1; } #endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ /*****************************************************************************/ static void dump_error_stack(const char *prefix) { /* Dump the error stack from the SSL library */ unsigned long code; char buff[256]; while ((code = ERR_get_error()) != 0L) { ERR_error_string_n(code, buff, sizeof(buff)); LOG(LOG_LEVEL_ERROR, "%s: %s", prefix, buff); } } /*****************************************************************************/ /* As above, but used for TLS connection errors where only the first error is logged */ static void dump_ssl_error_stack(struct ssl_tls *self) { if (!self->error_logged) { dump_error_stack("SSL"); self->error_logged = 1; } } /*****************************************************************************/ int ssl_init(void) { SSL_load_error_strings(); SSL_library_init(); return 0; } /*****************************************************************************/ int ssl_finish(void) { #if OPENSSL_VERSION_NUMBER >= 0x30000000L /* De-allocate any allocated globals * For OpenSSL 3, these can all safely be passed a NULL pointer */ EVP_MD_free(g_md_md5); EVP_MD_free(g_md_sha1); EVP_CIPHER_free(g_cipher_des_ede3_cbc); EVP_MAC_free(g_mac_hmac); #endif return 0; } /* rc4 stuff * * For OpenSSL 3.0, the rc4 encryption algorithm is only provided by the * legacy provider (see crypto(7)). Since RC4 is so simple, we can implement * it directly rather than having to load the legacy provider. This will * avoids problems if running on a system where openssl has been built * without the legacy provider */ #if OPENSSL_VERSION_NUMBER >= 0x30000000L struct rc4_data { /* See https://en.wikipedia.org/wiki/RC4 */ unsigned char S[256]; int i; int j; }; #endif /*****************************************************************************/ void * ssl_rc4_info_create(void) { #if OPENSSL_VERSION_NUMBER < 0x30000000L return g_malloc(sizeof(RC4_KEY), 1); #else return g_malloc(sizeof(struct rc4_data), 1); #endif } /*****************************************************************************/ void ssl_rc4_info_delete(void *rc4_info) { g_free(rc4_info); } /*****************************************************************************/ void ssl_rc4_set_key(void *rc4_info, const char *key, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L RC4_set_key((RC4_KEY *)rc4_info, len, (tui8 *)key); #else unsigned char *S = ((struct rc4_data *)rc4_info)->S; int i; int j = 0; unsigned char t; for (i = 0 ; i < 256; ++i) { S[i] = i; } for (i = 0 ; i < 256; ++i) { j = (j + S[i] + key[i % len]) & 0xff; t = S[i]; S[i] = S[j]; S[j] = t; } ((struct rc4_data *)rc4_info)->i = 0; ((struct rc4_data *)rc4_info)->j = 0; #endif } /*****************************************************************************/ void ssl_rc4_crypt(void *rc4_info, char *data, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L RC4((RC4_KEY *)rc4_info, len, (tui8 *)data, (tui8 *)data); #else unsigned char *S = ((struct rc4_data *)rc4_info)->S; int i = ((struct rc4_data *)rc4_info)->i; int j = ((struct rc4_data *)rc4_info)->j; unsigned char *p = (unsigned char *)data; unsigned char t; unsigned char k; /* * Do some loop-unrolling for performance. Here are the steps * for each byte */ #define RC4_ROUND \ i = (i + 1) & 0xff; \ j = (j + S[i]) & 0xff; \ t = S[i]; \ S[i] = S[j]; \ S[j] = t; \ k = S[(S[i] + S[j]) & 0xff]; \ *p++ ^= k while (len >= 8) { RC4_ROUND; RC4_ROUND; RC4_ROUND; RC4_ROUND; RC4_ROUND; RC4_ROUND; RC4_ROUND; RC4_ROUND; len -= 8; } while (len-- > 0) { RC4_ROUND; } ((struct rc4_data *)rc4_info)->i = i; ((struct rc4_data *)rc4_info)->j = j; #endif } /* sha1 stuff */ /*****************************************************************************/ void * ssl_sha1_info_create(void) { #if OPENSSL_VERSION_NUMBER < 0x30000000L return g_malloc(sizeof(SHA_CTX), 1); #else /* * If we can't get the digest loaded, there's a problem with the * library providers, so there's no point in us returning anything useful. * If we do load the digest, it's used later */ if (g_md_sha1 == NULL) { if ((g_md_sha1 = EVP_MD_fetch(NULL, "sha1", NULL)) == NULL) { dump_error_stack("sha1"); return NULL; } } return (void *)EVP_MD_CTX_new(); #endif } /*****************************************************************************/ void ssl_sha1_info_delete(void *sha1_info) { #if OPENSSL_VERSION_NUMBER < 0x30000000L g_free(sha1_info); #else EVP_MD_CTX_free((EVP_MD_CTX *)sha1_info); #endif } /*****************************************************************************/ void ssl_sha1_clear(void *sha1_info) { #if OPENSSL_VERSION_NUMBER < 0x30000000L SHA1_Init((SHA_CTX *)sha1_info); #else if (sha1_info != NULL) { EVP_DigestInit_ex((EVP_MD_CTX *)sha1_info, g_md_sha1, NULL); } #endif } /*****************************************************************************/ void ssl_sha1_transform(void *sha1_info, const char *data, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L SHA1_Update((SHA_CTX *)sha1_info, data, len); #else if (sha1_info != NULL) { EVP_DigestUpdate((EVP_MD_CTX *)sha1_info, data, len); } #endif } /*****************************************************************************/ void ssl_sha1_complete(void *sha1_info, char *data) { #if OPENSSL_VERSION_NUMBER < 0x30000000L SHA1_Final((tui8 *)data, (SHA_CTX *)sha1_info); #else if (sha1_info != NULL) { EVP_DigestFinal_ex((EVP_MD_CTX *)sha1_info, (unsigned char *)data, NULL); } #endif } /* md5 stuff */ /*****************************************************************************/ void * ssl_md5_info_create(void) { #if OPENSSL_VERSION_NUMBER < 0x30000000L return g_malloc(sizeof(MD5_CTX), 1); #else /* * If we can't get the digest loaded, there's a problem with the * library providers, so there's no point in us returning anything useful. * If we do load the digest, it's used later */ if (g_md_md5 == NULL) { if ((g_md_md5 = EVP_MD_fetch(NULL, "md5", NULL)) == NULL) { dump_error_stack("md5"); return NULL; } } return (void *)EVP_MD_CTX_new(); #endif } /*****************************************************************************/ void ssl_md5_info_delete(void *md5_info) { #if OPENSSL_VERSION_NUMBER < 0x30000000L g_free(md5_info); #else EVP_MD_CTX_free((EVP_MD_CTX *)md5_info); #endif } /*****************************************************************************/ void ssl_md5_clear(void *md5_info) { #if OPENSSL_VERSION_NUMBER < 0x30000000L MD5_Init((MD5_CTX *)md5_info); #else if (md5_info != NULL) { EVP_DigestInit_ex((EVP_MD_CTX *)md5_info, g_md_md5, NULL); } #endif } /*****************************************************************************/ void ssl_md5_transform(void *md5_info, const char *data, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L MD5_Update((MD5_CTX *)md5_info, data, len); #else if (md5_info != NULL) { EVP_DigestUpdate((EVP_MD_CTX *)md5_info, data, len); } #endif } /*****************************************************************************/ void ssl_md5_complete(void *md5_info, char *data) { #if OPENSSL_VERSION_NUMBER < 0x30000000L MD5_Final((tui8 *)data, (MD5_CTX *)md5_info); #else if (md5_info != NULL) { EVP_DigestFinal_ex((EVP_MD_CTX *)md5_info, (unsigned char *)data, NULL); } #endif } /* FIPS stuff */ /*****************************************************************************/ void * ssl_des3_encrypt_info_create(const char *key, const char *ivec) { EVP_CIPHER_CTX *des3_ctx; const tui8 *lkey; const tui8 *livec; #if OPENSSL_VERSION_NUMBER >= 0x30000000L /* * For these versions of OpenSSL, there are no long-term guarantees the * DES3 cipher will be available. We'll try to load it here so we * can log any errors */ if (g_cipher_des_ede3_cbc == NULL) { g_cipher_des_ede3_cbc = EVP_CIPHER_fetch(NULL, "des-ede3-cbc", NULL); if (g_cipher_des_ede3_cbc == NULL) { dump_error_stack("DES-EDE3-CBC"); return NULL; } } #endif des3_ctx = EVP_CIPHER_CTX_new(); lkey = (const tui8 *) key; livec = (const tui8 *) ivec; #if OPENSSL_VERSION_NUMBER < 0x30000000L EVP_EncryptInit_ex(des3_ctx, EVP_des_ede3_cbc(), NULL, lkey, livec); #else EVP_EncryptInit_ex(des3_ctx, g_cipher_des_ede3_cbc, NULL, lkey, livec); #endif EVP_CIPHER_CTX_set_padding(des3_ctx, 0); return des3_ctx; } /*****************************************************************************/ void * ssl_des3_decrypt_info_create(const char *key, const char *ivec) { EVP_CIPHER_CTX *des3_ctx; const tui8 *lkey; const tui8 *livec; #if OPENSSL_VERSION_NUMBER >= 0x30000000L /* * For these versions of OpenSSL, there are no long-term guarantees the * DES3 cipher will be available. We'll try to load it here so we * can log any errors */ if (g_cipher_des_ede3_cbc == NULL) { g_cipher_des_ede3_cbc = EVP_CIPHER_fetch(NULL, "des-ede3-cbc", NULL); if (g_cipher_des_ede3_cbc == NULL) { dump_error_stack("DES-EDE3-CBC"); return NULL; } } #endif des3_ctx = EVP_CIPHER_CTX_new(); lkey = (const tui8 *) key; livec = (const tui8 *) ivec; #if OPENSSL_VERSION_NUMBER < 0x30000000L EVP_DecryptInit_ex(des3_ctx, EVP_des_ede3_cbc(), NULL, lkey, livec); #else EVP_DecryptInit_ex(des3_ctx, g_cipher_des_ede3_cbc, NULL, lkey, livec); #endif EVP_CIPHER_CTX_set_padding(des3_ctx, 0); return des3_ctx; } /*****************************************************************************/ void ssl_des3_info_delete(void *des3) { EVP_CIPHER_CTX *des3_ctx; des3_ctx = (EVP_CIPHER_CTX *) des3; if (des3_ctx != 0) { EVP_CIPHER_CTX_free(des3_ctx); } } /*****************************************************************************/ int ssl_des3_encrypt(void *des3, int length, const char *in_data, char *out_data) { EVP_CIPHER_CTX *des3_ctx; int len; const tui8 *lin_data; tui8 *lout_data; des3_ctx = (EVP_CIPHER_CTX *) des3; if (des3_ctx != NULL) { lin_data = (const tui8 *) in_data; lout_data = (tui8 *) out_data; len = 0; EVP_EncryptUpdate(des3_ctx, lout_data, &len, lin_data, length); } return 0; } /*****************************************************************************/ int ssl_des3_decrypt(void *des3, int length, const char *in_data, char *out_data) { EVP_CIPHER_CTX *des3_ctx; int len; const tui8 *lin_data; tui8 *lout_data; des3_ctx = (EVP_CIPHER_CTX *) des3; if (des3_ctx != NULL) { lin_data = (const tui8 *) in_data; lout_data = (tui8 *) out_data; len = 0; EVP_DecryptUpdate(des3_ctx, lout_data, &len, lin_data, length); } return 0; } /*****************************************************************************/ void * ssl_hmac_info_create(void) { #if OPENSSL_VERSION_NUMBER < 0x30000000L return (HMAC_CTX *)HMAC_CTX_new(); #else /* Need a MAC algorithm loaded */ if (g_mac_hmac == NULL) { if ((g_mac_hmac = EVP_MAC_fetch(NULL, "hmac", NULL)) == NULL) { dump_error_stack("hmac"); return NULL; } } return (void *)EVP_MAC_CTX_new(g_mac_hmac); #endif } /*****************************************************************************/ void ssl_hmac_info_delete(void *hmac) { #if OPENSSL_VERSION_NUMBER < 0x30000000L HMAC_CTX *hmac_ctx; hmac_ctx = (HMAC_CTX *) hmac; if (hmac_ctx != 0) { HMAC_CTX_free(hmac_ctx); } #else EVP_MAC_CTX_free((EVP_MAC_CTX *)hmac); #endif } /*****************************************************************************/ void ssl_hmac_sha1_init(void *hmac, const char *data, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L HMAC_CTX *hmac_ctx; hmac_ctx = (HMAC_CTX *) hmac; HMAC_Init_ex(hmac_ctx, data, len, EVP_sha1(), NULL); #else if (hmac != NULL) { char digest[] = "sha1"; OSSL_PARAM params[3]; size_t n = 0; params[n++] = OSSL_PARAM_construct_utf8_string("digest", digest, 0); params[n++] = OSSL_PARAM_construct_end(); if (EVP_MAC_init((EVP_MAC_CTX *)hmac, (unsigned char *)data, len, params) == 0) { dump_error_stack("hmac-sha1"); } } #endif } /*****************************************************************************/ void ssl_hmac_transform(void *hmac, const char *data, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L HMAC_CTX *hmac_ctx; const tui8 *ldata; hmac_ctx = (HMAC_CTX *) hmac; ldata = (const tui8 *) data; HMAC_Update(hmac_ctx, ldata, len); #else if (hmac != NULL) { EVP_MAC_update((EVP_MAC_CTX *)hmac, (unsigned char *)data, len); } #endif } /*****************************************************************************/ void ssl_hmac_complete(void *hmac, char *data, int len) { #if OPENSSL_VERSION_NUMBER < 0x30000000L HMAC_CTX *hmac_ctx; tui8 *ldata; tui32 llen; hmac_ctx = (HMAC_CTX *) hmac; ldata = (tui8 *) data; llen = len; HMAC_Final(hmac_ctx, ldata, &llen); #else if (hmac != NULL) { EVP_MAC_final((EVP_MAC_CTX *)hmac, (unsigned char *)data, NULL, len); } #endif } /*****************************************************************************/ static void ssl_reverse_it(char *p, int len) { int i; int j; char temp; i = 0; j = len - 1; while (i < j) { temp = p[i]; p[i] = p[j]; p[j] = temp; i++; j--; } } /*****************************************************************************/ int ssl_mod_exp(char *out, int out_len, const char *in, int in_len, const char *mod, int mod_len, const char *exp, int exp_len) { BN_CTX *ctx; BIGNUM *lmod; BIGNUM *lexp; BIGNUM *lin; BIGNUM *lout; int rv; char *l_out; char *l_in; char *l_mod; char *l_exp; l_out = (char *)g_malloc(out_len, 1); l_in = (char *)g_malloc(in_len, 1); l_mod = (char *)g_malloc(mod_len, 1); l_exp = (char *)g_malloc(exp_len, 1); g_memcpy(l_in, in, in_len); g_memcpy(l_mod, mod, mod_len); g_memcpy(l_exp, exp, exp_len); ssl_reverse_it(l_in, in_len); ssl_reverse_it(l_mod, mod_len); ssl_reverse_it(l_exp, exp_len); ctx = BN_CTX_new(); lmod = BN_new(); lexp = BN_new(); lin = BN_new(); lout = BN_new(); BN_bin2bn((tui8 *)l_mod, mod_len, lmod); BN_bin2bn((tui8 *)l_exp, exp_len, lexp); BN_bin2bn((tui8 *)l_in, in_len, lin); BN_mod_exp(lout, lin, lexp, lmod, ctx); rv = BN_bn2bin(lout, (tui8 *)l_out); if (rv <= out_len) { ssl_reverse_it(l_out, rv); g_memcpy(out, l_out, out_len); } else { rv = 0; } BN_free(lin); BN_free(lout); BN_free(lexp); BN_free(lmod); BN_CTX_free(ctx); g_free(l_out); g_free(l_in); g_free(l_mod); g_free(l_exp); return rv; } /*****************************************************************************/ /* returns error generates a new rsa key exp is passed in and mod and pri are passed out */ int ssl_gen_key_xrdp1(int key_size_in_bits, const char *exp, int exp_len, char *mod, int mod_len, char *pri, int pri_len) { BIGNUM *my_e; char *lexp; char *lmod; char *lpri; int error; int len; int diff; if ((exp_len != 4) || ((mod_len != 64) && (mod_len != 256)) || ((pri_len != 64) && (pri_len != 256))) { return 1; } diff = 0; lexp = (char *)g_malloc(exp_len, 1); lmod = (char *)g_malloc(mod_len, 1); lpri = (char *)g_malloc(pri_len, 1); g_memcpy(lexp, exp, exp_len); ssl_reverse_it(lexp, exp_len); my_e = BN_new(); BN_bin2bn((tui8 *)lexp, exp_len, my_e); #if OPENSSL_VERSION_NUMBER < 0x30000000L const BIGNUM *n = NULL; const BIGNUM *d = NULL; RSA *my_key = RSA_new(); error = RSA_generate_key_ex(my_key, key_size_in_bits, my_e, 0) == 0; /* After this call, n and d point directly into my_key, and are valid * until my_key is free'd */ RSA_get0_key(my_key, &n, NULL, &d); #else BIGNUM *n = NULL; BIGNUM *d = NULL; OSSL_PARAM params[] = { OSSL_PARAM_construct_int("bits", &key_size_in_bits), OSSL_PARAM_construct_end() }; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_name(NULL, "RSA", NULL); EVP_PKEY *pkey = NULL; if (pctx != NULL && EVP_PKEY_keygen_init(pctx) > 0 && EVP_PKEY_CTX_set_params(pctx, params) > 0 && EVP_PKEY_generate(pctx, &pkey) > 0 && EVP_PKEY_get_bn_param(pkey, "n", &n) > 0 && EVP_PKEY_get_bn_param(pkey, "d", &d) > 0) { error = 0; } else { error = 1; } EVP_PKEY_CTX_free(pctx); EVP_PKEY_free(pkey); #endif if (error == 0) { len = BN_num_bytes(n); error = (len < 1) || (len > mod_len); diff = mod_len - len; } if (error == 0) { BN_bn2bin(n, (tui8 *)(lmod + diff)); ssl_reverse_it(lmod, mod_len); } if (error == 0) { len = BN_num_bytes(d); error = (len < 1) || (len > pri_len); diff = pri_len - len; } if (error == 0) { BN_bn2bin(d, (tui8 *)(lpri + diff)); ssl_reverse_it(lpri, pri_len); } if (error == 0) { g_memcpy(mod, lmod, mod_len); g_memcpy(pri, lpri, pri_len); } BN_free(my_e); #if OPENSSL_VERSION_NUMBER < 0x30000000L RSA_free(my_key); #else BN_free(n); BN_clear_free(d); #endif g_free(lexp); g_free(lmod); g_free(lpri); return error; } /*****************************************************************************/ /** static DH parameter, can be used if no custom parameter is specified see also * https://wiki.openssl.org/index.php/Diffie-Hellman_parameters * https://wiki.openssl.org/index.php/Manual:SSL_CTX_set_tmp_dh_callback(3) * * We dont do this for OpenSSL 3 - we use SSL_CTX_set_dh_auto() instead, as this * can cater for different key sizes on the certificate */ #if OPENSSL_VERSION_NUMBER < 0x30000000L static DH *ssl_get_dh2236() { static unsigned char dh2236_p[] = { 0x0E, 0xF8, 0x69, 0x0B, 0x35, 0x2F, 0x62, 0x59, 0xF7, 0xAF, 0x4E, 0x19, 0xB5, 0x9B, 0xD2, 0xEB, 0x33, 0x78, 0x1D, 0x43, 0x1D, 0xB6, 0xE4, 0xA3, 0x63, 0x47, 0x6A, 0xD4, 0xA8, 0x28, 0x11, 0x8C, 0x3F, 0xC8, 0xF1, 0x32, 0x2B, 0x5D, 0x9F, 0xF8, 0xA6, 0xCA, 0x21, 0x71, 0xDE, 0x30, 0xD7, 0xB5, 0xD6, 0xA4, 0xC2, 0xEE, 0xC0, 0x49, 0x30, 0xE7, 0x8C, 0x9B, 0x1A, 0x5A, 0x08, 0x2A, 0x11, 0x84, 0xE2, 0xC8, 0x36, 0x6C, 0xDC, 0x06, 0x79, 0x59, 0x51, 0xA4, 0xA0, 0x8F, 0xE1, 0x20, 0x94, 0x80, 0xAC, 0x6D, 0xFD, 0x3B, 0xA6, 0xA6, 0x70, 0x51, 0x93, 0x59, 0x28, 0x51, 0x54, 0xA3, 0xC5, 0x15, 0x44, 0x2C, 0x12, 0xE7, 0x95, 0x62, 0x0E, 0x65, 0x2F, 0x8C, 0x0D, 0xF8, 0x63, 0x52, 0x00, 0x2A, 0xA5, 0xD7, 0x59, 0xEF, 0x13, 0x18, 0x33, 0x25, 0xBC, 0xAD, 0xC8, 0x0A, 0x72, 0x8D, 0x26, 0x63, 0xD5, 0xB3, 0xBC, 0x43, 0x35, 0x0B, 0x5D, 0xC7, 0xCA, 0x45, 0x17, 0x06, 0x24, 0x71, 0xCA, 0x20, 0x73, 0xE8, 0x18, 0xD3, 0x8E, 0xE9, 0xE9, 0x8F, 0x67, 0xC0, 0x2C, 0x14, 0x7E, 0x41, 0x18, 0x6C, 0x74, 0x72, 0x56, 0x34, 0xC0, 0xDB, 0xDD, 0x85, 0x8B, 0xE0, 0x99, 0xE8, 0x5E, 0xC8, 0xF7, 0xD1, 0x0C, 0xF8, 0x83, 0x34, 0x37, 0x9E, 0x01, 0xDF, 0x1C, 0xD9, 0xE9, 0x95, 0xC1, 0x4C, 0x64, 0x37, 0x9B, 0xF5, 0x8F, 0x99, 0x97, 0x55, 0x68, 0x2E, 0x23, 0xB0, 0x35, 0xF3, 0xA5, 0x97, 0x92, 0xA0, 0x6D, 0xB4, 0xF8, 0xD8, 0x47, 0xCE, 0x3F, 0x0B, 0x36, 0x0E, 0xEB, 0x13, 0x15, 0xFD, 0x4F, 0x98, 0x4F, 0x14, 0x26, 0xE2, 0xAC, 0xD9, 0x42, 0xC6, 0x43, 0x8A, 0x95, 0x6B, 0x2B, 0x44, 0x38, 0x7F, 0x60, 0x97, 0x77, 0xD8, 0x7C, 0x6F, 0x5D, 0x62, 0x7C, 0xE1, 0xC8, 0x83, 0x12, 0x8B, 0x5E, 0x5E, 0xC7, 0x5E, 0xD5, 0x60, 0xF3, 0x2F, 0xFC, 0xFE, 0x70, 0xAC, 0x58, 0x3A, 0x3C, 0x18, 0x15, 0x54, 0x84, 0xA8, 0xAA, 0x41, 0x26, 0x7B, 0xE0, 0xA3, }; static unsigned char dh2236_g[] = { 0x02, }; DH *dh = DH_new(); if (dh == NULL) { return NULL; } BIGNUM *p = BN_bin2bn(dh2236_p, sizeof(dh2236_p), NULL); BIGNUM *g = BN_bin2bn(dh2236_g, sizeof(dh2236_g), NULL); if (p == NULL || g == NULL) { BN_free(p); BN_free(g); DH_free(dh); return NULL; } // p, g are freed later by DH_free() if (0 == DH_set0_pqg(dh, p, NULL, g)) { BN_free(p); BN_free(g); DH_free(dh); return NULL; } return dh; } #endif /* OPENSSL_VERSION_NUMBER < 0x30000000L */ /*****************************************************************************/ struct ssl_tls * ssl_tls_create(struct trans *trans, const char *key, const char *cert) { struct ssl_tls *self; int pid; char buf[1024]; self = (struct ssl_tls *) g_malloc(sizeof(struct ssl_tls), 1); if (self != NULL) { self->trans = trans; self->cert = (char *) cert; self->key = (char *) key; pid = g_getpid(); g_snprintf(buf, 1024, "xrdp_%8.8x_tls_rwo", pid); self->rwo = g_create_wait_obj(buf); } return self; } /*****************************************************************************/ static int ssl_tls_log_error(struct ssl_tls *self, const char *func, int value) { int result = 1; int ssl_error = SSL_get_error(self->ssl, value); if (ssl_error == SSL_ERROR_WANT_READ || ssl_error == SSL_ERROR_WANT_WRITE) { result = 0; } else if (!self->error_logged) { switch (ssl_error) { case SSL_ERROR_ZERO_RETURN: LOG(LOG_LEVEL_ERROR, "%s: Server closed TLS connection", func); break; case SSL_ERROR_SYSCALL: LOG(LOG_LEVEL_ERROR, "%s: I/O error", func); break; case SSL_ERROR_SSL: LOG(LOG_LEVEL_ERROR, "%s: Failure in SSL library " "(protocol error?)", func); break; default: LOG(LOG_LEVEL_ERROR, "%s: Unknown SSL error", func); break; } dump_ssl_error_stack(self); /* Sets self->error_logged */ } return result; } /**************************************************************************//** * Log an attempt to use an encrypted file * * For example, a private key could have a password set on it. We don't * support this. */ static int log_encrypted_file_unsupported(char *buf, int size, int rwflag, void *u) { LOG(LOG_LEVEL_ERROR, "Encryption is not supported for %s", (const char *)u); return -1; /* See pem_password_cb(3ssl) */ } /*****************************************************************************/ int ssl_tls_accept(struct ssl_tls *self, long ssl_protocols, const char *tls_ciphers) { int connection_status; long options = 0; ERR_clear_error(); /** * SSL_OP_NO_SSLv2 * SSLv3 is used by, eg. Microsoft RDC for Mac OS X. */ options |= SSL_OP_NO_SSLv2; /** * Disable SSL protocols not listed in ssl_protocols. */ options |= ssl_protocols; #if defined(SSL_OP_NO_COMPRESSION) /** * SSL_OP_NO_COMPRESSION: * * The Microsoft RDP server does not advertise support * for TLS compression, but alternative servers may support it. * This was observed between early versions of the FreeRDP server * and the FreeRDP client, and caused major performance issues, * which is why we're disabling it. */ options |= SSL_OP_NO_COMPRESSION; #endif /** * SSL_OP_TLS_BLOCK_PADDING_BUG: * * The Microsoft RDP server does *not* support TLS padding. * It absolutely needs to be disabled otherwise it won't work. */ options |= SSL_OP_TLS_BLOCK_PADDING_BUG; /** * SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: * * Just like TLS padding, the Microsoft RDP server does not * support empty fragments. This needs to be disabled. */ options |= SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; self->ctx = SSL_CTX_new(SSLv23_server_method()); if (self->ctx == NULL) { LOG(LOG_LEVEL_ERROR, "Unable to negotiate a TLS connection with the client"); dump_ssl_error_stack(self); return 1; } /* set context options */ SSL_CTX_set_mode(self->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_ENABLE_PARTIAL_WRITE); SSL_CTX_set_options(self->ctx, options); /* set DH parameters */ #if OPENSSL_VERSION_NUMBER < 0x30000000L DH *dh = ssl_get_dh2236(); if (dh == NULL) { LOG(LOG_LEVEL_ERROR, "Unable to generate DHE parameters for TLS"); return 1; } if (SSL_CTX_set_tmp_dh(self->ctx, dh) != 1) { LOG(LOG_LEVEL_ERROR, "Unable to setup DHE parameters for TLS"); dump_ssl_error_stack(self); return 1; } DH_free(dh); // ok to free, copied into ctx by SSL_CTX_set_tmp_dh() #else if (!SSL_CTX_set_dh_auto(self->ctx, 1)) { LOG(LOG_LEVEL_ERROR, "TLS DHE auto failed to be enabled"); dump_ssl_error_stack(self); return 1; } #endif #if defined(SSL_CTX_set_ecdh_auto) if (!SSL_CTX_set_ecdh_auto(self->ctx, 1)) { LOG(LOG_LEVEL_WARNING, "TLS ecdh auto failed to be enabled"); } #endif if (g_strlen(tls_ciphers) > 1) { LOG(LOG_LEVEL_TRACE, "tls_ciphers=%s", tls_ciphers); if (SSL_CTX_set_cipher_list(self->ctx, tls_ciphers) == 0) { LOG(LOG_LEVEL_ERROR, "Invalid TLS cipher options %s", tls_ciphers); dump_ssl_error_stack(self); return 1; } } SSL_CTX_set_read_ahead(self->ctx, 0); /* * We don't currently handle encrypted private keys - set a callback * to tell the user if one is provided */ SSL_CTX_set_default_passwd_cb(self->ctx, log_encrypted_file_unsupported); SSL_CTX_set_default_passwd_cb_userdata(self->ctx, self->key); if (SSL_CTX_use_PrivateKey_file(self->ctx, self->key, SSL_FILETYPE_PEM) <= 0) { LOG(LOG_LEVEL_ERROR, "Error loading TLS private key from %s", self->key); dump_ssl_error_stack(self); return 1; } SSL_CTX_set_default_passwd_cb(self->ctx, NULL); SSL_CTX_set_default_passwd_cb_userdata(self->ctx, NULL); if (SSL_CTX_use_certificate_chain_file(self->ctx, self->cert) <= 0) { LOG(LOG_LEVEL_ERROR, "Error loading TLS certificate chain from %s", self->cert); dump_ssl_error_stack(self); return 1; } /* * Don't call SSL_check_private_key() for openSSL prior to 1.0.2, as * certificate chains are not handled in the same way - see * SSL_CTX_check_private_key(3ssl) */ #if OPENSSL_VERSION_NUMBER >= 0x10002000L if (!SSL_CTX_check_private_key(self->ctx)) { LOG(LOG_LEVEL_ERROR, "Private key %s and certificate %s do not match", self->key, self->cert); dump_ssl_error_stack(self); return 1; } #endif self->ssl = SSL_new(self->ctx); if (self->ssl == NULL) { LOG(LOG_LEVEL_ERROR, "Unable to create an SSL structure"); dump_ssl_error_stack(self); return 1; } if (SSL_set_fd(self->ssl, self->trans->sck) < 1) { LOG(LOG_LEVEL_ERROR, "Unable to set up an SSL structure on fd %d", (int)self->trans->sck); dump_ssl_error_stack(self); return 1; } while (1) { /* * Make sure the error queue is clear before (re-) attempting the * accept. If the accept is successful, the error queue will * remain clear for normal SSL operation */ ERR_clear_error(); connection_status = SSL_accept(self->ssl); if (connection_status <= 0) { if (ssl_tls_log_error(self, "SSL_accept", connection_status)) { return 1; } /** * retry when SSL_get_error returns: * SSL_ERROR_WANT_READ * SSL_ERROR_WANT_WRITE */ switch (SSL_get_error(self->ssl, connection_status)) { case SSL_ERROR_WANT_READ: g_sck_can_recv(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); break; case SSL_ERROR_WANT_WRITE: g_sck_can_send(self->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); break; } } else { break; } } LOG(LOG_LEVEL_TRACE, "TLS connection accepted"); return 0; } /*****************************************************************************/ /* returns error, */ int ssl_tls_disconnect(struct ssl_tls *self) { int status; if (self == NULL) { return 0; } if (self->ssl == NULL) { return 0; } status = SSL_shutdown(self->ssl); if (status != 1) { status = SSL_shutdown(self->ssl); if (status <= 0) { if (ssl_tls_log_error(self, "SSL_shutdown", status)) { return 1; } /** * retry when SSL_get_error returns: * SSL_ERROR_WANT_READ * SSL_ERROR_WANT_WRITE */ } } return 0; } /*****************************************************************************/ void ssl_tls_delete(struct ssl_tls *self) { if (self != NULL) { if (self->ssl) { SSL_free(self->ssl); } if (self->ctx) { SSL_CTX_free(self->ctx); } g_delete_wait_obj(self->rwo); g_free(self); } } /*****************************************************************************/ int ssl_tls_read(struct ssl_tls *tls, char *data, int length) { int status; int break_flag; while (1) { status = SSL_read(tls->ssl, data, length); switch (SSL_get_error(tls->ssl, status)) { case SSL_ERROR_NONE: break_flag = 1; break; /** * retry when SSL_get_error returns: * SSL_ERROR_WANT_READ * SSL_ERROR_WANT_WRITE */ case SSL_ERROR_WANT_READ: g_sck_can_recv(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); continue; case SSL_ERROR_WANT_WRITE: g_sck_can_send(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); continue; /* socket closed */ case SSL_ERROR_ZERO_RETURN: return 0; default: ssl_tls_log_error(tls, "SSL_read", status); status = -1; break_flag = 1; break; } if (break_flag) { break; } } if (SSL_pending(tls->ssl) > 0) { g_set_wait_obj(tls->rwo); } return status; } /*****************************************************************************/ int ssl_tls_write(struct ssl_tls *tls, const char *data, int length) { int status; int break_flag; while (1) { status = SSL_write(tls->ssl, data, length); switch (SSL_get_error(tls->ssl, status)) { case SSL_ERROR_NONE: break_flag = 1; break; /** * retry when SSL_get_error returns: * SSL_ERROR_WANT_READ * SSL_ERROR_WANT_WRITE */ case SSL_ERROR_WANT_READ: g_sck_can_recv(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); continue; case SSL_ERROR_WANT_WRITE: g_sck_can_send(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT); continue; /* socket closed */ case SSL_ERROR_ZERO_RETURN: return 0; default: ssl_tls_log_error(tls, "SSL_write", status); status = -1; break_flag = 1; break; } if (break_flag) { break; } } return status; } /*****************************************************************************/ /* returns boolean */ int ssl_tls_can_recv(struct ssl_tls *tls, int sck, int millis) { if (SSL_pending(tls->ssl) > 0) { return 1; } g_reset_wait_obj(tls->rwo); return g_sck_can_recv(sck, millis); } /*****************************************************************************/ const char * ssl_get_version(const struct ssl_tls *ssl) { return SSL_get_version(ssl->ssl); } /*****************************************************************************/ const char * ssl_get_cipher_name(const struct ssl_tls *ssl) { return SSL_get_cipher_name(ssl->ssl); } /*****************************************************************************/ tintptr ssl_get_rwo(const struct ssl_tls *ssl) { return ssl->rwo; } /*****************************************************************************/ int ssl_get_protocols_from_string(const char *str, long *ssl_protocols) { long protocols; long bad_protocols; int rv; if ((str == NULL) || (ssl_protocols == NULL)) { return 1; } rv = 0; protocols = 0; #if defined(SSL_OP_NO_SSLv3) protocols |= SSL_OP_NO_SSLv3; #endif #if defined(SSL_OP_NO_TLSv1) protocols |= SSL_OP_NO_TLSv1; #endif #if defined(SSL_OP_NO_TLSv1_1) protocols |= SSL_OP_NO_TLSv1_1; #endif #if defined(SSL_OP_NO_TLSv1_2) protocols |= SSL_OP_NO_TLSv1_2; #endif #if defined(SSL_OP_NO_TLSv1_3) protocols |= SSL_OP_NO_TLSv1_3; #endif bad_protocols = protocols; if (g_pos(str, ",TLSv1.3,") >= 0) { #if defined(SSL_OP_NO_TLSv1_3) LOG(LOG_LEVEL_DEBUG, "TLSv1.3 enabled"); protocols &= ~SSL_OP_NO_TLSv1_3; #else LOG(LOG_LEVEL_WARNING, "TLSv1.3 enabled by config, " "but not supported by system OpenSSL"); rv |= (1 << 6); #endif } if (g_pos(str, ",TLSv1.2,") >= 0) { #if defined(SSL_OP_NO_TLSv1_2) LOG(LOG_LEVEL_DEBUG, "TLSv1.2 enabled"); protocols &= ~SSL_OP_NO_TLSv1_2; #else LOG(LOG_LEVEL_WARNING, "TLSv1.2 enabled by config, " "but not supported by system OpenSSL"); rv |= (1 << 1); #endif } if (g_pos(str, ",TLSv1.1,") >= 0) { #if defined(SSL_OP_NO_TLSv1_1) LOG(LOG_LEVEL_DEBUG, "TLSv1.1 enabled"); protocols &= ~SSL_OP_NO_TLSv1_1; #else LOG(LOG_LEVEL_WARNING, "TLSv1.1 enabled by config, " "but not supported by system OpenSSL"); rv |= (1 << 2); #endif } if (g_pos(str, ",TLSv1,") >= 0) { #if defined(SSL_OP_NO_TLSv1) LOG(LOG_LEVEL_DEBUG, "TLSv1 enabled"); protocols &= ~SSL_OP_NO_TLSv1; #else LOG(LOG_LEVEL_WARNING, "TLSv1 enabled by config, " "but not supported by system OpenSSL"); rv |= (1 << 3); #endif } if (g_pos(str, ",SSLv3,") >= 0) { #if defined(SSL_OP_NO_SSLv3) LOG(LOG_LEVEL_DEBUG, "SSLv3 enabled"); protocols &= ~SSL_OP_NO_SSLv3; #else LOG(LOG_LEVEL_WARNING, "SSLv3 enabled by config, " "but not supported by system OpenSSL"); rv |= (1 << 4); #endif } if (protocols == bad_protocols) { LOG(LOG_LEVEL_WARNING, "No SSL/TLS protocols enabled. " "At least one protocol should be enabled to accept " "TLS connections."); rv |= (1 << 5); } *ssl_protocols = protocols; return rv; } /*****************************************************************************/ const char *get_openssl_version() { #if OPENSSL_VERSION_NUMBER < 0x10100000L return SSLeay_version(SSLEAY_VERSION); #else return OpenSSL_version(OPENSSL_VERSION); #endif } xrdp-0.10.1/common/list.h000644 001751 000000 00000007751 14652432047 015263 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * simple list */ #if !defined(LIST_H) #define LIST_H #include "arch.h" /* list */ struct list { tintptr *items; int count; int alloc_size; int grow_by; int auto_free; }; struct list * list_create(void); /** * Creates a list with at least the specified number of items * reserved * @param size Number of items to reserve * @return list, or NULL if no memory */ struct list * list_create_sized(unsigned int size); void list_delete(struct list *self); /** * Adds an item to a list * @param self The list * @param item The item to add * @result 0 if a memory allocation failure occurred. In this * case the item is not added * * Memory allocation failures will not occur if the list is * sized appropriately when created. */ int list_add_item(struct list *self, tintptr item); tintptr list_get_item(const struct list *self, int index); void list_clear(struct list *self); int list_index_of(struct list *self, tintptr item); void list_remove_item(struct list *self, int index); /** * Inserts an item into a list * @param self The list * @param index The location to insert the item before * @param item The item to add * @result 0 if a memory allocation failure occurred. In this * case the item is not added * * Memory allocation failures will not occur if the list is * sized appropriately when created. */ int list_insert_item(struct list *self, int index, tintptr item); /** * Adds strings to a list from another list * @param self The source list * @param dest Destination list * @param start_index Index to start on the source list (zero based) * * @result 0 if a memory allocation failure occurred. In this * case the destination list is unaltered. * * Strings from the source list are copied with strdup() * The dest list should have auto_free set, or memory leaks will occur */ int list_append_list_strdup(struct list *self, struct list *dest, int start_index); void list_dump_items(struct list *self); /** * Splits a string on a separation character and then returns a list of * the string split by the character, without the character contained within * the pieces. * * The list must be disposed of by the caller. * * @param str String to split. * @param character Character used as the delimiter between strings. * @param start_index Index to start on the source list (zero based) * * @result 0 if a memory allocation failure occurred. * * String fragments in the list are created with strdup() */ struct list * split_string_into_list(const char *str, char character); /** * As list_add_item() but for a C string * * This is a convenience function for a common operation * @param self List to append to * @param str String to append * * The passed-in string is strdup'd onto the list, so if auto_free * isn't set, memory leaks will occur. * * A NULL pointer will be added as a NULL entry. * * @result 0 if any memory allocation failure occurred. In this case * the list is unchanged. */ int list_add_strdup(struct list *self, const char *str); /** * Add multiple strings to a list * * This is a convenience function for a common operation * @param self List to append to * @param ... Strings to append. Terminate the list with a NULL. * * @result 0 if any memory allocation failure occurred. In this case * the list is unchanged. */ int list_add_strdup_multi(struct list *self, ...); #endif xrdp-0.10.1/common/xrdp_sockets.h000644 001751 000000 00000005007 14652432047 017010 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * names of UNIX sockets for inter-process communication */ #if !defined(XRDP_SOCKETS_H) #define XRDP_SOCKETS_H /* XRDP_SOCKET_ROOT_PATH must be defined to include this file */ #ifdef __cppcheck__ /* avoid syntax errors */ # define XRDP_SOCKET_ROOT_PATH "/dummy" #elif !defined(XRDP_SOCKET_ROOT_PATH) # error "XRDP_SOCKET_ROOT_PATH must be defined" #endif /* Buffer size for code for fullpath declarations * * This needs to fit in the sun_path field of a sockaddr_un. POSIX * does not define this size, so the value below is the lower of * the FreeBSD/OpenBSD/NetBSD(104) and Linux(108) values */ #define XRDP_SOCKETS_MAXPATH 104 /* The socketdir is rooted at XRDP_SOCKET_ROOT_PATH. User-specific * sockets live in a user-specific sub-directory of this called * XRDP_SOCKET_PATH. The sub-directory is the UID of the user */ #define XRDP_SOCKET_PATH XRDP_SOCKET_ROOT_PATH "/%d" /* Sockets in XRDP_SOCKET_ROOT_PATH */ #define SCP_LISTEN_PORT_BASE_STR "sesman.socket" /* names of socket files within XRDP_SOCKET_PATH, qualified by * display number */ #define XRDP_CHANSRV_BASE_STR "xrdp_chansrv_socket_%d" #define CHANSRV_PORT_OUT_BASE_STR "xrdp_chansrv_audio_out_socket_%d" #define CHANSRV_PORT_IN_BASE_STR "xrdp_chansrv_audio_in_socket_%d" #define CHANSRV_API_BASE_STR "xrdpapi_%d" #define XRDP_X11RDP_BASE_STR "xrdp_display_%d" #define XRDP_DISCONNECT_BASE_STR "xrdp_disconnect_display_%d" /* fullpath declarations */ #define XRDP_CHANSRV_STR XRDP_SOCKET_PATH "/" XRDP_CHANSRV_BASE_STR #define CHANSRV_PORT_OUT_STR XRDP_SOCKET_PATH "/" CHANSRV_PORT_OUT_BASE_STR #define CHANSRV_PORT_IN_STR XRDP_SOCKET_PATH "/" CHANSRV_PORT_IN_BASE_STR #define CHANSRV_API_STR XRDP_SOCKET_PATH "/" CHANSRV_API_BASE_STR #define XRDP_X11RDP_STR XRDP_SOCKET_PATH "/" XRDP_X11RDP_BASE_STR #define XRDP_DISCONNECT_STR XRDP_SOCKET_PATH "/" XRDP_DISCONNECT_BASE_STR #endif xrdp-0.10.1/common/ms-erref.h000644 001751 000000 00000002414 14652432047 016017 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * MS-ERREF : Definitions from [MS-ERREF] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * References to MS-ERREF are currently correct for v20180912 of that * document */ #if !defined(MS_ERREF_H) #define MS_ERREF_H /* * NTSTATUS codes (section 2.3) */ enum NTSTATUS { STATUS_SUCCESS = 0x00000000, STATUS_NO_MORE_FILES = 0x80000006, STATUS_UNSUCCESSFUL = 0xc0000001, STATUS_NO_SUCH_FILE = 0xc000000f, STATUS_ACCESS_DENIED = 0xc0000022, STATUS_OBJECT_NAME_INVALID = 0xc0000033, STATUS_OBJECT_NAME_NOT_FOUND = 0xc0000034, STATUS_SHARING_VIOLATION = 0xc0000043, STATUS_NOT_SUPPORTED = 0xc00000bb }; #endif /* MS_ERREF_H */ xrdp-0.10.1/common/xrdp_rail.h000644 001751 000000 00000011114 14652432047 016260 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2012-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(_RAIL_H) #define _RAIL_H /* ORDER_TYPE_WINDOW WINDOW_ORDER_TYPE_WINDOW WINDOW_ORDER_ICON WINDOW_ORDER_CACHED_ICON WINDOW_ORDER_STATE_DELETED WINDOW_ORDER_STATE_NEW on WINDOW_ORDER_STATE_NEW off WINDOW_ORDER_TYPE_NOTIFY WINDOW_ORDER_STATE_DELETED WINDOW_ORDER_STATE_NEW on WINDOW_ORDER_STATE_NEW off WINDOW_ORDER_TYPE_DESKTOP WINDOW_ORDER_FIELD_DESKTOP_NONE on WINDOW_ORDER_FIELD_DESKTOP_NONE off */ /* Window Order Header Flags */ #define WINDOW_ORDER_TYPE_WINDOW 0x01000000 #define WINDOW_ORDER_TYPE_NOTIFY 0x02000000 #define WINDOW_ORDER_TYPE_DESKTOP 0x04000000 #define WINDOW_ORDER_STATE_NEW 0x10000000 #define WINDOW_ORDER_STATE_DELETED 0x20000000 #define WINDOW_ORDER_FIELD_OWNER 0x00000002 #define WINDOW_ORDER_FIELD_STYLE 0x00000008 #define WINDOW_ORDER_FIELD_SHOW 0x00000010 #define WINDOW_ORDER_FIELD_TITLE 0x00000004 #define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET 0x00004000 #define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE 0x00010000 #define WINDOW_ORDER_FIELD_RP_CONTENT 0x00020000 #define WINDOW_ORDER_FIELD_ROOT_PARENT 0x00040000 #define WINDOW_ORDER_FIELD_WND_OFFSET 0x00000800 #define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA 0x00008000 #define WINDOW_ORDER_FIELD_WND_SIZE 0x00000400 #define WINDOW_ORDER_FIELD_WND_RECTS 0x00000100 #define WINDOW_ORDER_FIELD_VIS_OFFSET 0x00001000 #define WINDOW_ORDER_FIELD_VISIBILITY 0x00000200 #define WINDOW_ORDER_FIELD_ICON_BIG 0x00002000 #define WINDOW_ORDER_ICON 0x40000000 #define WINDOW_ORDER_CACHED_ICON 0x80000000 #define WINDOW_ORDER_FIELD_NOTIFY_VERSION 0x00000008 #define WINDOW_ORDER_FIELD_NOTIFY_TIP 0x00000001 #define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP 0x00000002 #define WINDOW_ORDER_FIELD_NOTIFY_STATE 0x00000004 #define WINDOW_ORDER_FIELD_DESKTOP_NONE 0x00000001 #define WINDOW_ORDER_FIELD_DESKTOP_HOOKED 0x00000002 #define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED 0x00000004 #define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN 0x00000008 #define WINDOW_ORDER_FIELD_DESKTOP_ZORDER 0x00000010 #define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND 0x00000020 struct rail_icon_info { int bpp; int width; int height; int cmap_bytes; int mask_bytes; int data_bytes; char *mask; char *cmap; char *data; }; struct rail_window_rect { short left; short top; short right; short bottom; }; struct rail_notify_icon_infotip { int timeout; int flags; char *text; char *title; }; struct rail_window_state_order { int owner_window_id; int style; int extended_style; int show_state; char *title_info; int client_offset_x; int client_offset_y; int client_area_width; int client_area_height; int rp_content; int root_parent_handle; int window_offset_x; int window_offset_y; int window_client_delta_x; int window_client_delta_y; int window_width; int window_height; int num_window_rects; struct rail_window_rect *window_rects; int visible_offset_x; int visible_offset_y; int num_visibility_rects; struct rail_window_rect *visibility_rects; }; struct rail_notify_state_order { int version; char *tool_tip; struct rail_notify_icon_infotip infotip; int state; int icon_cache_entry; int icon_cache_id; struct rail_icon_info icon_info; }; struct rail_monitored_desktop_order { int active_window_id; int num_window_ids; int *window_ids; }; #endif xrdp-0.10.1/common/list16.c000644 001751 000000 00000010356 14652432047 015420 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * simple list */ #if defined(HAVE_CONFIG_H) #include #endif #include "arch.h" #include "os_calls.h" #include "list16.h" /*****************************************************************************/ struct list16 * list16_create(void) { struct list16 *self; self = (struct list16 *)g_malloc(sizeof(struct list16), 0); list16_init(self); return self; } /*****************************************************************************/ void list16_delete(struct list16 *self) { if (self == 0) { return; } list16_deinit(self); g_free(self); } /*****************************************************************************/ void list16_init(struct list16 *self) { g_memset(self, 0, sizeof(struct list16)); self->max_count = 4; self->items = self->mitems; } /*****************************************************************************/ void list16_deinit(struct list16 *self) { if (self->items != self->mitems) { g_free(self->items); } } /*****************************************************************************/ void list16_add_item(struct list16 *self, tui16 item) { tui16 *p; int i; if (self->count >= self->max_count) { i = self->max_count; self->max_count += 4; p = (tui16 *)g_malloc(sizeof(tui16) * self->max_count, 1); g_memcpy(p, self->items, sizeof(tui16) * i); if (self->items != self->mitems) { g_free(self->items); } self->items = p; } self->items[self->count] = item; self->count++; } /*****************************************************************************/ tui16 list16_get_item(struct list16 *self, int index) { if (index < 0 || index >= self->count) { return 0; } return self->items[index]; } /*****************************************************************************/ void list16_clear(struct list16 *self) { if (self->items != self->mitems) { g_free(self->items); } self->count = 0; self->max_count = 4; self->items = self->mitems; } /*****************************************************************************/ int list16_index_of(struct list16 *self, tui16 item) { int i; for (i = 0; i < self->count; i++) { if (self->items[i] == item) { return i; } } return -1; } /*****************************************************************************/ void list16_remove_item(struct list16 *self, int index) { int i; if (index >= 0 && index < self->count) { for (i = index; i < (self->count - 1); i++) { self->items[i] = self->items[i + 1]; } self->count--; } } /*****************************************************************************/ void list16_insert_item(struct list16 *self, int index, tui16 item) { tui16 *p; int i; if (index == self->count) { list16_add_item(self, item); return; } if (index >= 0 && index < self->count) { self->count++; if (self->count > self->max_count) { i = self->max_count; self->max_count += 4; p = (tui16 *)g_malloc(sizeof(tui16) * self->max_count, 1); g_memcpy(p, self->items, sizeof(tui16) * i); if (self->items != self->mitems) { g_free(self->items); } self->items = p; } for (i = (self->count - 2); i >= index; i--) { self->items[i + 1] = self->items[i]; } self->items[index] = item; } } xrdp-0.10.1/common/xrdp_client_info.h000644 001751 000000 00000016350 14652432047 017631 0ustar00metawheel000000 000000 /** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2014 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * xrdp / xserver info / caps */ #include "xrdp_constants.h" #include "ms-rdpbcgr.h" #if !defined(XRDP_CLIENT_INFO_H) #define XRDP_CLIENT_INFO_H /* * 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) * 2.2.1.3.9.1 Monitor Attributes (TS_MONITOR_ATTRIBUTES) * 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT */ struct monitor_info { /* From 2.2.1.3.6.1 Monitor Definition (TS_MONITOR_DEF) */ int left; int top; int right; int bottom; int flags; /* From [MS-RDPEDISP] 2.2.2.2.1 DISPLAYCONTROL_MONITOR_LAYOUT, or * [MS-RDPBCGR] 2.2.1.3.9.1 (TS_MONITOR_ATTRIBUTES) */ unsigned int physical_width; unsigned int physical_height; unsigned int orientation; unsigned int desktop_scale_factor; unsigned int device_scale_factor; /* Derived setting */ unsigned int is_primary; }; /* xrdp keyboard overrids */ struct xrdp_keyboard_overrides { int type; int subtype; int layout; }; struct display_size_description { unsigned int monitorCount; /* 2.2.2.2 DISPLAYCONTROL_MONITOR_LAYOUT_PDU: number of monitors detected (max = 16) */ struct monitor_info minfo[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; /* client monitor data */ struct monitor_info minfo_wm[CLIENT_MONITOR_DATA_MAXIMUM_MONITORS]; /* client monitor data, non-negative values */ unsigned int session_width; unsigned int session_height; }; enum client_resize_mode { CRMODE_NONE, CRMODE_SINGLE_SCREEN, CRMODE_MULTI_SCREEN }; /** * Information about the xrdp client * * @note This structure is shared with xorgxrdp. If you change anything * above the 'private to xrdp below this line' comment, you MUST * bump the CLIENT_INFO_CURRENT_VERSION number so that the mismatch * can be detected. */ struct xrdp_client_info { int size; /* bytes for this structure */ int version; /* Should be CLIENT_INFO_CURRENT_VERSION */ int bpp; /* bitmap cache info */ int cache1_entries; int cache1_size; int cache2_entries; int cache2_size; int cache3_entries; int cache3_size; int bitmap_cache_persist_enable; /* 0 or 2 */ int bitmap_cache_version; /* ored 1 = original version, 2 = v2, 4 = v3 */ /* pointer info */ int pointer_cache_entries; /* other */ int use_bitmap_comp; int use_bitmap_cache; int op1; /* use smaller bitmap header, non cache */ int op2; /* use smaller bitmap header in bitmap cache */ int desktop_cache; int use_compact_packets; /* rdp5 smaller packets */ char hostname[32]; int build; int keylayout; char username[INFO_CLIENT_MAX_CB_LEN]; char password[INFO_CLIENT_MAX_CB_LEN]; char domain[INFO_CLIENT_MAX_CB_LEN]; char program[INFO_CLIENT_MAX_CB_LEN]; char directory[INFO_CLIENT_MAX_CB_LEN]; int rdp_compression; int rdp_autologin; int crypt_level; /* 1, 2, 3 = low, medium, high */ int channels_allowed; /* 0 = no channels 1 = channels */ int sound_code; /* 1 = leave sound at server */ int is_mce; int rdp5_performanceflags; int brush_cache_code; /* 0 = no cache 1 = 8x8 standard cache 2 = arbitrary dimensions */ int max_bpp; int jpeg; /* non standard bitmap cache v2 cap */ int offscreen_support_level; int offscreen_cache_size; int offscreen_cache_entries; int rfx; /* CAPSETTYPE_RAIL */ int rail_support_level; /* CAPSETTYPE_WINDOW */ int wnd_support_level; int wnd_num_icon_caches; int wnd_num_icon_cache_entries; /* codecs */ int rfx_codec_id; int rfx_prop_len; char rfx_prop[64]; int ns_codec_id; int ns_prop_len; char ns_prop[64]; int jpeg_codec_id; int jpeg_prop_len; char jpeg_prop[64]; int v3_codec_id; int rfx_min_pixel; char orders[32]; int order_flags_ex; int use_bulk_comp; int pointer_flags; /* 0 color, 1 new, 2 no new */ int use_fast_path; int require_credentials; /* when true, credentials *must* be passed on cmd line */ int security_layer; /* 0 = rdp, 1 = tls , 2 = hybrid */ int multimon; /* 0 = deny , 1 = allow */ struct display_size_description display_sizes; int keyboard_type; int keyboard_subtype; int png_codec_id; int png_prop_len; char png_prop[64]; int vendor_flags[4]; int mcs_connection_type; int mcs_early_capability_flags; int max_fastpath_frag_bytes; int capture_code; int capture_format; char certificate[1024]; char key_file[1024]; /* X11 keyboard layout - inferred from keyboard type/subtype */ char model[16]; char layout[16]; char variant[16]; char options[256]; /* ==================================================================== */ /* Private to xrdp below this line */ /* ==================================================================== */ /* codec */ int h264_codec_id; int h264_prop_len; char h264_prop[64]; int use_frame_acks; int max_unacknowledged_frame_count; long ssl_protocols; char *tls_ciphers; char client_ip[MAX_PEER_ADDRSTRLEN]; char client_description[MAX_PEER_DESCSTRLEN]; int client_os_major; int client_os_minor; int no_orders_supported; int use_cache_glyph_v2; int rail_enable; // Mask of reasons why output may be suppressed // (see enum suppress_output_reason) unsigned int suppress_output_mask; int enable_token_login; char domain_user_separator[16]; /* xrdp.override_* values */ struct xrdp_keyboard_overrides xrdp_keyboard_overrides; /* These values are optionally send over as part of TS_UD_CS_CORE. * They can be used as a fallback for a single monitor session * if physical sizes are not available in the monitor-specific * data */ unsigned int session_physical_width; /* in mm */ unsigned int session_physical_height; /* in mm */ int large_pointer_support_flags; int gfx; // Can we resize the desktop by using a Deactivation-Reactivation Sequence? enum client_resize_mode client_resize_mode; }; enum xrdp_encoder_flags { NONE = 0, ENCODE_COMPLETE = 1 << 0, GFX_PROGRESSIVE_RFX = 1 << 1, GFX_H264 = 1 << 2, KEY_FRAME_REQUESTED = 1 << 3 }; /* * Return true if output is suppressed for a particular reason */ #define OUTPUT_SUPPRESSED_FOR_REASON(ci,reason) \ (((ci)->suppress_output_mask & (unsigned int)reason) != 0) /* yyyymmdd of last incompatible change to xrdp_client_info */ /* also used for changes to all the xrdp installed headers */ #define CLIENT_INFO_CURRENT_VERSION 20230425 #endif